/* Personal Shift Calendar V9.3.1
   Aurora glassmorphism / future SaaS console visual system */
:root {
  --blue: #4f7cff;
  --blue-2: #79a7ff;
  --indigo: #5c5cff;
  --purple: #8b5cf6;
  --violet: #a78bfa;
  --cyan: #35d3ff;
  --green: #57e6a5;
  --orange: #ffad66;
  --red: #ff6b7a;
  --gray: #8e98aa;
  --bg: #eef3fb;
  --bg-deep: #dfe8f7;
  --surface: rgba(255, 255, 255, .58);
  --surface-solid: #f9fbff;
  --surface-soft: rgba(255, 255, 255, .38);
  --surface-strong: rgba(255, 255, 255, .78);
  --text: #121a2f;
  --muted: #69758c;
  --muted-2: #8e98aa;
  --line: rgba(76, 94, 132, .14);
  --line-strong: rgba(89, 108, 149, .22);
  --glass-highlight: rgba(255, 255, 255, .72);
  --shadow: 0 26px 80px rgba(54, 78, 124, .15), 0 1px 0 rgba(255,255,255,.75) inset;
  --shadow-soft: 0 16px 50px rgba(54, 78, 124, .10);
  --radius: 28px;
  --radius-sm: 20px;
  --nav-h: 96px;
  --gradient: linear-gradient(135deg, #4f7cff 0%, #7657f5 48%, #a855f7 100%);
  --gradient-text: linear-gradient(100deg, #376dff 0%, #6d57f6 50%, #9e53ed 100%);
  --grid-line: rgba(83, 105, 150, .07);
}

body.theme-dark {
  --bg: #050915;
  --bg-deep: #02040b;
  --surface: rgba(12, 20, 39, .62);
  --surface-solid: #0e1629;
  --surface-soft: rgba(19, 30, 54, .48);
  --surface-strong: rgba(16, 26, 48, .82);
  --text: #f4f7ff;
  --muted: #9ca9c0;
  --muted-2: #73809b;
  --line: rgba(167, 184, 220, .13);
  --line-strong: rgba(167, 184, 220, .22);
  --glass-highlight: rgba(255,255,255,.10);
  --shadow: 0 34px 100px rgba(0, 0, 0, .44), 0 1px 0 rgba(255,255,255,.08) inset;
  --shadow-soft: 0 20px 60px rgba(0,0,0,.3);
  --grid-line: rgba(128, 155, 218, .055);
}

@media (prefers-color-scheme: dark) {
  body.theme-system {
    --bg: #050915;
    --bg-deep: #02040b;
    --surface: rgba(12, 20, 39, .62);
    --surface-solid: #0e1629;
    --surface-soft: rgba(19, 30, 54, .48);
    --surface-strong: rgba(16, 26, 48, .82);
    --text: #f4f7ff;
    --muted: #9ca9c0;
    --muted-2: #73809b;
    --line: rgba(167, 184, 220, .13);
    --line-strong: rgba(167, 184, 220, .22);
    --glass-highlight: rgba(255,255,255,.10);
    --shadow: 0 34px 100px rgba(0, 0, 0, .44), 0 1px 0 rgba(255,255,255,.08) inset;
    --shadow-soft: 0 20px 60px rgba(0,0,0,.3);
    --grid-line: rgba(128, 155, 218, .055);
  }
}

html { min-height: 100%; background: var(--bg-deep); }
body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 62rem 38rem at 8% -8%, rgba(53, 211, 255, .16), transparent 65%),
    radial-gradient(ellipse 58rem 42rem at 94% 2%, rgba(139, 92, 246, .20), transparent 68%),
    radial-gradient(ellipse 44rem 36rem at 52% 106%, rgba(79, 124, 255, .12), transparent 72%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%) !important;
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: -.01em;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
body::before {
  opacity: .68;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.82), transparent 78%);
}
body::after {
  opacity: .11;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

::selection { background: rgba(99,102,241,.3); color: var(--text); }
a { color: inherit; }
button, input, select, textarea { letter-spacing: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(79,124,255,.24);
  outline-offset: 2px;
}
.ui-icon { width: 20px; height: 20px; flex: 0 0 auto; display: block; }

.app-shell {
  width: min(100%, 1180px) !important;
  padding: max(24px, env(safe-area-inset-top)) 24px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)) !important;
}
.screen { animation: auroraEnter .42s cubic-bezier(.22,.9,.24,1); }
@keyframes auroraEnter { from { opacity: 0; transform: translateY(14px) scale(.994); } to { opacity: 1; transform: none; } }

