/* GW RhythmX Apps — Shared Shell & Conference Template Design System (CSP-clean, zero inline styles) */

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #F7F7FC;
  --surface: #FFFFFF;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --surface-alt: #F2F2F6;
  --surface-tint: #EFEDFC;
  --ink: #262626;
  --body: #5D5B82;
  --muted: #6E6E73;
  --border: #E3E4EF;
  --accent: #5851F2;
  --sky: #65BDFE;
  --green: #59B52A;
  --coral: #F77D6C;
  --violet: #8E51C4;
  --gold: #D99B00;
  --row-hover: #F2F2F6;
  --quad-grid: #E3E4EF;
  --on-accent: #FFFFFF;
  --on-green: #101010;
  --on-coral: #101010;
  --on-violet: #FFFFFF;
  --green-text: #287014;
  --coral-text: #B13D2E;
  --violet-text: #7440A8;
  --gold-text: #7A5500;
  --accent-hover: #4338CA;
  --card-shadow: 0 1px 2px rgba(38, 38, 38, 0.04), 0 4px 12px rgba(38, 38, 38, 0.025);
  --card-shadow-hover: 0 4px 14px rgba(88, 81, 242, 0.08), 0 1px 3px rgba(38, 38, 38, 0.05);
  --signin-card-shadow: 0 2px 8px rgba(38, 38, 38, 0.05), 0 12px 28px rgba(38, 38, 38, 0.04);

  /* Compatibility aliases for existing components */
  --bg-page: var(--bg);
  --bg-card: var(--surface);
  --bg-grouped: var(--surface-alt);
  --bg-elevated: var(--surface);
  --text-primary: var(--ink);
  --text-secondary: var(--body);
  --text-tertiary: var(--muted);
  --separator: var(--border);
  --accent-primary: var(--accent);
  --accent-primary-hover: var(--accent-hover);
  --accent-blue: var(--sky);
  --status-green: var(--green-text);
  --status-amber: var(--gold-text);
  --status-red: var(--coral-text);
  --focus-ring: rgba(88, 81, 242, 0.35);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101010;
  --surface: #181818;
  --surface-glass: rgba(24, 24, 24, 0.88);
  --surface-alt: #222222;
  --surface-tint: #262626;
  --ink: #F3F3F3;
  --body: #C4C4C4;
  --muted: #98989F;
  --border: #2C2C2C;
  --accent: #65BDFE;
  --sky: #65BDFE;
  --green: #6EE755;
  --coral: #FF8F80;
  --violet: #C084FC;
  --gold: #FFC328;
  --row-hover: #242424;
  --quad-grid: #2C2C2C;
  --on-accent: #101010;
  --on-green: #101010;
  --on-coral: #101010;
  --on-violet: #101010;
  --green-text: #6EE755;
  --coral-text: #FF8F80;
  --violet-text: #C084FC;
  --gold-text: #FFC328;
  --accent-hover: #82CBFF;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 6px 16px rgba(0, 0, 0, 0.25);
  --card-shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(101, 189, 254, 0.28);
  --signin-card-shadow: 0 4px 16px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);

  /* Compatibility aliases for existing components */
  --bg-page: var(--bg);
  --bg-card: var(--surface);
  --bg-grouped: var(--surface-alt);
  --bg-elevated: var(--surface-alt);
  --text-primary: var(--ink);
  --text-secondary: var(--body);
  --text-tertiary: var(--muted);
  --separator: var(--border);
  --accent-primary: var(--accent);
  --accent-primary-hover: var(--accent-hover);
  --accent-blue: var(--sky);
  --status-green: var(--green-text);
  --status-amber: var(--gold-text);
  --status-red: var(--coral-text);
  --focus-ring: rgba(101, 189, 254, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101010;
    --surface: #181818;
    --surface-glass: rgba(24, 24, 24, 0.88);
    --surface-alt: #222222;
    --surface-tint: #262626;
    --ink: #F3F3F3;
    --body: #C4C4C4;
    --muted: #98989F;
    --border: #2C2C2C;
    --accent: #65BDFE;
    --sky: #65BDFE;
    --green: #6EE755;
    --coral: #FF8F80;
    --violet: #C084FC;
    --gold: #FFC328;
    --row-hover: #242424;
    --quad-grid: #2C2C2C;
    --on-accent: #101010;
    --on-green: #101010;
    --on-coral: #101010;
    --on-violet: #101010;
    --green-text: #6EE755;
    --coral-text: #FF8F80;
    --violet-text: #C084FC;
    --gold-text: #FFC328;
    --accent-hover: #82CBFF;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 6px 16px rgba(0, 0, 0, 0.25);
    --card-shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(101, 189, 254, 0.28);
    --signin-card-shadow: 0 4px 16px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);

    --bg-page: var(--bg);
    --bg-card: var(--surface);
    --bg-grouped: var(--surface-alt);
    --bg-elevated: var(--surface-alt);
    --text-primary: var(--ink);
    --text-secondary: var(--body);
    --text-tertiary: var(--muted);
    --separator: var(--border);
    --accent-primary: var(--accent);
    --accent-primary-hover: var(--accent-hover);
    --accent-blue: var(--sky);
    --status-green: var(--green-text);
    --status-amber: var(--gold-text);
    --status-red: var(--coral-text);
    --focus-ring: rgba(101, 189, 254, 0.45);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: "Aptos", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.display-title {
  font-family: "Aptos Display", "Aptos", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  letter-spacing: -0.3px;
  line-height: 1.25;
  font-weight: 600;
}

