/* LE Workspace — wine / soil / cream. Layout: fixed wine sidebar + cream workspace; bottom tab bar on phones. */
:root {
  --wine: #5B0F18;
  --wine-2: #761B26;
  --wine-deep: #3D0910;
  --soil: #4A2E27;
  --soil-2: #7B625A;
  --soil-3: #A8938A;
  --cream: #F8F1E7;
  --paper: #FFFCF8;
  --sand: #F0E5D6;
  --line: #E6D8C6;
  --line-2: #D9C6B0;
  --rose: #F3E2DE;
  --gold: #B88A4A;
  --ok: #4C6A3A;  --ok-bg: #E5EBD8;
  --warn: #9A6212; --warn-bg: #F6E6C6;
  --bad: #A3271F; --bad-bg: #F6DCD6;
  --info: #3D5870; --info-bg: #DFE7ED;
  --idle: #7B625A; --idle-bg: #EDE3D7;
  --f-display: "IBM Plex Sans Thai", system-ui, sans-serif;
  --f-body: "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r: 12px; --r-sm: 8px; --r-lg: 18px;
  --sh-1: 0 1px 0 rgba(74,46,39,.04), 0 1px 3px rgba(74,46,39,.06);
  --sh-2: 0 10px 30px -12px rgba(61,9,16,.28), 0 2px 6px rgba(74,46,39,.06);
  --side-w: 248px;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--cream); color: var(--soil); font-family: var(--f-body); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--wine); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--f-mono); font-size: .92em; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--soil-2); }
.faint { color: var(--soil-3); }
.small { font-size: 12.5px; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0,1fr); min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; background: var(--wine); color: #F3E6E2; display: flex; flex-direction: column; padding: 18px 14px; gap: 6px; overflow-y: auto; }
.side::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 60% at 0% 0%, rgba(255,255,255,.07), transparent 60%), radial-gradient(80% 50% at 100% 100%, rgba(0,0,0,.18), transparent 70%); }
.brand { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px 14px; position: relative; z-index: 1; }
.brand-logo { width: 184px; height: auto; display: block; }
.brand .brand-sub { margin-left: 44px; }
.top-logo { display: none; width: 30px; height: 30px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--cream); color: var(--wine); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 16px; letter-spacing: -.5px; }
.brand-name { font-family: var(--f-display); font-weight: 600; font-size: 16px; line-height: 1.1; color: #fff; }
.brand-sub { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .65; }
.nav-group { font-size: 11.5px; letter-spacing: .02em; font-weight: 600; opacity: .5; padding: 14px 10px 4px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: #EBDAD5; font-weight: 500; transition: background .2s var(--ease), color .2s; z-index: 1; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav a.on { background: var(--cream); color: var(--wine); }
.nav a.on .ico { color: var(--wine); }
.nav .ico { width: 18px; height: 18px; flex: none; color: #D9B8B0; }
.nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.nav a.on .count { background: var(--wine); }
.side-foot { margin-top: auto; padding-top: 12px; z-index: 1; }
.me-card small { display: block; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(0,0,0,.18); cursor: pointer; border: 0; width: 100%; text-align: left; color: #fff; }
.me-card:hover { background: rgba(0,0,0,.26); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(248,241,231,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--line); }
.top-title { font-family: var(--f-display); font-weight: 600; font-size: 19px; color: var(--wine-deep); min-width: 0; }
.search { position: relative; margin-left: auto; width: min(320px, 34vw); }
.search input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); padding: 0 12px 0 36px; outline: none; transition: border-color .2s, box-shadow .2s; }
.search input:focus { border-color: var(--wine); box-shadow: 0 0 0 3px rgba(91,15,24,.1); }
.search .ico { position: absolute; left: 11px; top: 10px; width: 18px; height: 18px; color: var(--soil-3); }
.search-res { position: absolute; top: 44px; left: 0; right: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-2); padding: 6px; z-index: 50; max-height: 60vh; overflow: auto; }
.search-res a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; color: var(--soil); }
.search-res a:hover { background: var(--sand); text-decoration: none; }
.search-res .t { font-size: 11px; color: var(--soil-3); width: 58px; flex: none; }

.clock { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px 0 6px; border-radius: 19px; background: var(--paper); border: 1px solid var(--line); cursor: pointer; white-space: nowrap; transition: border-color .2s, background .2s; }
.clock:hover { border-color: var(--line-2); }
.clock.done8 { background: var(--wine); color: #fff; border-color: var(--wine); animation: pulse 2.2s infinite; }
.clock .ring { width: 28px; height: 28px; }
.clock .t { font-family: var(--f-mono); font-weight: 500; font-size: 13.5px; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(91,15,24,.35); } 50% { box-shadow: 0 0 0 7px rgba(91,15,24,0); } }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; cursor: pointer; flex: none; transition: background .15s; }
.icon-btn:hover { background: var(--sand); }
.icon-btn .ico { width: 19px; height: 19px; }
.badge-dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--wine); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--cream); }
.menu-btn { display: none; }

.view { padding: 22px 28px 60px; max-width: 1360px; width: 100%; margin: 0 auto; }
.view.enter { animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- primitives ---------- */
.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--paper); color: var(--soil); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; }
.btn:hover { background: var(--sand); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--wine); border-color: var(--wine); color: #fff; box-shadow: 0 6px 16px -8px rgba(91,15,24,.7); }
.btn.primary:hover { background: var(--wine-2); }
.btn.soil { background: var(--soil); border-color: var(--soil); color: var(--cream); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sand); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); border-color: #E3B9B2; }
.btn.sm { height: 31px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn .ico { width: 16px; height: 16px; }
.btn.loading { pointer-events: none; color: transparent !important; position: relative; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--line-2) var(--line-2) var(--wine) var(--wine); animation: spin .7s linear infinite; }
.btn.primary.loading::after { border-color: rgba(255,255,255,.35) rgba(255,255,255,.35) #fff #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px 0; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-h .more { margin-left: auto; font-size: 13px; }
.card-b { padding: 14px 18px 18px; }
.h-page { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.h-page h1 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; color: var(--wine-deep); text-wrap: balance; }
.h-page p { margin: 4px 0 0; color: var(--soil-2); }
.h-page .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; letter-spacing: .02em; color: var(--soil-3); font-weight: 600; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--idle-bg); color: var(--idle); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.no-dot::before { display: none; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.wine { background: var(--rose); color: var(--wine); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px; background: var(--sand); color: var(--soil); font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip .sw { width: 8px; height: 8px; border-radius: 2px; }

.av { --s: 30px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; font-size: calc(var(--s) * .4); font-weight: 600; color: #fff; flex: none; background: var(--soil); border: 2px solid var(--paper); letter-spacing: -.02em; }
.av.sm { --s: 24px; } .av.lg { --s: 40px; } .av.xl { --s: 56px; }
.avs { display: inline-flex; } .avs .av + .av { margin-left: -8px; }
.who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.who b { font-weight: 600; }

.bar { height: 6px; border-radius: 3px; background: var(--sand); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--wine); transition: width .6s var(--ease); }
.bar.ok > i { background: var(--ok); }

.seg { display: inline-flex; background: var(--sand); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 31px; padding: 0 13px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--soil-2); white-space: nowrap; transition: background .2s, color .2s; }
.seg button.on { background: var(--paper); color: var(--wine); box-shadow: var(--sh-1); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--soil); }
.field > span em { font-style: normal; color: var(--soil-3); font-weight: 400; }
.inp, select.inp, textarea.inp { width: 100%; min-height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; padding: 8px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.inp { min-height: 84px; resize: vertical; }
.inp:focus { border-color: var(--wine); box-shadow: 0 0 0 3px rgba(91,15,24,.1); }
.inp.err { border-color: var(--bad); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.sp { flex: 1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--wine); }
.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 12px; background: var(--line-2); transition: background .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .22s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--wine); }
.switch input:checked + i::after { transform: translateX(17px); }

