/* Compact Studio entrance. Existing TBLS tokens keep public/private identity coherent.
   The class is added only to authentication shells on the isolated TBLS mounts. */
:root[data-workspace-brand="tbls"] .tbls-entry-designed {
  --entry-bg: var(--bg);
  --entry-panel: var(--surface);
  --entry-inset: var(--surface-1);
  --entry-text: var(--text);
  --entry-muted: var(--muted);
  --entry-line: var(--line);
  --entry-accent: var(--accent);
  --entry-accent-ink: var(--accent-ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  justify-items: stretch;
  min-height: 100svh;
  min-width: 0;
  padding: 0;
  background: var(--entry-bg);
  color: var(--entry-text);
  overflow: visible;
  isolation: isolate;
}
:root[data-workspace-brand="tbls"] .tbls-entry-designed::before,
:root[data-workspace-brand="tbls"] .tbls-entry-designed::after { content: none; }

.tbls-entry-designed .tbls-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  min-height: 72px;
  padding: 12px clamp(20px, 3vw, 40px);
  border-bottom: 1px solid var(--entry-line);
  background: var(--entry-panel);
}
.tbls-entry-designed .tbls-entry-brand,
.tbls-entry-designed .tbls-entry-header-actions { display: flex; align-items: center; gap: 20px; min-width: 0; }
.tbls-entry-designed .tbls-entry-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  min-height: 44px;
  align-content: center;
  padding: 8px 0;
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -1.6px;
  line-height: 1;
  color: var(--entry-text);
  text-decoration: none;
}
.tbls-entry-designed .tbls-entry-wordmark-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--entry-accent); }
.tbls-entry-designed .tbls-entry-context { border-left: 1px solid var(--entry-line); padding-left: 20px; color: var(--entry-muted); font-size: 13px; }
.tbls-entry-designed .tbls-entry-events { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 4px; color: var(--entry-muted); font-size: 13px; text-decoration: none; }
.tbls-entry-designed .tbls-entry-events:hover { color: var(--entry-text); }
.tbls-entry-designed .app-theme-control { display: flex; align-items: center; gap: 0; margin: 0; min-width: 0; padding: 2px; border: 1px solid var(--entry-line); border-radius: 9px; background: var(--entry-bg); }
:root[data-workspace-brand="tbls"] .tbls-entry-designed .app-theme-control button { min-width: 44px; min-height: 44px; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--entry-muted); font-size: 12px; font-weight: 600; }
.tbls-entry-designed .app-theme-control button:is(.active, [aria-pressed="true"]) { background: var(--entry-inset); color: var(--entry-text); }

