/* =========================================================
   灏嗚嚦 路 Ice Workbench theme
   A cool, light, cobalt-driven product UI layered on the
   structural stylesheet. Loaded after styles.css.
   ========================================================= */

:root {
  --paper: #f3f6fc;
  --paper-deep: #e8eef8;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --ink: #0d1b2e;
  --ink-soft: #263753;
  --muted: #5b6a80;
  --muted-light: #6d7b91;
  --line: #e0e7f2;
  --line-strong: #c8d4e6;
  --forest: #0d1b2e;
  --forest-deep: #071122;
  --accent: #2e5bff;
  --accent-soft: #e7edff;
  --accent-ink: #1f43cc;
  --green: #0b9b72;
  --green-soft: #ddf7ee;
  --amber: #a96400;
  --amber-soft: #fff0d1;
  --red: #ce3f3f;
  --red-soft: #ffe8e7;
  --blue: #2e5bff;
  --blue-soft: #e7edff;
  --lime: #d8ff63;
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 22px 55px -42px rgba(18, 37, 74, 0.34);
  --shadow-float: 0 34px 90px -30px rgba(11, 28, 62, 0.38);
  --font-sans: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Bahnschrift", "DIN Alternate", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

html {
  background: #f3f6fc;
}

body {
  color: var(--ink);
  background:
    radial-gradient(900px 540px at 88% -12%, rgba(46, 91, 255, 0.15), transparent 62%),
    radial-gradient(620px 480px at -6% 28%, rgba(0, 184, 255, 0.08), transparent 64%),
    linear-gradient(rgba(18, 38, 75, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 38, 75, 0.032) 1px, transparent 1px),
    #f3f6fc;
  background-size: auto, auto, 46px 46px, 46px 46px, auto;
  font-family: var(--font-sans);
}

body::after {
  display: none;
}

::selection {
  color: #fff;
  background: var(--accent);
}

a {
  color: inherit;
}

:focus-visible {
  outline-color: var(--accent);
}

/* Boot */
.brand-sun,
.boot-brand .brand-sun {
  color: var(--lime);
  background: var(--ink);
  border-radius: 11px;
}

.boot-brand strong {
  color: var(--ink);
}

.boot-screen {
  background: transparent;
}

.boot-line {
  background: #dce5f2;
}

.boot-line span {
  background: var(--accent);
}

/* App shell -------------------------------------------------- */
.shell {
  max-width: 1500px;
  padding: 18px 28px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.main {
  min-width: 0;
  padding: 0 0 28px;
}

/* Top navigation */
.sidebar {
  position: sticky;
  top: 12px;
  z-index: 35;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 10px 13px;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  overflow: visible;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(201, 213, 231, 0.76);
  border-radius: 16px;
  box-shadow: 0 14px 34px -28px rgba(18, 37, 74, 0.42);
  backdrop-filter: blur(18px) saturate(1.3);
}

.sidebar::before,
.sidebar::after {
  display: none;
}

.sidebar > .brand {
  z-index: 1;
  flex: none;
  padding: 2px 4px;
  gap: 10px;
  color: var(--ink);
}

.sidebar > .brand .brand-sun {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  color: var(--lime);
  background: var(--ink);
}

.sidebar > .brand .brand-sun svg {
  width: 26px;
  height: 26px;
}

.sidebar > .brand strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.sidebar > .brand small {
  margin-top: 1px;
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.sidebar-kicker,
.sidebar-channel,
.sidebar-foot {
  display: none;
}

.sidebar-nav {
  margin-left: auto;
  flex-direction: row;
  align-items: center;
  gap: 3px;
}

.nav-link {
  min-height: 37px;
  padding: 8px 12px;
  gap: 8px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 570;
  transition: color 150ms ease, background 150ms ease;
}

.nav-link:hover {
  color: var(--ink);
  background: #f1f5fb;
}

.nav-link .icon {
  width: 16px;
  height: 16px;
}

.nav-link.active {
  color: var(--accent-ink);
  background: #eaf0ff;
  box-shadow: none;
}

.nav-link.active::before {
  display: none;
}

.nav-link.active .icon {
  color: var(--accent);
}

.nav-count {
  min-width: 19px;
  height: 19px;
  margin-left: 1px;
  padding: 0 5px;
  color: var(--muted);
  background: #edf2fa;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
}

.nav-link.active .nav-count {
  color: #fff;
  background: var(--accent);
}

/* Topbar */
.topbar {
  min-height: 39px;
  margin-bottom: 21px;
}

.mobile-brand {
  color: var(--ink);
}

.mobile-brand .brand-sun {
  background: var(--ink);
  color: var(--lime);
}

.crumb {
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.crumb b {
  color: var(--ink-soft);
  font-weight: 600;
}

.date-chip {
  height: 36px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
  border-color: var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.icon-btn {
  width: 37px;
  height: 37px;
  color: var(--ink-soft);
  background: #fff;
  border-color: var(--line);
  border-radius: 10px;
}

.icon-btn:hover {
  color: var(--accent);
  background: #f7f9ff;
  border-color: #bdcdf3;
}

/* Buttons */
.btn {
  height: 38px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #3b66ff, #2852ee);
  border-color: #2147d3;
  box-shadow: 0 8px 18px -12px rgba(46, 91, 255, 0.8);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #4a72ff, #315bf5);
  box-shadow: 0 10px 22px -12px rgba(46, 91, 255, 0.85);
}

.btn-dark {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.btn-dark:hover:not(:disabled) {
  background: #172a49;
}

.btn-ghost {
  color: var(--ink-soft);
  background: #fff;
  border-color: var(--line);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--accent-ink);
  background: #f7f9ff;
  border-color: #bed0f4;
}

.btn-soft {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: transparent;
}

.btn-soft:hover:not(:disabled) {
  background: #dbe5ff;
}

.btn-light {
  color: var(--accent-ink);
  background: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-light:hover:not(:disabled) {
  background: #f4f7ff;
}

.btn-danger {
  color: var(--red);
  border-color: rgba(206, 63, 63, 0.2);
}

.btn-danger:hover:not(:disabled) {
  background: var(--red-soft);
}

.btn-sm {
  height: 30px;
  border-radius: 8px;
  font-size: 10.5px;
}

.link-btn {
  color: var(--muted);
  font-size: 11px;
}

.link-btn:hover {
  color: var(--accent);
}

/* Page titles */
.page-intro {
  margin-bottom: 23px;
}

.page-intro h1,
.page-inline-head h1 {
  color: var(--ink);
  letter-spacing: -0.052em;
}

.page-intro h1 {
  margin-top: 9px;
  font-size: clamp(32px, 3.3vw, 47px);
  font-weight: 700;
}

.page-intro h1 em,
.page-inline-head h1 em {
  z-index: 0;
  color: var(--accent);
  isolation: isolate;
}

.page-intro h1 em::after {
  display: none;
}

.page-intro .sub,
.page-inline-head .sub {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.page-intro .sub strong {
  color: var(--ink-soft);
}

.intro-mark {
  display: none;
}

.eyebrow {
  gap: 8px;
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.eyebrow .live-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 91, 255, 0.12);
}

.page-inline-head {
  margin-bottom: 23px;
}

.page-inline-head h1 {
  font-size: clamp(29px, 2.9vw, 41px);
  font-weight: 700;
}

/* Demo strip */
.demo-banner {
  min-height: 38px;
  color: #324d92;
  background: rgba(234, 240, 255, 0.82);
  border: 1px dashed #b8c9f2;
  border-radius: 10px;
  font-size: 11.5px;
}

.demo-banner .demo-label {
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 8px;
}

.demo-banner button {
  color: var(--accent-ink);
}

/* Hero */
.hero-layout {
  gap: 14px;
}

.hero-card {
  min-height: 298px;
  padding: 27px 29px 23px;
  color: #f7f9ff;
  background:
    radial-gradient(circle at 88% 4%, rgba(216, 255, 99, 0.18), transparent 17rem),
    radial-gradient(circle at 72% 120%, rgba(0, 195, 255, 0.2), transparent 20rem),
    linear-gradient(138deg, #2e5bff 0%, #2046dc 52%, #142d9f 100%);
  border-radius: 24px;
  box-shadow: 0 24px 52px -34px rgba(46, 91, 255, 0.8);
}

.hero-card::before {
  border-color: rgba(255, 255, 255, 0.2);
}

.hero-card::after {
  border-color: rgba(255, 255, 255, 0.12);
}

.hero-label {
  color: rgba(255, 255, 255, 0.58);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.hero-label::before {
  background: var(--lime);
}

.hero-cat {
  color: var(--ink);
  background: var(--lime);
  font-size: 10.5px;
  font-weight: 650;
}

.hero-title {
  max-width: 78%;
  margin-top: 15px;
  color: #fff;
  font-size: clamp(23px, 2.2vw, 30px);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.hero-title .demo-inline {
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.24);
}

.hero-countdown {
  margin-top: 13px;
}

.hero-countdown .num {
  color: #fff;
  font-family: var(--font-serif);
  font-size: clamp(68px, 7vw, 95px);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.hero-countdown .unit {
  color: var(--lime);
  font-size: 14px;
  font-weight: 650;
}

.hero-countdown .caption {
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.hero-countdown.is-expired .num,
.hero-countdown.is-expired .unit {
  color: #ffd4c8;
}

.hero-bottom {
  border-top-color: rgba(255, 255, 255, 0.17);
}

.hero-date {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11.5px;
}

.hero-note {
  color: rgba(255, 255, 255, 0.43);
  font-size: 10.5px;
}

.hero-actions .btn {
  height: 32px;
  border-radius: 8px;
  font-size: 10.5px;
}

.hero-actions .btn-ghost {
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.28);
}

.hero-actions .btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
}

.hero-actions .btn-light {
  color: var(--accent-ink);
  background: #fff;
  border-color: #fff;
}

.hero-empty {
  background:
    radial-gradient(circle at 84% 12%, rgba(216, 255, 99, 0.18), transparent 16rem),
    linear-gradient(138deg, #2e5bff 0%, #2046dc 52%, #142d9f 100%);
}

.hero-empty .hero-title {
  color: #fff;
}

.hero-empty .hero-copy {
  color: rgba(255, 255, 255, 0.55);
}

.hero-empty-sun {
  border-color: rgba(255, 255, 255, 0.18);
}

.hero-empty-sun::before {
  border-color: rgba(255, 255, 255, 0.12);
}

.hero-empty-sun::after {
  background: var(--lime);
  opacity: 0.2;
}

/* Stats */
.stat-grid {
  gap: 11px;
}

.stat-card {
  min-height: 141px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 14px 30px -30px rgba(18, 37, 74, 0.38);
}

.stat-card:hover {
  transform: translateY(-2px);
  background: #fff;
  border-color: #c7d5ee;
}

.stat-card::after {
  border-color: #e8eef8;
}

.stat-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.stat-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
}

.stat-value {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 39px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.stat-value small {
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9px;
}

.stat-foot {
  color: var(--muted-light);
  font-size: 10px;
}

.stat-card.tone-green .stat-icon { color: var(--green); background: var(--green-soft); }
.stat-card.tone-red .stat-icon { color: var(--red); background: var(--red-soft); }
.stat-card.tone-red .stat-value { color: var(--red); }
.stat-card.tone-blue .stat-icon { color: var(--blue); background: var(--blue-soft); }
.stat-card.tone-amber .stat-icon { color: var(--amber); background: var(--amber-soft); }

/* Panels and dashboard */
.dashboard-grid {
  gap: 14px;
  margin-top: 14px;
}

.dashboard-left {
  gap: 13px;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}

.schedule-panel {
  padding: 21px 21px 12px;
}

.panel-head h2 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.03em;
}

.section-kicker {
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.panel-head .head-note {
  color: var(--muted-light);
  font-size: 10.5px;
}

.group-head {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.group-head::after {
  background: var(--line);
}

.group-head .group-dot {
  background: var(--accent);
}

.group-head.is-overdue {
  color: var(--red);
}

.group-head.is-overdue .group-dot {
  background: var(--red);
}

.item-row {
  grid-template-columns: 40px minmax(0, 1fr) auto 116px;
  min-height: 64px;
  border-radius: 10px;
}

.item-row:hover {
  background: #f5f8ff;
}

.item-row + .item-row {
  border-top-color: #edf1f7;
}

.cat-mark {
  border-radius: 10px;
}

.item-title {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 650;
}

.item-meta {
  color: var(--muted-light);
  font-size: 11.5px;
}

.item-due strong {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
}

.item-due span {
  color: var(--muted-light);
  font-size: 10px;
}

.item-row.is-overdue .item-due strong,
.item-row.is-overdue .item-due span {
  color: var(--red);
}

.item-row.is-soon .item-due span {
  color: var(--amber);
}

.mini-action {
  color: var(--muted-light);
  border-radius: 7px;
}

.mini-action:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.mini-action.is-danger:hover {
  color: var(--red);
  background: var(--red-soft);
}

.item-tag {
  color: #6b5a2c;
  background: #f7efd9;
  font-family: var(--font-mono);
}

.item-tag.tag-done {
  color: var(--green);
  background: var(--green-soft);
}

.item-tag.tag-overdue {
  color: var(--red);
  background: var(--red-soft);
}

.panel-foot-link {
  color: var(--muted);
  border-top-color: var(--line);
  font-size: 10.5px;
}

.panel-foot-link:hover {
  color: var(--accent);
}

.empty-inline .empty-icon {
  color: var(--accent);
  background: var(--accent-soft);
}

.empty-inline p {
  color: var(--muted);
}

/* Setup strip */
.setup-strip {
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--line);
  border-radius: 15px;
}

.setup-strip .setup-mark {
  color: var(--accent);
  background: var(--accent-soft);
}

.setup-strip b {
  color: var(--ink);
}

.setup-strip span {
  color: var(--muted);
}

/* Rail */
.rail {
  gap: 13px;
}

/* Calendar */
.calendar-card {
  padding: 17px 17px 13px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}

.cal-title strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.cal-title span {
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.cal-nav button {
  color: var(--muted);
  border-radius: 7px;
}

.cal-nav button:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}

.cal-weekdays {
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.cal-day {
  color: var(--ink-soft);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.cal-day:hover {
  background: var(--accent-soft);
}

.cal-day.is-today {
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.cal-day.has-due::after {
  background: var(--accent);
}

.cal-day.has-due.is-today::after {
  background: var(--accent);
}

.calendar-foot {
  color: var(--muted-light);
  border-top-color: var(--line);
  font-size: 8px;
}

.calendar-foot i {
  background: var(--accent);
}

/* Channel card */
.channel-card {
  padding: 18px;
  color: #f7f9ff;
  background:
    radial-gradient(circle at 100% 0%, rgba(46, 91, 255, 0.45), transparent 13rem),
    linear-gradient(145deg, #0d1b2e, #102342 68%, #142d57);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  box-shadow: 0 20px 38px -32px rgba(7, 17, 34, 0.8);
}

.channel-icon {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.channel-card h3 {
  color: #fff;
  font-size: 15px;
}

.channel-desc {
  color: rgba(255, 255, 255, 0.44);
}

.channel-rows {
  border-top-color: rgba(255, 255, 255, 0.1);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.channel-row span {
  color: rgba(255, 255, 255, 0.4);
}

.channel-row b {
  color: rgba(255, 255, 255, 0.85);
}

.channel-row b.is-error {
  color: #ff9b9b;
}

.channel-actions .btn-ghost {
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
}

.channel-actions .btn-ghost:hover:not(:disabled) {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
}

.channel-actions .btn-soft {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.channel-actions .btn-soft:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.channel-actions .btn-dark {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--lime);
}

.channel-tip {
  color: rgba(255, 255, 255, 0.34);
}

.channel-card .status-pill {
  color: var(--lime);
  background: rgba(255, 255, 255, 0.1);
}

.channel-card .status-pill.tone-error {
  color: #ffb3b3;
  background: rgba(206, 63, 63, 0.18);
}

.quote-card {
  display: none;
}

/* Items page */
.items-panel {
  padding: 17px 19px 9px;
}

.items-toolbar {
  border-bottom-color: var(--line);
}

.segmented {
  background: #edf2fa;
  border-radius: 9px;
}

.seg-btn {
  color: var(--muted);
  border-radius: 7px;
  font-family: var(--font-sans);
  font-size: 10.5px;
}

.seg-btn.active {
  color: var(--accent-ink);
  background: #fff;
  box-shadow: 0 3px 9px -6px rgba(26, 50, 100, 0.4);
}

.seg-btn span {
  color: var(--muted-light);
  background: #e8eef8;
  font-family: var(--font-mono);
}

.search-box input {
  height: 35px;
  color: var(--ink);
  background: #f8faff;
  border-color: var(--line);
  border-radius: 8px;
}

.search-box input:focus {
  border-color: #9cb3ef;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46, 91, 255, 0.08);
}

.items-list .item-row {
  grid-template-columns: 42px minmax(0, 1fr) 128px 116px;
}

.items-list .item-row + .item-row {
  border-top-color: #edf1f7;
}

.items-list .item-note {
  color: var(--muted);
  font-size: 10px;
}

.items-list .item-due small {
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 8px;
}

.month-separator {
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty-state h2 {
  color: var(--ink);
}

.empty-state p {
  color: var(--muted);
}

.empty-illustration {
  color: var(--accent);
  background: var(--accent-soft);
}

.empty-illustration::before {
  border-color: #bdcdf3;
}

/* Logs */
.summary-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--line);
  border-radius: 14px;
}

.summary-card span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.summary-card strong {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 25px;
}

.summary-card .summary-icon {
  color: var(--accent);
  background: var(--accent-soft);
}

.summary-card.is-error .summary-icon {
  color: var(--red);
  background: var(--red-soft);
}

.summary-card.is-time .summary-icon {
  color: var(--green);
  background: var(--green-soft);
}

.logs-panel {
  padding: 17px 19px 11px;
}

.logs-toolbar {
  border-bottom-color: var(--line);
}

.logs-toolbar h2 {
  color: var(--ink);
  font-size: 15px;
}

.logs-toolbar h2 span {
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9px;
}

.log-row + .log-row {
  border-top-color: #edf1f7;
}

.log-status-icon {
  color: var(--green);
  background: var(--green-soft);
}

.log-status-icon.is-failed {
  color: var(--red);
  background: var(--red-soft);
}

.log-title-line b {
  color: var(--ink);
  font-size: 12.5px;
}

.log-trigger {
  color: var(--muted);
  background: #eef3fa;
  font-family: var(--font-mono);
  font-size: 7px;
}

.log-preview {
  color: var(--muted);
}

.log-meta {
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 8px;
}

.log-error {
  color: var(--red);
  background: var(--red-soft);
}

.log-status {
  color: var(--green);
  background: var(--green-soft);
  font-family: var(--font-mono);
  font-size: 8px;
}

.log-status.is-failed {
  color: var(--red);
  background: var(--red-soft);
}

.log-retry {
  color: var(--muted);
  border-color: var(--line);
  background: #fff;
}

.log-retry:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}

/* Settings */
.form-card {
  padding: 22px;
}

.form-card + .form-card {
  margin-top: 14px;
}

.form-section-head h2 {
  color: var(--ink);
  font-size: 17px;
}

.form-section-head p {
  color: var(--muted);
}

.form-section-icon {
  color: var(--accent);
  background: var(--accent-soft);
}

.status-pill {
  height: 22px;
  color: var(--muted);
  background: #eef3fa;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.02em;
}

.status-pill.tone-ok { color: var(--green); background: var(--green-soft); }
.status-pill.tone-warn { color: var(--amber); background: var(--amber-soft); }
.status-pill.tone-error { color: var(--red); background: var(--red-soft); }
.status-pill.tone-blue { color: var(--accent); background: var(--accent-soft); }
.status-pill.tone-muted { color: var(--muted); background: #eef3fa; }

/* QR connection card */
.qr-connect {
  padding: 19px;
  color: #f7f9ff;
  background:
    radial-gradient(circle at 95% 0%, rgba(46, 91, 255, 0.55), transparent 14rem),
    radial-gradient(circle at 70% 120%, rgba(0, 196, 255, 0.14), transparent 16rem),
    linear-gradient(140deg, #0d1b2e, #102342 62%, #142d57);
  border-radius: 16px;
}

.qr-connect::before {
  border-color: rgba(255, 255, 255, 0.12);
}

.qr-connect::after {
  border-color: rgba(255, 255, 255, 0.07);
}

.qr-kicker {
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.qr-connect h3 {
  color: #fff;
  font-size: 20px;
  font-weight: 680;
}

.qr-connect p {
  color: rgba(255, 255, 255, 0.48);
}

.qr-fact,
.qr-session {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono);
  font-size: 8px;
}

.qr-session.is-ready {
  color: var(--ink);
  background: var(--lime);
}

.qr-connect .btn-light {
  color: var(--accent-ink);
  background: #fff;
}

.qr-connect .btn-ghost {
  color: rgba(255, 255, 255, 0.84);
  border-color: rgba(255, 255, 255, 0.22);
}

.qr-art {
  color: var(--lime);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 16px;
}

.qr-art::before {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Advanced config */
.advanced-config {
  background: #f7f9fd;
  border-color: var(--line);
}

.advanced-config summary {
  color: var(--ink-soft);
  font-size: 10.5px;
}

.advanced-config summary::after {
  color: var(--muted);
  border-color: var(--line);
}

.advanced-hint {
  color: var(--muted-light);
}

.advanced-body {
  border-top-color: var(--line);
}

/* Fields */
.field > label,
.field-label {
  color: var(--ink-soft);
  font-size: 11.5px;
}

.field-label .optional {
  color: var(--muted-light);
}

.field-hint {
  color: var(--muted-light);
  font-size: 10px;
}

.field-hint code {
  background: #eef3fa;
  color: var(--accent-ink);
}

.input,
.select,
.textarea {
  color: var(--ink);
  background: #f8faff;
  border-color: var(--line);
  border-radius: 9px;
  font-size: 12px;
}

.input,
.select {
  height: 40px;
}

.input::placeholder,
.textarea::placeholder {
  color: #a1acbd;
}

.input:focus,
.select:focus,
.textarea:focus,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  border-color: #91a9ea;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46, 91, 255, 0.09);
}

.select {
  background-color: #f8faff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6a80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px 12px;
}

.input-btn {
  color: var(--muted-light);
}

.secret-saved {
  color: var(--green);
}

.text-action {
  color: var(--muted-light);
}

.text-action:hover {
  color: var(--red);
}

/* Capture box / guide */
.capture-box {
  border-color: #d4e0fb;
  background: #f3f7ff;
}

.capture-box h3 {
  color: var(--ink-soft);
}

.capture-box h3 .icon {
  color: var(--accent);
}

.capture-box p {
  color: var(--muted);
}

.guide {
  background: #f7f9fd;
  border: 1px solid var(--line);
}

.guide-head {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.guide-head .icon {
  color: var(--accent);
}

.guide-num {
  color: var(--accent-ink);
  background: #fff;
  border: 1px solid #d5e1fa;
}

.guide-step p {
  color: var(--muted);
}

.guide-step p b {
  color: var(--ink-soft);
}

.form-divider {
  background: var(--line);
}

.toggle-copy strong {
  color: var(--ink);
}

.toggle-copy span {
  color: var(--muted);
}

.switch span {
  background: #cbd5e4;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:focus-visible + span {
  outline-color: var(--accent);
}

.chip {
  color: var(--muted);
  background: #f8faff;
  border-color: var(--line);
  border-radius: 7px;
  font-size: 9.5px;
}

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

.chip:has(input:checked) {
  color: var(--accent-ink);
  border-color: #b9caf3;
  background: var(--accent-soft);
}

.message-preview {
  color: #f7f9ff;
  background:
    radial-gradient(circle at 100% 0%, rgba(46, 91, 255, 0.45), transparent 10rem),
    linear-gradient(145deg, #0d1b2e, #102342);
  border-radius: 13px;
}

.message-preview .preview-label {
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-mono);
}

.message-preview pre {
  color: rgba(255, 255, 255, 0.86);
}

.security-note {
  color: var(--muted-light);
}

.security-note .icon {
  color: var(--green);
}

.form-actions {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 42px -28px rgba(18, 37, 74, 0.4);
  backdrop-filter: blur(14px);
}

.form-actions .action-note {
  color: var(--muted-light);
}

/* Modal */
dialog.modal::backdrop {
  background: rgba(7, 17, 34, 0.5);
  backdrop-filter: blur(6px);
}

.modal-card {
  background: #fbfcff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 21px;
  box-shadow: var(--shadow-float);
}

.modal-head {
  border-bottom-color: var(--line);
}

.modal-head h2 {
  color: var(--ink);
  font-size: 21px;
}

.modal-head p {
  color: var(--muted);
}

.modal-close {
  color: var(--muted);
  border-color: var(--line);
  background: #fff;
  border-radius: 9px;
}

.modal-close:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.modal-body {
  background: #fbfcff;
}

.modal-foot {
  background: #f4f7fc;
  border-top-color: var(--line);
}

.form-error {
  color: var(--red);
  background: var(--red-soft);
}

.editor-actions {
  background: #f4f7fc;
  border-color: var(--line);
}

.editor-state {
  color: var(--muted);
}

.category-option {
  color: var(--muted);
  background: #fff;
  border-color: var(--line);
  border-radius: 8px;
}

.category-option:hover {
  border-color: #c2d0ea;
}

.category-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46, 91, 255, 0.08);
}

.reminder-option {
  color: var(--muted);
  background: #fff;
  border-color: var(--line);
  border-radius: 7px;
}

.reminder-option:hover {
  border-color: #c2d0ea;
}

.reminder-option:has(input:checked) {
  color: var(--accent-ink);
  border-color: #b9caf3;
  background: var(--accent-soft);
}

.item-form .modal-note {
  color: #6b5a2c;
  background: #f7efd9;
}

.modal-delete {
  color: var(--red);
}

/* Confirm */
.confirm-icon {
  color: var(--red);
  background: var(--red-soft);
}

.modal-confirm p {
  color: var(--muted);
}

/* Capture modal */
.capture-visual {
  color: #fff;
  background: linear-gradient(145deg, #2e5bff, #1737b7);
}

.capture-visual::before {
  border-color: rgba(46, 91, 255, 0.25);
}

.capture-visual::after {
  border-color: rgba(46, 91, 255, 0.16);
}

.capture-body .capture-copy {
  color: var(--muted);
}

.capture-status {
  color: var(--muted);
  background: #f1f5fb;
}

.capture-status.is-live {
  color: var(--green);
  background: var(--green-soft);
}

.capture-status.is-error {
  color: var(--red);
  background: var(--red-soft);
}

.capture-found {
  border-color: #d4e0fb;
  background: #f3f7ff;
}

.capture-found b {
  color: var(--ink-soft);
}

/* QR modal */
.qr-body {
  background: #fbfcff;
}

.qr-stepper {
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 8px;
}

.qr-stepper i {
  color: var(--muted);
  background: #eef3fa;
}

.qr-stepper [data-step].is-active {
  color: var(--accent-ink);
}

.qr-stepper [data-step].is-active i {
  color: #fff;
  background: var(--accent);
}

.qr-stepper [data-step].is-done {
  color: var(--green);
}

.qr-stepper [data-step].is-done i {
  background: var(--green);
}

.qr-step-line {
  background: var(--line);
}

.qr-image-wrap {
  background: #fff;
  border-color: var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 34px -28px rgba(18, 37, 74, 0.42);
}

.qr-side h3 {
  color: var(--ink);
  font-size: 21px;
}

.qr-side > p {
  color: var(--muted);
}

.qr-status {
  color: var(--muted);
  background: #f1f5fb;
  border-radius: 8px;
  font-size: 9.5px;
}

.qr-status.is-live {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.qr-status.is-error {
  color: var(--red);
  background: var(--red-soft);
}

.qr-footnote {
  color: var(--muted-light);
}

.qr-activation-visual {
  color: var(--accent);
  background: var(--accent-soft);
}

.qr-check-icon {
  color: #fff;
  background: var(--accent);
}

.qr-orbit {
  border-color: #b9caf3;
}

.qr-activation-screen h3,
.qr-success-screen h3 {
  color: var(--ink);
}

.qr-activation-copy,
.qr-success-screen > p {
  color: var(--muted);
}

.qr-account-pill {
  color: var(--muted);
  background: #fff;
  border-color: var(--line);
  font-family: var(--font-mono);
}

.qr-success-visual {
  color: #fff;
  background: var(--green);
  box-shadow: 0 0 0 9px rgba(11, 155, 114, 0.1);
}

/* Toasts */
.toast {
  color: #f8fbff;
  background: rgba(13, 27, 46, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px -22px rgba(7, 17, 34, 0.7);
}

.toast .toast-icon {
  color: var(--ink);
  background: var(--lime);
}

.toast.is-error {
  background: rgba(156, 40, 40, 0.97);
}

.toast.is-error .toast-icon {
  color: #9c2828;
  background: #ffd6d6;
}

/* Fatal */
.fatal-icon {
  color: var(--red);
  background: var(--red-soft);
}

/* Scrollbar */
* {
  scrollbar-color: #c1cee1 transparent;
}

/* Login / first-run setup */
.logout-btn {
  height: 37px;
  padding: 0 11px;
  color: var(--muted);
  background: #fff;
  border-color: var(--line);
  font-size: 11px;
}

.logout-btn:hover:not(:disabled) {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: transparent;
}

.logout-btn .icon {
  width: 14px;
  height: 14px;
}

.auth-shell {
  width: 100%;
  max-width: 1500px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(430px, 0.96fr);
  gap: 14px;
}

.auth-visual {
  position: relative;
  min-height: calc(100vh - 36px);
  padding: 34px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 88% 8%, rgba(216, 255, 99, 0.19), transparent 18rem),
    radial-gradient(circle at 12% 100%, rgba(0, 195, 255, 0.2), transparent 22rem),
    linear-gradient(145deg, #2e5bff 0%, #1d42d8 48%, #0c1b47 100%);
  border-radius: 24px;
  box-shadow: 0 30px 70px -46px rgba(20, 45, 120, 0.8);
}

.auth-visual::before {
  content: "";
  position: absolute;
  top: -170px;
  right: -140px;
  width: 490px;
  height: 490px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.auth-visual::after {
  content: "";
  position: absolute;
  top: -100px;
  right: -70px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
}

.auth-visual-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
}

.auth-brand .brand-sun {
  width: 39px;
  height: 39px;
  border-radius: 11px;
  color: var(--ink);
  background: var(--lime);
}

.auth-brand .brand-sun svg {
  width: 29px;
  height: 29px;
}

.auth-brand strong {
  display: block;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.15;
}

.auth-brand small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.44);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.auth-local {
  min-height: 27px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.auth-local .icon {
  width: 10px;
  height: 10px;
}

.auth-visual-copy {
  position: relative;
  z-index: 1;
  max-width: 570px;
  margin-top: clamp(70px, 12vh, 140px);
}

.auth-visual-copy .eyebrow {
  color: var(--lime);
}

.auth-visual-copy .eyebrow .live-dot {
  background: var(--lime);
  box-shadow: 0 0 0 3px rgba(216, 255, 99, 0.13);
}

.auth-visual-copy h1 {
  margin-top: 13px;
  color: #fff;
  font-size: clamp(41px, 4.5vw, 64px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.auth-visual-copy h1 em {
  color: var(--lime);
  font-style: normal;
}

.auth-description {
  max-width: 430px;
  margin-top: 17px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12.5px;
  line-height: 1.8;
}

.auth-preview {
  position: relative;
  z-index: 1;
  width: min(390px, 100%);
  margin-top: 31px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 20px 40px -30px rgba(5, 16, 48, 0.8);
  backdrop-filter: blur(12px);
}

.auth-preview-top,
.auth-preview-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.46);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
}

.auth-preview-item {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-preview-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--ink);
  background: var(--lime);
}

.auth-preview-icon .icon {
  width: 18px;
  height: 18px;
}

.auth-preview-item b {
  display: block;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
}

.auth-preview-item small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.43);
  font-size: 9px;
}

.auth-preview-bar {
  height: 3px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
}

.auth-preview-bar i {
  display: block;
  width: 62%;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
}

.auth-preview-bottom {
  margin-top: 10px;
  letter-spacing: 0.02em;
}

.auth-points {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 27px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.auth-points span {
  min-height: 29px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 9px;
}

.auth-points .icon {
  width: 11px;
  height: 11px;
}

.auth-visual-foot {
  position: relative;
  z-index: 1;
  margin-top: 19px;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: rgba(255, 255, 255, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.auth-panel {
  min-height: calc(100vh - 36px);
  padding: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.auth-form-wrap {
  width: min(354px, 100%);
}

.auth-kicker {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.auth-form-wrap h2 {
  margin-top: 9px;
  color: var(--ink);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.045em;
}

.auth-lead {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.auth-message {
  margin-top: 15px;
  padding: 9px 11px;
  border: 1px solid #cfdcfa;
  border-radius: 8px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  font-size: 10.5px;
  line-height: 1.55;
}

.auth-error {
  display: none;
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 10.5px;
  line-height: 1.55;
}

.auth-error.is-visible {
  display: block;
}

.auth-form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.auth-input {
  width: 100%;
  height: 45px;
  padding: 0 13px;
  color: var(--ink);
  background: #f8faff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.auth-input::placeholder {
  color: #a1acbd;
}

.auth-input:focus,
.auth-input:focus-visible {
  outline: none;
  border-color: #96adeb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46, 91, 255, 0.09);
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap .auth-input {
  padding-right: 43px;
}

.auth-reveal {
  position: absolute;
  right: 5px;
  top: 50%;
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--muted-light);
  border: 0;
  border-radius: 7px;
  background: transparent;
  transform: translateY(-50%);
}

.auth-reveal:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.auth-reveal .icon {
  width: 16px;
  height: 16px;
}

.auth-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.6;
}

.auth-hint .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  flex: none;
  color: var(--green);
}

.auth-submit {
  height: 46px;
  margin-top: 4px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(180deg, #3b66ff, #2852ee);
  box-shadow: 0 10px 22px -14px rgba(46, 91, 255, 0.9);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}

.auth-submit:hover:not(:disabled) {
  background: linear-gradient(180deg, #4a72ff, #315bf5);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  cursor: progress;
  opacity: 0.65;
}

.auth-submit .icon {
  width: 16px;
  height: 16px;
}

.auth-note {
  margin-top: 20px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-light);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.02em;
}

.auth-note .icon {
  width: 11px;
  height: 11px;
}

.auth-icp {
  display: inline-block;
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.auth-icp:hover {
  color: var(--ink);
  text-decoration: underline;
}

.app-foot {
  margin-top: 34px;
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.app-foot .icp-link {
  color: inherit;
  text-decoration: none;
}

.app-foot .icp-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

@media (max-width: 980px) {
  .auth-shell {
    min-height: 100vh;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .auth-visual {
    min-height: 0;
    padding: 22px;
    border-radius: 18px;
  }

  .auth-visual-copy {
    margin-top: 48px;
  }

  .auth-visual-copy h1 {
    font-size: 40px;
  }

  .auth-description {
    display: none;
  }

  .auth-preview,
  .auth-points {
    display: none;
  }

  .auth-visual-foot {
    margin-top: 30px;
  }

  .auth-panel {
    min-height: 0;
    padding: 30px 22px;
    border-radius: 18px;
  }

  .auth-form-wrap {
    width: min(390px, 100%);
  }
}

@media (max-width: 600px) {
  .auth-shell {
    padding: 10px;
  }

  .auth-visual {
    padding: 18px;
    border-radius: 16px;
  }

  .auth-local {
    display: none;
  }

  .auth-visual-copy {
    margin-top: 30px;
  }

  .auth-visual-copy h1 {
    font-size: 32px;
  }

  .auth-visual-copy .eyebrow {
    font-size: 8px;
  }

  .auth-visual-foot {
    display: none;
  }

  .auth-panel {
    padding: 26px 18px 30px;
    border-radius: 16px;
  }

  .auth-form-wrap h2 {
    font-size: 28px;
  }

  .auth-form {
    margin-top: 17px;
    gap: 12px;
  }

  .auth-submit {
    height: 46px;
  }
}

/* iOS Safari / iPhone 18 Pro Max compatibility ------------------ */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
}

.shell,
.boot-screen {
  min-height: 100vh;
  min-height: 100svh;
}

.auth-shell {
  min-height: 100vh;
  min-height: 100svh;
}

@media (min-width: 981px) {
  .auth-visual,
  .auth-panel {
    min-height: calc(100vh - 36px);
    min-height: calc(100svh - 36px);
  }
}

/* Keep fixed controls clear of the Dynamic Island and home indicator. */
@media (max-width: 980px) {
  .auth-shell {
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 920px) {
  .shell {
    padding-top: calc(13px + env(safe-area-inset-top));
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .sidebar {
    bottom: calc(11px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 600px) {
  .auth-shell {
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

/* Dynamic viewport height avoids Safari toolbar clipping dialogs. */
dialog.modal {
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
}

.modal-card {
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
}

.modal-body {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 720px) {
  dialog.modal {
    max-height: calc(100vh - 14px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 14px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .modal-card {
    max-height: calc(100vh - 14px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 14px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .modal-foot {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* Backdrop blur needs the prefixed form on WebKit. */
.sidebar,
.form-actions,
.auth-preview,
.auth-panel {
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
}

dialog.modal::backdrop {
  -webkit-backdrop-filter: blur(6px);
}

/* Tap handling and native form control normalization. */
a,
button,
.item-row,
.cal-day {
  touch-action: manipulation;
}

button {
  -webkit-appearance: none;
  appearance: none;
}

.input,
.auth-input,
.field-grid > *,
.field {
  min-width: 0;
}

/* iOS Safari zooms a focused field whose text is below 16px. */
@media (max-width: 920px) {
  .input,
  .select,
  .textarea,
  .auth-input,
  .search-box input {
    font-size: 16px;
  }

  .input,
  .select,
  .auth-input {
    height: 46px;
  }

  .auth-input {
    height: 48px;
  }

  .search-box input {
    height: 42px;
  }

  .textarea {
    line-height: 1.55;
  }

  input[type="date"],
  input[type="time"] {
    min-width: 0;
    width: 100%;
  }

  input[type="date"]::-webkit-date-and-time-value,
  input[type="time"]::-webkit-date-and-time-value {
    text-align: left;
  }

  .chip,
  .reminder-option {
    min-height: 34px;
  }

  .auth-reveal {
    width: 40px;
    height: 40px;
  }

  .modal-close {
    width: 40px;
    height: 40px;
  }

  .seg-btn {
    min-height: 36px;
  }

  .log-retry {
    width: 32px;
    height: 32px;
  }
}

/* iPhone / compact touch layout: comfortable targets in the top bar. */
@media (max-width: 720px) {
  .topbar-actions {
    gap: 8px;
  }

  .icon-btn,
  .topbar-actions .btn {
    width: 44px;
    height: 44px;
  }
}

/* WebKit/iOS also needs 16px controls in landscape and on iPad. */
@supports (-webkit-touch-callout: none) {
  .input,
  .select,
  .textarea,
  .auth-input,
  .search-box input {
    font-size: 16px;
  }

  .input,
  .select {
    height: 46px;
  }

  .auth-input {
    height: 48px;
  }

  .search-box input {
    height: 42px;
  }

  .input,
  .auth-input {
    min-width: 0;
  }
}

/* Keep content clear of the notch in landscape. */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 920px) {
    .shell {
      padding-left: max(14px, env(safe-area-inset-left));
      padding-right: max(14px, env(safe-area-inset-right));
    }

    .sidebar {
      left: calc(12px + env(safe-area-inset-left));
      right: calc(12px + env(safe-area-inset-right));
    }
  }

  @media (min-width: 921px) and (max-width: 1200px) {
    .shell {
      padding-left: max(20px, env(safe-area-inset-left));
      padding-right: max(20px, env(safe-area-inset-right));
    }
  }

  @media (min-width: 1201px) {
    .shell {
      padding-left: max(28px, env(safe-area-inset-left));
      padding-right: max(28px, env(safe-area-inset-right));
    }
  }

  @media (min-width: 921px) {
    .shell {
      padding-top: max(18px, env(safe-area-inset-top));
      padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    .form-actions {
      bottom: calc(14px + env(safe-area-inset-bottom));
    }
  }

  @media (min-width: 981px) {
    .auth-shell {
      padding-top: max(18px, env(safe-area-inset-top));
      padding-bottom: max(18px, env(safe-area-inset-bottom));
    }
  }

  @media (max-width: 980px) {
    .auth-shell {
      padding-left: max(10px, env(safe-area-inset-left));
      padding-right: max(10px, env(safe-area-inset-right));
    }
  }
}

/* Fallback for older iOS versions without dvh/svh support. */
@supports not (height: 100svh) {
  .auth-shell,
  .shell,
  .boot-screen {
    min-height: 100vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-visual::before,
  .auth-visual::after,
  .qr-orbit {
    animation: none;
  }
}

/* Responsive ------------------------------------------------- */
@media (max-width: 1240px) {
  .shell {
    padding: 16px 20px 54px;
    gap: 18px;
  }

  .sidebar {
    top: 10px;
    padding: 9px 11px;
  }

  .nav-link {
    padding-inline: 10px;
  }

  .hero-card {
    padding: 24px 25px 21px;
  }

  .items-list .item-row {
    grid-template-columns: 42px minmax(0, 1fr) 115px 116px;
  }
}

@media (max-width: 1080px) {
  .hero-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(235px, 0.8fr);
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 920px) {
  .shell {
    display: block;
    padding: 13px 14px calc(92px + env(safe-area-inset-bottom));
  }

  .sidebar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(11px + env(safe-area-inset-bottom));
    top: auto;
    z-index: 50;
    width: auto;
    height: 63px;
    min-height: 0;
    padding: 7px;
    flex-direction: row;
    align-items: center;
    gap: 0;
    overflow: visible;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(200, 212, 230, 0.9);
    border-radius: 17px;
    box-shadow: 0 18px 45px -20px rgba(18, 37, 74, 0.35);
    backdrop-filter: blur(18px) saturate(1.3);
  }

  .sidebar > .brand,
  .sidebar-kicker,
  .sidebar-channel,
  .sidebar-foot {
    display: none;
  }

  .sidebar-nav {
    flex: 1;
    margin: 0;
    flex-direction: row;
    justify-content: space-around;
    gap: 4px;
  }

  .nav-link {
    flex: 1;
    min-height: 48px;
    padding: 5px 4px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    border-radius: 11px;
    font-size: 9.5px;
    color: var(--muted);
  }

  .nav-link.active {
    color: var(--accent-ink);
    background: var(--accent-soft);
  }

  .nav-link.active .icon {
    color: var(--accent);
  }

  .nav-link .icon {
    width: 17px;
    height: 17px;
  }

  .nav-count {
    position: absolute;
    top: 4px;
    right: calc(50% - 19px);
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    font-size: 7px;
    background: #eef3fa;
  }

  .nav-link.active .nav-count {
    color: #fff;
    background: var(--accent);
  }

  .main {
    padding: 3px 0 0;
  }

  .mobile-brand {
    display: flex;
  }

  .mobile-brand .brand-sun {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .mobile-brand .brand-sun svg {
    width: 24px;
    height: 24px;
  }

  .crumb {
    display: none;
  }

  .topbar {
    margin-bottom: 19px;
  }

  .page-intro {
    align-items: flex-start;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stat-card {
    min-height: 124px;
  }

  .hero-title {
    max-width: 82%;
  }

  .rail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .form-actions {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 720px) {
  .shell {
    padding-inline: 11px;
  }

  .date-chip {
    display: none;
  }

  .page-intro h1 {
    font-size: 32px;
  }

  .page-intro .sub {
    font-size: 12px;
  }

  .hero-card {
    min-height: 318px;
    padding: 22px 20px 18px;
  }

  .hero-title {
    max-width: 92%;
    font-size: 23px;
  }

  .hero-countdown .num {
    font-size: 73px;
  }

  .hero-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1;
  }

  .hero-empty-sun {
    right: -10px;
    top: 18%;
    width: 105px;
    height: 105px;
    opacity: 0.7;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    min-height: 118px;
  }

  .stat-value {
    font-size: 34px;
  }

  .rail {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-panel {
    padding: 19px 15px 12px;
  }

  .item-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 62px;
    padding: 10px 3px;
  }

  .item-row .row-actions {
    display: none;
  }

  .cat-mark {
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }

  .item-title {
    font-size: 13.5px;
  }

  .item-due {
    min-width: 61px;
  }

  .item-due strong {
    font-size: 11.5px;
  }

  .item-due span {
    font-size: 9.5px;
  }

  .panel-head h2 {
    font-size: 18px;
  }

  .page-inline-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .page-inline-head h1 {
    font-size: 29px;
  }

  .items-panel {
    padding: 14px 13px 8px;
  }

  .items-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .segmented {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .segmented::-webkit-scrollbar {
    display: none;
  }

  .seg-btn {
    flex: none;
  }

  .search-box {
    width: 100%;
  }

  .items-list .item-row {
    grid-template-columns: 39px minmax(0, 1fr) auto;
    padding: 12px 3px;
  }

  .items-list .row-actions {
    display: none;
  }

  .items-list .item-note {
    max-width: 100%;
  }

  .items-list .item-due {
    min-width: 62px;
  }

  .items-list .item-due small {
    display: none;
  }

  .month-separator {
    padding-top: 13px;
  }

  .log-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .summary-card {
    padding: 11px 13px;
  }

  .summary-card strong {
    font-size: 20px;
  }

  .logs-panel {
    padding: 14px 13px 8px;
  }

  .logs-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .log-row {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
  }

  .log-status-icon {
    width: 31px;
    height: 31px;
  }

  .log-side {
    grid-column: 2;
    padding-top: 0;
  }

  .log-preview {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .settings-grid {
    gap: 12px;
  }

  .form-card {
    padding: 19px 16px;
  }

  .field-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }

  .field.wide {
    grid-column: auto;
  }

  .capture-box {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .capture-box .btn {
    width: 100%;
  }

  .form-actions {
    position: static;
    padding: 11px;
    flex-wrap: wrap;
  }

  .form-actions .action-left {
    width: 100%;
  }

  .form-actions .action-left .btn {
    flex: 1;
  }

  .form-actions .action-note {
    display: none;
  }

  .form-actions > .btn {
    width: 100%;
  }

  .category-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  dialog.modal {
    width: calc(100vw - 14px);
    max-height: calc(100vh - 14px);
  }

  .modal-card {
    max-height: calc(100vh - 14px);
    border-radius: 19px;
  }

  .modal-head {
    padding: 17px 17px 14px;
  }

  .modal-head h2 {
    font-size: 19px;
  }

  .modal-body {
    padding: 16px 17px;
  }

  .modal-foot {
    padding: 12px 17px;
    flex-wrap: wrap;
  }

  .modal-foot .foot-right {
    flex: 1;
    justify-content: flex-end;
  }

  .modal-foot .foot-right .btn {
    flex: 1;
  }

  .qr-connect {
    align-items: flex-start;
    padding: 17px;
  }

  .qr-connect-copy {
    max-width: calc(100% - 88px);
  }

  .qr-connect h3 {
    font-size: 18px;
  }

  .qr-art {
    width: 78px;
    height: 78px;
    border-radius: 14px;
  }

  .qr-art-icon .icon {
    width: 27px;
    height: 27px;
  }

  .qr-scan-screen {
    grid-template-columns: minmax(0, 1fr);
    gap: 17px;
    text-align: center;
  }

  .qr-image-wrap {
    width: 212px;
    max-width: 100%;
    margin: 0 auto;
  }

  .qr-side {
    text-align: center;
  }

  .qr-side .qr-status {
    text-align: left;
  }

  .qr-footnote {
    text-align: center;
  }

  .qr-body {
    padding: 16px 17px 18px;
  }

  .qr-stepper {
    margin-bottom: 16px;
    font-size: 8px;
  }

  .qr-activation-screen,
  .qr-success-screen {
    padding: 5px 2px;
  }

  .qr-activation-screen h3,
  .qr-success-screen h3,
  .qr-side h3 {
    font-size: 19px;
  }

  .modal-foot .field-hint {
    display: none;
  }

  .toast-host {
    left: 14px;
    right: 14px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 460px) {
  .page-intro h1 {
    font-size: 29px;
  }

  .hero-title {
    font-size: 21px;
  }

  .hero-countdown .num {
    font-size: 64px;
  }

  .hero-cat {
    height: 25px;
    padding-inline: 8px;
    font-size: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-label {
    font-size: 9.5px;
  }

  .stat-value {
    font-size: 30px;
  }

  .stat-icon {
    width: 24px;
    height: 24px;
  }

  .stat-icon .icon {
    width: 13px;
    height: 13px;
  }

  .calendar-card {
    padding: 16px 14px 12px;
  }

  .channel-card {
    padding: 16px;
  }

  .demo-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .demo-banner p {
    flex-basis: calc(100% - 80px);
  }

  .demo-banner button {
    margin-left: auto;
  }

  .item-title-line {
    flex-wrap: wrap;
    gap: 4px;
  }

  .item-tag {
    display: none;
  }

  .category-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reminder-option {
    padding-inline: 8px;
  }

  .editor-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .editor-actions > div {
    width: 100%;
  }

  .editor-actions .btn {
    flex: 1;
  }

  .qr-connect {
    padding: 15px;
  }

  .qr-connect-copy {
    max-width: 100%;
  }

  .qr-art {
    display: none;
  }

  .qr-connect h3 {
    font-size: 17px;
  }

  .qr-connect-actions {
    width: 100%;
  }

  .qr-connect-actions .btn {
    flex: 1;
  }

  .qr-image-wrap {
    width: 190px;
  }

  .qr-stepper {
    gap: 5px;
  }

  .qr-step-line {
    min-width: 8px;
  }

  .modal-foot {
    justify-content: space-between;
  }

  .modal-foot .foot-right {
    width: 100%;
    flex: auto;
  }
}
