:root {
  --bg: #050b14;
  --bg-elevated: #091423;
  --surface: #0c192a;
  --surface-2: #101f32;
  --surface-3: #14263b;
  --stroke: rgba(145, 181, 220, .14);
  --stroke-strong: rgba(145, 181, 220, .24);
  --text: #f3f7fc;
  --muted: #93a6bc;
  --muted-2: #6f8298;
  --accent: #4b9dff;
  --accent-rgb: 75, 157, 255;
  --accent-soft: rgba(var(--accent-rgb), .15);
  --cyan: #53d8e9;
  --green: #4ed3a2;
  --amber: #ffbc66;
  --red: #ff6d7d;
  --purple: #a882ff;
  --page-outer: #02060c;
  --shell-top: #07101c;
  --shell-bottom: #040912;
  --glass: rgba(12,25,42,.8);
  --hero-start: rgba(18,39,62,.95);
  --hero-end: rgba(9,22,37,.98);
  --surface-start: rgba(12,25,42,.98);
  --surface-end: rgba(8,18,31,.98);
  --divider: rgba(145,181,220,.09);
  --day-dim: #485a6e;
  --on-accent: #04101d;
  --segmented-bg: rgba(12,25,42,.7);
  --tool-result-bg: rgba(2,8,15,.36);
  --composer-bg: rgba(10,22,37,.96);
  --nav-bg: rgba(5,12,21,.95);
  --nav-badge-border: #07101c;
  --sheet-bg: #0b1727;
  --sheet-backdrop: rgba(0,5,12,.68);
  --sheet-handle: #40526a;
  --toast-bg: rgba(17,33,51,.97);
  --toggle-off: #26364a;
  --danger-text: #ff9eaa;
  --approve-text: #75e3bb;
  --success-text: #76ddb9;
  --denied-text: #ff9da8;
  --voice-end: #365ed8;
  --radius: 17px;
  --space: 1;
  --ui-scale: 1;
  --font-scale: 1;
  --orb-scale: 1;
  --nav-height: 68px;
  --composer-height: 54px;
  --ease: 200ms cubic-bezier(.2,.75,.25,1);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7fbff;
  --bg-elevated: #edf3f9;
  --surface: #ffffff;
  --surface-2: #f3f8fd;
  --surface-3: #e4f1ff;
  --stroke: rgba(39,72,108,.14);
  --stroke-strong: rgba(39,72,108,.25);
  --text: #13243a;
  --muted: #607289;
  --muted-2: #64768c;
  --accent: #126fdc;
  --accent-rgb: 18, 111, 220;
  --accent-soft: rgba(var(--accent-rgb), .11);
  --cyan: #168fa3;
  --green: #13805c;
  --amber: #9a5c00;
  --red: #cf3f55;
  --purple: #704cc0;
  --page-outer: #eaf4ff;
  --shell-top: #ffffff;
  --shell-bottom: #eff7ff;
  --glass: rgba(255,255,255,.78);
  --hero-start: rgba(255,255,255,.98);
  --hero-end: rgba(241,248,255,.98);
  --surface-start: rgba(255,255,255,.99);
  --surface-end: rgba(248,251,255,.99);
  --divider: rgba(39,72,108,.10);
  --day-dim: #8796a8;
  --on-accent: #ffffff;
  --segmented-bg: rgba(223,232,242,.72);
  --tool-result-bg: rgba(224,233,243,.72);
  --composer-bg: rgba(255,255,255,.96);
  --nav-bg: rgba(248,251,255,.96);
  --nav-badge-border: #f8fbff;
  --sheet-bg: #ffffff;
  --sheet-backdrop: rgba(31,48,70,.34);
  --sheet-handle: #b5c1ce;
  --toast-bg: rgba(255,255,255,.98);
  --toggle-off: #c9d4df;
  --danger-text: #bc2f45;
  --approve-text: #08724e;
  --success-text: #08724e;
  --denied-text: #bd3047;
  --voice-end: #285ac4;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--page-outer); font-size: calc(16px * var(--font-scale)); }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--text);
  background: var(--page-outer);
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: calc(.94rem * var(--ui-scale));
  line-height: 1.45;
  overscroll-behavior-y: none;
  transition: color var(--ease), background-color var(--ease);
}
button, input, select { color: inherit; font: inherit; }
button { border: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100svh;
  margin: 0 auto;
  background:
    radial-gradient(90% 35% at 50% -8%, rgba(var(--accent-rgb), .17), transparent 72%),
    linear-gradient(180deg, var(--shell-top) 0, var(--bg) 34%, var(--shell-bottom) 100%);
  box-shadow: 0 0 70px rgba(0,0,0,.55);
  transition: background var(--ease), box-shadow var(--ease);
}
#app {
  min-height: 100svh;
  padding: calc(12px + env(safe-area-inset-top)) calc(12px * var(--space)) calc(146px + env(safe-area-inset-bottom));
}
#app.no-composer { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
#app.chat-detail-pad { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.screen { animation: screen-in var(--ease) both; }
@keyframes screen-in { from { opacity: .3; transform: translateY(5px); } }