:root[data-workspace-brand="tbls"] .tbls-entry-designed .auth-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  width: min(480px, calc(100% - 40px));
  max-width: 480px;
  min-width: 0;
  min-height: 0;
  margin: clamp(32px, 6vh, 64px) auto 48px;
  padding: 32px;
  border: 1px solid var(--entry-line);
  border-radius: 16px;
  background: var(--entry-panel);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .08);
  backdrop-filter: none;
  overflow: visible;
  animation: tbls-entry-reveal .18s ease-out both;
}
:root[data-workspace-brand="tbls"] .tbls-entry-designed .auth-card h1 { max-width: none; margin: 0; font-size: clamp(28px, 3vw, 36px); font-weight: 600; letter-spacing: -.045em; line-height: 1.12; color: var(--entry-text); }
.tbls-entry-designed .auth-card > :is(p, .tbls-entry-lede) { max-width: none; margin: -4px 0 4px; font-size: 14px; line-height: 1.55; color: var(--entry-muted); }
.tbls-entry-designed .auth-card > .ops-label { margin: 0; font-size: 11px; letter-spacing: .08em; color: var(--entry-muted); }
:root[data-workspace-brand="tbls"] .tbls-entry-designed .auth-primary { display: grid; gap: 10px; margin: 0; padding: 18px; border: 1px solid var(--entry-line); border-radius: 12px; background: var(--entry-inset); box-shadow: none; }
.tbls-entry-designed .auth-primary .ops-label { display: none; }
.tbls-entry-designed .auth-primary h2 { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 600; color: var(--entry-text); }
.tbls-entry-designed .tbls-entry-guidance,
.tbls-entry-designed .invite-google-guidance { margin: 0; font-size: 12px; line-height: 1.55; color: var(--entry-muted); }
.tbls-entry-designed #googleSignInButton { min-width: 0; max-width: 100%; min-height: 44px; }
.tbls-entry-designed #googleSignInStatus { margin: 0; padding: 10px; border: 1px solid var(--entry-line); border-radius: 8px; color: var(--entry-text); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.tbls-entry-designed #googleSignInStatus:empty { display: none; }
.tbls-entry-designed .auth-divider { margin: 0; gap: 12px; font-size: 10px; color: var(--entry-muted); }
:root[data-workspace-brand="tbls"] .tbls-entry-designed details.auth-fallback { margin: 0; padding: 0; border: 1px solid var(--entry-line); border-radius: 10px; background: var(--entry-panel); }
.tbls-entry-designed .auth-fallback summary { position: relative; display: block; min-height: 52px; margin: 0; padding: 15px 40px 15px 16px; list-style: none; color: var(--entry-text); font-size: 14px; font-weight: 500; line-height: 1.5; cursor: pointer; }
.tbls-entry-designed .auth-fallback summary::-webkit-details-marker { display: none; }
.tbls-entry-designed .auth-fallback summary::after { position: absolute; right: 16px; top: 13px; content: "+"; font-size: 20px; color: var(--entry-muted); transition: transform .15s ease; }
.tbls-entry-designed .auth-fallback[open] summary::after { transform: rotate(45deg); color: var(--entry-accent); }
.tbls-entry-designed .auth-fallback summary:hover { background: var(--entry-inset); border-radius: 9px; }
.tbls-entry-designed .auth-fallback > :is(form, .wallet-access-actions, .muted) { padding: 0 16px 16px; }
.tbls-entry-designed .auth-fallback .muted { font-size: 12px; line-height: 1.55; color: var(--entry-muted); }
.tbls-entry-designed .auth-form-stack { gap: 14px; }
.tbls-entry-designed .auth-form-stack label { gap: 7px; min-width: 0; color: var(--entry-muted); font-size: 13px; font-weight: 500; }
.tbls-entry-designed .auth-form-stack input { min-height: 46px; min-width: 0; width: 100%; padding: 12px; border: 1px solid var(--entry-line); border-radius: 8px; background: var(--entry-bg); color: var(--entry-text); font-size: 16px; }
.tbls-entry-designed .auth-card :is(.primary-button, .ghost-button, .text-button) { min-height: 44px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.tbls-entry-designed .auth-card .primary-button { background: var(--entry-accent); color: var(--entry-accent-ink); }
.tbls-entry-designed .auth-card .text-button { text-align: left; color: var(--entry-text); }
.tbls-entry-designed .wallet-access-actions { grid-template-columns: minmax(0, 1fr); }
.tbls-entry-designed .tbls-entry-footer { margin: 2px 0 0; padding: 0; max-width: none; text-align: left; color: var(--entry-muted); font-size: 12px; line-height: 1.55; }
.tbls-entry-designed .error-empty { margin: 0; padding: 14px; border-radius: 9px; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.tbls-entry-designed :is(a, summary, button, input):focus-visible { outline: 2px solid var(--entry-accent); outline-offset: 3px; }
.tbls-entry-designed :is(a, button) { transition: color .15s ease, background-color .15s ease; }
.tbls-entry-designed .mfa-setup-key { min-width: 0; }
.tbls-entry-designed .mfa-setup-key code { overflow-wrap: anywhere; }
@keyframes tbls-entry-reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
  .tbls-entry-designed .tbls-entry-header { gap: 10px; min-height: 64px; padding: 8px 16px; }
  .tbls-entry-designed .tbls-entry-brand,
  .tbls-entry-designed .tbls-entry-header-actions { gap: 12px; }
  .tbls-entry-designed .tbls-entry-wordmark { font-size: 24px; }
  .tbls-entry-designed .tbls-entry-context { padding-left: 12px; font-size: 12px; }
  :root[data-workspace-brand="tbls"] .tbls-entry-designed .auth-card { width: calc(100% - 32px); margin: 24px auto 80px; padding: 24px; border-radius: 14px; }
  :root[data-workspace-brand="tbls"] .tbls-entry-designed .auth-primary { padding: 0; border: 0; border-radius: 0; background: transparent; }
}
@media (max-width: 360px) {
  .tbls-entry-designed .tbls-entry-brand,
  .tbls-entry-designed .tbls-entry-header-actions { gap: 8px; }
  .tbls-entry-designed .tbls-entry-context { padding-left: 8px; }
  :root[data-workspace-brand="tbls"] .tbls-entry-designed .auth-card { padding: 20px; }
}
@media (max-width: 340px) {
  /* Give the native provider button its 280px footprint at 320px without
     resizing its iframe or moving the surrounding copy and form fields. */
  .tbls-entry-designed #googleSignInButton { margin-inline: -17px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tbls-entry-designed *, .tbls-entry-designed *::before, .tbls-entry-designed *::after { animation: none !important; transition: none !important; }
}
