:root {
  --bg: #F3F1EC;
  --surface: #FFFFFF;
  --surface-2: #F8F6F1;
  --surface-3: #EFECE5;
  --ink: #15171C;
  --ink-2: #4A4F5A;
  --ink-3: #8A8F99;
  --line: #E4E0D7;
  --accent: #FF5B22;
  --accent-hover: #EE4C14;
  --accent-ink: #FFFFFF;
  --accent-soft: #FFE8DE;
  --green: #12804A;
  --green-soft: #DDF3E6;
  --amber: #A86400;
  --amber-soft: #FFF0D1;
  --blue: #2453D6;
  --blue-soft: #E3EAFD;
  --red: #C62E2E;
  --red-soft: #FBE3E3;
  --dark-card: #15171C;
  --dark-card-ink: #F3F1EC;
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 10px 30px rgba(20, 20, 30, .06);
  --shadow-lg: 0 24px 60px rgba(20, 20, 30, .18);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101114;
    --surface: #191B20;
    --surface-2: #1F2228;
    --surface-3: #262A31;
    --ink: #F2F0EB;
    --ink-2: #BBBEC6;
    --ink-3: #7F848E;
    --line: #2B2F36;
    --accent: #FF6A33;
    --accent-hover: #FF7F4F;
    --accent-soft: #3A2117;
    --green: #45C786;
    --green-soft: #15352A;
    --amber: #F2AA3D;
    --amber-soft: #3A2B12;
    --blue: #86A3FF;
    --blue-soft: #1C2747;
    --red: #FF7474;
    --red-soft: #3D1C1C;
    --dark-card: #F2F0EB;
    --dark-card-ink: #15171C;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #101114;
  --surface: #191B20;
  --surface-2: #1F2228;
  --surface-3: #262A31;
  --ink: #F2F0EB;
  --ink-2: #BBBEC6;
  --ink-3: #7F848E;
  --line: #2B2F36;
  --accent: #FF6A33;
  --accent-hover: #FF7F4F;
  --accent-soft: #3A2117;
  --green: #45C786;
  --green-soft: #15352A;
  --amber: #F2AA3D;
  --amber-soft: #3A2B12;
  --blue: #86A3FF;
  --blue-soft: #1C2747;
  --red: #FF7474;
  --red-soft: #3D1C1C;
  --dark-card: #F2F0EB;
  --dark-card-ink: #15171C;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ic { flex: none; display: block; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 24px;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  font: 700 19px/1 var(--display);
}
.brand-name { font: 600 19px/1.05 var(--display); display: flex; flex-direction: column; gap: 4px; }
.brand-name small { font: 500 12px/1 var(--font); color: var(--ink-3); letter-spacing: 0; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--ink-2); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav a.active .ic { color: var(--accent); }
.nav .count {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px; display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  background: var(--accent); color: #fff;
}
.nav .count.soft { background: var(--surface-3); color: var(--ink-2); }

.side-card {
  margin-top: auto; padding: 16px; border-radius: var(--radius);
  background: var(--dark-card); color: var(--dark-card-ink);
}
.side-card-title { font: 600 14px/1.2 var(--display); margin-bottom: 6px; }
.side-card p { font-size: 13px; opacity: .72; margin-bottom: 12px; }

.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-title { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.top-title h1 { font: 600 21px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title .muted { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search {
  display: flex; align-items: center; gap: 8px;
  width: min(340px, 30vw); height: 42px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink-3);
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); }

.online {
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px 0 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
  font-weight: 500; font-size: 14px; white-space: nowrap;
}
.online-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); box-shadow: 0 0 0 4px var(--surface-3); }
.online[aria-pressed="true"] { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.online[aria-pressed="true"] .online-dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px var(--green-soft); } }

.icon-btn {
  position: relative; width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); }
.badge-dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }

.bell-wrap { position: relative; }
.pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  width: 360px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.pop-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.pop-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.pop-item:last-child { border-bottom: 0; }
.pop-item.unread { background: var(--surface-2); }
.pop-item .muted { font-size: 12px; }