.app-header, .page-header {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: calc(10px * var(--space));
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { width: 5px; height: 28px; border-radius: 5px; background: linear-gradient(var(--cyan), var(--accent)); box-shadow: 0 0 14px rgba(var(--accent-rgb), .55); }
.brand h1, .page-header h1 { margin: 0; font-size: 1.38rem; line-height: 1; letter-spacing: .18em; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: .68rem; }
.connection-pill { min-height: 44px; padding: 0 11px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--stroke); border-radius: 999px; background: var(--glass); color: var(--muted); font-size: .7rem; }
.header-control-group { display: flex; align-items: center; gap: 7px; }
.theme-toggle { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 1px solid var(--stroke); border-radius: 14px; background: var(--glass); color: var(--accent); font-size: 1.12rem; box-shadow: inset 0 1px rgba(255,255,255,.05); transition: color var(--ease), background-color var(--ease), border-color var(--ease), transform var(--ease); }
.theme-toggle:active { transform: scale(.94); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px var(--green); }
.page-title-wrap { min-width: 0; }
.page-header h1 { letter-spacing: -.03em; font-size: 1.5rem; }
.page-header p { margin: 5px 0 0; color: var(--muted); font-size: .75rem; }
.icon-button, .back-button {
  width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center;
  border-radius: 14px; background: var(--surface-2); border: 1px solid var(--stroke); color: var(--text); font-size: 1.15rem;
}
.back-button { margin-right: 2px; }
.header-leading { display: flex; align-items: center; min-width: 0; gap: 8px; }
.header-actions { display: flex; gap: 7px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) calc(86px * var(--orb-scale)) minmax(0,1fr);
  gap: 7px;
  align-items: center;
  margin-bottom: calc(10px * var(--space));
}
.weather-card, .feature-slide {
  height: 116px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: linear-gradient(155deg, var(--hero-start), var(--hero-end));
  box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.weather-card { padding: 10px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; overflow: hidden; }
.weather-icon { font-size: 1.25rem; line-height: 1; }
.weather-temp { margin-top: auto; font-size: 1.72rem; line-height: 1; font-weight: 750; letter-spacing: -.06em; }
.weather-card strong { margin-top: 3px; font-size: .67rem; }
.weather-card small { margin-top: 2px; color: var(--muted); font-size: .58rem; white-space: nowrap; }
.orb-stage { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.jarvis-orb {
  position: relative;
  width: calc(76px * var(--orb-scale)); height: calc(76px * var(--orb-scale)); max-width: 100%; aspect-ratio: 1;
  padding: 0; border-radius: 50%; overflow: hidden;
  background:
    radial-gradient(circle at 48% 38%, rgba(220,250,255,.95) 0 3%, transparent 8%),
    radial-gradient(circle at 50% 46%, #2a8fe1 0 15%, #17499b 38%, #242370 57%, #090d25 76%);
  box-shadow: 0 0 0 1px rgba(104,190,255,.52), 0 0 20px rgba(var(--accent-rgb),.42), inset 0 -10px 20px rgba(6,4,30,.72);
  transition: filter var(--ease), box-shadow var(--ease), transform var(--ease);
}
.jarvis-orb::before, .jarvis-orb::after { content: ""; position: absolute; inset: 11%; border-radius: 50%; border: 1px solid rgba(168,230,255,.52); }
.jarvis-orb::before { border-left-color: transparent; border-right-color: transparent; animation: orb-spin 9s linear infinite; }
.jarvis-orb::after { inset: 24%; border-color: rgba(255,255,255,.08); box-shadow: 0 0 13px rgba(92,211,255,.34); }
.orb-wave { position: absolute; z-index: 2; left: 20%; right: 20%; top: 49%; height: 1px; background: #bcf7ff; box-shadow: 0 0 7px #58dfff; transform: rotate(-8deg); }
.orb-state-label { margin-top: 7px; max-width: 100%; color: var(--muted); font-size: .59rem; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jarvis-orb[data-state="listening"] { box-shadow: 0 0 0 4px rgba(83,216,233,.12), 0 0 26px rgba(83,216,233,.65); animation: orb-listen 1.15s ease-in-out infinite; }
.jarvis-orb[data-state="thinking"]::before { animation-duration: 1.2s; border-top-width: 2px; }
.jarvis-orb[data-state="tool"] { box-shadow: 0 0 0 2px rgba(168,130,255,.35), 0 0 24px rgba(168,130,255,.55); filter: hue-rotate(24deg); }
.jarvis-orb[data-state="speaking"] .orb-wave { height: 3px; animation: speak-wave .48s ease-in-out infinite alternate; }
.jarvis-orb[data-state="error"] { filter: hue-rotate(120deg) saturate(1.3); box-shadow: 0 0 24px rgba(255,109,125,.55); animation: error-pulse .65s ease 2; }
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes orb-listen { 50% { transform: scale(1.035); } }
@keyframes speak-wave { to { transform: rotate(7deg) scaleY(2.5); } }
@keyframes error-pulse { 50% { transform: scale(.94); } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; } }

.feature-carousel { min-width: 0; }
.feature-track { display: flex; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius); }
.feature-track::-webkit-scrollbar { display: none; }
.feature-slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; padding: 10px; text-align: left; display: flex; flex-direction: column; align-items: stretch; color: var(--text); }
.feature-slide .feature-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-size: .95rem; }
.feature-slide strong { margin-top: auto; font-size: .72rem; line-height: 1.2; }
.feature-slide small { display: block; margin-top: 4px; color: var(--muted); font-size: .56rem; line-height: 1.35; }
.carousel-dots { display: flex; justify-content: center; gap: 4px; margin-top: 5px; }
.carousel-dot { width: 5px; height: 5px; border-radius: 9px; background: var(--muted-2); transition: width var(--ease), background var(--ease); }
.carousel-dot.is-active { width: 14px; background: var(--accent); }

.surface { margin-bottom: calc(10px * var(--space)); border: 1px solid var(--stroke); border-radius: var(--radius); background: linear-gradient(180deg, var(--surface-start), var(--surface-end)); overflow: hidden; }
.surface-head { min-height: 49px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--stroke); }
.surface-title { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: .92rem; font-weight: 700; }
.title-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: .8rem; }
.text-button { min-height: 44px; padding: 0 2px 0 10px; background: none; color: var(--muted); font-size: .7rem; white-space: nowrap; }
.calendar { padding: 10px 10px 5px; }
.calendar-nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin-bottom: 5px; }
.calendar-nav button { width: 44px; height: 44px; border-radius: 13px; background: transparent; color: var(--muted); font-size: 1.35rem; }
.calendar-nav button:active { background: var(--surface-3); }
.month-title { text-align: center; font-size: .9rem; font-weight: 750; }
.week-row, .day-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.week-row span { height: 25px; display: grid; place-items: center; color: var(--muted-2); font-size: .62rem; }
.calendar-day { position: relative; min-width: 0; min-height: 40px; padding: 0; display: grid; place-items: center; border-radius: 12px; background: transparent; color: var(--text); font-size: .73rem; }
.calendar-day.is-dim { color: var(--day-dim); }
.calendar-day.is-today::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--stroke-strong); border-radius: 10px; }
.calendar-day.is-selected { color: white; font-weight: 750; background: var(--accent); box-shadow: 0 5px 14px rgba(var(--accent-rgb), .26); }
.calendar-day.has-events::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); }
.calendar-day.is-selected::after { background: #fff; }
.agenda { padding: 4px 10px 11px; }
.agenda-head { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.agenda-head strong { font-size: .78rem; }
.count-label { color: var(--muted); font-size: .66rem; }
.event-grid { display: grid; gap: 6px; grid-template-columns: repeat(var(--event-cols,1), minmax(0,1fr)); }
.event-card, .more-events-card { min-width: 0; min-height: 64px; padding: 8px; border: 1px solid var(--stroke); border-radius: 12px; background: var(--surface-2); text-align: left; }
.event-card time { display: block; color: var(--accent); font-size: .61rem; }
.event-card strong { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; }
.event-card small { display: block; margin-top: 2px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .57rem; }
.more-events-card { display: grid; place-items: center; color: var(--accent); font-size: .65rem; font-weight: 700; }
.empty-inline { width: 100%; min-height: 68px; display: grid; place-items: center; border: 1px dashed var(--stroke-strong); border-radius: 12px; color: var(--muted); font-size: .69rem; }

.list { padding: 5px 9px 9px; }
.list-row { width: 100%; min-height: 60px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 7px 3px; text-align: left; background: none; border-bottom: 1px solid var(--divider); }
.list-row:last-child { border-bottom: 0; }
.row-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--surface-3); color: var(--accent); font-size: 1rem; }
.row-copy { min-width: 0; }
.row-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .77rem; }
.row-copy small { display: block; margin-top: 4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .64rem; }
.row-meta { max-width: 70px; color: var(--muted-2); font-size: .61rem; text-align: right; }
.chevron { color: var(--muted-2); font-size: 1rem; }
.quick-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; padding: 10px; }
.quick-tool { min-width: 0; min-height: 78px; padding: 9px 5px 7px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; border: 1px solid var(--stroke); border-radius: 14px; background: var(--surface-2); }
.quick-tool span { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.quick-tool strong { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .62rem; font-weight: 650; }

.primary-button, .secondary-button, .danger-button { min-height: 46px; padding: 0 16px; border-radius: 14px; font-weight: 700; font-size: .76rem; }
.primary-button { background: var(--accent); color: var(--on-accent); box-shadow: 0 7px 18px rgba(var(--accent-rgb),.2); }
.secondary-button { background: var(--surface-3); color: var(--text); border: 1px solid var(--stroke); }
.danger-button { background: rgba(255,109,125,.13); color: var(--danger-text); border: 1px solid rgba(255,109,125,.25); }
.full-button { width: 100%; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented { display: flex; gap: 5px; padding: 4px; margin-bottom: 10px; overflow-x: auto; border-radius: 14px; background: var(--segmented-bg); scrollbar-width: none; }
.segmented button { min-width: 0; min-height: 44px; flex: 1 0 auto; padding: 0 14px; border-radius: 11px; background: transparent; color: var(--muted); font-size: .7rem; }
.segmented button.is-active { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.18); }

.chat-list { display: flex; flex-direction: column; gap: 7px; }
.chat-row { min-height: 72px; padding: 10px; display: grid; grid-template-columns: 43px minmax(0,1fr) auto; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--stroke); border-radius: 16px; background: var(--surface); }
.chat-avatar { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg,var(--surface-3),var(--accent-soft)); color: var(--accent); font-weight: 800; }
.chat-copy { min-width: 0; }
.chat-copy strong, .chat-copy p { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-copy strong { font-size: .78rem; }
.chat-copy p { margin: 5px 0 0; color: var(--muted); font-size: .65rem; }
.chat-time { align-self: start; padding-top: 3px; color: var(--muted-2); font-size: .59rem; }
.message-stack { display: flex; flex-direction: column; gap: 10px; }
.date-divider { margin: 1px auto 3px; color: var(--muted-2); font-size: .62rem; }
.message { max-width: 88%; padding: 11px 12px; border-radius: 16px; font-size: .75rem; line-height: 1.55; }
.message.user { margin-left: auto; border-bottom-right-radius: 5px; background: var(--accent); color: var(--on-accent); }
.message.assistant { margin-right: auto; border-bottom-left-radius: 5px; background: var(--surface-2); border: 1px solid var(--stroke); }
.message-label { display: block; margin-bottom: 5px; color: var(--accent); font-size: .59rem; font-weight: 750; letter-spacing: .05em; }
.message-tool { width: 100%; max-width: 100%; }
.tool-result { margin-top: 8px; padding: 9px; border-radius: 11px; background: var(--tool-result-bg); }
.tool-result-row { display: flex; align-items: center; justify-content: space-between; min-height: 31px; gap: 8px; border-bottom: 1px solid var(--stroke); font-size: .66rem; }
.tool-result-row:last-child { border: 0; }
.tool-meta { margin-top: 7px; color: var(--muted-2); font-size: .58rem; }
.link-preview { margin-top: 8px; padding: 9px; border: 1px solid var(--stroke); border-radius: 11px; background: var(--bg-elevated); }
.link-preview strong { display: block; font-size: .67rem; }
.link-preview small { display: block; margin-top: 4px; color: var(--muted); font-size: .59rem; }
.message.error { border-color: rgba(255,109,125,.25); background: rgba(255,109,125,.08); }
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite alternate; }
.typing i:nth-child(2) { animation-delay: .2s; }.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes typing { to { opacity: .25; transform: translateY(-2px); } }
.chat-composer { position: fixed; z-index: 24; left: 50%; bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 7px); width: min(calc(100% - 20px),410px); min-height: var(--composer-height); padding: 6px; display: grid; grid-template-columns: minmax(0,1fr) 44px; gap: 6px; border: 1px solid var(--stroke-strong); border-radius: 18px; background: var(--composer-bg); backdrop-filter: blur(18px); box-shadow: 0 10px 26px rgba(0,0,0,.26); }
.chat-composer input { min-width: 0; border: 0; padding: 0 9px; outline: 0; background: none; font-size: .75rem; }