.font-mono-num,
.numeric {
  font-family: "Aptos Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden],
.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
  }
}

/* Theme-switched brand logos */
.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

a.brand-logo-wrap {
  min-height: 44px;
  min-width: 44px;
}

.brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

.logo-dark {
  display: none;
}

[data-theme="dark"] .logo-light {
  display: none;
}

[data-theme="dark"] .logo-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light {
    display: none;
  }

  :root:not([data-theme="light"]) .logo-dark {
    display: block;
  }
}

/* SF Symbol inline SVG sizing */
.sf-symbol-svg,
.sf-symbol {
  width: 15px;
  height: 15px;
  display: inline-block;
  vertical-align: -0.15em;
  fill: currentColor;
  flex-shrink: 0;
}

/* Template Card & Glass Surfaces */
.apple-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  border-radius: 12px;
  transition: box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.apple-glass {
  background: var(--surface-glass);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

/* Template Left Sidebar Navigation */
.sidebar-nav-btn {
  width: 100%;
  min-height: 41.6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8.8px 12px;
  border-radius: 9.6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--body);
  background: transparent;
  border: 1px solid transparent;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.sidebar-nav-btn:hover {
  background: var(--row-hover);
  color: var(--ink);
}

.sidebar-nav-btn[aria-selected="true"],
.sidebar-nav-btn[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  font-weight: 600;
}

.sidebar-nav-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-count-pill {
  padding: 2px 6px;
  height: 22px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
  background: var(--surface-alt);
  color: var(--body);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav-btn[aria-selected="true"] .sidebar-count-pill,
.sidebar-nav-btn[aria-current="page"] .sidebar-count-pill {
  background: var(--surface-alt);
  color: var(--accent);
  font-weight: 600;
  border: none;
}

/* Template Segmented Control */
.segmented {
  display: inline-flex;
  align-items: center;
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.segmented button {
  border-radius: 7px;
  min-height: 44px;
  min-width: 44px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--body);
  background: transparent;
  border: none;
  transition: all 0.14s ease;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button[aria-selected="true"],
.segmented button[aria-pressed="true"] {
  background-color: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Template Status Pills / Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tone-green {
  background: color-mix(in srgb, var(--green) 13%, var(--surface));
  color: var(--green-text);
  border-color: color-mix(in srgb, var(--green) 32%, var(--border));
}

.tone-accent,
.tone-sky {
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.tone-violet {
  background: color-mix(in srgb, var(--violet) 12%, var(--surface));
  color: var(--violet-text);
  border-color: color-mix(in srgb, var(--violet) 28%, var(--border));
}

.tone-gold {
  background: color-mix(in srgb, var(--gold) 14%, var(--surface));
  color: var(--gold-text);
  border-color: color-mix(in srgb, var(--gold) 34%, var(--border));
}

.tone-coral {
  background: color-mix(in srgb, var(--coral) 14%, var(--surface));
  color: var(--coral-text);
  border-color: color-mix(in srgb, var(--coral) 34%, var(--border));
}

.tone-neutral {
  background: var(--surface-alt);
  color: var(--body);
  border-color: var(--border);
}

.citation-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background-color: var(--surface-alt);
  color: var(--accent);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.citation-pill:hover {
  background-color: var(--surface-tint);
  border-color: var(--accent);
}

.repo-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.repo-link:hover {
  opacity: 0.85;
}

/* Template Tables */
.directory-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.directory-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  padding: 12px 8px;
  text-align: left;
  white-space: nowrap;
}

.directory-table tbody td {
  border-bottom: 1px solid var(--border);
  padding: 12px 8px;
  vertical-align: middle;
  font-size: 13px;
  color: var(--ink);
}

.directory-table tbody tr:last-child td {
  border-bottom: none;
}

.directory-table tbody tr:hover td {
  background: var(--row-hover);
}

/* Template Compact Control (.filters-btn) */
.filters-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.filters-btn:hover {
  background: var(--row-hover);
}

/* Template Mobile Avatar & Bottom Tab Bar */
.toolbar-avatar {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  box-shadow: none;
}

.toolbar-avatar:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

.toolbar-avatar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toolbar-avatar:hover {
  border-color: var(--accent);
}

.tabbar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 4px 2px;
  border-radius: 10px;
  color: var(--body);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.14s ease;
}

.tabbar-btn .sf-symbol-svg {
  width: 19px;
  height: 19px;
}

.tabbar-btn[aria-selected="true"],
.tabbar-btn[aria-current="true"] {
  color: var(--accent);
  font-weight: 600;
}

/* Template Bottom Sheet (Phone Settings & Modals) */
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 56;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet {
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  background: var(--surface);
  border: 0;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
  display: block;
  overflow-y: auto;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px)) 16px;
}

@media (min-width: 768px) {
  .sheet-wrap {
    align-items: center;
    padding: 24px;
  }
  .sheet {
    border: 1px solid var(--border);
    border-radius: 16px;
  }
}

.sheet-grabber {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  margin: 0 auto 10px;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  margin-bottom: 12px;
  border: 0;
}

.sheet-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}