.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #FFB088, #FF5B22);
  color: #fff; font-weight: 700; font-size: 15px;
}
.avatar-sm { width: 42px; height: 42px; font-size: 14px; }
.avatar-xs { width: 34px; height: 34px; font-size: 12px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; font-family: var(--display); border: 4px solid var(--surface); }
.av-blue { background: linear-gradient(135deg, #9DB4FF, #3B5BDB); }
.av-green { background: linear-gradient(135deg, #8BE0B3, #16884F); }
.av-violet { background: linear-gradient(135deg, #C9B2FF, #6D42D9); }
.av-amber { background: linear-gradient(135deg, #FFD88A, #D68A00); }
.av-ink { background: linear-gradient(135deg, #5A5F6B, #15171C); }

#view { padding: 26px 28px 56px; width: 100%; max-width: 1320px; outline: 0; }
.view-enter { animation: enter .28s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

.tabbar { display: none; }

/* ---------- primitives ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2, .h2 { font: 600 16px/1.3 var(--display); }
.card-head a, .link { color: var(--accent); font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; }

.grid { display: grid; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid transparent; font-weight: 600; font-size: 14px;
  white-space: nowrap; transition: background .15s, transform .1s, border-color .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-soft { background: var(--surface-3); color: var(--ink); }
.btn-soft:hover { background: var(--line); }
.btn-ghost-light { background: color-mix(in srgb, var(--dark-card-ink) 14%, transparent); color: var(--dark-card-ink); }
.btn-ghost-light:hover { background: color-mix(in srgb, var(--dark-card-ink) 22%, transparent); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .n { font-size: 12px; opacity: .6; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 9px; border-radius: 7px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--ink-2);
}
.tag-accent { background: var(--accent-soft); color: var(--accent); }
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-amber { background: var(--amber-soft); color: var(--amber); }
.tag-blue { background: var(--blue-soft); color: var(--blue); }
.tag-red { background: var(--red-soft); color: var(--red); }

.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-3); border-radius: 12px; }
.seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: none; font-weight: 500; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 11px 14px; outline: 0;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); }
.textarea { resize: vertical; min-height: 96px; }
.input-wrap { position: relative; }
.input-wrap .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 600; }

.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 14px; background: var(--line); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }

.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }

.empty { padding: 36px 16px; text-align: center; color: var(--ink-3); }
.empty .ic { margin: 0 auto 10px; opacity: .5; }

/* ---------- home ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.hello h2 { font: 600 clamp(24px, 3vw, 32px)/1.15 var(--display); letter-spacing: -.02em; }
.hello p { color: var(--ink-2); margin-top: 6px; }

.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 10px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-3); font-size: 13px; font-weight: 500; }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.kpi-value { font: 600 26px/1.1 var(--display); letter-spacing: -.02em; }
.kpi-foot { font-size: 13px; color: var(--ink-3); }
.kpi-foot b { color: var(--green); font-weight: 600; }
.kpi.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.kpi.accent .kpi-top, .kpi.accent .kpi-foot { color: rgba(255,255,255,.8); }
.kpi.accent .kpi-foot b { color: #fff; }
.kpi.accent .kpi-icon { background: rgba(255,255,255,.18); color: #fff; }

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

.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 56px 18px minmax(0, 1fr); gap: 12px; }
.tl-time { font-weight: 600; font-size: 14px; padding-top: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-item:first-child .tl-rail::before { top: 18px; }
.tl-item:last-child .tl-rail::before { bottom: calc(100% - 18px); }
.tl-dot { position: relative; margin-top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ink-3); }
.tl-item.now .tl-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-item.done .tl-dot { background: var(--green); border-color: var(--green); }
.tl-body { padding: 8px 0 14px; min-width: 0; }
.tl-card { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.tl-item.now .tl-card { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.tl-card h4 { font-size: 15px; font-weight: 600; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.tl-meta span { display: inline-flex; align-items: center; gap: 5px; }

.chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; height: 170px; padding-top: 20px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar {
  position: relative; width: 100%; max-width: 44px; border-radius: 8px 8px 4px 4px;
  background: var(--surface-3); min-height: 4px; transition: background .15s;
}
.bar.today { background: var(--accent); }
.bar:hover { background: var(--ink); }
.bar.today:hover { background: var(--accent-hover); }
.bar-tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  padding: 3px 7px; border-radius: 6px; background: var(--ink); color: var(--bg);
  font-size: 11px; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s;
}
.bar:hover .bar-tip, .bar.today .bar-tip { opacity: 1; }
.bar.today .bar-tip { background: var(--accent); color: #fff; }
.bar-label { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.bar-label.today { color: var(--ink); font-weight: 700; }

.mini-order { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.mini-order:first-of-type { border-top: 0; padding-top: 0; }
.mini-order:hover h4 { color: var(--accent); }
.mini-order h4 { font-size: 14px; font-weight: 600; line-height: 1.35; transition: color .15s; }
.mini-order .price { margin-left: auto; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mini-order .tl-meta { margin-top: 2px; }

.checklist { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check-box { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; border: 2px solid var(--line); color: transparent; }
.check-row.ok .check-box { background: var(--green); border-color: var(--green); color: #fff; }
.check-row.ok span { color: var(--ink-3); text-decoration: line-through; }
.check-row button { margin-left: auto; }

.tip-card { background: var(--dark-card); color: var(--dark-card-ink); border: 0; }
.tip-card p { opacity: .75; font-size: 14px; margin: 6px 0 14px; }
.tip-card .h2 { color: var(--dark-card-ink); }

/* ---------- feed ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; min-width: 0; }
.chips::-webkit-scrollbar { display: none; }
.toolbar .select { width: auto; height: 36px; padding: 0 34px 0 12px; border-radius: 10px; font-size: 14px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: right 16px top 15px, right 11px top 15px; background-size: 5px 5px; background-repeat: no-repeat; }

.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.feed-list { display: flex; flex-direction: column; gap: 12px; }
.order {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px;
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.order:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); box-shadow: var(--shadow); }
.order.responded { background: var(--surface-2); }
.order-tags { display: flex; gap: 6px; flex-wrap: wrap; grid-column: 1 / -1; }
.order h3 { font-size: 17px; font-weight: 600; line-height: 1.3; }
.order-price { text-align: right; }
.order-price b { font: 600 19px/1.2 var(--display); white-space: nowrap; letter-spacing: -.01em; }
.order-price small { display: block; color: var(--ink-3); font-size: 12px; }
.order-desc { grid-column: 1 / -1; color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.order-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 10px; margin-top: 2px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--ink-3); }
.order-foot span { display: inline-flex; align-items: center; gap: 5px; }
.order-foot .btn { margin-left: auto; }

.side-stats .stat-line { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.side-stats .stat-line:first-of-type { border-top: 0; }
.side-stats .stat-line b { font-variant-numeric: tabular-nums; }

/* ---------- drawer / modal ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(12, 13, 16, .45); backdrop-filter: blur(2px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; z-index: 70; top: 0; right: 0; bottom: 0;
  width: min(520px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); box-shadow: var(--shadow-lg);
  animation: slideIn .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font: 600 19px/1.3 var(--display); flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 20px; overscroll-behavior: contain; }
.drawer-foot { padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; }
.drawer-foot .btn-primary { flex: 1; }
.close-btn { width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.close-btn:hover { color: var(--ink); }

.price-hero { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.price-hero b { font: 600 30px/1 var(--display); letter-spacing: -.02em; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.info { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.info small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 500; margin-bottom: 2px; }
.info b { font-weight: 600; font-size: 14px; }

.map {
  position: relative; height: 150px; border-radius: var(--radius-sm); overflow: hidden;
  background:
    linear-gradient(115deg, transparent 46%, color-mix(in srgb, var(--blue) 30%, transparent) 46%, color-mix(in srgb, var(--blue) 30%, transparent) 54%, transparent 54%),
    linear-gradient(0deg, transparent 48%, var(--surface) 48%, var(--surface) 52%, transparent 52%),
    linear-gradient(90deg, transparent 30%, var(--surface) 30%, var(--surface) 33%, transparent 33%, transparent 70%, var(--surface) 70%, var(--surface) 72%, transparent 72%),
    repeating-linear-gradient(0deg, var(--surface-3) 0 22px, var(--surface-2) 22px 24px),
    var(--surface-3);
  border: 1px solid var(--line);
}
.map-pin { position: absolute; left: 56%; top: 38%; transform: translate(-50%, -100%); color: var(--accent); filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); }
.map-pin::after { content: ""; position: absolute; left: 50%; top: 100%; width: 60px; height: 60px; transform: translate(-50%, -50%); border-radius: 50%; background: color-mix(in srgb, var(--accent) 18%, transparent); z-index: -1; }
.map-label { position: absolute; left: 12px; bottom: 10px; padding: 4px 10px; border-radius: 8px; background: var(--surface); font-size: 12px; font-weight: 600; box-shadow: var(--shadow); }

.client { display: flex; align-items: center; gap: 12px; }
.client b { display: block; }
.stars { display: inline-flex; align-items: center; gap: 4px; color: var(--amber); font-weight: 600; font-size: 13px; }

.responded-box { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green); font-weight: 500; font-size: 14px; }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal-card {
  width: min(440px, 100%); background: var(--surface); border-radius: 22px;
  box-shadow: var(--shadow-lg); padding: 22px; animation: pop .22s cubic-bezier(.2, .8, .2, 1);
  max-height: calc(100vh - 32px); overflow-y: auto;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal-card .card-head { margin-bottom: 18px; }

.toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 500; font-size: 14px; box-shadow: var(--shadow-lg); animation: toastIn .25s ease-out; }
.toast .ic { color: var(--accent); }
.toast.out { animation: toastOut .25s ease-in forwards; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(12px); opacity: 0; } }

/* ---------- my orders ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { background: var(--surface-3); border-radius: var(--radius); padding: 12px; min-width: 0; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; font-weight: 600; }
.col-head .n { margin-left: auto; color: var(--ink-3); font-weight: 600; font-size: 13px; }
.col-dot { width: 10px; height: 10px; border-radius: 50%; }
.col-list { display: flex; flex-direction: column; gap: 10px; }
.job { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.job h4 { font-size: 15px; font-weight: 600; line-height: 1.35; }
.job-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.job-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.job .tl-meta { margin-top: 0; }
.job-note { font-size: 13px; color: var(--ink-2); padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.job-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.job-actions .btn { flex: 1; }
.job.flash { animation: flash 1s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.board-tabs { display: none; margin-bottom: 14px; }

/* ---------- schedule ---------- */
.week { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.week-head { padding: 12px 8px; text-align: center; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.week-head small { display: block; color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.week-head b { font: 600 20px/1.2 var(--display); }
.week-head.today b { color: var(--accent); }
.week-head.off { background: var(--surface-2); }
.week-corner { border-bottom: 1px solid var(--line); }
.hours { position: relative; }
.hour { height: 48px; font-size: 11px; color: var(--ink-3); text-align: right; padding: 0 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.day-col { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(180deg, transparent 0 47px, var(--line) 47px 48px); }
.day-col.off { background-color: var(--surface-2); }
.day-col.off::after { content: "Выходной"; position: absolute; top: 12px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.ev {
  position: absolute; left: 4px; right: 4px; padding: 6px 8px; border-radius: 10px;
  font-size: 12px; line-height: 1.3; overflow: hidden; cursor: pointer;
  background: var(--accent-soft); color: var(--ink); border-left: 3px solid var(--accent);
}
.ev b { display: block; font-weight: 600; }
.ev span { color: var(--ink-2); }
.ev.short span { display: none; }
.ev.short { padding: 4px 8px; }
.ev.blue { background: var(--blue-soft); border-color: var(--blue); }
.ev.green { background: var(--green-soft); border-color: var(--green); }
.ev.ghost { background: transparent; border: 1.5px dashed var(--ink-3); border-left-width: 3px; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); z-index: 2; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.agenda { display: none; }
.sched-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.hours-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.hours-row:first-of-type { border-top: 0; }
.hours-row .muted { font-size: 13px; }

/* ---------- chat ---------- */
.chat { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 71px - 52px); min-height: 480px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dialogs { border-right: 1px solid var(--line); overflow-y: auto; }
.dialogs-head { padding: 16px; border-bottom: 1px solid var(--line); }
.dialog { display: flex; gap: 12px; padding: 14px 16px; cursor: pointer; border-bottom: 1px solid var(--line); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; }
.dialog:hover { background: var(--surface-2); }
.dialog.active { background: var(--surface-3); }
.dialog-main { flex: 1; min-width: 0; }
.dialog-top { display: flex; justify-content: space-between; gap: 8px; }
.dialog-top b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialog-top small { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.dialog-sub { font-size: 12px; color: var(--accent); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialog-last { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-3); }
.dialog-last span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.av-wrap { position: relative; flex: none; }
.av-wrap.on::after { content: ""; position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--green); border: 2px solid var(--surface); }

.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.thread-head .muted { font-size: 13px; }
.thread-back { display: none; }
.thread-order { margin: 12px 16px 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.thread-order b { font-weight: 600; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.day-sep { align-self: center; font-size: 12px; color: var(--ink-3); padding: 4px 10px; margin: 8px 0; border-radius: 8px; background: var(--surface-2); }
.msg { max-width: min(78%, 520px); padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; background: var(--surface-3); align-self: flex-start; border-bottom-left-radius: 5px; overflow-wrap: anywhere; }
.msg time { display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; text-align: right; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
.msg.me time { color: rgba(255,255,255,.75); }
.msg.sys { align-self: center; background: var(--green-soft); color: var(--green); font-size: 13px; text-align: center; border-radius: 12px; }
.typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.quick { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .chip { height: 32px; font-size: 13px; }
.composer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.composer .input { flex: 1; }
.composer .btn { width: 46px; padding: 0; }

/* ---------- wallet ---------- */
.wallet-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
.balance { background: var(--dark-card); color: var(--dark-card-ink); border: 0; padding: 24px; position: relative; overflow: hidden; }
.balance::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 70%, transparent), transparent 70%); opacity: .55; }
.balance small { opacity: .65; font-size: 13px; font-weight: 500; }
.balance .big { font: 600 clamp(32px, 5vw, 44px)/1.1 var(--display); letter-spacing: -.03em; margin: 6px 0 18px; position: relative; z-index: 1; }
.balance-row { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 20px; position: relative; z-index: 1; }
.balance-row b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.balance .row { position: relative; z-index: 1; }
.tx { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.tx:first-child { border-top: 0; }
.tx-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--green-soft); color: var(--green); }
.tx-icon.out { background: var(--surface-3); color: var(--ink-2); }
.tx-icon.fee { background: var(--amber-soft); color: var(--amber); }
.tx-main { flex: 1; min-width: 0; }
.tx-main b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-main small { color: var(--ink-3); font-size: 12px; }
.tx-sum { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-sum.plus { color: var(--green); }
.tx-sum small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-3); }
.cardpay { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.cardpay input { accent-color: var(--accent); width: 18px; height: 18px; }
.cardpay-logo { width: 42px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; flex: none; }
.cardpay:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }
.split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 3px; margin: 12px 0 14px; }
.split i { display: block; height: 100%; }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- profile ---------- */
.card.profile-head { padding: 0; overflow: hidden; margin-bottom: 16px; }
.cover { height: 130px; background:
  radial-gradient(circle at 15% 120%, color-mix(in srgb, var(--accent) 85%, transparent) 0 30%, transparent 31%),
  radial-gradient(circle at 85% -20%, color-mix(in srgb, var(--blue) 60%, transparent) 0 35%, transparent 36%),
  linear-gradient(120deg, var(--dark-card), color-mix(in srgb, var(--dark-card) 70%, var(--accent))); }
.profile-info { display: flex; gap: 20px; align-items: flex-end; padding: 0 24px 22px; margin-top: -48px; flex-wrap: wrap; }
.profile-info .who { flex: 1; min-width: 220px; padding-bottom: 4px; }
.profile-info h2 { font: 600 24px/1.2 var(--display); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.verified { color: var(--blue); display: inline-flex; }
.profile-stats { display: flex; gap: 24px; flex-wrap: wrap; padding: 16px 24px; border-top: 1px solid var(--line); }
.profile-stats div b { display: block; font: 600 20px/1.2 var(--display); }
.profile-stats div small { color: var(--ink-3); font-size: 13px; }
.profile-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.price-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.price-row:first-child { border-top: 0; padding-top: 0; }
.price-row span { flex: 1; min-width: 0; }
.price-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.portfolio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pf { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; display: flex; align-items: flex-end; padding: 10px; color: #fff; font-size: 12px; font-weight: 600; }
.pf::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.55)); }
.pf span { position: relative; }
.pf-add { border: 2px dashed var(--line); color: var(--ink-3); justify-content: center; align-items: center; flex-direction: column; gap: 4px; background: none; cursor: pointer; }
.pf-add::before { display: none; }
.review { padding: 14px 0; border-top: 1px solid var(--line); }
.review:first-of-type { border-top: 0; padding-top: 0; }
.review p { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.review-top { display: flex; align-items: center; gap: 10px; }
.review-top b { font-weight: 600; font-size: 14px; display: block; }
.review-top small { color: var(--ink-3); font-size: 12px; }
.review-top .stars { margin-left: auto; }
.rating-bars { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.rating-bars div { display: grid; grid-template-columns: 14px minmax(0, 1fr) 30px; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-3); }
.rating-bars .progress { height: 6px; }
.rating-bars .progress i { background: var(--amber); }
.rating-big { display: flex; align-items: baseline; gap: 8px; }
.rating-big b { font: 600 40px/1 var(--display); letter-spacing: -.03em; }

.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sheet-link { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 500; font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feed-layout, .sched-grid { grid-template-columns: minmax(0, 1fr); }
  .feed-aside { display: none; }
  .search { width: 220px; }
}

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top { padding: 10px 16px; gap: 8px; }
  .top-title h1 { font-size: 18px; }
  .search, #themeToggle, .top .avatar { display: none; }
  .online { height: 38px; padding: 0 12px 0 10px; font-size: 13px; }
  .icon-btn { width: 38px; height: 38px; }
  #view { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .home-grid, .wallet-grid, .profile-grid { grid-template-columns: minmax(0, 1fr); }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; border: 0; background: none; border-radius: 12px;
    font-size: 11px; font-weight: 500; color: var(--ink-3);
  }
  .tabbar .active { color: var(--accent); }
  .tabbar .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

  .drawer {
    top: auto; left: 0; width: 100%; max-height: 92vh;
    border-radius: 22px 22px 0 0;
    animation: sheetIn .3s cubic-bezier(.2, .8, .2, 1);
  }
  .drawer::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; }
  .drawer-head { padding: 12px 18px 14px; }
  .drawer-body { padding: 16px 18px; }
  .drawer-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
  @keyframes sheetIn { from { transform: translateY(60px); opacity: 0; } }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }

  .board-tabs { display: flex; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .board .col { display: none; background: none; padding: 0; }
  .board .col.show { display: block; }
  .board .col-head { display: none; }

  .week { display: none; }
  .agenda { display: block; }

  .chat { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 59px - 16px - 76px - env(safe-area-inset-bottom)); min-height: 420px; margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; }
  .chat .thread { display: none; }
  .chat.open .dialogs { display: none; }
  .chat.open .thread { display: flex; }
  .thread-back { display: grid; }
  .dialogs { border-right: 0; }
}

@media (max-width: 560px) {
  .kpi-value { font-size: 21px; }
  .kpi { padding: 14px; gap: 6px; }
  .kpi-icon { width: 30px; height: 30px; }
  .card { padding: 16px; }
  .online-label { display: none; }
  .online { width: 38px; padding: 0; justify-content: center; }
  .order { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .order-price { text-align: left; display: flex; align-items: baseline; gap: 8px; }
  .order-foot .btn { margin-left: 0; width: 100%; }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
  .portfolio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-info { padding: 0 16px 18px; }
  .profile-stats { padding: 14px 16px; gap: 18px; }
  .chart { gap: 6px; height: 150px; }
  .toolbar .select { width: 100%; }
  .tl-item { grid-template-columns: 46px 14px minmax(0, 1fr); gap: 8px; }
  .hello h2 { font-size: 24px; }
  .msg { max-width: 86%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