.approval-list { display: flex; flex-direction: column; gap: 8px; }
.approval-card { padding: 12px; border: 1px solid var(--stroke); border-radius: 17px; background: var(--surface); transition: opacity var(--ease), transform var(--ease); }
.approval-card.is-resolved { opacity: .84; }
.approval-card-head { min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.approval-type { display: flex; gap: 9px; min-width: 0; }
.approval-type .row-icon { width: 36px; height: 36px; flex: 0 0 36px; }
.approval-type strong { display: block; font-size: .77rem; }
.approval-type small { display: block; margin-top: 4px; color: var(--muted); font-size: .61rem; }
.risk-pill, .status-pill { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; font-size: .56rem; }
.risk-pill { background: rgba(255,188,102,.12); color: var(--amber); }
.risk-pill.high { background: rgba(255,109,125,.12); color: var(--red); }
.approval-body { margin: 10px 0; padding: 10px; border-radius: 12px; background: var(--bg-elevated); font-size: .69rem; line-height: 1.55; }
.approval-meta { color: var(--muted-2); font-size: .58rem; }
.approval-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.approval-actions button { min-height: 44px; border-radius: 12px; font-size: .69rem; font-weight: 750; }
.approve-button { background: rgba(78,211,162,.15); color: var(--approve-text); border: 1px solid rgba(78,211,162,.24); }
.deny-button { background: rgba(255,109,125,.1); color: var(--danger-text); border: 1px solid rgba(255,109,125,.2); }
.resolution { margin-top: 10px; min-height: 40px; display: flex; align-items: center; padding: 0 10px; border-radius: 11px; background: rgba(78,211,162,.1); color: var(--success-text); font-size: .66rem; }
.resolution.denied { background: rgba(255,109,125,.09); color: var(--denied-text); }

.menu-section { margin-bottom: calc(17px * var(--space)); }
.menu-section h2 { margin: 0 8px 6px; color: var(--muted); font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.menu-card { border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.menu-row { width: 100%; min-height: 58px; padding: 7px 11px; display: grid; grid-template-columns: 35px minmax(0,1fr) auto; gap: 9px; align-items: center; text-align: left; background: none; border-bottom: 1px solid var(--divider); }
.menu-row:last-child { border-bottom: 0; }
.menu-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.menu-row strong { display: block; font-size: .75rem; }
.menu-row small { display: block; margin-top: 2px; color: var(--muted); font-size: .6rem; }

.content-card { margin-bottom: 9px; padding: 12px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--surface); }
.content-card h3 { margin: 0; font-size: .79rem; }
.content-card p { margin: 6px 0 0; color: var(--muted); font-size: .68rem; line-height: 1.55; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.theme-settings { overflow: hidden; }
.theme-settings .card-head > div { min-width: 0; }
.theme-settings .card-head p { margin-top: 4px; }
.theme-segmented { margin: 12px 0 0; }
.theme-segmented button { min-height: 44px; }
.theme-preview { position: relative; width: 54px; height: 36px; flex: 0 0 54px; overflow: hidden; border: 1px solid var(--stroke-strong); border-radius: 12px; background: linear-gradient(135deg,#07101c 0 50%,#f4f8fc 50% 100%); box-shadow: inset 0 1px 5px rgba(0,0,0,.14); }
.theme-preview i { position: absolute; top: 9px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 7px rgba(var(--accent-rgb),.35); transition: left var(--ease); }
.theme-preview.dark i { left: 8px; }.theme-preview.light i { left: 29px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-card { min-height: 92px; padding: 11px; border: 1px solid var(--stroke); border-radius: 15px; background: var(--surface); }
.stat-card small { color: var(--muted); font-size: .6rem; }
.stat-card strong { display: block; margin-top: 9px; font-size: 1rem; }
.stat-card span { color: var(--green); font-size: .61rem; }
.search-field { width: 100%; height: 46px; margin-bottom: 10px; padding: 0 13px; border: 1px solid var(--stroke); border-radius: 14px; outline: 0; background: var(--surface); font-size: .72rem; }
.filter-chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; scrollbar-width: none; }
.filter-chip { min-height: 38px; padding: 0 13px; flex: 0 0 auto; border-radius: 999px; border: 1px solid var(--stroke); background: var(--surface); color: var(--muted); font-size: .67rem; }
.filter-chip.is-active { color: var(--accent); background: var(--accent-soft); border-color: rgba(var(--accent-rgb),.28); }
.news-card { margin-bottom: 8px; padding: 12px; border: 1px solid var(--stroke); border-radius: 16px; background: var(--surface); text-align: left; }
.news-card .eyebrow { color: var(--accent); font-size: .59rem; }
.news-card h3 { margin: 7px 0 0; font-size: .78rem; line-height: 1.4; }
.news-card p { margin: 6px 0 0; color: var(--muted); font-size: .65rem; line-height: 1.5; }
.todo-row { min-height: 55px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--stroke); }
.todo-row:last-child { border: 0; }
.todo-check { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 1px solid var(--stroke-strong); border-radius: 12px; background: transparent; color: transparent; }
.todo-row.done { color: var(--muted-2); text-decoration: line-through; }.todo-row.done .todo-check { color: white; background: var(--accent); }
.toggle { position: relative; width: 48px; height: 44px; padding: 0; border-radius: 999px; background: transparent; }
.toggle::before { content: ""; position: absolute; left: 2px; top: 9px; width: 44px; height: 26px; border-radius: 999px; background: var(--toggle-off); transition: background var(--ease); }
.toggle::after { content: ""; position: absolute; left: 5px; top: 12px; width: 20px; height: 20px; border-radius: 50%; background: white; transition: transform var(--ease); }
.toggle.is-on::before { background: var(--accent); }.toggle.is-on::after { transform: translateX(18px); }
.permission-row { min-height: 57px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--stroke); }
.permission-row:last-child { border: 0; }.permission-row strong { display: block; font-size: .72rem; }.permission-row small { color: var(--muted); font-size: .6rem; }
.status-pill { color: var(--green); background: rgba(78,211,162,.1); }.status-pill.ask { color: var(--amber); background: rgba(255,188,102,.1); }.status-pill.block { color: var(--red); background: rgba(255,109,125,.1); }
.activity-row { min-height: 58px; display: grid; grid-template-columns: 43px minmax(0,1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--stroke); }
.activity-row:last-child { border: 0; }.activity-time { color: var(--muted); font-size: .61rem; }.activity-row strong { display: block; font-size: .69rem; }.activity-row small { color: var(--muted); font-size: .59rem; }.activity-ok { color: var(--green); font-size: .62rem; }
details.advanced { margin-top: 9px; border: 1px solid var(--stroke); border-radius: 15px; background: var(--surface); overflow: hidden; }
details.advanced summary { min-height: 48px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-size: .72rem; }
.advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border-top: 1px solid var(--stroke); background: var(--stroke); }
.advanced-grid div { padding: 10px; background: var(--surface); }.advanced-grid small { display: block; color: var(--muted); font-size: .58rem; }.advanced-grid strong { font-size: .72rem; }
.demo-state { min-height: 168px; padding: 18px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--surface); }
.demo-state .state-icon { width: 49px; height: 49px; display: grid; place-items: center; border-radius: 16px; background: var(--accent-soft); color: var(--accent); font-size: 1.25rem; }
.demo-state h3 { margin: 10px 0 0; font-size: .84rem; }.demo-state p { max-width: 250px; margin: 6px 0 0; color: var(--muted); font-size: .66rem; }.demo-state .button-row { width: 100%; margin-top: 12px; }
.progress { width: 100%; height: 6px; margin-top: 13px; overflow: hidden; border-radius: 9px; background: var(--surface-3); }.progress span { display: block; width: 72%; height: 100%; border-radius: inherit; background: var(--accent); animation: progress-glow 1.4s ease-in-out infinite alternate; } @keyframes progress-glow { to { filter: brightness(1.5); } }

.lab-group { margin-bottom: 9px; padding: 12px; border: 1px solid var(--stroke); border-radius: 16px; background: var(--surface); }
.lab-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }.lab-head label, .lab-head strong { font-size: .72rem; }.lab-value { color: var(--accent); font-size: .67rem; }
input[type="range"] { width: 100%; height: 30px; accent-color: var(--accent); }
.choice-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }.choice { min-height: 40px; padding: 0 5px; border-radius: 11px; border: 1px solid var(--stroke); background: var(--surface-2); color: var(--muted); font-size: .62rem; }.choice.is-active { color: var(--accent); border-color: rgba(var(--accent-rgb),.42); background: var(--accent-soft); }
.accent-choice { position: relative; padding-left: 16px; }.accent-choice::before { content: ""; position: absolute; left: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--choice-color); }