.sheet-done {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--accent);
  padding: 6px 12px;
  min-height: 44px;
  min-width: 44px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  font-family: inherit;
}

.sheet-body {
  padding: 0;
  overflow: visible;
  display: block;
}

.sheet-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 0;
  margin-bottom: 12px;
}

.sheet-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sheet-user-name {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-user-email {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-group {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.sheet-section-label,
.sheet-group-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
  padding: 0;
}

.sheet-segmented,
.sheet-group .segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  margin-bottom: 0;
  width: 100%;
}

.sheet-segmented.segmented-two,
.sheet-group .segmented.segmented-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sheet-segment-btn,
.sheet-group .segmented button {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--body);
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
}

.sheet-segment-btn.active,
.sheet-segment-btn[aria-pressed="true"],
.sheet-group .segmented button.active,
.sheet-group .segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sheet-section,
.sheet-list {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  overflow: hidden;
  margin-bottom: 12px;
  gap: 0;
}

.sheet-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  min-height: 48px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  text-align: left;
  font-family: inherit;
}

.sheet-row + .sheet-row {
  border-top: 1px solid var(--border);
}

.sheet-row-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.sheet-row-title {
  font-weight: 400;
}

.sheet-row-right {
  text-align: right;
}

.sheet-row-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--green-text);
}

.sheet-row-meta {
  font-size: 12px;
  color: var(--muted);
}

.sheet-row-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--body);
  font-variant-numeric: tabular-nums;
}

.sheet-row-danger {
  color: var(--coral-text);
  font-weight: 400;
  cursor: pointer;
}

.sheet-row-danger:hover {
  background: var(--row-hover);
}

/* Sign-in, Setup, and Suite Home Centered Layout (Matching Conference Portal) */
.centered-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px;
  background-color: var(--bg);
  color: var(--ink);
}

.centered-shell.auth-body {
  padding-top: calc(32px + env(safe-area-inset-top, 0px));
  padding-right: calc(24px + env(safe-area-inset-right, 0px));
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  padding-left: calc(24px + env(safe-area-inset-left, 0px));
}

.auth-topbar,
.auth-top-bar {
  width: 100%;
  max-width: 448px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.auth-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 102px;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  font-family: inherit;
  box-shadow: none;
  white-space: nowrap;
}

