@font-face {
  font-family: "B Yekan";
  src: url("../fonts/Yekan.woff2") format("woff2"),
       url("../fonts/Yekan.woff") format("woff"),
       url("../fonts/Yekan.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --font: "B Yekan", Tahoma, Arial, sans-serif;
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-soft: #edf4f1;
  --ink: #172521;
  --muted: #6d7d78;
  --line: #dce7e3;
  --primary: #176b5b;
  --primary-dark: #0d5145;
  --primary-soft: #dff1eb;
  --amber: #d98a19;
  --amber-soft: #fff1d7;
  --blue: #2f70b7;
  --blue-soft: #e3effb;
  --purple: #7654b3;
  --purple-soft: #eee8fa;
  --danger: #b84747;
  --danger-soft: #fae7e7;
  --shadow: 0 12px 36px rgba(30, 62, 53, 0.08);
  --shadow-soft: 0 5px 18px rgba(30, 62, 53, 0.06);
  --radius: 18px;
  --radius-small: 12px;
  --sidebar: 244px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font-family: var(--font); font-size: 16px; line-height: 1.65; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(1.55rem, 2.5vw, 2.2rem); line-height: 1.35; }
h2 { margin-bottom: 8px; font-size: 1.24rem; line-height: 1.4; }
.muted { color: var(--muted); }
.is-hidden { display: none !important; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 30; display: flex; flex-direction: column; padding: 24px 18px 18px; background: #123f37; color: #fff; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 26px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand img { border-radius: 14px; box-shadow: 0 7px 18px rgba(0,0,0,.18); }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 1.18rem; }
.brand span { color: rgba(255,255,255,.65); font-size: .78rem; }
.main-nav { display: grid; gap: 7px; padding: 24px 0; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border-radius: 12px; color: rgba(255,255,255,.75); transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); transform: translateX(-2px); }
.nav-link.is-active { color: #123f37; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.nav-icon { width: 24px; text-align: center; font-family: Arial, sans-serif; font-size: 1.25rem; font-weight: 700; }
.sidebar-footer { margin-top: auto; display: grid; gap: 14px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); }
.owner-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.owner-chip .avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; color: #123f37; background: #dff1eb; font-weight: 700; }
.owner-chip div { min-width: 0; }
.owner-chip strong, .owner-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-chip small { color: rgba(255,255,255,.6); }

.page-column { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 76px; padding: 0 clamp(18px, 4vw, 48px); border-bottom: 1px solid rgba(220,231,227,.82); background: rgba(243,246,244,.91); backdrop-filter: blur(14px); }
.topbar-title { display: grid; line-height: 1.25; }
.topbar-title strong { font-size: 1.12rem; }
.eyebrow { color: var(--primary); font-size: .72rem; letter-spacing: .04em; }
.eyebrow.light { color: #a9dfd3; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.menu-button { display: none !important; }
.page-content { width: min(1480px, 100%); margin: 0 auto; padding: 30px clamp(18px, 4vw, 48px) 52px; }

.button { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 18px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .58; cursor: not-allowed; transform: none; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 7px 17px rgba(23,107,91,.18); }
.button-primary:hover { color: #fff; background: var(--primary-dark); }
.button-soft { color: var(--primary-dark); background: var(--primary-soft); }
.button-soft:hover { background: #cde7df; }
.button-ghost { color: inherit; border-color: var(--line); background: transparent; }
.sidebar .button-ghost { color: #fff; border-color: rgba(255,255,255,.24); }
.button-block { width: 100%; }
.button-large { min-height: 50px; }
.button-small { min-height: 34px; padding: 5px 12px; font-size: .87rem; }
.icon-button { appearance: none; position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); cursor: pointer; }
.icon-button:hover { border-color: #b8cec7; background: var(--surface-soft); }
.text-button { padding: 0; border: 0; color: var(--primary); background: transparent; cursor: pointer; }
.danger-text { color: var(--danger) !important; }

.notification-badge { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid var(--bg); border-radius: 10px; color: #fff; background: var(--danger); font-family: Arial, sans-serif; font-size: 10px; line-height: 16px; }
.notification-panel { position: absolute; top: 66px; inset-inline-end: clamp(18px, 4vw, 48px); width: min(390px, calc(100vw - 36px)); max-height: min(620px, calc(100vh - 90px)); padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 24px 65px rgba(24,55,47,.2); overflow: auto; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 4px 3px 12px; }
.notification-list { display: grid; gap: 8px; margin-bottom: 12px; }
.notification-item { display: block; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafcfb; color: inherit; text-decoration: none; }
.notification-item.is-unread { border-color: #a9d3c7; background: var(--primary-soft); }
.notification-item strong, .notification-item span, .notification-item small { display: block; }
.notification-item span { margin-top: 3px; color: #43544f; font-size: .9rem; }
.notification-item small { margin-top: 5px; color: var(--muted); }
.empty-note { margin: 0; padding: 12px 5px; text-align: center; }

.workshop-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.status-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgba(20,65,54,.06); }
.status-summary span { color: var(--muted); }
.status-summary strong { color: var(--primary); font-family: Arial, sans-serif; font-size: 1.65rem; }
.workshop-list { display: grid; gap: 14px; }
.workshop-card { padding: 21px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 9px 30px rgba(20,65,54,.06); }
.workshop-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.workshop-card h2 { margin: 10px 0 0; font-size: 1.08rem; line-height: 1.75; }
.workshop-card p { margin: 13px 0 0; color: #43544f; line-height: 1.9; }
.workshop-meta { display: flex; flex-wrap: wrap; gap: 9px 22px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #edf2f0; color: var(--muted); font-size: .82rem; }

.hero-card { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 190px; margin-bottom: 24px; padding: clamp(25px, 4vw, 42px); border-radius: 24px; color: #fff; background: linear-gradient(135deg, #0e594b, #1d806d); box-shadow: var(--shadow); }
.hero-card::after { content: ""; position: absolute; width: 290px; height: 290px; inset-inline-end: -90px; top: -160px; border: 48px solid rgba(255,255,255,.07); border-radius: 50%; }
.hero-card > * { position: relative; z-index: 1; }
.hero-card .eyebrow { color: #a9dfd3; }
.hero-card h1 { max-width: 730px; margin: 6px 0; }
.hero-card p { margin-bottom: 0; color: rgba(255,255,255,.72); }
.hero-card .button-primary { flex: 0 0 auto; color: var(--primary-dark); background: #fff; box-shadow: 0 10px 28px rgba(0,0,0,.16); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { position: relative; overflow: hidden; min-height: 136px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.stat-card::after { content: ""; position: absolute; width: 72px; height: 72px; inset-inline-end: -18px; bottom: -18px; border-radius: 50%; background: currentColor; opacity: .08; }
.stat-card span, .stat-card strong, .stat-card small { display: block; }
.stat-card span { color: var(--muted); }
.stat-card strong { margin: 4px 0 -2px; font-family: Arial, sans-serif; font-size: 2.15rem; }
.stat-card small { color: var(--muted); }
.accent-green { color: var(--primary); border-top: 3px solid var(--primary); }
.accent-amber { color: var(--amber); border-top: 3px solid var(--amber); }
.accent-blue { color: var(--blue); border-top: 3px solid var(--blue); }
.accent-purple { color: var(--purple); border-top: 3px solid var(--purple); }

.content-grid { display: grid; gap: 20px; margin-bottom: 20px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
.settings-grid .info-card { grid-column: 1 / -1; }
.card { padding: clamp(18px, 2.6vw, 26px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.card-heading h1, .card-heading h2 { margin-bottom: 0; }
.item-list, .data-list { display: grid; }
.compact-item { display: flex; align-items: center; gap: 11px; min-height: 67px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.compact-item:last-child { border-bottom: 0; }
.compact-item > div { min-width: 0; flex: 1; }
.compact-item strong, .compact-item small { display: block; }
.compact-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-item small { margin-top: 2px; color: var(--muted); }
.priority-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #8da09a; }
.priority-high { background: var(--danger); }
.priority-normal { background: var(--amber); }
.priority-low { background: var(--primary); }
.status-pill { display: inline-flex; align-items: center; min-height: 27px; padding: 2px 9px; border-radius: 10px; color: #52635e; background: #edf1ef; font-size: .78rem; white-space: nowrap; }
.status-doing, .status-scheduled { color: #8a5b0b; background: var(--amber-soft); }
.status-done { color: var(--primary-dark); background: var(--primary-soft); }
.status-canceled { color: var(--danger); background: var(--danger-soft); }
.priority-bg-high { color: var(--danger); background: var(--danger-soft); }
.priority-bg-normal { color: #95620d; background: var(--amber-soft); }
.priority-bg-low { color: var(--primary-dark); background: var(--primary-soft); }
.date-tile { display: grid; place-items: center; min-width: 49px; min-height: 49px; padding: 4px; border-radius: 11px; color: var(--primary-dark); background: var(--primary-soft); line-height: 1.15; }
.date-tile b { font-family: Arial, sans-serif; }
.date-tile small { color: var(--primary); font-size: .7rem; }
.empty-state { display: grid; justify-items: center; gap: 7px; padding: 42px 20px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 1.05rem; }
.empty-state.small { padding: 28px 15px; }
.conversation-strip { display: grid; grid-template-columns: repeat(5, minmax(155px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.conversation-card { display: grid; gap: 5px; min-height: 116px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fafcfb; }
.conversation-card:hover { border-color: #b7d1c9; background: var(--primary-soft); }
.conversation-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-card small { color: var(--muted); }
.conversation-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 3px 0; }
.page-heading p { margin-bottom: 0; color: var(--muted); }
.create-card { margin-bottom: 20px; border-color: #b9d8cf; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: grid; gap: 6px; color: #3c4c47; }
.field > span { font-size: .88rem; }
.field-wide { grid-column: 1 / -1; }
.field input, .field textarea, .field select, .stack-form input:not([type="checkbox"]), .stack-form textarea, .stack-form select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #cddbd6; border-radius: 10px; outline: none; color: var(--ink); background: #fbfcfc; transition: border-color .16s ease, box-shadow .16s ease; }
.field textarea, .stack-form textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .stack-form input:focus, .stack-form textarea:focus, .stack-form select:focus { border-color: #62aa99; box-shadow: 0 0 0 3px rgba(23,107,91,.1); background: #fff; }
.checkbox-field { display: flex; align-items: center; gap: 9px; }
.checkbox-field input { width: 18px; height: 18px; accent-color: var(--primary); }
.field-error { color: var(--danger); }
.form-actions { display: flex; gap: 9px; margin-top: 3px; }
.stack-form { display: grid; gap: 16px; }
.form-errors { padding: 10px 12px; border-radius: 9px; color: #842f2f; background: var(--danger-soft); }
.form-errors ul { margin: 0; padding-inline-start: 20px; }

.data-row { display: flex; align-items: center; gap: 13px; min-height: 86px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.data-row:last-child { border-bottom: 0; }
.row-main { min-width: 0; flex: 1; }
.row-main strong { display: block; font-size: 1.02rem; }
.row-main p { margin: 2px 0 5px; color: var(--muted); }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: .82rem; }
.task-check { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 2px solid #a8bcb6; border-radius: 50%; color: transparent; background: #fff; cursor: pointer; }
.task-check:hover, .task-check.is-done { border-color: var(--primary); color: #fff; background: var(--primary); }
.inline-select { max-width: 135px; min-height: 37px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; }
.history-card { margin-top: 20px; }
.history-card summary { cursor: pointer; color: var(--primary); font-size: 1rem; }
.history-card[open] summary { margin-bottom: 14px; }
.muted-list { opacity: .82; }

.reminder-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.reminder-card { display: grid; gap: 15px; min-height: 225px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.reminder-time { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--primary); }
.reminder-time span { color: var(--muted); font-size: .78rem; }
.reminder-body { flex: 1; }
.reminder-body h2 { margin: 8px 0 3px; }
.reminder-body p { color: var(--muted); }
.reminder-card .button { justify-self: start; align-self: end; }

.detail-list { display: grid; gap: 0; margin: 0 0 18px; }
.detail-list > div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; text-align: left; }
.check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; margin: 0; padding: 0; list-style: none; }
.check-list li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-inline-end: 8px; border-radius: 50%; color: var(--primary); background: var(--primary-soft); }
.narrow-card { max-width: 650px; margin: 0 auto; }

.chat-layout { height: calc(100vh - 136px); min-height: 590px; display: grid; grid-template-columns: 235px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.conversation-sidebar { padding: 15px; border-inline-end: 1px solid var(--line); background: #f7faf8; overflow-y: auto; }
.conversation-list { display: grid; gap: 5px; margin-top: 14px; }
.conversation-link { display: grid; padding: 10px 11px; border-radius: 10px; color: var(--ink); }
.conversation-link:hover, .conversation-link.is-active { color: var(--primary-dark); background: var(--primary-soft); }
.conversation-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-link small { color: var(--muted); font-size: .72rem; direction: ltr; text-align: right; }
.chat-panel { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; background: #f9fbfa; }
.chat-header { display: flex; align-items: center; justify-content: space-between; min-height: 70px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: #fff; }
.chat-header > div { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; }
.chat-header strong { line-height: 1.25; }
.chat-header small { grid-column: 2; color: var(--muted); }
.assistant-presence { grid-row: 1 / span 2; width: 10px; height: 10px; border: 2px solid #bce8dc; border-radius: 50%; background: #39aa8f; box-shadow: 0 0 0 4px #e3f5f0; }
.privacy-chip { padding: 3px 9px; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: .78rem; }
.message-list { min-height: 0; display: flex; flex-direction: column; gap: 11px; padding: 22px clamp(14px, 3vw, 34px); overflow-y: auto; scroll-behavior: smooth; }
.message-bubble { max-width: min(78%, 760px); padding: 11px 15px; border-radius: 16px; box-shadow: 0 3px 10px rgba(30,62,53,.05); white-space: pre-wrap; overflow-wrap: anywhere; }
.message-bubble.user { align-self: flex-start; border-bottom-left-radius: 5px; color: #fff; background: var(--primary); }
.message-bubble.assistant { align-self: flex-end; border: 1px solid var(--line); border-bottom-right-radius: 5px; background: #fff; }
.message-bubble.failed { outline: 2px solid #e9b1b1; }
.message-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; color: inherit; opacity: .68; font-size: .72rem; }
.message-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.action-chip { padding: 3px 8px; border-radius: 8px; color: var(--primary-dark); background: var(--primary-soft); font-size: .75rem; }
.retry-button { padding: 2px 8px; border: 1px solid currentColor; border-radius: 7px; color: inherit; background: transparent; cursor: pointer; }
.typing-indicator { display: flex; align-items: center; gap: 5px; padding: 5px clamp(14px, 3vw, 34px); color: var(--muted); }
.typing-indicator span { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: bounce 1.1s infinite ease-in-out; }
.typing-indicator span:nth-child(2) { animation-delay: .12s; }
.typing-indicator span:nth-child(3) { animation-delay: .24s; }
.typing-indicator small { margin-inline-start: 5px; }
@keyframes bounce { 0%, 70%, 100% { transform: translateY(0); opacity: .45; } 35% { transform: translateY(-4px); opacity: 1; } }
.composer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 9px; margin: 8px clamp(12px, 3vw, 28px) 0; padding: 8px; border: 1px solid #c8d9d3; border-radius: 16px; background: #fff; box-shadow: 0 8px 25px rgba(30,62,53,.08); }
.composer:focus-within { border-color: #6caf9f; box-shadow: 0 0 0 3px rgba(23,107,91,.09); }
.composer textarea { min-height: 42px; max-height: 150px; padding: 8px 4px; border: 0; outline: 0; resize: none; color: var(--ink); background: transparent; }
.record-button { display: grid; place-items: center; width: 48px; height: 48px; padding: 4px; border: 0; border-radius: 12px; color: var(--danger); background: var(--danger-soft); cursor: pointer; }
.record-button small { font-size: .65rem; }
.record-button.is-recording { color: #fff; background: var(--danger); animation: recording-pulse 1.4s infinite; }
@keyframes recording-pulse { 50% { box-shadow: 0 0 0 6px rgba(184,71,71,.13); } }
.send-button { min-width: 66px; height: 48px; border: 0; border-radius: 12px; color: #fff; background: var(--primary); cursor: pointer; }
.send-button:disabled { opacity: .55; }
.composer-note { margin: 5px 32px 12px; color: var(--muted); font-size: .7rem; text-align: center; }
.chat-empty { margin: auto; max-width: 560px; }
.chat-empty p { max-width: 490px; }

.flash-stack { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { padding: 10px 13px; border: 1px solid #b8d7cd; border-radius: 10px; color: var(--primary-dark); background: var(--primary-soft); }
.flash-error { border-color: #edc1c1; color: #8a3232; background: var(--danger-soft); }
.toast-region { position: fixed; z-index: 100; inset-inline-end: 22px; bottom: 22px; display: grid; gap: 8px; width: min(360px, calc(100vw - 44px)); }
.toast { padding: 12px 15px; border: 1px solid #b8d7cd; border-radius: 12px; color: #fff; background: #173f37; box-shadow: 0 14px 35px rgba(0,0,0,.2); animation: toast-in .22s ease-out; }
.toast.error { background: #7e3434; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.offline-banner { position: fixed; z-index: 110; inset-inline: 0; bottom: 0; padding: 8px 16px; color: #563a09; background: #ffdc98; text-align: center; }
.mobile-nav { display: none; }
.sidebar-backdrop { position: fixed; z-index: 25; inset: 0; background: rgba(8,29,24,.48); backdrop-filter: blur(2px); }

.standalone-state { min-height: 55vh; display: grid; align-content: center; justify-items: center; gap: 10px; max-width: 680px; margin: 0 auto; padding: 40px; text-align: center; }
.standalone-state.full-page { min-height: 100vh; }
.standalone-state p { color: var(--muted); }
.error-code { font-family: Arial, sans-serif; font-size: 4rem; font-weight: 800; color: var(--primary); }

.auth-body { display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 12% 10%, #d8ede7, transparent 32%), #edf3f0; }
.auth-shell { width: min(1000px, 100%); min-height: 610px; display: grid; grid-template-columns: 1.05fr .95fr; border: 1px solid rgba(255,255,255,.8); border-radius: 28px; background: #fff; box-shadow: 0 30px 80px rgba(24,68,57,.16); overflow: hidden; }
.auth-visual { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(35px, 6vw, 70px); color: #fff; background: linear-gradient(145deg, #0e5145, #21816e); }
.auth-visual::before, .auth-visual::after { content: ""; position: absolute; border: 50px solid rgba(255,255,255,.06); border-radius: 50%; }
.auth-visual::before { width: 300px; height: 300px; top: -180px; inset-inline-end: -120px; }
.auth-visual::after { width: 210px; height: 210px; bottom: -150px; inset-inline-start: -110px; }
.auth-visual > * { position: relative; z-index: 1; }
.auth-visual img { margin-bottom: 25px; border-radius: 22px; box-shadow: 0 14px 30px rgba(0,0,0,.2); }
.auth-visual h1 { margin-top: 7px; }
.auth-visual p { color: rgba(255,255,255,.72); }
.auth-visual ul { display: grid; gap: 7px; margin: 18px 0 0; padding: 0; list-style: none; }
.auth-visual li::before { content: "✓"; margin-inline-end: 8px; color: #a9dfd3; }
.auth-card { display: grid; align-content: center; padding: clamp(32px, 6vw, 68px); }
.auth-heading { margin-bottom: 24px; }
.auth-heading h2 { margin: 4px 0; font-size: 1.65rem; }
.auth-heading p, .auth-footnote { color: var(--muted); }
.auth-footnote { margin: 18px 0 0; font-size: .8rem; text-align: center; }

@media (max-width: 1120px) {
  :root { --sidebar: 210px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conversation-strip { grid-template-columns: repeat(5, 180px); }
  .reminder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  body { padding-bottom: 70px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(285px, 85vw); height: 100vh; transform: translateX(110%); transition: transform .22s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .menu-button { display: inline-grid !important; }
  .topbar { height: 68px; padding-inline: 15px; }
  .topbar-title .eyebrow { display: none; }
  .page-content { padding: 19px 14px 30px; }
  .mobile-nav { position: fixed; z-index: 24; inset-inline: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); height: 61px; padding: 5px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.95); box-shadow: 0 12px 40px rgba(20,55,46,.18); backdrop-filter: blur(12px); }
  .mobile-nav a { display: grid; place-items: center; align-content: center; gap: 1px; border-radius: 12px; color: var(--muted); }
  .mobile-nav a.is-active { color: var(--primary); background: var(--primary-soft); }
  .mobile-nav span { font-family: Arial, sans-serif; font-size: 1.18rem; line-height: 1; }
  .mobile-nav small { font-size: .68rem; }
  .hero-card { align-items: flex-start; flex-direction: column; min-height: 0; }
  .two-columns, .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .info-card { grid-column: auto; }
  .chat-layout { height: calc(100vh - 158px); min-height: 510px; grid-template-columns: 1fr; }
  .conversation-sidebar { display: none; }
  .message-bubble { max-width: 88%; }
  .install-button { display: none !important; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-card { min-height: 570px; }
}

@media (max-width: 580px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 118px; padding: 15px; }
  .stat-card strong { font-size: 1.75rem; }
  .stat-card small { font-size: .74rem; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading .button { align-self: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .data-row { align-items: flex-start; flex-wrap: wrap; }
  .data-row .row-main { flex-basis: calc(100% - 52px); }
  .inline-select { margin-inline-start: 47px; }
  .reminder-grid { grid-template-columns: 1fr; }
  .workshop-status-grid { grid-template-columns: 1fr; }
  .workshop-card-head { align-items: stretch; flex-direction: column; }
  .workshop-card-head .button { align-self: flex-start; }
  .check-list { grid-template-columns: 1fr; }
  .hero-card { padding: 24px 20px; border-radius: 19px; }
  .hero-card .button { width: 100%; }
  .card { padding: 17px; }
  .composer { grid-template-columns: auto minmax(0, 1fr) auto; margin-inline: 8px; }
  .record-button { width: 44px; height: 44px; }
  .send-button { min-width: 55px; height: 44px; }
  .message-list { padding-inline: 12px; }
  .auth-body { padding: 0; }
  .auth-shell { min-height: 100vh; border: 0; border-radius: 0; }
  .auth-card { padding: 30px 22px; }
}

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