.assistant-composer {
  position: fixed; z-index: 22; left: 50%; bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 7px); transform: translateX(-50%);
  width: min(calc(100% - 20px),410px); min-height: var(--composer-height); padding: 5px;
  display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; gap: 4px; align-items: center;
  border: 1px solid rgba(var(--accent-rgb),.3); border-radius: 18px; background: var(--composer-bg); backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px rgba(0,0,0,.4), 0 0 20px rgba(var(--accent-rgb),.08);
  transition: opacity var(--ease), transform var(--ease);
}
.assistant-composer.is-hidden { opacity: 0; pointer-events: none; transform: translate(-50%,12px); }
.assistant-composer input { min-width: 0; height: 42px; padding: 0 5px; border: 0; outline: 0; background: transparent; font-size: .72rem; }
.assistant-composer input::placeholder, .chat-composer input::placeholder { color: var(--muted-2); }
.composer-action, .voice-button { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 13px; background: transparent; color: var(--muted); }
.voice-button { background: linear-gradient(145deg,var(--accent),var(--voice-end)); color: white; }
.voice-bars { height: 16px; display: flex; align-items: center; gap: 2px; }.voice-bars i { width: 2px; height: 8px; border-radius: 2px; background: currentColor; }.voice-bars i:nth-child(2) { height: 14px; }.voice-bars i:nth-child(3) { height: 6px; }
.bottom-nav {
  position: fixed; z-index: 23; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%,430px); height: calc(var(--nav-height) + env(safe-area-inset-bottom)); padding: 4px 6px env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4,1fr); background: var(--nav-bg); border-top: 1px solid var(--stroke); backdrop-filter: blur(18px);
}
.nav-item { position: relative; min-width: 0; min-height: 58px; padding: 4px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: transparent; color: var(--muted); font-size: .61rem; }
.nav-icon { position: relative; height: 26px; min-width: 32px; display: grid; place-items: center; border-radius: 12px; font-size: 1.23rem; line-height: 1; }
.nav-item.is-active { color: var(--accent); }.nav-item.is-active .nav-icon { background: var(--accent-soft); }
.nav-badge { position: absolute; right: -6px; top: -4px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border-radius: 9px; border: 2px solid var(--nav-badge-border); background: var(--red); color: white; font-size: .51rem; font-weight: 800; }