.auth-theme-toggle:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.auth-theme-toggle .auth-theme-icon {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
  box-shadow: inset -4px -2px 0 0 currentColor;
}

[data-theme="dark"] .auth-theme-toggle .auth-theme-icon {
  background-color: currentColor;
  transform: scale(0.65);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px currentColor;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .auth-theme-toggle .auth-theme-icon {
    background-color: currentColor;
    transform: scale(0.65);
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px currentColor;
  }
}

.auth-theme-dot,
.auth-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background-color: var(--accent);
  display: inline-block;
}

.centered-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
}

.auth-card {
  width: 100%;
  max-width: 448px;
  margin: 0 auto;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: var(--signin-card-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-card .btn-primary {
  width: 100%;
}

.auth-brand-header,
.auth-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 4px;
}

.auth-brand-header .brand-logo,
.auth-logo-wrap .brand-logo {
  height: 32px;
  width: auto;
}

.auth-portal-pill,
.auth-pill {
  margin-top: 4px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background-color: var(--surface-tint);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.auth-title {
  font-family: "Aptos Display", "Aptos", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: 20px;
  line-height: 25px;
  font-weight: 500;
  letter-spacing: -0.3px;
  margin: 10px 0 0;
  color: var(--ink);
}

.text-title2 {
  font-family: "Aptos Display", "Aptos", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 10px 0 0;
  color: var(--ink);
}

.auth-subtitle,
.text-body {
  font-size: 12px;
  line-height: 1.5;
  color: var(--body);
  margin: 4px 0 0;
}

.text-subhead {
  font-size: 13px;
  line-height: 1.4;
  color: var(--body);
}

.text-caption {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.auth-footer {
  width: 100%;
  max-width: 448px;
  margin: 0 auto;
  text-align: center;
  font-size: 11px;
  line-height: 16.5px;
  color: var(--muted);
  padding: 0 0 8px;
}

#signin-form,
#setup-confirm-form,
#setup-step-reveal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group,
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label,
.form-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--body);
}

.form-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink);
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-input-code {
  font-family: "Aptos Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1.4px;
  padding: 10px 14px;
  font-variant-numeric: tabular-nums;
}

.form-helper {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.btn-primary,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 16px;
  background-color: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background-color 0.14s ease;
}

@media (max-width: 767px) {
  .btn-primary,
  .primary-button {
    min-height: 44px;
  }
}

.btn-primary:hover,
.primary-button:hover {
  background-color: var(--accent-hover);
}

.btn-primary:disabled,
.primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary,
.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 6px 12px;
  background-color: var(--surface-alt);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.btn-secondary:hover,
.header-btn:hover {
  background-color: var(--row-hover);
  border-color: var(--accent);
}

@media (pointer: coarse) {
  input,
  select,
  textarea,
  .form-input,
  .form-input-code {
    font-size: 16px;
    min-height: 44px;
  }
  button,
  a[href],
  summary,
  [role="button"],
  [role="tab"],
  [role="radio"],
  .auth-theme-toggle,
  .btn-primary,
  .primary-button,
  .btn-secondary,
  .header-btn {
    height: auto;
    min-height: 44px;
    min-width: 44px;
  }
}

.form-error {
  padding: 10px 12px;
  border-radius: 8px;
  background-color: color-mix(in srgb, var(--coral) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--coral) 32%, var(--border));
  color: var(--coral-text);
  font-size: 12px;
  font-weight: 500;
}

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: #FFFFFF;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 4px auto;
}

.secret-key-box {
  padding: 10px 12px;
  background-color: var(--surface-alt);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.secret-key-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  word-break: break-all;
}

#setup-toggle-key-btn {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  letter-spacing: normal;
  word-break: normal;
  flex-shrink: 0;
}

.suite-header .btn-label {
  display: none;
}

@media (min-width: 768px) {
  .suite-header .btn-label {
    display: inline;
  }
}

/* Suite Home App Tiles & Settings App Tiles */
.app-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 640px;
}

.app-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  min-height: 132px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}

.app-tile:hover {
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
}

.app-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: var(--surface-tint);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-tile-icon .sf-symbol-svg {
  width: 20px;
  height: 20px;
}

.app-tile-name {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.app-tile-note {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}