.empty { text-align: center; padding: 36px 16px; color: var(--soil-2); }
.empty .ico { width: 34px; height: 34px; color: var(--soil-3); margin-bottom: 6px; }
.skel { background: linear-gradient(90deg, var(--sand) 0%, #F7EEE3 50%, var(--sand) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--soil-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td.mono { white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: #FBF5EC; }
.tbl .r { text-align: right; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { position: relative; border: 0; background: none; padding: 10px 14px; font-weight: 500; color: var(--soil-2); cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--wine); }
.tabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--wine); border-radius: 2px; }
.tabs .n { display: inline-grid; place-items: center; min-width: 19px; height: 19px; border-radius: 10px; background: var(--rose); color: var(--wine); font-size: 11px; margin-left: 5px; padding: 0 5px; }

/* ---------- modal / drawer / toast ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(42,18,14,.42); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(640px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--paper); border-radius: var(--r-lg); box-shadow: 0 30px 80px -20px rgba(42,8,12,.5); animation: pop .28s var(--ease); overflow: hidden; }
.modal.wide { width: min(860px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-h { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 6px; }
.modal-h h2 { margin: 0; font-family: var(--f-display); font-size: 20px; font-weight: 600; color: var(--wine-deep); }
.modal-h p { margin: 2px 0 0; color: var(--soil-2); font-size: 13.5px; }
.modal-b { padding: 14px 22px 18px; overflow-y: auto; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); background: #FBF6EF; flex-wrap: wrap; }
.x-btn { margin-left: auto; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--soil-2); flex: none; }
.x-btn:hover { background: var(--sand); }
.form-err { background: var(--bad-bg); color: var(--bad); padding: 9px 12px; border-radius: 9px; font-size: 13.5px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; width: min(370px, calc(100vw - 32px)); background: var(--soil); color: var(--cream); border-radius: 14px; padding: 13px 15px; box-shadow: 0 18px 40px -16px rgba(42,8,12,.6); animation: toastIn .35s var(--ease); }
.toast.leaving { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.toast .ico { color: #E9C9A0; margin-top: 2px; }
.toast b { display: block; font-weight: 600; }
.toast small { opacity: .8; display: block; font-size: 12.5px; }
.toast .chs { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.toast .chs span { font-size: 10.5px; padding: 1px 7px; border-radius: 6px; background: rgba(255,255,255,.12); }
.toast.push { background: #fff; color: var(--soil); border: 1px solid var(--line); }
.toast.push .app-i { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex: none; background: var(--wine); color: var(--cream); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 13px; flex: none; }
.toast.push .meta { font-size: 11px; color: var(--soil-3); }

.popover { position: fixed; z-index: 90; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-2); animation: pop .2s var(--ease); overflow: hidden; }
.notif-pop { width: min(380px, calc(100vw - 24px)); }
.notif-pop .hd { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-pop .list { max-height: 60vh; overflow-y: auto; }
.notif { display: flex; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; color: var(--soil); }
.notif:hover { background: #FBF5EC; text-decoration: none; }
.notif.unread { background: #FDF4F1; }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wine); margin-top: 7px; flex: none; }
.notif.read .dot { background: transparent; }
.notif b { font-weight: 600; display: block; font-size: 13.5px; }
.notif small { color: var(--soil-2); display: block; font-size: 12.5px; }
.notif time { font-size: 11px; color: var(--soil-3); }
.menu-pop { min-width: 250px; padding: 6px; }
.menu-pop button, .menu-pop a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--soil); }
.menu-pop button:hover, .menu-pop a:hover { background: var(--sand); text-decoration: none; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ---------- home ---------- */
.hello { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.hello h1 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: clamp(24px, 3vw, 34px); color: var(--wine-deep); line-height: 1.2; }
.hello .date { color: var(--soil-2); margin-top: 4px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.work-card { position: relative; overflow: hidden; background: var(--wine); color: #F6E9E4; border-radius: var(--r-lg); padding: 22px 24px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 22px; align-items: center; box-shadow: 0 20px 40px -24px rgba(61,9,16,.8); }
.work-card::before { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.1), transparent 70%); }
.work-card .big-ring { width: 128px; height: 128px; position: relative; }
.work-card .big-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.work-card .big-ring .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.work-card .big-ring .lbl b { font-family: var(--f-mono); font-size: 21px; font-weight: 500; color: #fff; letter-spacing: -.02em; }
.work-card .big-ring .lbl small { font-size: 11px; opacity: .7; }
.work-card h3 { margin: 0 0 2px; font-family: var(--f-display); font-weight: 600; font-size: 19px; color: #fff; }
.work-card .facts { display: flex; gap: 22px; flex-wrap: wrap; margin: 12px 0 14px; }
.work-card .facts div { display: flex; flex-direction: column; }
.work-card .facts span { font-size: 12px; opacity: .6; }
.work-card .facts b { font-family: var(--f-mono); font-size: 16px; font-weight: 500; color: #fff; }
.work-card .btn { background: var(--cream); color: var(--wine); border-color: var(--cream); }
.work-card .btn.ghost { background: transparent; color: #F6E9E4; border-color: rgba(255,255,255,.25); }
.work-card .btn.ghost:hover { background: rgba(255,255,255,.08); }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.stat { padding: 14px 16px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; color: var(--soil); transition: border-color .2s, transform .2s var(--ease); }
a.stat:hover { border-color: var(--line-2); text-decoration: none; transform: translateY(-2px); }
.stat b { font-family: var(--f-display); font-size: 26px; font-weight: 600; color: var(--wine); line-height: 1.1; }
.stat span { font-size: 13px; color: var(--soil-2); }
.task-li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.task-li:last-child { border-bottom: 0; }
.task-li .ti { min-width: 0; flex: 1; }
.task-li .ti b { display: block; font-weight: 600; font-size: 14px; }
.task-li .ti small { color: var(--soil-2); font-size: 12.5px; }
.ev-li { display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: center; }
.ev-li:last-child { border-bottom: 0; }
.ev-date { text-align: center; border-radius: 10px; background: var(--sand); padding: 4px 0; line-height: 1.1; }
.ev-date b { display: block; font-family: var(--f-display); font-size: 18px; color: var(--wine); }
.ev-date small { font-size: 10.5px; color: var(--soil-2); }
.dash-slot { display: grid; place-items: center; text-align: center; min-height: 160px; border: 1.5px dashed var(--line-2); border-radius: var(--r); color: var(--soil-2); padding: 20px; background: repeating-linear-gradient(-45deg, transparent 0 12px, rgba(240,229,214,.5) 12px 24px); }

/* ---------- projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.proj { display: flex; flex-direction: column; gap: 12px; padding: 18px; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s, border-color .2s; color: var(--soil); }
.proj:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--line-2); text-decoration: none; }
.proj .top-row { display: flex; align-items: center; gap: 8px; }
.proj h3 { margin: 0; font-size: 16.5px; font-weight: 600; line-height: 1.35; text-wrap: balance; }
.proj .desc { margin: 0; font-size: 13px; color: var(--soil-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.proj .now { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--cream); border-radius: 10px; font-size: 13px; }
.proj .now small { display: block; color: var(--soil-3); font-size: 11px; }
.proj .foot { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--soil-2); }
.star { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; cursor: pointer; color: var(--soil-3); transition: color .2s, background .2s, transform .2s var(--ease); margin-left: auto; flex: none; }
.star:hover { background: var(--sand); }
.star.on { color: var(--wine); background: var(--rose); border-color: #E7C6BF; }
.star.on .ico { fill: currentColor; }
.star.bump { animation: bump .35s var(--ease); }
@keyframes bump { 50% { transform: scale(1.22); } }

.p-head { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 18px; }
.p-head h1 { margin: 6px 0 4px; font-family: var(--f-display); font-weight: 600; font-size: clamp(22px, 2.6vw, 30px); color: var(--wine-deep); line-height: 1.25; text-wrap: balance; }
.p-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; font-size: 13px; }
.p-meta > div { display: flex; flex-direction: column; gap: 3px; }
.p-meta span.k { font-size: 12px; color: var(--soil-3); }
.p-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.flow { display: flex; gap: 0; overflow-x: auto; padding: 4px 2px 12px; margin-bottom: 6px; }
.flow-step { flex: 1 0 120px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; position: relative; font-size: 12px; color: var(--soil-2); }
.flow-step::before { content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 2px; background: var(--line-2); z-index: 0; }
.flow-step:first-child::before { display: none; }
.flow-step.done::before, .flow-step.active::before { background: var(--wine); }
.flow-step .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--line-2); font-weight: 600; z-index: 1; color: var(--soil-2); font-size: 13px; }
.flow-step.done .n { background: var(--wine); border-color: var(--wine); color: #fff; }
.flow-step.active .n { border-color: var(--wine); color: var(--wine); box-shadow: 0 0 0 5px rgba(91,15,24,.12); }
.flow-step .lb { max-width: 130px; padding: 0 4px; line-height: 1.35; }
.flow-step.active .lb { color: var(--soil); font-weight: 600; }

.step { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 14px; position: relative; padding-bottom: 14px; }
.step::before { content: ""; position: absolute; left: 16px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--line-2); font-weight: 600; color: var(--soil-2); }
.step.done .n { background: var(--wine); border-color: var(--wine); color: #fff; }
.step.pending .n, .step.in_progress .n { border-color: var(--wine); color: var(--wine); }
.step.blocked .n { border-color: var(--bad); color: var(--bad); }
.step-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; transition: box-shadow .25s, border-color .25s; }
.step.pending .step-card, .step.in_progress .step-card { border-color: #DDB9B1; box-shadow: 0 8px 22px -16px rgba(91,15,24,.6); }
.step.waiting .step-card { background: transparent; border-style: dashed; }
.step-card h4 { margin: 0; font-size: 15px; font-weight: 600; }
.step-card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--soil-2); }
.step-card .note { margin-top: 10px; padding: 9px 12px; border-radius: 9px; background: var(--cream); font-size: 13px; }
.links { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.link-li { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; background: #FBF6EF; border: 1px solid var(--line); font-size: 13px; color: var(--soil); min-width: 0; }
.link-li:hover { border-color: var(--line-2); text-decoration: none; background: #F8F0E4; }
.link-li .gd { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--sand); color: var(--soil-2); font-size: 10px; font-weight: 700; }
.link-li .gd.drive { background: #E7EFE0; color: #3C6B3A; }
.link-li .gd.doc { background: #DFE7F2; color: #34557A; }
.link-li .gd.sheet { background: #E1EEE4; color: #2F6B45; }
.link-li .gd.figma { background: #F1E2EE; color: #7A3A6B; }
.step-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ack-banner { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 9px 12px; border-radius: 9px; background: var(--warn-bg); color: var(--warn); font-size: 13px; font-weight: 500; }

.feed { display: flex; flex-direction: column; }
.feed-li { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed-li:last-child { border-bottom: 0; }
.feed-li .msg { font-size: 13.5px; }
.feed-li .msg.comment { background: var(--cream); padding: 8px 11px; border-radius: 4px 12px 12px 12px; margin-top: 4px; }
.feed-li time { font-size: 11.5px; color: var(--soil-3); }
.comment-box { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 6px; }
.comment-box textarea { min-height: 42px; height: 42px; }

.steps-builder { display: flex; flex-direction: column; gap: 8px; }
.sb-row { display: grid; grid-template-columns: 26px minmax(0, 1.6fr) minmax(0,1fr) 140px 32px; gap: 8px; align-items: center; }
.sb-row .n { width: 26px; height: 26px; border-radius: 50%; background: var(--rose); color: var(--wine); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.handoff-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--cream); }
.handoff-arrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--paper); border-radius: 10px; border: 1px solid var(--line); }

/* ---------- calendar ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 18px; align-items: start; }
.cal { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cal-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-h h2 { margin: 0 8px 0 4px; font-family: var(--f-display); font-size: 19px; font-weight: 600; color: var(--wine-deep); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.cal-dow { padding: 8px 10px; font-size: 11.5px; font-weight: 600; color: var(--soil-3); letter-spacing: .06em; border-bottom: 1px solid var(--line); }
.cal-d { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; transition: background .15s; min-width: 0; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d:hover { background: #FBF6EF; }
.cal-d.out { background: #FAF4EB; color: var(--soil-3); }
.cal-d.we { background: #FBF5EE; }
.cal-d.sel { box-shadow: inset 0 0 0 2px var(--wine); }
.cal-d .dn { font-size: 12.5px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-d.today .dn { background: var(--wine); color: #fff; }
.ev { font-size: 11.5px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; line-height: 1.5; }
.ev.seminar { background: var(--wine); color: #fff; }
.ev.meeting { background: var(--info-bg); color: var(--info); }
.ev.leave { background: var(--warn-bg); color: var(--warn); }
.ev.ot { background: var(--ok-bg); color: var(--ok); }
.ev.holiday { background: #EFE0C6; color: #7A5418; }
.ev.other { background: var(--sand); color: var(--soil); }
.ev-more { font-size: 11px; color: var(--soil-2); padding-left: 4px; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.legend button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; height: 30px; padding: 0 10px; font-size: 12.5px; cursor: pointer; transition: opacity .2s; }
.legend button.off { opacity: .4; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.agenda-li { display: grid; grid-template-columns: 4px minmax(0,1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.agenda-li:last-child { border-bottom: 0; }
.agenda-li .bar-c { border-radius: 2px; }
.gcal { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }

/* ---------- products ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.prod { overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .25s var(--ease), box-shadow .25s; color: var(--soil); }
.prod:hover { transform: translateY(-3px); box-shadow: var(--sh-2); text-decoration: none; }
.prod-img { aspect-ratio: 4/3; max-width: 100%; position: relative; display: grid; place-items: center; overflow: hidden; }
.prod-img .mk { font-family: var(--f-display); font-weight: 700; font-size: 34px; color: rgba(255,255,255,.92); letter-spacing: -.02em; text-align: center; line-height: 1.05; padding: 10px; }
.prod-img .sku { position: absolute; left: 10px; bottom: 10px; font-family: var(--f-mono); font-size: 11px; background: rgba(255,255,255,.88); color: var(--soil); padding: 2px 7px; border-radius: 6px; }
.prod-img .st { position: absolute; right: 10px; top: 10px; }
.prod .bd { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.prod h3 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.prod p { margin: 0; font-size: 12.5px; color: var(--soil-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod .ft { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 6px; font-size: 13px; }
.prod .price { font-weight: 600; color: var(--wine); }
.pd-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0,1fr); gap: 18px; align-items: start; }
.pd-hero { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 20px; padding: 18px; }
.pd-hero .prod-img { border-radius: 12px; }
.prose { font-size: 14.5px; line-height: 1.7; max-width: 68ch; }
.prose h2 { font-family: var(--f-display); font-size: 17px; font-weight: 600; color: var(--wine-deep); margin: 18px 0 6px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 20px; margin: 6px 0; }
.prose p { margin: 6px 0; }
.kv { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--soil-2); }
.kv dd { margin: 0; font-weight: 500; }

/* ---------- stock ---------- */
.lvl { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.lvl .bar { flex: 1; height: 7px; }
.lvl .bar > i { background: var(--ok); }
.lvl.low .bar > i { background: var(--bad); }
.mv-in { color: var(--ok); font-weight: 600; }
.mv-out { color: var(--bad); font-weight: 600; }
.mv-adjust { color: var(--info); font-weight: 600; }
.type-pick { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.type-pick label { border: 1.5px solid var(--line); border-radius: 11px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: border-color .15s, background .15s; }
.type-pick input { display: none; }
.type-pick label:has(input:checked) { border-color: var(--wine); background: var(--rose); }
.type-pick b { font-size: 14px; } .type-pick small { font-size: 12px; color: var(--soil-2); }

/* ---------- requests ---------- */
.req { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.req-top { display: flex; gap: 12px; align-items: flex-start; }
.req-top .ti { flex: 1; min-width: 0; }
.req-top h4 { margin: 0; font-size: 15px; font-weight: 600; }
.track { display: flex; align-items: center; gap: 0; font-size: 12px; flex-wrap: wrap; row-gap: 6px; }
.track .s { display: inline-flex; align-items: center; gap: 6px; color: var(--soil-3); }
.track .s i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; background: var(--paper); }
.track .s.ok { color: var(--ok); } .track .s.ok i { background: var(--ok); border-color: var(--ok); }
.track .s.ok i::after { content: ""; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px,-1px); }
.track .s.now { color: var(--wine); font-weight: 600; } .track .s.now i { border-color: var(--wine); box-shadow: 0 0 0 3px rgba(91,15,24,.12); }
.track .s.bad { color: var(--bad); } .track .s.bad i { background: var(--bad); border-color: var(--bad); }
.track .ln { width: 26px; height: 2px; background: var(--line-2); margin: 0 6px; }
.quota { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.quota .q { padding: 14px 16px; }
.quota .q b { font-family: var(--f-display); font-size: 24px; color: var(--wine); font-weight: 600; }
.quota .q small { color: var(--soil-2); }
.items-tbl { width: 100%; border-collapse: collapse; }
.items-tbl th { font-size: 12px; text-align: left; color: var(--soil-2); font-weight: 500; padding: 0 4px 6px; }
.items-tbl td { padding: 4px; vertical-align: top; }
.items-tbl .inp { min-height: 36px; padding: 6px 9px; }
.total-row { display: flex; justify-content: flex-end; align-items: baseline; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 6px; }
.total-row b { font-family: var(--f-display); font-size: 24px; color: var(--wine); }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: 11px; padding: 14px; text-align: center; color: var(--soil-2); cursor: pointer; font-size: 13px; transition: border-color .2s, background .2s; }
.dropzone:hover, .dropzone.over { border-color: var(--wine); background: var(--rose); }
.amount { font-family: var(--f-display); font-weight: 600; font-size: 20px; color: var(--wine); white-space: nowrap; }

/* ---------- integrations ---------- */
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 14px; }
.int { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.int .lg { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); background: var(--cream); }
.login-art { position: relative; background: var(--wine); color: var(--cream); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.login-art > * { position: relative; }
.login-art h1 { font-family: var(--f-display); font-weight: 600; font-size: clamp(30px, 4vw, 52px); line-height: 1.15; margin: 0; color: #fff; max-width: 14ch; text-wrap: balance; }
.login-art p { max-width: 42ch; opacity: .8; font-size: 15.5px; }
.login-mods { display: flex; flex-wrap: wrap; gap: 8px; }
.login-mods span { padding: 5px 11px; border: 1px solid rgba(255,255,255,.25); border-radius: 20px; font-size: 12.5px; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-box { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-box h2 { font-family: var(--f-display); font-size: 26px; margin: 0; color: var(--wine-deep); font-weight: 600; }
.gbtn { height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 600; cursor: pointer; font-size: 15px; transition: box-shadow .2s, transform .1s; }
.gbtn:hover { box-shadow: var(--sh-2); }
.gbtn:active { transform: translateY(1px); }
.login.out { animation: loginOut .55s var(--ease) forwards; }
@keyframes loginOut { to { opacity: 0; transform: scale(1.03); visibility: hidden; } }

.demo-flag { position: fixed; left: 50%; transform: translateX(-50%); top: 8px; z-index: 60; font-size: 11px; background: var(--soil); color: var(--cream); padding: 2px 10px; border-radius: 10px; opacity: .85; pointer-events: none; }

.tabbar { display: none; }
.sheet-nav { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; padding: 14px; }
.sheet-nav a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 12px; background: var(--cream); color: var(--soil); font-size: 12.5px; text-align: center; }
.sheet-nav a .ico { width: 22px; height: 22px; color: var(--wine); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .home-grid, .p-layout, .pd-layout { grid-template-columns: minmax(0,1fr); }
  .cal-layout { grid-template-columns: minmax(0,1fr); }
  .quota { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0,1fr); }
  .side { display: none; }
  .top { padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .search { display: none; }
  .top-logo { display: block; }
  .clock .lbl-l { display: none; }
  .view { padding: 16px 16px 96px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255,252,248,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--soil-2); padding: 4px 0; border: 0; background: none; cursor: pointer; }
  .tabbar a.on, .tabbar button.on { color: var(--wine); font-weight: 600; }
  .tabbar .ico { width: 22px; height: 22px; }
  .tabbar .badge-dot { top: -2px; right: calc(50% - 22px); }
  .toasts { left: 16px; right: 16px; bottom: 84px; align-items: stretch; }
  .toast { width: auto; }
  .work-card { grid-template-columns: minmax(0,1fr); justify-items: start; }
  .work-card .big-ring { width: 116px; height: 116px; }
  .work-card .big-ring .lbl b { font-size: 17px; }
  .work-card { padding: 18px; }
  .stat-row { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
  .stat { padding: 10px 12px; } .stat b { font-size: 21px; } .stat span { font-size: 11.5px; }
  .grid2, .grid3 { grid-template-columns: minmax(0,1fr); }
  .sb-row { grid-template-columns: 26px minmax(0,1fr) 32px; }
  .sb-row .sb-who, .sb-row .sb-due { grid-column: 2 / 3; }
  .cal-d { min-height: 62px; padding: 3px; }
  .cal-d .ev { font-size: 0; height: 6px; padding: 0; border-radius: 3px; }
  .cal-dow { padding: 6px 4px; text-align: center; }
  .pd-hero { grid-template-columns: minmax(0,1fr); }
  .login { grid-template-columns: minmax(0,1fr); grid-template-rows: auto 1fr; }
  .login-art { padding: 28px 22px; min-height: 300px; }
  .modal { max-height: calc(100vh - 20px); }
  .overlay { padding: 10px; align-items: end; }
  .quota { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .h-page .actions { margin-left: 0; width: 100%; }
  .p-head { padding: 16px; }
  .flow-step { flex-basis: 96px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- categories, archive ---------- */
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 18px; }
.cat-chips button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--soil-2); transition: background .15s, border-color .15s, color .15s; }
.cat-chips button:hover { border-color: var(--line-2); }
.cat-chips button.on { background: var(--soil); border-color: var(--soil); color: var(--cream); }
.cat-chips .sw, .cat-h .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.cat-chips .n { font-size: 11px; opacity: .7; }
.cat-sec { margin-bottom: 22px; }
.cat-h { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 4px 2px 12px; cursor: pointer; color: var(--soil); text-align: left; }
.cat-h b { font-family: var(--f-display); font-size: 17px; font-weight: 600; color: var(--wine-deep); }
.cat-h .chev { transition: transform .25s var(--ease); color: var(--soil-3); }
.cat-sec.closed .chev { transform: rotate(-90deg); }
.cat-sec.closed .proj-grid { display: none; }
.proj.is-done { background: #FBF7F1; }
.proj.is-done h3 { color: var(--soil-2); }

/* ---------- mind map ---------- */
.mm-wrap { overflow: auto; border-radius: 12px; background: radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 1.2px) 0 0/22px 22px, #FCF8F2; border: 1px solid var(--line); cursor: grab; max-height: 72vh; }
.mm-wrap.grab { cursor: grabbing; user-select: none; }
.mm { position: relative; margin: 10px; }
.mm-svg { position: absolute; left: 0; top: 0; overflow: visible; }
.mm-e { fill: none; stroke-width: 2.2; }
.mm-e.on { stroke: var(--wine); }
.mm-e.half { stroke: var(--wine); stroke-dasharray: 6 5; opacity: .6; }
.mm-e.wait { stroke: var(--line-2); stroke-dasharray: 5 5; }
.mm-root { position: absolute; left: 0; background: var(--wine); color: #fff; border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 14px 30px -18px rgba(61,9,16,.8); font-size: 14px; }
.mm-root .av { border-color: var(--wine); }
.mm-n { position: absolute; background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 12px 10px 16px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; overflow: hidden; }
.mm-n::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--line-2); }
.mm-n:hover { transform: translateY(-2px); box-shadow: var(--sh-2); z-index: 2; }
.mm-t { font-weight: 600; font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mm-m { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--soil-2); min-width: 0; }
.mm-m .ico { width: 15px; height: 15px; color: var(--ok); }
.mm-due { color: var(--warn); font-size: 11.5px; }
.mm-ack { position: absolute; right: 8px; top: 8px; }
.mm-n.st-done { background: #F7F2EA; } .mm-n.st-done::before { background: var(--ok); } .mm-n.st-done .mm-t { color: var(--soil-2); }
.mm-n.st-in_progress { border-color: #D9B3AC; } .mm-n.st-in_progress::before { background: var(--wine); }
.mm-n.st-pending { border-color: #E5C98F; } .mm-n.st-pending::before { background: var(--warn); }
.mm-n.st-blocked { border-color: #E3B9B2; } .mm-n.st-blocked::before { background: var(--bad); }
.mm-n.st-waiting { border-style: dashed; background: rgba(255,252,248,.75); }
.mm-n.mine { box-shadow: 0 0 0 3px rgba(91,15,24,.16); }
.mm-n.st-pending.mine .mm-t { padding-right: 82px; }
.mm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--soil-2); }
.mm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mm-legend i { width: 14px; height: 10px; border-radius: 3px; background: var(--line-2); }
.mm-legend .lg-done { background: var(--ok); } .mm-legend .lg-in_progress { background: var(--wine); } .mm-legend .lg-pending { background: var(--warn); } .mm-legend .lg-blocked { background: var(--bad); } .mm-legend .lg-waiting { background: transparent; border: 1.5px dashed var(--soil-3); } .mm-legend .lg-me { background: transparent; box-shadow: 0 0 0 3px rgba(91,15,24,.25); }
.tl { display: flex; flex-direction: column; gap: 8px; }
.tl-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-left: calc(var(--d) * 22px); border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; transition: border-color .2s; position: relative; }
.tl-row:hover { border-color: var(--line-2); }
.tl-row.st-waiting { border-style: dashed; background: transparent; }
.tl-row.mine { box-shadow: 0 0 0 3px rgba(91,15,24,.12); }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--line-2); }
.tl-row.st-done .tl-dot { background: var(--ok); } .tl-row.st-in_progress .tl-dot { background: var(--wine); } .tl-row.st-pending .tl-dot { background: var(--warn); } .tl-row.st-blocked .tl-dot { background: var(--bad); }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.pick-list .check { min-width: 0; }
.sb-row { grid-template-columns: 26px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 140px 32px; }
.sb-head { padding: 0 0 2px; }

/* ---------- due today ---------- */
.due-card { border-color: #E9CDA0; background: linear-gradient(180deg, #FFF8EC, var(--paper) 70%); }
.due-card.calm { border-color: var(--line); background: var(--paper); }
.due-card.calm .card-b { color: var(--ok); }
.due-card .card-h h3 { display: flex; align-items: center; gap: 8px; color: var(--soil); }
.due-card .card-h h3 .ico { color: var(--warn); }
.due-li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.due-li:last-child { border-bottom: 0; }
.due-tag { flex: none; min-width: 64px; text-align: center; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 7px; background: var(--sand); color: var(--soil-2); }
.due-tag.warn { background: var(--warn-bg); color: var(--warn); }
.due-tag.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- calendar deadline layer ---------- */
.ev.task { background: transparent; border: 1.5px dashed var(--wine); color: var(--wine); line-height: 1.35; cursor: pointer; }
.ev.task.following { border-color: var(--soil-3); color: var(--soil-2); }
.ev.task.done { opacity: .5; text-decoration: line-through; }
.legend .lg-sep { width: 1px; background: var(--line); margin: 4px 4px; }
.legend .sw.dash { background: transparent; border: 1.5px dashed; }
@media (max-width: 860px) {
  .hide-m { display: none; }
  .tl-row { margin-left: calc(var(--d) * 12px); }
  .sb-row { grid-template-columns: 26px minmax(0,1fr) 32px; }
  .sb-row .sb-after, .sb-row .sb-who, .sb-row .sb-due { grid-column: 2 / 3; }
  .sb-head { display: none; }
  .cal-d .ev.task { border: 0; background: var(--wine); opacity: .55; }
}

.p-layout-b { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); }
.card-h { flex-wrap: wrap; row-gap: 8px; }
.zoom { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.zoom .btn { min-width: 30px; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .p-layout-b { grid-template-columns: minmax(0,1fr); } }

/* ---------- announcements ---------- */
.ann { display: flex; gap: 16px; padding: 18px 20px; position: relative; overflow: hidden; }
.ann::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line-2); }
.ann.lv-urgent::before { background: var(--bad); } .ann.lv-important::before { background: var(--warn); }
.ann.lv-urgent { border-color: #E9C2BA; }
.ann.is-read { box-shadow: none; }
.ann.is-old { opacity: .65; }
.ann-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--sand); color: var(--soil-2); flex: none; }
.ann-ic .ico { width: 22px; height: 22px; }
.ann.lv-urgent .ann-ic { background: var(--bad-bg); color: var(--bad); }
.ann.lv-important .ann-ic { background: var(--warn-bg); color: var(--warn); }
.ann h3 { margin: 8px 0 6px; font-size: 17px; font-weight: 600; line-height: 1.4; text-wrap: balance; }
.ann-body { font-size: 14px; line-height: 1.7; color: var(--soil); max-width: 72ch; }
.ann-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.mini-bar { display: inline-block; width: 46px; height: 5px; border-radius: 3px; background: var(--sand); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--ok); }
.ann-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; margin-bottom: 14px; background: var(--warn-bg); color: var(--warn); border: 1px solid #E9CDA0; }
.ann-banner b { color: var(--soil); }
.ann-banner.lv-urgent { background: var(--bad-bg); color: var(--bad); border-color: #E9C2BA; }
.ann-banner > .ico { width: 22px; height: 22px; }
.lv-pick label.lv-urgent:has(input:checked) { border-color: var(--bad); background: var(--bad-bg); }
.lv-pick label.lv-important:has(input:checked) { border-color: var(--warn); background: var(--warn-bg); }
.lv-pick .ico { width: 17px; height: 17px; }
.dpick { cursor: pointer; height: 30px; }
.dpick:has(input:checked) { background: var(--soil); color: var(--cream); }
.dpick input { display: none; }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-solid:hover { background: #8C1F18; }

.urgent-ov { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: rgba(40,6,10,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .25s; }
.urgent-ov.leaving { animation: fade .25s reverse forwards; }
.urgent-box { width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--paper); border-radius: 22px; overflow: hidden; box-shadow: 0 40px 100px -30px rgba(0,0,0,.7); animation: urgentIn .5s var(--ease); }
@keyframes urgentIn { 0% { opacity: 0; transform: scale(.9) translateY(20px); } 60% { transform: scale(1.02); } }
.urgent-top { display: flex; align-items: center; gap: 14px; padding: 18px 22px; background: var(--bad); color: #fff; }
.urgent-ic { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; animation: ring 1.4s infinite; }
.urgent-ic .ico { width: 24px; height: 24px; }
@keyframes ring { 0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,.45); } 60% { box-shadow: 0 0 0 12px rgba(255,255,255,0); } }
.urgent-lbl { font-weight: 700; font-size: 16px; }
.urgent-n { margin-left: auto; font-size: 12px; background: rgba(255,255,255,.2); padding: 3px 9px; border-radius: 10px; white-space: nowrap; }
.urgent-b { padding: 22px; overflow-y: auto; }
.urgent-b h2 { margin: 0 0 10px; font-family: var(--f-display); font-size: 24px; line-height: 1.3; color: var(--wine-deep); text-wrap: balance; }
.urgent-body { font-size: 15px; line-height: 1.75; }
.urgent-f { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); background: #FBF6EF; flex-wrap: wrap; }
.urgent-f .btn { margin-left: auto; height: 44px; padding: 0 22px; font-size: 15px; }
@media (max-width: 860px) { .ann { padding: 14px; gap: 12px; } .ann-ic { width: 34px; height: 34px; } .lv-pick { grid-template-columns: minmax(0,1fr); } .urgent-f .btn { width: 100%; } }

/* ---------- templates ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tpl { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.tpl h3 { margin: 2px 0 0; font-size: 17px; font-weight: 600; font-family: var(--f-display); color: var(--wine-deep); }
.tpl .desc { margin: 0; font-size: 13px; color: var(--soil-2); min-height: 2.6em; }
.mini-g { width: 100%; height: 64px; background: var(--cream); border-radius: 10px; }
.tpl-new { align-items: center; justify-content: center; text-align: center; border-style: dashed; background: transparent; cursor: pointer; color: var(--soil); min-height: 240px; box-shadow: none; }
.tpl-new:hover { background: var(--paper); }
.tpl-new > .ico { width: 30px; height: 30px; color: var(--wine); }
.recur-card { margin-bottom: 16px; background: var(--rose); border-color: #E7C6BF; }
.recur-card .card-b > .ico { color: var(--wine); }
.tsb { display: flex; flex-direction: column; gap: 8px; }
.tsb-row { display: grid; grid-template-columns: 26px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 130px 32px; gap: 8px; align-items: center; }
.tsb-row .n { width: 26px; height: 26px; border-radius: 50%; background: var(--rose); color: var(--wine); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.dep { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 40px; }
.dep-b { width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--soil-2); transition: all .15s; }
.dep-b.on { background: var(--wine); border-color: var(--wine); color: #fff; }
@media (max-width: 860px) {
  .tsb-row { grid-template-columns: 26px minmax(0,1fr) 32px; }
  .tsb-row > :nth-child(3), .tsb-row > :nth-child(4), .tsb-row > :nth-child(5) { grid-column: 2 / 3; }
  .tsb-head { display: none; }
}

/* ---------- team overview ---------- */
.ov-kpi { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.ov-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ov-row { border-bottom: 1px solid var(--line); }
.ov-row:last-child { border-bottom: 0; }
.ov-main { display: grid; grid-template-columns: 34px minmax(0, 1.1fr) minmax(0, 1fr) auto 20px; gap: 12px; align-items: center; width: 100%; padding: 11px 0; border: 0; background: none; cursor: pointer; text-align: left; color: var(--soil); }
.ov-main:hover .ov-who b { color: var(--wine); }
.ov-main .chev { transition: transform .25s var(--ease); color: var(--soil-3); }
.ov-row.open .chev { transform: rotate(180deg); }
.ov-who { min-width: 0; }
.ov-load { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ov-bar { height: 8px; border-radius: 4px; background: var(--sand); overflow: hidden; }
.ov-bar i { display: block; height: 100%; border-radius: 4px; background: var(--ok); transition: width .5s var(--ease); }
.ov-bar.warn i { background: var(--warn); } .ov-bar.bad i { background: var(--bad); } .ov-bar.idle i { background: var(--line-2); }
.ov-lt.ok { color: var(--ok); } .ov-lt.warn { color: var(--warn); font-weight: 600; } .ov-lt.bad { color: var(--bad); font-weight: 600; } .ov-lt.idle { color: var(--info); font-weight: 600; }
.ov-nums { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; font-size: 13px; }
.ov-tasks { display: none; padding: 0 0 12px 46px; }
.ov-row.open .ov-tasks { display: flex; flex-direction: column; gap: 6px; }
.ov-t { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #FBF6EF; color: var(--soil); }
.ov-t:hover { border-color: var(--line-2); text-decoration: none; }
.ov-t .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); flex: none; }
.ov-t .dot.st-in_progress { background: var(--wine); } .ov-t .dot.st-pending { background: var(--warn); } .ov-t .dot.st-blocked { background: var(--bad); }
.risk { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--soil); }
.risk:last-child { border-bottom: 0; }
.risk:hover { text-decoration: none; }
.risk:hover b { color: var(--wine); }
.digest { white-space: pre-wrap; font-family: var(--f-body); font-size: 14px; line-height: 1.7; background: var(--cream); border-radius: 12px; padding: 16px 18px; margin: 0; border-left: 4px solid #06C755; }

/* ---------- checklist & mentions ---------- */
.ck-list { display: flex; flex-direction: column; gap: 2px; }
.ck { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.ck:hover { background: var(--cream); }
.ck input { width: 17px; height: 17px; accent-color: var(--ok); flex: none; }
.ck span { flex: 1; min-width: 0; }
.ck.done span { color: var(--soil-3); text-decoration: line-through; }
.ck .btn { opacity: 0; } .ck:hover .btn { opacity: 1; }
.mm-ck { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--soil-2); margin-right: 6px; }
.mm-ck .ico { width: 13px; height: 13px; color: var(--soil-3) !important; }
.mention { color: var(--wine); font-weight: 600; background: var(--rose); border-radius: 5px; padding: 0 4px; }
.mention-box { position: absolute; left: 0; bottom: calc(100% + 6px); width: min(300px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-2); padding: 4px; z-index: 20; }
.mention-box button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; color: var(--soil); }
.mention-box button.on, .mention-box button:hover { background: var(--sand); }

/* ---------- AI ---------- */
.ai-btn { height: 38px; border-color: #E2C7C0; background: linear-gradient(135deg, #FFF8F3, #F6E6E2); color: var(--wine); font-weight: 600; }
.ai-btn .ico { color: var(--wine); }
.ai-soft { border-color: #E2C7C0; background: #FBF1EE; color: var(--wine); }
.ai-badge { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--wine), #9B3A45); color: #fff; flex: none; }
.ai-badge .ico { width: 18px; height: 18px; }
.ai-dr { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 95; background: var(--paper); border-left: 1px solid var(--line); box-shadow: -20px 0 60px -30px rgba(42,8,12,.5); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .3s var(--ease); padding-top: env(safe-area-inset-top, 0px); }
.ai-dr.in { transform: none; }
.ai-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ai-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-empty { margin: auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--soil); padding: 20px; }
.ai-empty > .ico { width: 34px; height: 34px; color: var(--wine); }
.ai-msg { max-width: 90%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.6; }
.ai-msg p { margin: 0 0 4px; } .ai-msg p:last-child { margin: 0; }
.ai-msg.me { align-self: flex-end; background: var(--wine); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.bot { align-self: flex-start; background: var(--cream); border-bottom-left-radius: 4px; }
.ai-li { padding-left: 14px; position: relative; margin: 2px 0; }
.ai-li::before { content: ""; position: absolute; left: 3px; top: .7em; width: 5px; height: 5px; border-radius: 50%; background: var(--wine); }
.ai-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.ai-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--soil-3); animation: dot 1s infinite; }
.ai-dots i:nth-child(2) { animation-delay: .15s; } .ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-4px); opacity: .5; } }
.ai-hints { display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px; border-top: 1px solid var(--line); }
.ai-hints button { flex: none; border: 1px solid var(--line); background: var(--paper); border-radius: 16px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; color: var(--soil); white-space: nowrap; }
.ai-hints button:hover { border-color: var(--wine); color: var(--wine); }
.ai-in { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.ai-scan { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1.5px dashed #E2C7C0; background: #FCF4F1; }
.ai-scan.ok { border-style: solid; border-color: #CBD7B8; background: var(--ok-bg); }
.ai-cta { cursor: pointer; } .ai-cta:hover { border-color: var(--wine); }
.ai-cta > .ico { width: 24px; height: 24px; color: var(--wine); }
.inp.ai-filled { animation: aiFill 2s var(--ease); }
@keyframes aiFill { 0%,40% { background: #FBEBD0; border-color: var(--gold); } }
.ai-draft { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--paper); }
.ai-step { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ai-step:last-of-type { border-bottom: 0; }
.ai-step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--rose); color: var(--wine); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
@media (max-width: 1100px) { .ov-layout { grid-template-columns: minmax(0,1fr); } .ov-kpi { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 860px) {
  .ai-btn { padding: 0 10px; } .ai-btn .lbl-l { display: none; }
  .ov-main { grid-template-columns: 34px minmax(0,1fr) 20px; }
  .ov-main .ov-load, .ov-main .ov-nums { grid-column: 2 / 3; justify-content: flex-start; }
  .ov-tasks { padding-left: 0; }
}

/* ---------- AI settings ---------- */
.ai-set { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ai-feat { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ai-feat:last-child { border-bottom: 0; }
.ai-fi { width: 36px; height: 36px; border-radius: 10px; background: var(--rose); color: var(--wine); display: grid; place-items: center; flex: none; }
.meter { position: relative; height: 10px; border-radius: 5px; background: var(--sand); margin: 10px 0 6px; }
.meter > i { display: block; height: 100%; border-radius: 5px; background: var(--wine); }
.meter .tick { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--warn); border-radius: 1px; }
.ai-save { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--ok-bg); }
.ai-save > b { font-family: var(--f-display); font-size: 30px; color: var(--ok); line-height: 1; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hb { display: grid; grid-template-columns: 96px minmax(0, 1fr) 48px; gap: 10px; align-items: center; padding: 2px 0; cursor: default; border-radius: 6px; }
.hb:hover .hb-t i, .hb:focus .hb-t i { background: var(--wine-2); }
.hb-l { font-size: 13px; color: var(--soil); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-t { height: 14px; display: block; }
.hb-t i { display: block; height: 100%; background: var(--wine); border-radius: 0 4px 4px 0; min-width: 2px; }
.hb-v { font-size: 12.5px; color: var(--soil-2); text-align: right; }
.hb-tip { position: fixed; z-index: 200; background: var(--soil); color: var(--cream); font-size: 12.5px; padding: 6px 10px; border-radius: 8px; pointer-events: none; opacity: 0; transition: opacity .15s; max-width: 300px; }
.ai-feat-use { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.ai-via { display: flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11.5px; color: var(--soil-3); }
.ai-via .ico { width: 13px; height: 13px; }
@media (max-width: 1100px) { .ai-set { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 860px) { .ai-feat { flex-wrap: wrap; } .ai-feat select { order: 3; margin-left: 48px; } }

/* ---------- Revenue dashboard ---------- */
.rd-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.rd-grid2 { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.rd-h { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.rd-hero { text-align: center; padding: 16px 12px 14px; border: 1px solid var(--line); border-top: 4px solid var(--ok); border-radius: var(--r); background: var(--paper); }
.rd-hero b { display: block; font-size: 54px; line-height: 1.05; font-weight: 700; color: var(--ok); letter-spacing: -.02em; margin: 2px 0 4px; }
.rd-hero.warn { border-top-color: var(--warn); } .rd-hero.warn b { color: var(--warn); }
.rd-hero.bad { border-top-color: var(--bad); } .rd-hero.bad b { color: var(--bad); }
.rd-arrow { font-size: 20px; vertical-align: middle; margin-right: 4px; }
.rd-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.rd-tiles div { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; text-align: center; background: var(--cream); }
.rd-tiles span { display: block; font-size: 11.5px; letter-spacing: .08em; color: var(--soil-2); }
.rd-tiles b { font-size: 24px; font-weight: 700; color: var(--soil); }
.rd-sub { margin: 20px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: .08em; color: var(--soil-2); font-weight: 600; }
.rd-brow { display: grid; grid-template-columns: 118px minmax(0, 1fr) 52px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.rd-track { position: relative; height: 24px; border-radius: 6px; background: var(--sand); overflow: hidden; }
.rd-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, #7A1A27, #9B2335); }
.rd-track i.over { background: linear-gradient(90deg, #5B0F18, #9B2335); }
.rd-track b { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 600; color: var(--soil); }
.rd-track b.in { right: auto; left: 50%; transform: translate(-50%, -50%); color: #fff; }
.rd-track.none { background: repeating-linear-gradient(-45deg, var(--sand) 0 6px, var(--paper) 6px 12px); border: 1px dashed var(--line-2); }
.rd-track.none b { left: 50%; right: auto; transform: translate(-50%, -50%); color: var(--soil-3); font-weight: 500; }
.rd-amt { text-align: right; color: var(--soil-2); font-size: 12.5px; }
.rd-donut { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 14px; align-items: center; }
.rd-donut svg path { stroke: var(--paper); stroke-width: 2; transition: opacity .2s; }
.rd-donut svg:hover path { opacity: .55; } .rd-donut svg path:hover { opacity: 1; }
.rd-dt { font-size: 11px; fill: var(--soil-2); } .rd-dv { font-size: 18px; font-weight: 700; fill: var(--soil); font-family: var(--f-body); }
.rd-donut ul { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.rd-donut li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 3px 0; }
.rd-donut li i { width: 10px; height: 10px; border-radius: 3px; }
.rd-chips { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.rd-chips span { border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; font-size: 11.5px; letter-spacing: .06em; color: var(--soil-2); }
.rd-chips b { font-size: 17px; letter-spacing: 0; color: var(--soil); margin-left: 4px; }
.rd-chips b.ok { color: var(--ok); } .rd-chips b.bad { color: var(--bad); }
.rd-leg { display: flex; gap: 16px; justify-content: center; font-size: 12.5px; color: var(--soil-2); margin-bottom: 6px; }
.rd-leg span { display: inline-flex; align-items: center; gap: 6px; }
.rd-leg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rd-leg i.ln { height: 2px; width: 16px; border-radius: 0; background: var(--soil); }
.rd-svg { width: 100%; height: auto; display: block; overflow: visible; }
.rd-grid { stroke: var(--line); stroke-width: 1; }
.rd-ax { font-size: 11px; fill: var(--soil-2); font-family: var(--f-mono); }
.rd-bar { fill: var(--wine); }
.rd-tline { fill: none; stroke: var(--soil); stroke-width: 2; }
.rd-tdot { fill: var(--soil); stroke: var(--paper); stroke-width: 2; }
.rd-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rd-cross { stroke: var(--soil-3); stroke-dasharray: 3 3; }
.rd-ring { stroke: var(--paper); stroke-width: 2; }
.rd-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rd-tbl th { text-align: left; font-size: 11.5px; letter-spacing: .06em; color: var(--soil-2); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.rd-tbl td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rd-tbl .r { text-align: right; }
.rd-rank { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--sand); font-size: 12px; font-weight: 600; }
.rd-rank.r1 { background: #F4E2B8; color: #7A5410; } .rd-rank.r2 { background: #E6E1DC; } .rd-rank.r3 { background: #F2D9C4; color: #7A3E14; }
.rd-tip { position: fixed; z-index: 400; pointer-events: none; background: var(--soil); color: #fff; border-radius: 10px; padding: 9px 12px; font-size: 12.5px; line-height: 1.55; box-shadow: var(--sh-2); max-width: 260px; }
.rd-tip .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.rd-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rd-mini b { display: block; font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--soil); }
.rd-spark { width: 100%; height: 54px; margin: 10px 0 4px; }
@media (max-width: 1100px) { .rd-grid2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .rd-filters { grid-template-columns: 1fr; } .rd-donut { grid-template-columns: 120px minmax(0,1fr); } }