.sheet-layer { position: fixed; z-index: 60; inset: 0; display: flex; justify-content: center; align-items: flex-end; visibility: hidden; pointer-events: none; }
.sheet-layer.is-open { visibility: visible; pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--sheet-backdrop); opacity: 0; transition: opacity var(--ease); }
.is-open .sheet-backdrop { opacity: 1; }
.bottom-sheet { position: relative; width: min(100%,430px); max-height: min(78svh,680px); padding: 7px 15px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; border: 1px solid var(--stroke-strong); border-bottom: 0; border-radius: 24px 24px 0 0; background: var(--sheet-bg); box-shadow: 0 -20px 55px rgba(0,0,0,.28); transform: translateY(102%); transition: transform 240ms cubic-bezier(.2,.8,.2,1); }
.is-open .bottom-sheet { transform: translateY(0); }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 13px; border-radius: 4px; background: var(--sheet-handle); }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }.sheet-header h2 { margin: 0; font-size: 1.05rem; }.sheet-header p { margin: 5px 0 0; color: var(--muted); font-size: .67rem; }.sheet-close { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 13px; background: var(--surface-3); }
.detail-list { margin: 0 0 15px; }.detail-list div { min-height: 50px; padding: 8px 0; border-bottom: 1px solid var(--stroke); }.detail-list dt { color: var(--muted); font-size: .59rem; }.detail-list dd { margin: 4px 0 0; font-size: .72rem; }
.toast-region { position: fixed; z-index: 80; left: 50%; bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 16px); width: min(calc(100% - 28px),402px); transform: translateX(-50%); pointer-events: none; }
.toast { min-height: 48px; padding: 0 13px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--stroke-strong); border-radius: 14px; background: var(--toast-bg); box-shadow: 0 10px 28px rgba(0,0,0,.24); font-size: .7rem; animation: toast-in 220ms ease both; }.toast.is-leaving { animation: toast-out 180ms ease both; }.toast-icon { color: var(--green); font-size: .9rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } } @keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

