/* TeamHub — slate rail, amber hex-nut mark, chat on a parts-pattern wallpaper */
:root {
  --rail: #1B2A3A;
  --rail-ink: #93A4B6;
  --rail-hover: rgba(255,255,255,.06);
  --amber: #F2A900;
  --amber-ink: #3A2A00;
  --bg: #EEF1F4;
  --panel: #FFFFFF;
  --panel-2: #F6F8FA;
  --field: #EFF2F5;
  --ink: #17212B;
  --ink-2: #3D4B59;
  --muted: #6E7D8C;
  --line: #DFE5EA;
  --blue: #2A6FD1;
  --blue-ink: #FFFFFF;
  --blue-soft: rgba(42,111,209,.12);
  --sel: #1B2A3A;
  --sel-ink: #FFFFFF;
  --sel-muted: #A9B8C8;
  --green: #1C8B57;
  --green-soft: rgba(28,139,87,.12);
  --red: #C73A2F;
  --red-soft: rgba(199,58,47,.1);
  --wall-bg: #D5DEE5;
  --bubble: #FFFFFF;
  --bubble-own: #DDEBFF;
  --bubble-shadow: 0 1px 1px rgba(20,40,60,.13);
  --meta: #7A8896;
  --meta-own: #5A7EA8;
  --tick-read: #2A6FD1;
  --pill: rgba(27,42,58,.42);
  --shadow-lg: 0 18px 50px rgba(15,30,45,.22);
  --radius: 12px;
  --font: "Onest", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --rail: #0E1823;
  --rail-ink: #7F91A4;
  --bg: #121C26;
  --panel: #18232E;
  --panel-2: #1D2935;
  --field: #22303D;
  --ink: #E5ECF2;
  --ink-2: #C3CFDA;
  --muted: #8899AA;
  --line: #2A3A48;
  --blue: #4C8FE6;
  --blue-soft: rgba(76,143,230,.16);
  --sel: #2B4A6B;
  --sel-muted: #B4C6D9;
  --green: #3CB37B;
  --green-soft: rgba(60,179,123,.15);
  --red: #E26357;
  --red-soft: rgba(226,99,87,.14);
  --wall-bg: #0F1A24;
  --bubble: #1F2D3A;
  --bubble-own: #2B5278;
  --bubble-shadow: 0 1px 1px rgba(0,0,0,.25);
  --meta: #8597A8;
  --meta-own: #A6C3E2;
  --tick-read: #8CC4FF;
  --pill: rgba(0,0,0,.4);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.4; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ico { display: inline-flex; flex: none; }
.ico svg { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- auth screens ---------- */
.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: var(--rail) var(--wall-dark) repeat;
}
.auth-card {
  width: min(400px, 100%); background: var(--panel); border-radius: 18px; padding: 28px 28px 24px;
  box-shadow: var(--shadow-lg);
}
.auth-mark { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-mark .logo { color: var(--amber); }
.auth-mark .logo svg { --hole: var(--panel); }
.auth-mark b { font-size: 19px; letter-spacing: -.01em; }
.auth h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.02em; }
.auth p { margin: 0 0 18px; color: var(--muted); }
.auth form { display: grid; gap: 12px; }
.auth .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth .btn { height: 44px; margin-top: 6px; }
.form-error { color: var(--red); font-size: 14px; min-height: 0; }
.form-error:empty { display: none; }

/* ---------- fields & buttons ---------- */
.field { display: grid; gap: 5px; }
.field > span { font-size: 13px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px;
  background: var(--panel); outline: none; transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.select { appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: 10px; font-weight: 600; white-space: nowrap; transition: background .12s, opacity .12s;
}
.btn.primary { background: var(--blue); color: var(--blue-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.soft { background: var(--field); }
.btn.soft:hover { background: var(--line); }
.btn.ghost:hover { background: var(--field); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--muted); flex: none;
}
.icon-btn:hover { background: var(--field); color: var(--ink); }
.check-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 12px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + i { background: var(--blue); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- shell ---------- */
#app { display: grid; grid-template-columns: 76px 1fr; height: 100dvh; }
.rail {
  background: var(--rail); display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 12px; gap: 4px; z-index: 5;
}
.rail .logo { color: var(--amber); margin-bottom: 14px; }
.rail .logo svg { --hole: var(--rail); }
.nav-btn {
  position: relative; width: 62px; padding: 8px 0 6px; border-radius: 12px; color: var(--rail-ink);
  display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 500;
}
.nav-btn:hover { background: var(--rail-hover); color: var(--rail-fg, #DCE5EE); }
.nav-btn.active { color: var(--rail-fg, #fff); background: var(--rail-active, rgba(255,255,255,.09)); }
.nav-btn.active::before {
  content: ""; position: absolute; left: -7px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--amber);
}
.nav-badge {
  position: absolute; top: 3px; right: 9px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--amber); color: var(--amber-ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.rail .spacer { flex: 1; }
.me-btn { border-radius: 50%; padding: 2px; }
.me-btn:hover { box-shadow: 0 0 0 2px var(--rail-ink); }
#main { min-width: 0; min-height: 0; display: flex; position: relative; }
.conn-banner {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 90; background: var(--rail); color: var(--rail-fg, #fff);
  padding: 7px 14px; border-radius: 18px; font-size: 13.5px; box-shadow: var(--shadow-lg);
}

/* ---------- avatars ---------- */
.avatar {
  position: relative; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  color: #fff; font-weight: 600; letter-spacing: .01em; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar .dot {
  position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; min-width: 10px; min-height: 10px; border-radius: 50%;
  background: #34C06F; box-shadow: 0 0 0 2px var(--dot-ring, var(--panel));
}
.avatar.group-mark { background: var(--rail) !important; color: var(--amber); }
.avatar.group-mark svg { --hole: var(--rail); }

/* ---------- chat ---------- */
.chat-view { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; flex: 1; min-width: 0; min-height: 0; }
.chat-list-pane { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.pane-head { height: 60px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.search { position: relative; flex: 1; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 40px; border-radius: 20px; border: 1px solid transparent; background: var(--field);
  padding: 0 14px 0 38px; outline: none;
}
.search input:focus { border-color: var(--blue); background: var(--panel); }
.chat-items { flex: 1; overflow-y: auto; padding: 2px 6px 10px; }
.list-label { font-size: 13px; color: var(--muted); padding: 10px 12px 4px; }
.chat-item {
  width: 100%; display: grid; grid-template-columns: 52px 1fr; column-gap: 10px; align-items: center;
  padding: 7px 8px; border-radius: 12px; text-align: left; --dot-ring: var(--panel);
}
.chat-item:hover { background: var(--panel-2); }
.chat-item.active { background: var(--sel); color: var(--sel-ink); --dot-ring: var(--sel); }
.chat-item .ci-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.chat-item .ci-name { font-weight: 600; flex: 1; min-width: 0; }
.chat-item .ci-time { font-size: 12.5px; color: var(--muted); flex: none; }
.chat-item .ci-bottom { display: flex; align-items: center; gap: 8px; margin-top: 1px; min-width: 0; }
.chat-item .ci-prev { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; }
.chat-item .ci-prev b { font-weight: 500; color: var(--ink-2); }
.chat-item .ci-prev .typing { color: var(--blue); }
.chat-item.active .ci-time, .chat-item.active .ci-prev, .chat-item.active .ci-prev b { color: var(--sel-muted); }
.chat-item.active .ci-prev .typing { color: #fff; }
.chat-item .ci-main { min-width: 0; }
.unread {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--blue); color: #fff;
  font-size: 12.5px; font-weight: 600; display: inline-grid; place-items: center;
}
.chat-item.active .unread { background: #fff; color: var(--sel); }
.tick { color: var(--blue); display: inline-flex; }
.chat-item.active .tick { color: #fff; }
.empty-note { padding: 28px 18px; color: var(--muted); text-align: center; }

.conv, .lp-wall, .thread-body {
  background-color: var(--wall-bg); background-image: var(--wall-img, var(--wall-light)); background-size: var(--wall-size, auto);
  background-repeat: var(--wall-repeat, repeat); background-position: center;
}
.conv { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.conv-empty { margin: auto; background: var(--pill); color: #fff; padding: 6px 14px; border-radius: 16px; font-size: 14px; }
.conv-head {
  height: 60px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); z-index: 2;
}
.conv-head .back { display: none; }
.conv-head .who { min-width: 0; flex: 1; cursor: pointer; }
.conv-head .who b { display: block; font-weight: 600; }
.conv-head .who small { display: block; font-size: 13.5px; color: var(--muted); }
.conv-head .who small.on { color: var(--blue); }
.msgs { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 0 6px; overscroll-behavior: contain; }
.msgs-inner { max-width: 780px; margin: 0 auto; padding: 0 14px; display: flex; flex-direction: column; }
.day-sep, .sys-msg, .unread-sep {
  align-self: center; margin: 10px 0 8px; padding: 3px 11px; border-radius: 13px; background: var(--pill); color: #fff;
  font-size: 13px; font-weight: 500; position: sticky; top: 4px; z-index: 1;
}
.sys-msg { position: static; font-weight: 400; }
.unread-sep { position: static; align-self: stretch; text-align: center; border-radius: 0; background: rgba(255,255,255,.55); color: var(--ink-2); margin: 8px -14px; }
:root[data-theme="dark"] .unread-sep { background: rgba(0,0,0,.25); color: var(--ink-2); }
.msg-row { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; }
.msg-row.first { margin-top: 7px; }
.msg-row.own { justify-content: flex-end; }
.msg-row .av-slot { width: 36px; flex: none; align-self: flex-end; }
.bubble {
  position: relative; max-width: min(560px, 82%); background: var(--bubble); border-radius: 16px; padding: 6px 10px 6px 11px;
  box-shadow: var(--bubble-shadow); overflow-wrap: anywhere; min-width: 64px;
}
.own .bubble { background: var(--bubble-own); }
.msg-row.last:not(.own) .bubble { border-bottom-left-radius: 5px; }
.msg-row.last.own .bubble { border-bottom-right-radius: 5px; }
.bubble.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--amber); } 100% { box-shadow: var(--bubble-shadow); } }
.sender { font-size: 13.5px; font-weight: 600; margin-bottom: 1px; }
.btext { white-space: pre-wrap; }
.btext a { word-break: break-all; }
.meta {
  float: right; position: relative; top: 7px; margin: -4px -2px 0 10px; display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; color: var(--meta); line-height: 1; height: 16px; user-select: none;
}
.own .meta { color: var(--meta-own); }
.meta .tick { color: var(--meta-own); }
.meta .tick.read { color: var(--tick-read); }
.meta.on-media { position: absolute; top: auto; right: 8px; bottom: 8px; margin: 0; padding: 3px 7px; height: auto; border-radius: 10px; background: rgba(0,0,0,.45); color: #fff; float: none; }
.meta.on-media .tick, .meta.on-media .tick.read { color: #fff; }
.bubble.media-only { padding: 3px; }
.bubble.media-only .sender { padding: 3px 7px 2px; }
.media-grid { display: grid; gap: 3px; margin: 2px -6px 4px -7px; border-radius: 12px; overflow: hidden; }
.bubble.media-only .media-grid { margin: 0; }
.media-grid.n2, .media-grid.n3, .media-grid.n4 { grid-template-columns: 1fr 1fr; }
.media-grid.many { grid-template-columns: repeat(6, 1fr); }
.media-grid img { display: block; width: 100%; height: auto; max-height: 380px; object-fit: cover; cursor: zoom-in; background: var(--field); }
.media-grid.n2 img, .media-grid.n3 img, .media-grid.n4 img { height: 170px; }
.media-grid.n3 img:first-child { grid-column: 1 / -1; height: 230px; }
.media-grid.many img { height: 128px; }
.mention { color: var(--blue); font-weight: 600; cursor: pointer; }
.mention.me { background: rgba(242,169,0,.25); color: inherit; border-radius: 4px; padding: 0 3px; }
.mention-pop {
  position: absolute; left: 0; right: 56px; bottom: calc(100% + 6px); z-index: 12; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 300px; overflow-y: auto;
}
.mention-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; text-align: left; min-width: 0; }
.mention-item.on, .mention-item:hover { background: var(--field); }
.mention-item small { margin-left: auto; color: var(--muted); font-size: 12.5px; max-width: 45%; }
.composer-inner, .comment-input { position: relative; }
.comment-input .mention-pop { right: 50px; }
.unread.at { padding: 0; width: 22px; font-weight: 700; }
.file-att { display: flex; align-items: center; gap: 10px; padding: 3px 0 4px; text-decoration: none; color: inherit; min-width: 0; }
.file-att .fi { width: 42px; height: 42px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; }
.file-att .fn { font-weight: 500; }
.file-att small { color: var(--meta); font-size: 13px; }
.own .file-att small { color: var(--meta-own); }
.reply-quote {
  display: block; width: 100%; text-align: left; border-left: 3px solid var(--qc, var(--blue)); background: var(--qbg, var(--blue-soft));
  border-radius: 6px; padding: 3px 8px 4px; margin: 2px 0 5px; font-size: 13.5px; line-height: 1.3; min-width: 0;
}
.reply-quote b { display: block; color: var(--qc, var(--blue)); font-weight: 600; }
.reply-quote span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.msg-tools {
  align-self: center; opacity: 0; display: flex; gap: 2px; transition: opacity .1s;
}
.msg-row:hover .msg-tools { opacity: 1; }
.msg-tools .icon-btn { width: 30px; height: 30px; background: var(--panel); box-shadow: var(--bubble-shadow); color: var(--muted); }
.typing-dots { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .2s; }
.typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.composer { flex: none; padding: 6px 14px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.composer-inner { max-width: 780px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; }
.input-box { flex: 1; min-width: 0; background: var(--panel); border-radius: 22px; box-shadow: var(--bubble-shadow); display: flex; flex-direction: column; overflow: hidden; }
.compose-bar { display: flex; align-items: center; gap: 10px; padding: 8px 8px 0 14px; color: var(--blue); }
.compose-bar .grow { border-left: 2px solid var(--blue); padding-left: 9px; font-size: 13.5px; line-height: 1.3; }
.compose-bar .grow b { display: block; }
.compose-bar .grow span { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-bar .icon-btn { width: 30px; height: 30px; }
.att-chips { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; padding: 8px 10px 0; max-height: 170px; overflow-y: auto; }
.att-thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--field); flex: none; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-thumb .icon-btn { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; background: rgba(0,0,0,.55); color: #fff; }
.att-thumb .bar { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.45); overflow: hidden; }
.att-thumb .bar i { display: block; height: 100%; background: #fff; transition: width .15s; }
.att-thumb.err { outline: 2px solid var(--red); outline-offset: -2px; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; background: var(--field); border-radius: 14px; padding: 4px 4px 4px 10px; font-size: 13px; }
.att-chip .icon-btn { width: 22px; height: 22px; }
.att-chip progress { width: 44px; height: 4px; }
.att-chip.err { color: var(--red); }
.input-row { display: flex; align-items: flex-end; }
.input-row .icon-btn { margin: 4px; }
.input-row textarea {
  flex: 1; min-width: 0; border: 0; outline: none; resize: none; background: transparent; padding: 12px 4px 12px 2px;
  max-height: 200px; line-height: 1.4; font-size: 15px;
}
.send-btn { width: 48px; height: 48px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; box-shadow: var(--bubble-shadow); }
.send-btn:disabled { opacity: .6; }
.fab-down {
  position: absolute; right: 22px; bottom: 86px; width: 46px; height: 46px; border-radius: 50%; background: var(--panel);
  color: var(--muted); box-shadow: 0 2px 6px rgba(0,0,0,.18); display: grid; place-items: center; z-index: 3;
}
.fab-down .unread { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); }
.drop-zone {
  position: absolute; inset: 70px 18px 18px; border: 2px dashed var(--blue); border-radius: 18px; background: rgba(255,255,255,.75);
  display: grid; place-items: center; font-size: 17px; font-weight: 600; color: var(--blue); z-index: 6; pointer-events: none;
}
:root[data-theme="dark"] .drop-zone { background: rgba(14,24,35,.8); }

/* ---------- menus, modals, drawers, toasts ---------- */
.menu {
  position: fixed; z-index: 80; min-width: 190px; background: var(--panel); border-radius: 12px; padding: 6px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.menu button, .menu .menu-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; text-align: left; }
.menu button:hover { background: var(--field); }
.menu button.danger { color: var(--red); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.menu .menu-head { padding: 8px 12px 10px; display: flex; gap: 10px; align-items: center; }
.menu .menu-head small { display: block; color: var(--muted); }
.modal-back { position: fixed; inset: 0; z-index: 70; background: rgba(8,16,24,.45); display: grid; place-items: center; padding: 16px; }
.modal {
  width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--panel); border-radius: 18px;
  padding: 20px; box-shadow: var(--shadow-lg);
}
.modal.wide { width: min(620px, 100%); }
.modal h2 { margin: 0 0 14px; font-size: 19px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.modal h2 .grow { flex: 1; }
.modal .body { display: grid; gap: 12px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.pick-list { max-height: 340px; overflow: auto; margin: 0 -8px; }
.pick-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 10px; text-align: left; }
.pick-item:hover { background: var(--panel-2); }
.pick-item input { width: 18px; height: 18px; accent-color: var(--blue); }
.pick-item small { display: block; color: var(--muted); font-size: 13px; }
.drawer-back { position: fixed; inset: 0; z-index: 40; background: rgba(8,16,24,.3); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(540px, 100vw); background: var(--panel);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .16s ease-out;
}
@keyframes slidein { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; }
.toast-wrap { position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 95; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--rail); color: var(--rail-fg, #fff); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; max-width: 90vw; pointer-events: auto; }
.toast.err { background: var(--red); }
.lightbox { position: fixed; inset: 0; z-index: 99; background: rgba(5,10,15,.9); display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 6px; }
.lightbox .lb-bar { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; }
.lightbox .icon-btn { color: #fff; background: rgba(255,255,255,.1); }
.lightbox .lb-prev, .lightbox .lb-next { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; }
.lightbox .lb-prev { left: 16px; }
.lightbox .lb-next { right: 16px; }
.lightbox .lb-count { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; background: rgba(0,0,0,.45); padding: 3px 11px; border-radius: 12px; }
.lightbox .lb-count:empty { display: none; }

/* ---------- page header (tasks, team) ---------- */
.page { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.page-head { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 18px 24px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0 8px 0 0; font-size: 22px; letter-spacing: -.02em; }
.page-head .search { flex: 0 1 280px; }
.page-head .push { margin-left: auto; display: flex; gap: 8px; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--field); border-radius: 10px; padding: 3px; }
.seg button { height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.page-body { flex: 1; overflow: auto; padding: 18px 24px 40px; }

/* ---------- tasks ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 16px; align-items: start; min-width: 820px; }
.col { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px; min-height: 160px; }
:root[data-theme="dark"] .col { background: #15202A; }
.col.drag-over { border-color: var(--blue); background: var(--blue-soft); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 10px; font-weight: 600; min-height: 46px; }
.col-head .count { color: var(--muted); font-weight: 500; }
.col-head .bar { width: 10px; height: 10px; border-radius: 3px; }
.col-head .icon-btn { margin-left: auto; width: 30px; height: 30px; }
.tcard {
  display: block; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; cursor: grab;
}
.tcard:hover { border-color: #B9C5D0; }
:root[data-theme="dark"] .tcard:hover { border-color: #3B4C5C; }
.tcard.dragging { opacity: .5; }
.tcard .tc-title { display: flex; gap: 8px; font-weight: 500; }
.prio { display: inline-flex; flex: none; margin-top: 1px; }
.prio.urgent { color: var(--red); }
.prio.high { color: #D99500; }
.tr-title .prio { margin-right: 6px; vertical-align: -3px; }
/* traffic-light priority: red urgent, yellow important, green normal */
:root { --p-urgent: #D63B2F; --p-high: #F2A900; --p-normal: #2FA36B; }
.pdot { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; }
.pdot.urgent { background: var(--p-urgent); }
.pdot.high { background: var(--p-high); }
.pdot.normal { background: var(--p-normal); }
.seg button .pdot { width: 10px; height: 10px; }
.ptiles { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)) auto; gap: 10px; margin-bottom: 16px; align-items: stretch; }
.ptile {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-left-width: 5px; min-width: 0;
}
.ptile.urgent { border-left-color: var(--p-urgent); }
.ptile.high { border-left-color: var(--p-high); }
.ptile.normal { border-left-color: var(--p-normal); }
.ptile:hover { border-color: #B9C5D0; }
.ptile.urgent:hover { border-left-color: var(--p-urgent); }
.ptile.high:hover { border-left-color: var(--p-high); }
.ptile.normal:hover { border-left-color: var(--p-normal); }
.ptile .pdot { width: 16px; height: 16px; }
.ptile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ptile-label { font-weight: 600; }
.ptile small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptile b { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.ptile.on { color: #fff; border-color: transparent; }
.ptile.on small { color: rgba(255,255,255,.85); }
.ptile.on .pdot { background: #fff; }
.ptile.urgent.on { background: var(--p-urgent); }
.ptile.normal.on { background: var(--p-normal); }
.ptile.high.on { background: var(--p-high); color: #3A2A00; }
.ptile.high.on small { color: rgba(58,42,0,.75); }
.ptile.high.on .pdot { background: #3A2A00; }
.ptiles-all { align-self: center; justify-self: start; }
.ptile small.over { color: var(--red); font-weight: 600; }
.ptile.on small.over { color: #fff; }
.ptile.high.on small.over { color: #3A2A00; }
.tc-meta .avatar, .trow .avatar { display: inline-grid; }
.tcard, .trow { border-left-width: 4px; }
.tcard.p-urgent, .trow.p-urgent { border-left-color: var(--p-urgent); }
.tcard.p-high, .trow.p-high { border-left-color: var(--p-high); }
.tcard.p-normal, .trow.p-normal { border-left-color: var(--p-normal); }
.tcard.done, .trow.done { border-left-color: var(--line); }
.watcher { display: inline-flex; align-items: center; gap: 6px; background: var(--field); border-radius: 15px; padding: 2px 10px 2px 2px; font-size: 13.5px; max-width: 170px; }
.tcard.done .tc-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.tc-meta { display: flex; align-items: center; gap: 10px; margin-top: 9px; font-size: 13px; color: var(--muted); }
.tc-meta .grow { flex: 1; }
.tc-meta span { display: inline-flex; align-items: center; gap: 4px; }
.due { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 8px; background: var(--field); color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.due.over { background: var(--red-soft); color: var(--red); }
.due.today { background: rgba(242,169,0,.18); color: #8A5A00; }
:root[data-theme="dark"] .due.today { color: #F5C451; }
.due.ok { background: var(--green-soft); color: var(--green); }
.tlist { max-width: 900px; }
.tgroup h3 { font-size: 14px; margin: 18px 0 6px; color: var(--muted); font-weight: 600; display: flex; gap: 8px; }
.tgroup h3.over { color: var(--red); }
.trow {
  display: grid; grid-template-columns: 28px 1fr auto auto 32px; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer;
}
.trow:hover { border-color: #B9C5D0; }
.trow.done .tr-title { color: var(--muted); text-decoration: line-through; }
.round-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #A8B5C1; display: grid; place-items: center; color: transparent; flex: none;
}
.round-check:hover { border-color: var(--green); color: var(--green); }
.round-check.on { background: var(--green); border-color: var(--green); color: #fff; }
.task-title-input { width: 100%; border: 0; outline: none; background: transparent; font-size: 21px; font-weight: 600; letter-spacing: -.01em; padding: 4px 0; border-radius: 6px; }
.task-title-input:focus { box-shadow: 0 0 0 3px var(--blue-soft); }
.props { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; align-items: center; margin: 14px 0 20px; }
.props > span { color: var(--muted); font-size: 14px; }
.props .inline { display: flex; gap: 8px; align-items: center; }
.status-pill { width: auto; height: 32px; border-radius: 16px; padding: 0 30px 0 14px; font-weight: 600; border: 0; }
.status-pill.todo { background: var(--field); }
.status-pill.doing { background: rgba(42,111,209,.14); color: var(--blue); }
.status-pill.done { background: var(--green-soft); color: var(--green); }
.section-title { font-size: 15px; font-weight: 600; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title small { color: var(--muted); font-weight: 400; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-radius: 8px; }
.check-item:hover { background: var(--panel-2); }
.check-item.done span { color: var(--muted); text-decoration: line-through; }
.check-item .icon-btn { width: 28px; height: 28px; opacity: 0; }
.check-item:hover .icon-btn { opacity: 1; }
.progress { height: 6px; border-radius: 3px; background: var(--field); overflow: hidden; margin-bottom: 8px; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment .c-body { background: var(--panel-2); border-radius: 4px 14px 14px 14px; padding: 7px 12px; min-width: 0; }
.comment .c-body b { font-size: 13.5px; }
.comment .c-body small { color: var(--muted); margin-left: 6px; font-size: 12.5px; }
.comment .c-body div { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-input { display: flex; gap: 8px; align-items: flex-end; }
.comment-input textarea { min-height: 42px; height: 42px; }
.files-list { display: grid; gap: 6px; }
.task-foot { display: flex; align-items: center; gap: 10px; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.task-foot .btn { margin-left: auto; }

/* ---------- team ---------- */
.stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.stat {
  display: inline-flex; align-items: baseline; gap: 8px; height: 38px; padding: 0 14px; border-radius: 19px;
  background: var(--panel); border: 1px solid var(--line); font-weight: 500;
}
.stat b { font-size: 17px; font-variant-numeric: tabular-nums; }
.stat.on { background: var(--sel); border-color: var(--sel); color: #fff; }
.stat.warn b { color: #B87A00; }
.stat.on.warn b { color: var(--amber); }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.badge-card {
  position: relative; display: grid; grid-template-columns: 76px 1fr; gap: 0 14px; text-align: left; width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 0; overflow: hidden;
}
.badge-card:hover { border-color: #B9C5D0; }
:root[data-theme="dark"] .badge-card:hover { border-color: #3B4C5C; }
.badge-card.off { opacity: .62; }
.badge-card .avatar { border-radius: 14px; }
.badge-card .avatar img { border-radius: 14px; }
.badge-card .bc-name { font-weight: 600; font-size: 16px; line-height: 1.25; padding-right: 34px; }
.badge-card .bc-pos { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.status-tag { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 13px; font-weight: 600; }
.status-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-tag.active { color: var(--green); }
.role-chip { display: inline-block; margin: 7px 0 0 10px; padding: 1px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 600; background: var(--blue-soft); color: var(--blue); vertical-align: 1px; }
.role-chip.owner { background: rgba(242,169,0,.18); color: #8A5A00; }
:root[data-theme="dark"] .role-chip.owner { color: #F5C451; }
.status-tag.terminated { color: var(--red); }
.badge-card .bc-sched { grid-column: 1 / -1; font-size: 13.5px; color: var(--ink-2); margin-top: 12px; }
.badge-card .bc-foot {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; margin: 12px -14px 0; padding: 9px 14px;
  background: var(--panel-2); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.badge-card .bc-foot span { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.badge-card .bc-foot .docs-ok { color: var(--green); }
.badge-card .bc-foot .docs-miss { color: #B87A00; }
:root[data-theme="dark"] .badge-card .bc-foot .docs-miss { color: #F5C451; }
.badge-card .write { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; color: var(--blue); }
.profile-top { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.profile-top .avatar { border-radius: 20px; }
.profile-top .avatar img { border-radius: 20px; }
.profile-top h2 { margin: 0; font-size: 21px; letter-spacing: -.01em; }
.profile-top .muted { margin-top: 2px; }
.photo-btn { position: relative; border-radius: 20px; }
.photo-btn .cam { position: absolute; right: -4px; bottom: -4px; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--panel); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.private-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); background: var(--panel-2); border-radius: 10px; padding: 8px 12px; margin: 6px 0 4px; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; }
.doc-row .grow small { display: block; color: var(--muted); font-size: 12.5px; }
.doc-row .state { font-size: 13px; font-weight: 600; }
.doc-row .state.ok { color: var(--green); }
.doc-row .state.ext { color: var(--blue); }
.doc-row .state.miss { color: #B87A00; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.hist-row { display: grid; grid-template-columns: 130px 110px 1fr 32px; gap: 8px; margin-bottom: 6px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail {
    order: 2; flex-direction: row; justify-content: space-around; padding: 4px 8px; padding-bottom: max(4px, env(safe-area-inset-bottom));
    gap: 0; border-top: 1px solid rgba(255,255,255,.06);
  }
  .rail .logo, .rail .spacer { display: none; }
  .nav-btn { width: auto; flex: 1; max-width: 96px; }
  .nav-btn.active::before { left: 30%; right: 30%; top: -4px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .me-btn { margin: 0 8px; }
  .chat-view { grid-template-columns: 1fr; }
  .chat-view .conv { display: none; }
  .chat-view.show-conv .chat-list-pane { display: none; }
  .chat-view.show-conv .conv { display: flex; }
  #app.in-conv { grid-template-rows: 1fr 0; }
  #app.in-conv .rail { display: none; }
  .conv-head .back { display: inline-grid; }
  .conv-head { padding-left: 4px; padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); }
  .pane-head, .page-head { padding-top: max(10px, env(safe-area-inset-top)); }
  .pane-head { height: auto; min-height: 60px; }
  .msg-tools { display: none; }
  .bubble { max-width: 86%; }
  .page-head { padding: 12px 14px 10px; }
  .page-head h1 { font-size: 20px; }
  .page-head .search { flex: 1 1 100%; order: 5; }
  .page-head .push { margin-left: auto; }
  .page-head .push .btn span.lbl { display: none; }
  .page-body { padding: 14px 14px 30px; }
  .board { min-width: 0; grid-template-columns: repeat(3, 84vw); overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px; padding: 0 14px; }
  .col { scroll-snap-align: center; }
  .trow { grid-template-columns: 28px 1fr auto; }
  .ptiles { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ptile { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; border-left-width: 1px; border-top-width: 5px; }
  .ptile.urgent { border-top-color: var(--p-urgent); } .ptile.high { border-top-color: var(--p-high); } .ptile.normal { border-top-color: var(--p-normal); }
  .ptile.urgent, .ptile.high, .ptile.normal, .ptile.urgent:hover, .ptile.high:hover, .ptile.normal:hover { border-left-color: var(--line); }
  .ptile .pdot { display: none; }
  .ptile b { font-size: 22px; order: -1; }
  .ptile small { display: none; }
  .ptiles-all { grid-column: 1 / -1; justify-self: start; }
  .trow .tr-who, .trow .tr-more { display: none; }
  .drawer { width: 100vw; }
  .drawer-head { padding-top: max(12px, env(safe-area-inset-top)); }
  .props { grid-template-columns: 100px 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .hist-row { grid-template-columns: 1fr 1fr 32px; }
  .hist-row .h-note { grid-column: 1 / 3; }
  .fab-down { bottom: 80px; right: 14px; }
  .composer { padding: 6px 8px 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}

/* ---------- 2.0: companies, chat extras, files, departments, disposal ---------- */
.rail .logo { position: relative; border-radius: 12px; padding: 4px; }
.rail .logo:hover { background: var(--rail-hover); }
.logo-dot { position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px var(--rail); }
.company-switch { display: flex; align-items: center; gap: 6px; padding: 12px 16px 0; font-size: 16px; text-align: left; min-width: 0; color: var(--ink); }
.company-switch b { min-width: 0; }
.company-switch:disabled { cursor: default; }
.company-switch:not(:disabled):hover { color: var(--blue); }
.menu-label { padding: 6px 12px 4px; font-size: 12.5px; color: var(--muted); }
.menu .company-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px; text-align: left; }
.menu .company-item:hover { background: var(--field); }
.menu .company-item.on { font-weight: 600; }
.menu .company-item .ico { color: var(--blue); }

.react-bar { display: flex; gap: 2px; padding: 2px 4px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .react-bar button.react-pick { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 20px; border-radius: 50%; }
.menu .react-bar button.react-pick:hover { background: var(--field); transform: scale(1.15); }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; clear: both; }
.reaction { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--blue-soft); font-size: 14px; }
.reaction b { font-size: 12.5px; color: var(--blue); }
.reaction.mine { background: var(--blue); }
.reaction.mine b { color: #fff; }
.own .reaction { background: rgba(42,111,209,.16); }
.own .reaction.mine { background: var(--blue); }

.emoji-btn { margin-left: 0 !important; }
.emoji-pop {
  position: absolute; right: 56px; bottom: calc(100% + 6px); z-index: 12; width: min(360px, calc(100vw - 24px)); background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
}
.emoji-tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); }
.emoji-tab { width: 36px; height: 32px; border-radius: 8px; font-size: 18px; display: grid; place-items: center; color: var(--muted); }
.emoji-tab.on { background: var(--field); color: var(--ink); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; max-height: 250px; overflow-y: auto; }
.emoji { height: 38px; border-radius: 8px; font-size: 23px; line-height: 1; }
.emoji:hover { background: var(--field); }

.task-bubble { width: min(440px, 86%); max-width: min(440px, 86%); }
.tk-who { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.task-card { border-left: 4px solid var(--p-normal); background: var(--panel-2); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
:root[data-theme="dark"] .task-card { background: rgba(0,0,0,.18); }
.own .task-card { background: rgba(255,255,255,.55); }
:root[data-theme="dark"] .own .task-card { background: rgba(0,0,0,.18); }
.task-card.p-urgent { border-left-color: var(--p-urgent); }
.task-card.p-high { border-left-color: var(--p-high); }
.task-card:hover .tk-head b { text-decoration: underline; }
.tk-head { display: flex; gap: 8px; align-items: flex-start; color: var(--blue); margin-bottom: 6px; }
.tk-head b { color: var(--ink); }
.tk-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 13.5px; }
.tk-grid dt { color: var(--muted); }
.tk-grid dd { margin: 0; min-width: 0; }
.tk-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tk-status { font-weight: 600; }
.tk-status.doing { color: var(--blue); }
.tk-status.done { color: var(--green); }
.head-task { height: 34px; padding: 0 12px; }

.file-att-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.file-att-row .file-att { flex: 1; min-width: 0; }
.save-drive { width: 32px; height: 32px; opacity: .55; }
.file-att-row:hover .save-drive { opacity: 1; }
.fi { border-radius: 10px !important; flex: none; display: grid; place-items: center; color: #fff; background: #7A8896; }
.fi b { font-size: 10.5px; letter-spacing: .02em; }
.fi.kind-pdf { background: #D9483B; }
.fi.kind-xls { background: #1E8E4E; }
.fi.kind-doc { background: #2F65C8; }
.fi.kind-ppt { background: #D2692D; }
.fi.kind-zip { background: #8A6A3D; }
.fi.kind-img { background: #8D5FD3; }
.fi.kind-vid { background: #C7417A; }
.fi.kind-aud { background: #2A9A9C; }
.fi.kind-txt { background: #6E7D8C; }
.pick-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.photo-btn.round, .photo-btn.round .avatar, .photo-btn.round img { border-radius: 50% !important; }
.pick-item.on { background: var(--blue-soft); color: var(--blue); }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
.crumb { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.crumb:hover { background: var(--field); }
.crumb:last-child { color: var(--ink); font-weight: 600; }
.crumb-sep { color: var(--muted); }
.modal .crumbs { margin-bottom: 4px; }

.dept-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.dept-chip-wrap { display: inline-flex; align-items: center; }
.dept-chip { --dc: var(--muted); display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--panel); border: 1px solid var(--line); font-weight: 500; }
.dept-chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dc); }
.dept-chip small { color: var(--muted); }
.dept-chip.on { border-color: var(--dc); box-shadow: inset 0 0 0 1px var(--dc); }
.dept-chip.on:first-child { background: var(--sel); color: #fff; border-color: var(--sel); box-shadow: none; }
.dept-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.dept-tag { --dc: var(--muted); font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 10px; color: var(--dc); background: color-mix(in srgb, var(--dc) 13%, transparent); }
.color-row { display: flex; gap: 8px; }
.color-dot { width: 28px; height: 28px; border-radius: 50%; }
.color-dot.on { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--ink); }
.dept-select { width: auto; height: 38px; }
.emp-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.restore { color: var(--green); }
.role-chip.chief { background: rgba(141,116,214,.16); color: #6B4FC4; }
:root[data-theme="dark"] .role-chip.chief { color: #B9A6F0; }

.crumbs-bar { flex: none; padding: 8px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.upload-progress { flex: none; height: 4px; background: var(--field); }
.upload-progress i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.page.dropping .page-body { outline: 2px dashed var(--blue); outline-offset: -10px; background: var(--blue-soft); }
.drive-list { max-width: 980px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.drive-row { display: flex; align-items: center; gap: 14px; padding: 9px 12px 9px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.drive-row:last-child { border-bottom: 0; }
.drive-row:hover { background: var(--panel-2); }
.drive-row small { color: var(--muted); font-size: 13px; }
.drive-ico.folder { width: 40px; height: 40px; display: grid; place-items: center; color: #D99A1E; flex: none; }
.drive-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--field); }
.drive-name { font-weight: 500; }
.drive-date { white-space: nowrap; }
.drive-empty { max-width: 520px; margin: 40px auto; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: 18px; padding: 36px 20px; }
.drive-empty .ico { color: var(--line); }

.disp-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; max-width: 980px; }
.disp-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.disp-stat small { color: var(--muted); font-size: 12.5px; display: inline-flex; align-items: center; }
.disp-stat b { font-size: 22px; font-variant-numeric: tabular-nums; }
.disp-stat em { font-style: normal; font-size: 12px; color: #B87A00; }
.disp-stat.cost { border-color: rgba(141,116,214,.45); }
.month-input { height: 32px; padding: 0 8px; }
.disp-list { display: grid; gap: 8px; max-width: 980px; }
.disp-card { display: flex; align-items: center; gap: 14px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--p-high); border-radius: 12px; cursor: pointer; }
.disp-card.disposed { border-left-color: var(--p-normal); }
.disp-card:hover { border-color: #B9C5D0; }
.disp-card.pending:hover { border-left-color: var(--p-high); }
.disp-card.disposed:hover { border-left-color: var(--p-normal); }
.disp-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: var(--field); }
.disp-thumb.empty { display: grid; place-items: center; color: var(--muted); }
.disp-part { font-weight: 700; font-size: 16px; letter-spacing: .01em; }
.disp-part small { font-weight: 400; color: var(--muted); font-size: 13px; }
.disp-desc { color: var(--ink-2); font-size: 14px; }
.disp-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.disp-status { display: inline-flex; align-items: center; gap: 4px; color: #B87A00; font-weight: 500; }
.disp-status.done { color: var(--green); }
.disp-quick { flex: none; }
.disp-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(242,169,0,.14); color: #8A5A00; margin-bottom: 14px; }
.disp-head.disposed { background: var(--green-soft); color: var(--green); }
.disp-head small { display: block; color: var(--ink-2); }
:root[data-theme="dark"] .disp-head { color: #F5C451; }
.disp-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.disp-photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--field); }
.disp-photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.disp-photo .icon-btn { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; background: rgba(0,0,0,.55); color: #fff; }
.disp-photo.add { display: grid; place-items: center; color: var(--blue); border: 2px dashed var(--line); background: transparent; }
.disp-loss { margin-top: 16px; padding: 10px 12px; background: var(--panel-2); border-radius: 10px; font-size: 14px; }

@media (max-width: 760px) {
  .nav-btn { font-size: 10px; padding: 7px 0 5px; }
  .nav-btn .ico svg { width: 22px; height: 22px; }
  .head-task .lbl, .disp-quick .lbl { display: none; }
  .head-task { width: 38px; padding: 0; }
  .emp-actions .lbl { display: none; }
  .drive-date { display: none; }
  .disp-thumb { width: 52px; height: 52px; }
  .emoji-pop { right: 0; }
  .company-switch { padding-top: max(12px, env(safe-area-inset-top)); }
}

/* ---------- company logo ---------- */
.cmark { display: inline-grid; place-items: center; flex: none; border-radius: 24%; overflow: hidden; background: transparent;
  box-shadow: 0 0 0 1px rgba(16,32,48,.1); }
.cmark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rail .logo.has-logo { margin-bottom: 12px; padding: 2px; border-radius: 14px; }
.rail .logo.has-logo .cmark { box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.company-switch .cmark, .company-switch .avatar { margin-right: 2px; }
.company-item .cmark { box-shadow: 0 0 0 1px var(--line); }

/* ---------- sign-in languages ---------- */
.lang-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 18px; }
.lang-chip { height: 30px; padding: 0 12px; border-radius: 15px; font-size: 13.5px; color: var(--muted); border: 1px solid var(--line); }
.lang-chip:hover { color: var(--ink); border-color: var(--muted); }
.lang-chip.on { color: var(--ink); background: var(--field); border-color: transparent; font-weight: 600; }

/* ---------- time zones ---------- */
.tz-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 12px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; }
.tz-bar > .ico { color: var(--blue); }
.tzb-note { font-weight: 500; }
.tzb-clock { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 10px; border-radius: 9px; background: var(--field); white-space: nowrap; }
.tzb-clock > span { color: var(--muted); }
.tzb-clock b { font-variant-numeric: tabular-nums; color: var(--ink); }
.tzb-clock small { color: var(--muted); font-size: 12px; }
.dz { display: grid; gap: 2px; font-size: 13.5px; }
.dz-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dz-main .ico { color: var(--blue); }
.dz-zone { font-size: 12px; padding: 1px 7px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.dz-second { color: var(--muted); padding-left: 21px; }
.dz-edit { display: grid; gap: 8px; }
.dz-inputs { display: flex; gap: 8px; flex-wrap: wrap; }
.dz-inputs .input { width: auto; flex: 1 1 150px; max-width: 200px; }
.dz-inputs .dz-time { flex: 0 1 130px; }
.dz-preview { min-height: 20px; font-size: 13px; }
.dz-preview .muted { font-size: 12.5px; line-height: 1.35; }
.dz-cell { display: grid; gap: 6px; justify-items: start; }
.dz-clear { height: 28px; padding: 0 10px; }

/* ---------- company settings ---------- */
.modal.cs-modal { width: min(780px, 100%); }
.modal.le-modal { width: min(720px, 100%); }
.cs-tabs { margin-bottom: 14px; align-self: flex-start; }
.cs-body { display: grid; gap: 12px; }
.cs-section { font-weight: 650; font-size: 14.5px; margin-top: 8px; }
.cs-section.first { margin-top: 0; }
.cs-note { margin: -6px 0 0; font-size: 13px; }
.cs-logo-row { display: flex; gap: 16px; align-items: flex-start; }
.cs-logo { width: 96px; height: 96px; flex: none; border-radius: 24%; overflow: hidden; display: grid; place-items: center;
  box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgba(16,32,48,.12); background: var(--panel); }
.cs-logo.empty { background: var(--field); color: var(--muted); box-shadow: none; border: 1.5px dashed var(--line); }
.cs-logo img { width: 100%; height: 100%; object-fit: contain; }
.inline.wrap { flex-wrap: wrap; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; width: 34px; height: 34px; border-radius: 50%; padding: 3px; border: 2px solid transparent; cursor: pointer; display: inline-block; }
.swatch i { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.swatch.on { border-color: var(--ink); }
.swatch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.wall-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.wall-tile { aspect-ratio: 3 / 4; border-radius: 10px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); cursor: pointer; }
.wall-tile.on { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--panel); }
.wall-tile.upload { display: grid; place-content: center; justify-items: center; gap: 2px; text-align: center; font-size: 10.5px; line-height: 1.15;
  color: var(--muted); background: var(--field); box-shadow: none; border: 1.5px dashed var(--line); padding: 4px; }
.wall-tile.upload:hover { color: var(--ink); border-color: var(--muted); }
.cs-look { display: grid; grid-template-columns: 1fr 220px; gap: 22px; align-items: start; }
.cs-look-controls { display: grid; gap: 12px; min-width: 0; }
.cs-look-preview { position: sticky; top: 0; display: grid; gap: 8px; }
.le-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.look-preview { display: grid; grid-template-columns: 46px 1fr; height: 250px; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 8px 22px rgba(16,32,48,.12); }
.lp-rail { background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 9px; padding-top: 10px; }
.lp-nut { color: var(--amber); --hole: var(--rail); }
.lp-rail i { width: 22px; height: 6px; border-radius: 3px; background: var(--rail-ink); opacity: .55; }
.lp-rail i.on { background: var(--rail-fg, #fff); opacity: 1; box-shadow: -11px 0 0 -1px var(--amber); }
.lp-rail .cmark { box-shadow: none; }
.lp-wall { padding: 14px 10px; display: flex; flex-direction: column; gap: 8px; }
.lp-msg { align-self: flex-start; max-width: 85%; background: var(--bubble); color: var(--ink); padding: 6px 10px; border-radius: 12px 12px 12px 4px; font-size: 12.5px; box-shadow: var(--bubble-shadow); }
.lp-msg.own { align-self: flex-end; background: var(--bubble-own); border-radius: 12px 12px 4px 12px; }
.lp-btn { margin-top: auto; align-self: center; background: var(--blue); color: var(--blue-ink); padding: 6px 14px; border-radius: 9px; font-size: 12.5px; font-weight: 600; }

/* ---------- logo editor ---------- */
.le { display: grid; grid-template-columns: 260px 1fr; gap: 22px; align-items: start; }
.le-big { width: 260px; height: 260px; border-radius: 24%; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 10px 28px rgba(16,32,48,.16); background: var(--panel); }
.le-big.checker { background: repeating-conic-gradient(#E6EAEE 0 25%, #FFFFFF 0 50%) 0 0 / 20px 20px; }
.le-img { width: 100%; height: 100%; display: block; }
.le-side { display: grid; gap: 12px; min-width: 0; }
.le-mocks { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.le-rail { background: var(--rail); padding: 10px; border-radius: 12px; }
.le-rail .cmark { box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.le-list { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: 12px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); max-width: 220px; font-size: 14px; }
.le-fav { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px 8px 0 0; background: var(--field); font-size: 12px; max-width: 170px; color: var(--ink-2); }
.le-fav .cmark { border-radius: 4px; box-shadow: none; }
.le-side .seg { flex-wrap: wrap; }
.le-side input[type=range] { width: 100%; accent-color: var(--blue); }

@media (max-width: 720px) {
  .cs-look { grid-template-columns: 1fr; }
  .cs-look-preview { position: static; order: -1; }
  .look-preview { height: 170px; }
  .le { grid-template-columns: 1fr; justify-items: center; }
  .le-big { width: 200px; height: 200px; }
  .le-side { width: 100%; }
  .tz-bar { font-size: 12.5px; gap: 6px; padding: 8px 10px; }
  .tz-bar > .ico, .tz-bar .grow, .tzb-clock small { display: none; }
  .tzb-note { flex: 1 1 100%; }
  .tzb-clock { padding: 3px 8px; }
}

/* ---------- threads ---------- */
.chat-view { position: relative; }
.chat-view.show-thread { grid-template-columns: minmax(260px, 320px) 1fr minmax(340px, 400px); }
.thread-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: var(--panel); z-index: 3; }
.thread-head { height: 60px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.thread-head .grow { min-width: 0; }
.thread-head b { display: block; font-weight: 650; }
.thread-head small { display: block; font-size: 13px; color: var(--muted); }
.thread-head .back { display: none; }
.thread-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 0 6px; overscroll-behavior: contain; }
.thread-body .msgs-inner { padding: 0 10px; }
.thread-body .bubble { max-width: 88%; }
.thread-sep { display: flex; align-items: center; gap: 10px; margin: 10px 4px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.thread-sep::before, .thread-sep::after { content: ""; flex: 1; height: 1px; background: rgba(23,33,43,.14); }
:root[data-theme="dark"] .thread-sep::before, :root[data-theme="dark"] .thread-sep::after { background: rgba(255,255,255,.14); }
.thread-sep { color: var(--ink-2); text-shadow: 0 0 6px var(--wall-bg); }
.thread-composer { background: transparent; }
.also-chat { display: flex; align-items: center; gap: 7px; max-width: 780px; margin: 6px auto 0; padding-left: 4px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.also-chat input { accent-color: var(--blue); width: 15px; height: 15px; }
.thread-sum { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 6px; padding: 6px 6px 2px 0; border-top: 1px solid rgba(23,33,43,.08);
  color: var(--blue); font-size: 13.5px; text-align: left; }
.msg-row.own .thread-sum { border-top-color: rgba(23,33,43,.1); }
:root[data-theme="dark"] .thread-sum { border-top-color: rgba(255,255,255,.1); }
.thread-sum:hover b { text-decoration: underline; }
.thread-sum .ts-avs { display: inline-flex; }
.thread-sum .ts-avs .avatar { font-size: 9px !important; box-shadow: 0 0 0 2px var(--bubble); }
.msg-row.own .thread-sum .ts-avs .avatar { box-shadow: 0 0 0 2px var(--bubble-own); }
.thread-sum .ts-avs .avatar + .avatar { margin-left: -6px; }
.thread-sum b { font-weight: 650; white-space: nowrap; }
.thread-sum .ts-when { color: var(--meta); font-size: 12.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-sum.new .ts-when { color: var(--blue); font-weight: 600; }
.thread-sum.new .ts-when::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin-right: 5px; vertical-align: 1px; }
.thread-sum > .ico { color: var(--meta); }
.task-bubble .thread-sum { margin-top: 8px; }
.thread-ref { display: flex; align-items: center; gap: 5px; max-width: 100%; margin: 0 0 4px; font-size: 12.5px; color: var(--meta); }
.thread-ref:hover { color: var(--blue); }
@media (max-width: 1100px) {
  .chat-view.show-thread { grid-template-columns: minmax(280px, 340px) 1fr; }
  .thread-pane { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); box-shadow: var(--shadow-lg); }
}
@media (max-width: 760px) {
  .thread-pane { position: fixed; inset: 0; width: 100%; border-left: 0; z-index: 30; }
  .thread-head { padding: env(safe-area-inset-top) 8px 0 4px; height: calc(60px + env(safe-area-inset-top)); }
  .thread-head .back { display: inline-grid; }
  .thread-head .th-close { display: none; }
  .thread-body .bubble { max-width: 86%; }
}

/* the second clock is only for reference: quieter than the US one */
.tzb-clock.ref { background: transparent; padding-left: 4px; font-size: 12.5px; }
.tzb-clock.ref b { color: var(--muted); font-weight: 600; }
.dz-second { font-size: 12.5px; }

/* ---------- orders ---------- */
.orders-body { padding-top: 16px; }
.page.viewing-order > .page-head { display: none; }
.olist { display: grid; gap: 8px; max-width: 1100px; margin: 0 auto; }
.orow { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 10px 14px 10px 10px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.orow:hover { border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); }
.orow:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.orow.cancelled { opacity: .62; }
.othumb { width: 56px; height: 56px; border-radius: 10px; background: var(--field); display: grid; place-items: center; overflow: hidden; color: var(--muted); flex: none; }
.othumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.omain { min-width: 0; display: grid; gap: 2px; }
.otop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.otop b { font-size: 15.5px; font-variant-numeric: tabular-nums; }
.otitle { font-size: 14px; color: var(--ink-2); }
.osub { font-size: 13px; color: var(--muted); }
.oside { display: grid; justify-items: end; gap: 3px; text-align: right; }
.ototal { font-size: 15.5px; font-variant-numeric: tabular-nums; }
.opills { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.opill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.opill.ok { background: var(--green-soft); color: var(--green); }
.opill.warn { background: rgba(214,155,20,.16); color: #9A6A00; }
:root[data-theme="dark"] .opill.warn { color: #E3B44A; }
.opill.bad { background: var(--red-soft); color: var(--red); }
.opill.info { background: var(--blue-soft); color: var(--blue); }
.opill.muted { background: var(--field); color: var(--muted); }
.ochip { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--field); color: var(--ink-2); }
.ochip.ebay { background: #FFF4CC; color: #6B4E00; }
:root[data-theme="dark"] .ochip.ebay { background: #4A3C10; color: #FFE08A; }
.ochip.web { background: var(--blue-soft); color: var(--blue); }
.ochip.loc { font-weight: 500; }
.orisk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.orisk i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.orisk.low { color: var(--green); } .orisk.medium { color: #C98A00; } .orisk.high { color: var(--red); }
.oshield { color: var(--green); display: inline-flex; }
.ophotos { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.olist-more { display: flex; justify-content: center; padding: 14px; }

.order-page { max-width: 1240px; margin: 0 auto; }
.ohead { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.ohead-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ohead-title h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ohead .osmall { margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ohead-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ogrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.ocol { display: grid; gap: 14px; min-width: 0; }
.ocard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.ocard > h3, .ocard-head h3, .otimeline > h3 { margin: 0; font-size: 15px; font-weight: 650; }
.ocard-head { display: flex; align-items: center; gap: 8px; }
.ostate { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ostate.ok { background: var(--green-soft); color: var(--green); }
.ostate.warn { background: rgba(214,155,20,.18); color: #9A6A00; }
.ofo-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); }
.ofo-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.ofo-lines { display: grid; gap: 5px; font-size: 13.5px; color: var(--ink-2); }
.ofo-lines > div { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ofo-lines .ico { color: var(--muted); }
.oitem { display: flex; gap: 12px; align-items: flex-start; padding-top: 10px; border-top: 1px solid var(--line); }
.oitem:first-of-type { border-top: 0; }
.oitem .othumb { width: 52px; height: 52px; }
.oi-title { font-weight: 550; line-height: 1.3; }
.oi-price { display: grid; justify-items: end; gap: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 14px; }
.osmall { font-size: 12.5px; }
.osmall.cost { display: inline-flex; align-items: center; gap: 4px; color: #8A5A00; margin-top: 2px; }
.icon-btn.mini { width: 24px; height: 24px; }
.btn.mini-btn { height: 30px; padding: 0 10px; font-size: 13px; }
.pay-row { display: flex; gap: 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
.pay-row > span:first-child { min-width: 110px; }
.pay-row .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-row > span:last-child { white-space: nowrap; }
.pay-row.strong { font-weight: 650; }
.ocard hr { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }
.addr { display: grid; gap: 1px; font-size: 14px; }
.otags { display: flex; gap: 6px; flex-wrap: wrap; }
.pre { white-space: pre-wrap; font-size: 14px; }
.risk-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.risk-bar i { height: 6px; border-radius: 3px; background: var(--field); }
.risk-bar.low i.on { background: var(--green); }
.risk-bar.medium i.on { background: #E0A100; }
.risk-bar.high i.on { background: var(--red); }
.risk-labels { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; font-size: 12px; color: var(--muted); margin-top: -4px; }
.risk-labels .on { color: var(--ink); font-weight: 650; }
.risk-text { margin: 0; font-size: 13.5px; }
.risk-facts { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }
.risk-facts .negative { color: var(--red); } .risk-facts .positive { color: var(--green); }
.verdict { display: flex; align-items: flex-start; gap: 7px; font-size: 13.5px; line-height: 1.3; }
.verdict .ico { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.verdict.ok .ico { background: var(--green); color: #fff; }
.verdict.bad .ico { background: var(--red); color: #fff; }
.verdict.warn .ico { background: #E0A100; color: #fff; }
.verdict.na .ico { background: var(--field); color: var(--muted); }
.verdict .ico svg { width: 13px; height: 13px; stroke-width: 2.6; }
.verdict.bad { color: var(--red); font-weight: 600; }

.otimeline { display: grid; gap: 8px; }
.ocomment { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: visible; }
.ocomment-row { display: flex; gap: 10px; padding: 12px 12px 6px; align-items: flex-start; }
.ocomment-input { width: 100%; border: 0; outline: 0; resize: vertical; min-height: 42px; background: transparent; font: inherit; padding: 6px 0; }
.ocomment-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 6px; }
.ocomment-files .att-thumb.doc { background: var(--field); display: grid; place-items: center; }
.ocomment-tools { display: flex; align-items: center; gap: 2px; padding: 6px 8px 8px; background: var(--panel-2); border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; }
.tool-glyph { font-size: 16px; font-weight: 600; color: var(--muted); line-height: 1; }
.ocomment progress { width: calc(100% - 24px); margin: 0 12px 10px; }
.ocomment-note { text-align: right; margin-top: -4px; }
.otl { display: grid; gap: 8px; padding-left: 14px; border-left: 2px solid var(--line); margin-left: 16px; }
.otl-day { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 8px 0 0 6px; }
.otl-event { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; padding: 2px 6px; position: relative; }
.otl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-2); box-shadow: 0 0 0 3px var(--bg); position: absolute; left: -21px; top: 6px; }
.otl-note { display: flex; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-left: -6px; }
.otl-note.shipped { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.otl-note.store { background: var(--panel-2); }
.otl-meta { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.otl-text { white-space: pre-wrap; font-size: 14.5px; margin-top: 3px; overflow-wrap: anywhere; }
.otl-ship { display: flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; margin-top: 3px; }
.otl-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-top: 8px; }
.otl-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: zoom-in; background: var(--field); }
.oref { color: var(--blue); font-weight: 600; }
.oref:hover { text-decoration: underline; }
.shop-ok { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-weight: 600; }
.ship-items { display: grid; gap: 2px; }

/* ---------- camera: shoot in a row ---------- */
.cam { position: fixed; inset: 0; z-index: 200; background: #000; color: #fff; display: flex; flex-direction: column; }
.cam-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
.cam-top .icon-btn, .cam-bar .icon-btn { color: #fff; }
.cam-view { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.cam-view video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.on { animation: camflash .25s ease-out; }
@keyframes camflash { from { opacity: .85; } to { opacity: 0; } }
.cam-note { position: absolute; left: 20px; right: 20px; text-align: center; font-size: 15px; color: #ddd; }
.cam-strip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; min-height: 76px; }
.cam-shot { position: relative; flex: none; width: 60px; height: 60px; border-radius: 8px; overflow: hidden; background: #222; }
.cam-shot img { width: 100%; height: 100%; object-fit: cover; }
.cam-shot .icon-btn { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; background: rgba(0,0,0,.6); color: #fff; border-radius: 50%; }
.cam-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 18px 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.cam-gal { justify-self: start; width: 48px; height: 48px; }
.cam-shutter { width: 74px; height: 74px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px #000, 0 0 0 7px #fff; }
.cam-shutter:active { transform: scale(.94); }
.cam-done { justify-self: end; }

@media (max-width: 900px) {
  .ogrid { grid-template-columns: 1fr; }
  .ocol.side { order: -1; }
}
@media (max-width: 760px) {
  .orow { grid-template-columns: 48px 1fr; gap: 10px; }
  .orow .othumb { width: 48px; height: 48px; }
  .oside { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; text-align: left; }
  .oside small, .orisk, .opill { white-space: nowrap; }
  .oside .opills { justify-content: flex-start; }
  .ohead { flex-wrap: wrap; }
  .ohead-actions { width: 100%; justify-content: stretch; }
  .ohead-actions .btn { flex: 1; }
  .ohead-actions .btn .lbl { display: inline !important; }
  .ocol.side { order: 0; }
  .otl { margin-left: 6px; }
  .pay-row > span:first-child { min-width: 84px; }
}
.nav-btn { width: 70px; }
.nav-btn > span:not(.ico):not(.nav-badge) { letter-spacing: -.01em; max-width: 68px; text-align: center; overflow-wrap: anywhere; line-height: 1.15; }
@media (max-width: 760px) { .nav-btn { width: auto; } }

/* ----- 2.2: group members ----- */
.member-row { padding: 4px 8px; }
.member-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: left; padding: 3px 0; }
.member-open .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.sys-members .bubble, .sys-line { color: var(--muted); }

/* ----- 2.2: access checkboxes on the employee card ----- */
.perms { display: grid; gap: 6px; }
.perm-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.perm-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; font-size: 14.5px; cursor: pointer; }
.perm-row input { width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.perm-row.sub { padding-left: 28px; font-size: 14px; }
.perm-row.off { color: var(--muted); cursor: default; }

/* ----- 2.2: order actions ----- */
.ocard-title { display: flex; align-items: center; gap: 6px; }
.ocard-title h3 { margin: 0; font-size: 15px; font-weight: 650; flex: 1; }
.ocard-head .inline { display: inline-flex; gap: 8px; }
.qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; flex: none; }
.qty .icon-btn.mini { width: 30px; height: 30px; }
.qty .icon-btn:disabled { opacity: .35; }
.qty-val { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
.eitems { display: grid; gap: 0; }
.eitem { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.eitem:first-child { border-top: 0; }
.eitem .grow { min-width: 0; }
.eitem.gone .ellipsis { text-decoration: line-through; color: var(--muted); }
.eitem.new { background: color-mix(in srgb, var(--blue) 6%, transparent); border-radius: 10px; padding: 9px 8px; margin: 2px 0; border-top: 0; }
.echange { color: var(--blue); font-weight: 550; }
.othumb.sm { width: 40px; height: 40px; border-radius: 8px; }
.ppick { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.ppick-list { display: grid; max-height: 300px; overflow: auto; }
.ppick-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 10px; text-align: left; width: 100%; }
.ppick-row:hover, .ppick-row:focus-visible { background: var(--panel); }
.ppick-row .grow { min-width: 0; }
.ppick-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.citem { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.dims { display: flex; align-items: center; gap: 8px; }
.dims .input { min-width: 0; }
.form-grid.three { grid-template-columns: 2fr 1fr 1fr; }
.refund-sum { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.otl-note.sys .otl-ship { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 14.5px; }
.otl-note.sys.label { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.otl-note.sys.refund { border-color: color-mix(in srgb, var(--orange, #E8A33D) 45%, var(--line)); }
.otl-note.sys.cancelled { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.otl-note.sys.edited { border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); }
.orow.draft .othumb { width: 44px; height: 44px; }
.draft-addr { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 760px) {
  .form-grid.three { grid-template-columns: 1fr 1fr; }
  .form-grid.three > :first-child { grid-column: 1 / -1; }
  .ocard-head { flex-wrap: wrap; }
  .ocard-head .inline { width: 100%; }
  .ocard-head .inline .btn { flex: 1; }
}

/* ----- 2.2: security ----- */
.linkish { color: var(--blue); font-weight: 500; padding: 0; background: none; text-decoration: underline; text-underline-offset: 2px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.auth-card.wide { width: min(560px, 100%); }
.code-in { font-size: 22px; letter-spacing: .18em; font-variant-numeric: tabular-nums; height: 48px; text-align: center; max-width: 240px; }
.tfa-box { display: grid; gap: 12px; }
.tfa-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.tfa-grid { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.tfa-qr { width: 196px; height: 196px; flex: none; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.tfa-qr svg { width: 100%; height: 100%; display: block; }
.tfa-secret { display: block; font-size: 15px; letter-spacing: .06em; word-spacing: .2em; padding: 8px 10px; margin: 6px 0; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); word-break: normal; overflow-wrap: normal; }
.tfa-grid > .grow { flex: 1 1 220px; min-width: 0; }
.recovery { display: grid; gap: 10px; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px dashed var(--line); }
.recovery-codes code { font-size: 15.5px; letter-spacing: .08em; }
.sec-body { display: grid; gap: 12px; }
.sec-card { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.sec-head { display: flex; align-items: center; gap: 10px; }
.sec-head b { font-size: 15.5px; }
.sec-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.sec-card .inline .input { flex: 1; min-width: 0; }
@media (max-width: 760px) { .tfa-qr { width: 168px; height: 168px; } }
.cs-mail { display: grid; gap: 12px; }
