/* Shared web/iPhone foundation. Feature pages add layout, not another theme. */
:root {
  --sa-accent: #6650dc;
  --sa-accent-soft: #f0edff;
  --sa-tab-height: 72px;
}
.app-page {
  --bg: #f5f6fa;
  --text: #202238;
  --text-muted: #60677b;
  --line: #e2e4ee;
  --line-soft: #eceef4;
  --raised: #f9f9fc;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
.skip-link { position: fixed; top: 8px; left: -10000px; z-index: 999; padding: 12px 18px; border-radius: 12px; color: #fff; background: #202238; }
.skip-link:focus { left: 12px; }
.app-page .shell { width: 100%; max-width: 1180px; margin-inline: auto; padding: 34px 28px 64px; }
.app-page .topbar { position: sticky; inset: 0 0 auto; width: 100%; min-height: 72px; border: 0; border-bottom: 1px solid var(--line-soft); background: rgba(255,255,255,.95); box-shadow: none; backdrop-filter: blur(16px); }
.app-page .topbar-inner { display: flex; flex-direction: row; align-items: center; min-height: 72px; max-width: 1180px; margin: auto; padding: 12px 28px; gap: 32px; }
.app-page .brand-logo { width: 174px; max-height: 38px; content: url('/assets/branding/simplyanswered-logo.svg'); }
.app-page .main-nav { flex-direction: row; gap: 6px; }
.app-page .main-nav a { min-height: 44px; padding: 9px 16px; border: 0; border-radius: 12px; font-size: .9375rem; color: var(--text-muted); box-shadow: none; }
.app-page .main-nav a.active { color: #5842c5; background: var(--sa-accent-soft); box-shadow: none; }
.app-page .main-nav a.active .bx { color: inherit; }
.app-page .topbar-actions { flex-direction: row; margin-left: auto; border: 0; padding: 0; }
.app-page .credit-chip { border-radius: 12px; color: var(--text-muted); background: #fff; box-shadow: none; }
.app-page .avatar { width: 44px; height: 44px; border-radius: 50%; color: #5842c5; background: var(--sa-accent-soft); border: 1px solid #e8e1ff; }
.app-page .user-menu-popover { top: calc(100% + 12px); right: 0; left: auto; bottom: auto; width: min(320px,calc(100vw - 32px)); padding: 10px; border-radius: 18px; box-shadow: 0 12px 45px #20223820; }
.app-page .user-menu-popover a,.app-page .user-menu-popover button { min-height: 48px; font-size: 1rem; border-radius: 10px; }
.app-page .user-menu-head { overflow-wrap: anywhere; }
.app-page .page-head { gap: 16px; align-items: center; text-align: left; }
.app-page .page-head h1 { font-size: clamp(1.8rem,3.5vw,2.45rem); line-height: 1.15; letter-spacing: -.04em; }
.app-page .page-head .sub { font-size: 1rem; line-height: 1.6; margin-top: 7px; max-width: 60ch; }
.app-page .eyebrow { font-family: var(--font); font-size: .8125rem; font-weight: 700; letter-spacing: .065em; color: var(--text-muted); }
.app-page .panel,.app-page .work-panel { border-radius: 18px; box-shadow: 0 3px 18px #20223804; }
.app-page .panel:hover { box-shadow: 0 3px 18px #20223804; }
.app-page .panel-head { padding: 20px 22px; }
.app-page .panel-body { padding: 22px; }
.app-page .panel-head h2 { font-size: 1.0625rem; font-weight: 750; }
.app-page .btn { min-height: 48px; padding: 11px 18px; border: 1px solid transparent; border-radius: 13px; color: #fff; background: var(--sa-accent); box-shadow: none; font-size: .9375rem; font-weight: 750; line-height: 1.4; white-space: normal; }
.app-page .btn:hover { background: #5741c6; box-shadow: none; transform: none; }
.app-page .btn:active { transform: scale(.985); box-shadow: none; }
.app-page .btn.secondary { color: #373653; background: #fff; border-color: #dcdfea; box-shadow: none; }
.app-page .btn.secondary:hover { background: #f7f5ff; border-color: #c9c2eb; }
.app-page .btn.quiet { color: #5944c2; background: transparent; border-color: transparent; box-shadow: none; }
.app-page .btn.quiet:hover { background: #f0edff; }
.app-page .btn.danger { color: #a53439; background: #fff3f3; border-color: #f0d2d4; }
.app-page .btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.app-page :is(input,select,textarea).control { min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1px solid #d6d9e5; background: #fff; font-family: inherit; font-size: 1rem !important; line-height: 1.45; box-shadow: none; max-width: 100%; }
.app-page :is(input,select,textarea).control:focus { border-color: var(--sa-accent); box-shadow: 0 0 0 3px #6650dc15; transform: none; }
.app-page :is(input,select,textarea).control:disabled { opacity: 1; color: #72788b; background: #f0f1f5; }
.app-page input[type=checkbox],.app-page input[type=radio] { accent-color: var(--sa-accent); }
.app-page :is(button,a,summary,input,select,textarea) { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.app-page .help { font-size: .875rem; line-height: 1.65; }
.app-page .panel-foot { padding: 16px 22px; }
.app-page .badge { border-radius: 7px; font-size: .8125rem; font-weight: 650; white-space: normal; }
.app-page .portal-table td { padding-block: 15px; }
.app-page .portal-table th { font-family: var(--font); letter-spacing: .025em; font-size: .8125rem; text-transform: none; }
.app-page .table-wrap { overscroll-behavior-inline: contain; scrollbar-width: thin; }
.app-page .footer { max-width: 1180px; margin: auto; padding: 24px 28px 36px; border-top: 1px solid var(--line); background: transparent; }
.app-page .footer a { display: inline-flex; align-items: center; min-height: 44px; }
.native-app .footer { display: none; }
.app-page .back-link { min-height: 40px; font-size: .875rem; margin-bottom: 6px; }
.toast-region { bottom: calc(var(--sa-tab-height) + env(safe-area-inset-bottom) + 12px); }
.toast { display: flex; align-items: center; gap: 12px; padding: 15px 17px; border: 1px solid #e2e4ee; border-radius: 16px; font-size: .9375rem; box-shadow: 0 8px 32px #20223818; }
.toast-close { flex: 0 0 36px; min-height: 36px; margin-left: auto; border: 0; border-radius: 9px; background: transparent; color: inherit; font-size: 22px; cursor: pointer; }
.toast-close:hover { background: #2022380a; }
.busy-signal { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding-inline: 2px; }
.busy-signal i { display: block; width: 3px; height: 8px; border-radius: 9px; background: currentColor; animation: sa-signal .85s ease-in-out infinite alternate; }
.busy-signal i:nth-child(2) { height: 17px; animation-delay: .12s; }
.busy-signal i:nth-child(3) { height: 11px; animation-delay: .24s; }
@keyframes sa-signal { to { transform: scaleY(.45); opacity: .5; } }
.app-page .greeting-builder-grid { grid-template-columns: minmax(0,1fr); max-width: 780px; margin: 0 auto 24px; }
.greeting-voice-options { margin-block: 16px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.greeting-voice-options > summary { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 12px 15px; cursor: pointer; list-style: none; }
.greeting-voice-options > summary::-webkit-details-marker { display: none; }
.greeting-voice-options > summary > span { color: var(--text-muted); font-size: .9375rem; }
.greeting-voice-options > summary > strong { margin-left: auto; font-size: .9375rem; }
.greeting-voice-options .voice-picker { padding: 14px; margin: 0; border: 0; border-top: 1px solid var(--line); }
.greeting-voice-options .voice-picker legend { padding-top: 8px; }
.greeting-voice-options .voice-filters { flex-wrap: wrap; }
.greeting-voice-options .voice-filters button { min-height: 44px; }
.greeting-upload-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 60px; padding: 18px 22px; font-weight: 700; cursor: pointer; }
.greeting-upload-card > summary > small { color: var(--text-muted); font-size: .875rem; font-weight: 500; }
.greeting-dialog { width: min(720px,calc(100% - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 22px; color: var(--text); background: var(--bg); box-shadow: 0 20px 90px #20223840; overscroll-behavior: contain; }
.greeting-dialog::backdrop { background: #20223870; backdrop-filter: blur(4px); }
.greeting-dialog > header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px; border-bottom: 1px solid var(--line); background: #fff; }
.greeting-dialog > header h2 { font-size: 1.2rem; }
.greeting-dialog > header p { margin: 4px 0 0; font-size: .875rem; color: var(--text-muted); }
.greeting-dialog > header button { flex-shrink: 0; min-width: 44px; min-height: 44px; font-size: 24px; }
.greeting-dialog-content { padding: 16px; }
.greeting-dialog-content .greeting-builder-grid { margin: 0; }
.greeting-dialog-status:empty { display: none; }
.greeting-dialog-status { padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--sa-accent-soft); color: #4835a5; font-size: .9375rem; }

@media (max-width: 900px) {
  .app-page .shell { padding: 24px 20px calc(var(--sa-tab-height) + env(safe-area-inset-bottom) + 32px); }
  .app-page .topbar-inner { padding: 10px 20px; gap: 16px; min-height: 64px; }
  .app-page .topbar { min-height: 64px; }
  .app-page .brand-logo { width: 162px; }
  .app-page .main-nav { display: none; }
  .app-page .credit-chip { display: none; }
  .app-page .mobile-tabs { position: fixed; inset: auto 0 0; transform: none; max-width: none; margin: 0; z-index: 100; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; width: 100%; min-height: var(--sa-tab-height); padding: 8px max(10px,env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid #e6e7ef; border-radius: 0; background: rgba(255,255,255,.97); box-shadow: 0 -4px 20px #20223804; backdrop-filter: blur(16px); }
  .app-page .mobile-tabs > a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 55px; min-width: 0; padding: 6px 3px; color: #6b7085; font-size: .75rem; font-weight: 650; border-radius: 13px; line-height: 1.3; }
  .app-page .mobile-tabs > a .bx { font-size: 24px; color: inherit; }
  .app-page .mobile-tabs > a.active { color: #5842c5; background: var(--sa-accent-soft); }
  .app-page .page-head { flex-direction: column; align-items: stretch; }
  .app-page .page-head > div { min-width: 0; }
  .app-page .page-head .head-actions { margin-left: 0; justify-content: flex-start; }
  .app-page .footer { padding: 8px 20px calc(var(--sa-tab-height) + env(safe-area-inset-bottom) + 20px); }
  .app-page .panel-head { padding: 18px; }
  .app-page .panel-body { padding: 18px; }
  .app-page .panel-foot { padding: 16px 18px; }
  .app-page .btn.small { min-height: 44px; }
  .app-page .search-bar { min-width: 0; border-radius: 13px; }
  .app-page .search-bar input { width: 0; min-width: 0; font-size: 1rem; }
  .app-page .greeting-builder-grid { gap: 16px; }
  .app-page .greeting-checkout { align-items: stretch; gap: 14px; }
  .app-page .greeting-checkout .btn-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .greeting-dialog-content { padding: 12px; }
}
@media (max-width: 375px) {
  .app-page .shell { padding-inline: 14px; }
  .app-page .topbar-inner { padding-inline: 14px; }
  .app-page .panel-body,.app-page .panel-head { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .busy-signal i { animation: none; }
  .app-page .btn:active { transform: none; }
}