body.density-low .secondary-copy, body.density-low .optional-content { display: none !important; }
body.density-high .surface-head, body.density-high .menu-row { min-height: 52px; }
body.density-high .content-card { margin-bottom: 6px; padding-top: 10px; padding-bottom: 10px; }

:root[data-theme="light"] .app-shell { box-shadow: 0 0 70px rgba(39,72,108,.17); }
:root[data-theme="light"] .weather-card,
:root[data-theme="light"] .feature-slide,
:root[data-theme="light"] .surface,
:root[data-theme="light"] .content-card,
:root[data-theme="light"] .menu-card,
:root[data-theme="light"] .approval-card,
:root[data-theme="light"] .chat-row { box-shadow: 0 7px 20px rgba(43,75,110,.055); }
:root[data-theme="light"] .jarvis-orb { box-shadow: 0 0 0 1px rgba(42,126,210,.45), 0 0 18px rgba(var(--accent-rgb),.26), inset 0 -10px 20px rgba(6,4,30,.72); }

@media (max-width: 359px) {
  #app { padding-left: 8px; padding-right: 8px; }
  .hero-grid { grid-template-columns: minmax(0,1fr) calc(76px * var(--orb-scale)) minmax(0,1fr); gap: 5px; }
  .weather-card, .feature-slide { height: 108px; padding: 8px; }
  .jarvis-orb { width: calc(69px * var(--orb-scale)); height: calc(69px * var(--orb-scale)); }
  .weather-card small, .feature-slide small { display: none; }
  .weather-temp { font-size: 1.5rem; }
  .brand h1 { font-size: 1.24rem; }
  .quick-grid { gap: 5px; padding: 8px; }
  .quick-tool { min-height: 72px; }
  .connection-pill span:last-child { display: none; }
}

@media (min-width: 413px) {
  #app { padding-left: 14px; padding-right: 14px; }
  .hero-grid { gap: 9px; grid-template-columns: minmax(0,1fr) calc(92px * var(--orb-scale)) minmax(0,1fr); }
  .jarvis-orb { width: calc(82px * var(--orb-scale)); height: calc(82px * var(--orb-scale)); }
}