.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--surface-strong), var(--surface)) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  -webkit-backdrop-filter: blur(28px) saturate(138%);
  backdrop-filter: blur(28px) saturate(138%);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(145deg, var(--glass-highlight), transparent 28%, transparent 72%, rgba(111, 96, 255, .045));
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  opacity: .34;
}

.topbar {
  min-height: 118px !important;
  align-items: flex-start !important;
  gap: 20px !important;
  padding: 12px 4px 18px;
}
.page-heading { min-width: 0; }
.page-heading p { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue-2);
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; opacity: .7; }
.title {
  margin-top: 11px !important;
  font-size: clamp(38px, 6.5vw, 62px) !important;
  line-height: .98 !important;
  font-weight: 900 !important;
  letter-spacing: -.055em;
}
.title span,
.auth-visual-copy h1 span {
  color: transparent;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
}
.toolbar { flex-wrap: wrap; justify-content: flex-end; }

.pill, .icon-btn, .primary-btn, .ghost-btn, .danger-btn {
  min-height: 46px !important;
  border-radius: 16px !important;
  font-weight: 800 !important;
  transition: transform .22s cubic-bezier(.22,.9,.24,1), border-color .22s ease, background .22s ease, box-shadow .22s ease !important;
}
.pill, .ghost-btn, .icon-btn {
  color: var(--text) !important;
  background: var(--surface-soft) !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.primary-btn {
  background: var(--gradient) !important;
  box-shadow: 0 16px 38px rgba(82, 91, 242, .28), 0 1px 0 rgba(255,255,255,.24) inset !important;
}
.danger-btn { background: rgba(255,107,122,.12) !important; color: var(--red) !important; border: 1px solid rgba(255,107,122,.18) !important; }
.pill:hover, .icon-btn:hover, .primary-btn:hover, .ghost-btn:hover, .danger-btn:hover { transform: translateY(-2px) !important; }
.icon-btn { width: 46px !important; padding: 0 !important; }
.auth-pill { max-width: 260px; padding: 0 14px 0 8px !important; gap: 9px !important; }
.auth-pill > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-dot {
  width: 30px; height: 30px; border-radius: 11px; display: grid; place-items: center;
  color: #fff; background: var(--gradient); font-size: 12px; font-weight: 900;
  box-shadow: 0 8px 20px rgba(91, 88, 246, .25);
}

/* Auth workspace */
.auth-stage { min-height: calc(100vh - 48px); display: grid; place-items: center; position: relative; }
.auth-ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.auth-ambient::before, .auth-ambient::after {
  content:""; position:absolute; border-radius:50%; filter: blur(46px); opacity:.4;
}
.auth-ambient::before { width: 440px; height: 440px; left: -150px; top: 8%; background: rgba(53,211,255,.24); }
.auth-ambient::after { width: 520px; height: 520px; right: -170px; bottom: 2%; background: rgba(139,92,246,.28); }
.auth-shell {
  width: min(1080px, 100%);
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  padding: 10px;
  border-radius: 36px !important;
}
.auth-visual {
  min-height: 660px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 70% 32%, rgba(78,210,255,.17), transparent 25%),
    radial-gradient(circle at 35% 70%, rgba(139,92,246,.22), transparent 30%),
    linear-gradient(145deg, rgba(4,10,25,.97), rgba(13,18,47,.91));
  color: #f7f8ff;
}
.auth-visual::before {
  content:""; position:absolute; inset:0;
  background-image: linear-gradient(rgba(141,168,230,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(141,168,230,.07) 1px, transparent 1px);
  background-size: 42px 42px; mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.auth-visual-copy, .terminal-card { position: relative; z-index: 3; }
.auth-visual-copy h1 { margin: 18px 0 20px; font-size: clamp(44px, 5vw, 70px); line-height: .98; letter-spacing: -.055em; }
.auth-visual-copy p { max-width: 510px; margin: 0; color: #aebbd5; line-height: 1.8; font-size: 15px; }
.terminal-card {
  width: min(100%, 390px); padding: 16px 18px; border: 1px solid rgba(162,181,230,.16); border-radius: 18px;
  background: rgba(3,8,20,.62); box-shadow: 0 24px 60px rgba(0,0,0,.25); backdrop-filter: blur(16px);
}
.terminal-card > span { display:block; color:#7786a5; font-size:9px; letter-spacing:.18em; font-weight:900; }
.terminal-card strong { display:flex; align-items:center; gap:9px; margin-top:9px; font-size:13px; }
.terminal-card i, .status-light, .status-chip i { width:8px; height:8px; border-radius:50%; background:var(--green); box-shadow:0 0 16px rgba(87,230,165,.7); }
.terminal-card code { display:block; margin-top:7px; color:#6f7d98; font-size:11px; }
.auth-panel { min-width:0; display:flex; flex-direction:column; padding: 44px 42px 30px; }
.brand-lockup { display:flex; align-items:center; gap:13px; }
.brand-mark { width:46px; height:46px; display:grid; place-items:center; border-radius:16px; color:#fff; background:var(--gradient); box-shadow:0 14px 32px rgba(83,92,242,.3); }
.brand-mark .ui-icon { width:23px; height:23px; }
.brand-lockup > div { display:grid; gap:6px; }
.brand-lockup strong { font-size:16px; letter-spacing:-.02em; }
.auth-copy { margin-top: 54px; }
.auth-copy h2 { margin:0; font-size:34px; letter-spacing:-.045em; }
.auth-copy p { margin:9px 0 0; color:var(--muted); line-height:1.7; }
.auth-tabs { margin-top:28px; padding:5px; border:1px solid var(--line); border-radius:16px; background:var(--surface-soft); }
.auth-tabs button { min-height:42px !important; border-radius:12px !important; }
.auth-tabs button.active { color:#fff !important; border-color:transparent !important; background:var(--gradient) !important; box-shadow:0 10px 24px rgba(82,91,242,.22); }
.auth-form { margin-top:22px; }
.field > span { font-size:12px; color:var(--muted); letter-spacing:.04em; }
.input-shell { min-height:52px; display:flex; align-items:center; gap:10px; padding:0 14px; border:1px solid var(--line); border-radius:16px; background:var(--surface-soft); transition:.2s ease; }
.input-shell:focus-within { border-color:rgba(79,124,255,.52); box-shadow:0 0 0 4px rgba(79,124,255,.09); }
.input-shell .ui-icon { color:var(--muted-2); width:18px; }
.input-shell input { min-width:0; flex:1; min-height:48px; padding:0 !important; border:0 !important; outline:0 !important; background:transparent !important; box-shadow:none !important; }
.auth-message { display:flex; align-items:flex-start; gap:9px; padding:12px 14px; border:1px solid rgba(255,173,102,.22); border-radius:14px; background:rgba(255,173,102,.09); color:var(--orange); font-size:13px; line-height:1.55; }
.auth-submit { width:100%; min-height:52px !important; justify-content:center; margin-top:2px; }
.auth-submit .ui-icon { width:18px; }
.auth-footnote { display:flex; align-items:flex-start; gap:10px; color:var(--muted); font-size:12px; line-height:1.6; }
.auth-footnote .ui-icon { width:17px; color:var(--green); }
.auth-version { margin-top:auto; padding-top:24px; display:flex; align-items:center; justify-content:space-between; gap:16px; color:var(--muted-2); font-size:9px; letter-spacing:.15em; }
.auth-version strong { color:var(--blue-2); font-size:11px; }
.auth-loading { margin:auto 0; display:flex; align-items:center; gap:10px; color:var(--muted); }
.button-loader { width:16px; height:16px; border-radius:50%; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; animation:spin .7s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

.orbital-visual { position:absolute; inset:100px 18px 92px 80px; z-index:1; }
.orbit { position:absolute; left:50%; top:50%; border:1px solid rgba(143,165,220,.18); border-radius:50%; transform:translate(-50%,-50%) rotate(-16deg); }
.orbit-a { width:350px; height:220px; }
.orbit-b { width:250px; height:250px; transform:translate(-50%,-50%) rotate(44deg); }
.orbit i { position:absolute; width:10px; height:10px; border-radius:50%; background:var(--cyan); box-shadow:0 0 22px rgba(53,211,255,.7); }
.orbit-a i:first-child { left:12%; top:19%; }.orbit-a i:last-child { right:8%; bottom:22%; background:var(--violet); }
.orbit-b i { right:12%; top:18%; background:var(--green); }
.orbit-core { position:absolute; left:50%; top:50%; width:88px; height:88px; display:grid; place-items:center; transform:translate(-50%,-50%); border-radius:30px; color:#fff; background:linear-gradient(145deg, rgba(79,124,255,.95), rgba(139,92,246,.92)); box-shadow:0 0 0 12px rgba(97,104,246,.08),0 26px 60px rgba(54,58,181,.35); }
.orbit-core .ui-icon { width:38px; height:38px; }
.node { position:absolute; min-width:52px; height:29px; padding:0 11px; display:grid; place-items:center; border:1px solid rgba(160,181,231,.17); border-radius:10px; background:rgba(8,15,36,.72); color:#9ba8c3; font-size:9px; letter-spacing:.12em; font-weight:900; }
.node-a { left:3%; bottom:18%; }.node-b { right:0; top:7%; }.node-c { right:8%; bottom:4%; }
.network-lines { position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.network-lines path { stroke:rgba(104,137,217,.18); stroke-width:1.2; stroke-dasharray:5 8; }

/* Core workspace */
.month-switch.clean-month-switch { margin: 0 0 20px !important; justify-items:start !important; text-align:left; }
.month-switch strong { text-align:left !important; color:transparent !important; background:var(--gradient-text); -webkit-background-clip:text; background-clip:text; font-size:clamp(32px,5vw,48px) !important; letter-spacing:-.045em; }
.month-hint { text-align:left !important; letter-spacing:.05em; }
.group-strip { display:flex; gap:9px; overflow:auto; padding:1px 2px 16px; scrollbar-width:none; }
.group-strip::-webkit-scrollbar { display:none; }
.group-chip { min-height:40px !important; padding:0 16px !important; border-radius:14px !important; background:var(--surface-soft) !important; border:1px solid var(--line) !important; color:var(--muted) !important; white-space:nowrap; font-weight:800; }
.group-chip.active { color:#fff !important; border-color:transparent !important; background:var(--gradient) !important; box-shadow:0 12px 26px rgba(83,92,242,.2); }
.group-chip.manage { border-style:dashed !important; color:var(--blue-2) !important; }

.calendar-card { padding:18px 16px 22px !important; border-radius:32px !important; }
.calendar-card::after { content:""; position:absolute; width:220px; height:220px; right:-100px; top:-100px; border-radius:50%; background:rgba(139,92,246,.09); filter:blur(10px); pointer-events:none; }
.weekdays { margin-bottom:9px !important; font-size:12px; letter-spacing:.08em; }
.weekdays span { padding:10px 0 !important; }
.day-cell { min-height:clamp(88px,11vw,116px) !important; padding:10px 5px !important; border-radius:18px !important; border:1px solid transparent; gap:5px !important; }
.day-cell:hover { transform:translateY(-2px); background:rgba(91,103,238,.06) !important; border-color:var(--line); }
.day-cell.selected { outline:0 !important; border-color:rgba(91,103,238,.35) !important; background:linear-gradient(145deg, rgba(79,124,255,.14), rgba(139,92,246,.08)) !important; box-shadow:0 12px 28px rgba(58,70,150,.12), 0 0 0 1px rgba(255,255,255,.06) inset !important; }
.day-cell.today:not(.selected) { outline:0 !important; border-color:rgba(53,211,255,.42) !important; background:rgba(53,211,255,.055) !important; }
.day-number { font-size:clamp(19px,3.8vw,29px) !important; letter-spacing:-.04em; }
.day-cell.weekend .day-number { color:var(--orange) !important; }
.lunar-line { color:var(--muted); }
.shift-badge { min-width:40px !important; height:23px !important; padding:0 9px !important; border-radius:9px !important; font-size:12px !important; letter-spacing:.04em; box-shadow:0 7px 16px rgba(0,0,0,.12); }
.corner-tag { right:7px !important; top:7px !important; border-radius:7px !important; }
.manual-dot { border-radius:7px !important; }

.detail-card { margin-top:18px !important; padding:24px !important; grid-template-columns:auto minmax(0,1fr) auto !important; }
.shift-square { border-radius:18px !important; box-shadow:0 14px 30px rgba(0,0,0,.14); }
.detail-date { color:var(--text) !important; letter-spacing:-.035em; }
.detail-chip { border:1px solid var(--line); background:var(--surface-soft) !important; }
.detail-grid > div { border-radius:16px !important; background:var(--surface-soft) !important; border:1px solid var(--line); }

.stats-swipe-viewport { margin-inline:0 !important; }
.stats-month-panel { padding:0 1px 10px !important; }
.stats-hero { padding:32px !important; background:
  radial-gradient(circle at 88% 20%, rgba(53,211,255,.13), transparent 24%),
  radial-gradient(circle at 15% 105%, rgba(139,92,246,.14), transparent 34%),
  linear-gradient(145deg,var(--surface-strong),var(--surface)) !important; }
.stats-hero .label { color:var(--muted); letter-spacing:.13em; font-size:11px; font-weight:900; text-transform:uppercase; }
.stats-number { font-size:clamp(52px,10vw,86px) !important; color:transparent !important; background:var(--gradient-text); -webkit-background-clip:text; background-clip:text; letter-spacing:-.07em; }
.stats-number span { color:var(--muted) !important; font-size:15px !important; letter-spacing:0; }
.info-chip { border-radius:12px !important; border:1px solid var(--line); background:var(--surface-soft) !important; }
.stats-mini-grid > div { min-height:82px !important; border-radius:18px !important; background:var(--surface-soft) !important; box-shadow:none !important; }
.section-title { margin:30px 2px 14px !important; font-size:22px !important; letter-spacing:-.03em; }
.list { gap:12px !important; }
.row-card { padding:19px 20px !important; border-radius:22px !important; }
.row-card:hover { transform:translateY(-2px); border-color:var(--line-strong) !important; }
.row-title { font-size:16px !important; }
.row-value { color:var(--blue-2) !important; }
.chart-card, .rules { padding:25px !important; }
.chart-day { border-radius:8px 8px 4px 4px !important; }
.bar { border-radius:8px 8px 3px 3px !important; box-shadow:0 -6px 18px rgba(79,124,255,.12); }
.stats-focus-card { border-radius:18px !important; background:var(--surface-soft) !important; border:1px solid var(--line); }
.rules ul { color:var(--muted); line-height:1.8; }

.cycle-card { padding:26px !important; background:
  radial-gradient(circle at 92% 12%, rgba(139,92,246,.14), transparent 28%),
  linear-gradient(145deg,var(--surface-strong),var(--surface)) !important; }
.confirm-sequence { border-radius:18px !important; background:rgba(8,15,35,.08) !important; }
body.theme-dark .confirm-sequence { background:rgba(3,8,22,.36) !important; }
.confirm-shift { border-radius:15px !important; box-shadow:0 10px 20px rgba(0,0,0,.14); }
.cycle-arrow { color:var(--muted-2) !important; }
.cycle-footer { border:1px solid var(--line); background:var(--surface-soft) !important; }
.shift-list-card { grid-template-columns:auto minmax(0,1fr) auto !important; }
.shift-row-tags span { border:1px solid var(--line); border-radius:9px !important; background:var(--surface-soft) !important; }
.page-main-btn { min-height:54px !important; border-radius:18px !important; }

/* Settings */
.settings-bento { display:grid; grid-template-columns:1.25fr .75fr; gap:16px; margin-bottom:16px; }
.settings-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:16px; }
.settings-card { padding:24px !important; }
.settings-head-row { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.settings-head { margin:8px 0 0 !important; font-size:21px !important; letter-spacing:-.035em; }
.settings-orbit, .section-icon { width:42px; height:42px; display:grid; place-items:center; border:1px solid var(--line); border-radius:15px; color:var(--blue-2); background:var(--surface-soft); }
.settings-orbit .ui-icon, .section-icon .ui-icon { width:20px; }
.status-chip { min-height:30px; padding:0 11px; display:inline-flex; align-items:center; gap:8px; border:1px solid rgba(87,230,165,.18); border-radius:10px; background:rgba(87,230,165,.08); color:var(--green); font-size:11px; font-weight:900; }
.account-profile { display:flex; align-items:center; gap:14px; padding:14px; border:1px solid var(--line); border-radius:18px; background:var(--surface-soft); }
.account-avatar { width:48px; height:48px; display:grid; place-items:center; border-radius:16px; color:#fff; background:var(--gradient); font-size:16px; font-weight:900; }
.account-profile > div { min-width:0; display:grid; gap:5px; }
.account-profile strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-profile span:last-child { color:var(--muted); font-size:12px; }
.theme-segmented { gap:8px !important; }
.theme-segmented button { min-height:64px !important; display:flex; align-items:center; justify-content:center; gap:8px; border-radius:16px !important; }
.theme-segmented button.active { color:#fff !important; border-color:transparent !important; background:var(--gradient) !important; box-shadow:0 12px 24px rgba(83,92,242,.22); }
.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.setting-tile { min-width:0; min-height:86px; display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:13px; align-items:center; padding:14px; border:1px solid var(--line); border-radius:18px; background:var(--surface-soft); text-align:left; }
.setting-tile:hover { transform:translateY(-2px); border-color:var(--line-strong); }
.setting-tile.active { background:linear-gradient(145deg, rgba(79,124,255,.1), rgba(139,92,246,.06)); border-color:rgba(91,103,238,.24); }
.setting-icon { width:38px; height:38px; display:grid; place-items:center; border:1px solid var(--line); border-radius:13px; color:var(--muted); background:var(--surface-soft); }
.setting-tile.active .setting-icon, .setting-icon.is-active { color:var(--blue-2); background:rgba(79,124,255,.1); }
.setting-icon .ui-icon { width:19px; }
.setting-copy { min-width:0; display:grid; gap:5px; text-align:left; }
.setting-copy strong { font-size:14px; color:var(--text); }
.setting-copy small { color:var(--muted); font-size:11px; line-height:1.45; font-weight:600; }
.setting-row { min-height:72px !important; display:grid !important; grid-template-columns:auto minmax(0,1fr) auto !important; gap:13px !important; align-items:center !important; padding:12px 0 !important; border-top:1px solid var(--line) !important; text-decoration:none !important; }
.setting-row:first-of-type { border-top:0 !important; }
.setting-button:hover { transform:translateX(3px) !important; }
.setting-value { max-width:190px; display:flex; align-items:center; justify-content:flex-end; gap:6px; color:var(--muted); font-size:12px; font-weight:800; text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.setting-value .ui-icon { width:15px; }
.setting-row.danger .setting-icon, .setting-row.danger .setting-value { color:var(--red); }
.switch { width:52px !important; height:30px !important; padding:3px !important; border:1px solid var(--line); }
.switch::after { width:22px !important; height:22px !important; }
.switch.on { background:linear-gradient(135deg,var(--blue),var(--purple)) !important; }
.switch.on::after { transform:translateX(22px) !important; }

/* Dock */
.bottom-nav {
  width:min(calc(100% - 40px), 650px) !important;
  height:76px !important;
  bottom:max(18px,env(safe-area-inset-bottom)) !important;
  padding:7px !important;
  gap:5px !important;
  border-radius:24px !important;
  background:linear-gradient(145deg,var(--surface-strong),var(--surface)) !important;
  border:1px solid var(--line-strong) !important;
  box-shadow:0 26px 80px rgba(20,31,71,.22), 0 1px 0 rgba(255,255,255,.18) inset !important;
  backdrop-filter:blur(30px) saturate(145%) !important;
}
.nav-item { border-radius:18px !important; gap:3px !important; font-size:11px !important; letter-spacing:.02em; }
.nav-icon { width:27px !important; height:27px !important; }
.nav-icon svg { width:22px !important; height:22px !important; }
.nav-item.active { color:#fff !important; background:var(--gradient) !important; box-shadow:0 12px 28px rgba(82,91,242,.28); }

/* Forms / modal / toasts */
.field input, .field select, .field textarea { border-radius:15px !important; background:var(--surface-soft) !important; border:1px solid var(--line) !important; }
.modal-backdrop { background:rgba(2,5,14,.62) !important; backdrop-filter:blur(12px); }
.modal { border-radius:28px !important; padding:26px !important; }
.confirm-icon { width:62px !important; height:62px !important; border-radius:21px !important; color:#fff !important; background:var(--gradient) !important; box-shadow:0 16px 34px rgba(82,91,242,.26); }
.toast { border-radius:16px !important; background:var(--surface-strong) !important; border:1px solid var(--line-strong) !important; backdrop-filter:blur(24px); }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns:1fr; max-width:620px; }
  .auth-visual { min-height:360px; padding:34px; }
  .auth-visual-copy h1 { font-size:48px; }
  .orbital-visual { inset:80px 0 45px 180px; transform:scale(.72); }
  .terminal-card { display:none; }
  .auth-panel { min-height:560px; }
  .settings-columns { grid-template-columns:1fr; }
}

@media (max-width: 720px) {
  .app-shell { padding-inline:14px !important; }
  .topbar { min-height:auto !important; flex-direction:column !important; align-items:stretch !important; padding-top:8px; }
  .toolbar { width:100%; justify-content:flex-start; overflow:auto; flex-wrap:nowrap; padding-bottom:2px; scrollbar-width:none; }
  .toolbar::-webkit-scrollbar { display:none; }
  .title { font-size:38px !important; }
  .page-heading p { font-size:13px; }
  .settings-bento, .settings-grid { grid-template-columns:1fr; }
  .settings-theme-card, .settings-account-card { min-height:auto; }
  .detail-card { grid-template-columns:auto minmax(0,1fr) !important; }
  .detail-card > .ghost-btn { grid-column:1/-1; width:100%; }
  .shift-list-card { grid-template-columns:auto minmax(0,1fr) !important; }
  .shift-list-card > .ghost-btn { grid-column:2; width:100%; }
}

@media (max-width: 640px) {
  :root { --radius:22px; --nav-h:90px; }
  body::before { background-size:34px 34px; }
  .app-shell { padding: max(14px,env(safe-area-inset-top)) 10px calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)) !important; }
  .auth-stage { min-height:calc(100vh - 24px); }
  .auth-shell { min-height:0; padding:7px; border-radius:28px !important; }
  .auth-visual { min-height:240px; padding:26px; border-radius:22px; }
  .auth-visual-copy h1 { margin-top:14px; font-size:39px; }
  .auth-visual-copy p { display:none; }
  .orbital-visual { inset:55px -45px 5px 112px; transform:scale(.52); }
  .auth-panel { min-height:520px; padding:28px 20px 22px; }
  .auth-copy { margin-top:34px; }
  .auth-copy h2 { font-size:29px; }
  .auth-tabs { margin-top:22px; }
  .auth-version { padding-top:18px; }
  .topbar { margin-bottom:14px !important; }
  .eyebrow { font-size:9px; }
  .title { margin-top:9px !important; font-size:34px !important; }
  .month-switch strong { font-size:34px !important; }
  .calendar-card { padding:11px 5px 15px !important; border-radius:24px !important; }
  .weekdays span { padding:7px 0 !important; }
  .day-cell { min-height:76px !important; padding:7px 2px !important; border-radius:13px !important; gap:3px !important; }
  .day-number { font-size:19px !important; }
  .lunar-line { font-size:10px !important; }
  .shift-badge { min-width:31px !important; height:19px !important; padding:0 6px !important; font-size:10px !important; border-radius:7px !important; }
  .corner-tag { right:3px !important; top:3px !important; transform:scale(.86); transform-origin:top right; }
  .manual-dot { right:3px !important; bottom:3px !important; transform:scale(.82); transform-origin:bottom right; }
  .detail-card, .stats-hero, .chart-card, .rules, .cycle-card, .settings-card { padding:18px !important; }
  .stats-number { font-size:58px !important; }
  .stats-mini-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  .row-card { padding:15px !important; }
  .settings-head { font-size:19px !important; }
  .setting-row { min-height:66px !important; }
  .setting-value { max-width:120px; }
  .bottom-nav { width:calc(100% - 20px) !important; height:70px !important; bottom:max(10px,env(safe-area-inset-bottom)) !important; border-radius:22px !important; }
  .nav-item { border-radius:16px !important; }
  .modal-backdrop { padding:10px !important; }
  .modal { padding:20px !important; border-radius:24px !important; }
}

@media (max-width: 390px) {
  .auth-visual { min-height:210px; }
  .auth-visual-copy h1 { font-size:33px; }
  .brand-lockup .eyebrow { display:none; }
  .auth-panel { padding-inline:16px; }
  .title { font-size:31px !important; }
  .day-cell { min-height:70px !important; }
  .lunar-line { max-width:4.4em; }
  .settings-card { padding:16px !important; }
  .setting-copy small { display:none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; scroll-behavior:auto !important; transition-duration:.01ms !important; }
}

/* V9.3.1 unified in-app action dialogs */
.aurora-action-host{position:fixed;inset:0;z-index:220}
.aurora-action-backdrop{position:absolute;inset:0;display:grid;place-items:center;padding:18px;background:rgba(2,5,14,.68);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.aurora-action-dialog{width:min(520px,100%);max-height:min(88vh,760px);overflow:auto;padding:26px!important;border-radius:28px!important}
.aurora-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px}
.aurora-dialog-head h2{margin:10px 0 0;font-size:27px;line-height:1.08;letter-spacing:-.045em}
.aurora-dialog-head p{margin:9px 0 0;color:var(--muted);font-size:13px;line-height:1.65}
.aurora-dialog-fields{display:grid;gap:13px}
.aurora-dialog-field>span{display:block;margin-bottom:7px;color:var(--muted);font-size:11px;font-weight:800}
.aurora-dialog-field input{width:100%;min-height:48px;padding:0 14px;border-radius:15px!important;background:var(--surface-soft)!important;border:1px solid var(--line)!important;color:var(--text);outline:none}
.aurora-dialog-field input:focus{border-color:rgba(79,124,255,.48)!important;box-shadow:0 0 0 3px rgba(79,124,255,.1)}
@media(max-width:640px){.aurora-action-backdrop{align-items:end;padding:8px}.aurora-action-dialog{width:100%;max-height:92vh;padding:20px!important;border-radius:24px 24px 14px 14px!important}.aurora-dialog-head h2{font-size:24px}.aurora-action-dialog .modal-actions{display:grid!important;grid-template-columns:1fr 1fr}.aurora-action-dialog .modal-actions button{width:100%}}
@media(max-width:390px){.aurora-action-dialog .modal-actions{grid-template-columns:1fr}}
