/* Star House Office - app styles */
:root {
  --green: #0D3B23; --green-2: #15502F; --green-3: #1E6B45; --green-soft: #E6EFEA; --green-tint: #F2F7F4;
  --gold: #C9A227; --gold-soft: #FBF5E1;
  --bg: #F8F7F3; --panel: #FFFFFF; --side: #F1F0EA; --side-2: #E8E6DE;
  --text: #1B2621; --muted: #66756D; --line: #E2E0D8; --line-2: #D5D3CA;
  --red: #B42318; --red-soft: #FDECEA; --blue: #1D5FA8;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,20,.06), 0 4px 16px rgba(16,24,20,.06);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141917; --panel: #1B211E; --side: #111614; --side-2: #1F2723; --text: #E6ECE8; --muted: #93A39A;
    --line: #2A332E; --line-2: #36413B; --green-soft: #1E3329; --green-tint: #18231E; --gold-soft: #2D2715;
    --red-soft: #3A1E1B; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
  }
  .send, .btn.primary { background: #2B7A5E !important; }
  .msg.user .bubble { background: #22302A !important; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--green-3); }
.ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ic svg { width: 100%; height: 100%; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--panel);
  border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 500; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--green-tint); border-color: var(--green-3); }
.btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn.primary:hover { background: var(--green-2); }
.btn.small { padding: 5px 11px; font-size: 13.5px; border-radius: 8px; }
.btn.big { width: 100%; justify-content: center; padding: 12px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.danger { color: var(--red); }
.icon { border: 0; background: transparent; cursor: pointer; border-radius: 9px; padding: 7px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--muted); }
.icon:hover { background: var(--side-2); color: var(--text); }
.link { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px 4px; text-align: left; }
.link:hover { color: var(--green-3); text-decoration: underline; }
.small { font-size: 13px; }
.fine { font-size: 12px; color: var(--muted); }
.center { text-align: center; }
.error { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 9px 12px; font-size: 14px; margin: 10px 0; }

/* offline banner */
.offline { position: fixed; top: 0; left: 0; right: 0; z-index: 90; background: var(--red); color: #fff; padding: 9px 16px;
  font-size: 14px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.offline .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #fff; margin-right: 8px;
  animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
body.is-offline .send, body.is-offline .btn.primary:not(#lg-go) { opacity: .5; pointer-events: none; }

/* sign-in */
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--green-soft), transparent), var(--bg); }
.login-card { width: 100%; max-width: 410px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 34px 32px 26px; box-shadow: var(--shadow); }
.login-logo { width: 64px; height: 64px; border-radius: 15px; display: block; margin: 0 auto 14px; }
.login h1 { text-align: center; margin: 0; font-size: 24px; letter-spacing: -.2px; color: var(--green); }
@media (prefers-color-scheme: dark) { .login h1 { color: #CFE3D8; } }
.login .sub { text-align: center; color: var(--muted); margin: 6px 0 22px; font-size: 14px; }
.login label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
.login input { display: block; width: 100%; margin-top: 6px; padding: 11px 13px; border: 1px solid var(--line-2);
  border-radius: 10px; background: var(--panel); font-size: 15.5px; outline: none; }
.login input:focus { border-color: var(--green-3); box-shadow: 0 0 0 3px var(--green-soft); }
.pwrow { position: relative; display: block; }
.pwrow input { padding-right: 44px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin-top: 3px; border: 0; background: none;
  cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; display: flex; }
.eye:hover { background: var(--side); }
.rules { list-style: none; padding: 0; margin: -4px 0 12px; font-size: 13px; color: var(--muted); }
.rules li::before { content: "○"; margin-right: 8px; }
.rules li.ok { color: var(--green-3); }
.rules li.ok::before { content: "✓"; font-weight: 700; }
.welcome-new { background: var(--green-tint); border: 1px solid var(--green-soft); border-radius: 10px; padding: 10px 12px;
  margin-bottom: 14px; font-size: 14px; }
.login .fine { margin: 16px 2px 0; text-align: center; }
.login-foot { color: var(--muted); font-size: 12px; margin-top: 18px; }

/* layout */
.app { display: grid; grid-template-columns: 276px 1fr; height: 100dvh; }
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
  position: relative; }
.brand { display: flex; align-items: center; gap: 11px; padding: 16px 16px 12px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand b { display: block; font-size: 15.5px; color: var(--green); line-height: 1.15; }
@media (prefers-color-scheme: dark) { .brand b { color: #CFE3D8; } }
.brand span { font-size: 12.5px; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; }
.brand .icon { margin-left: auto; }
.nav { padding: 4px 10px 8px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--line); }
.nav button { display: flex; align-items: center; gap: 11px; border: 0; background: none; padding: 9px 11px;
  border-radius: 10px; cursor: pointer; font-weight: 500; text-align: left; color: var(--text); }
.nav button:hover { background: var(--side-2); }
.nav button.active { background: var(--panel); box-shadow: var(--shadow); color: var(--green); }
@media (prefers-color-scheme: dark) { .nav button.active { color: #CFE3D8; } }
.badge { margin-left: auto; background: var(--gold); color: #1b1b1b; border-radius: 99px; font-size: 11.5px; font-weight: 700;
  padding: 1px 7px; min-width: 20px; text-align: center; }
.side-section { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 10px 6px; }
.new-chat { justify-content: center; margin: 0 2px 12px; background: var(--panel); }
.side-title { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px;
  padding: 4px 10px 6px; }
.list { overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 1px; }
.item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; cursor: pointer; border: 0;
  background: none; text-align: left; width: 100%; color: var(--text); position: relative; }
.item:hover { background: var(--side-2); }
.item.active { background: var(--panel); box-shadow: var(--shadow); }
.item .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.item .s { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .more { opacity: 0; padding: 3px; }
.item:hover .more { opacity: 1; }
.item .spin { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: blink 1s infinite; }
.item .av { width: 28px; height: 28px; font-size: 11.5px; }
.item.unread .t { font-weight: 700; }
.me { display: flex; align-items: center; gap: 10px; margin: 6px 10px 10px; padding: 9px 10px; border-radius: 12px;
  cursor: pointer; border: 1px solid transparent; }
.me:hover, .me:focus { background: var(--side-2); outline: none; }
.me-text { flex: 1; min-width: 0; }
.me-text b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar, .av { width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; position: relative; }
.av.partner { background: var(--gold); color: #1b1b1b; }
.av.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%;
  background: #22A06B; border: 2px solid var(--side); }
.menu { position: absolute; left: 10px; right: 10px; bottom: 66px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.16); padding: 6px; z-index: 40; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 10px;
  border-radius: 9px; cursor: pointer; text-align: left; font-size: 14px; }
.menu button:hover { background: var(--side); }
.menu .ic { color: var(--muted); }
.menu .danger { color: var(--red); }
.menu .danger .ic { color: var(--red); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; font-size: 14px; }
.menu-row span { display: flex; gap: 10px; align-items: center; }
.menu-row select { border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 6px; background: var(--panel); max-width: 150px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: var(--panel); min-height: 56px; }
.top-title { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daybar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; }
.daybar + .top-title { display: none; }
.dstate { font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.dstate::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dstate.in::before { background: #22A06B; }
.dstate.out::before { background: var(--gold); }
.dchips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--side); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--green-soft); color: var(--green-3); }
.chip.warn { background: var(--gold-soft); color: #7a5d00; }
@media (prefers-color-scheme: dark) { .chip.warn { color: #E8C76A; } .chip.ok { color: #8FD3B5; } }
.net { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.net .dot { width: 8px; height: 8px; border-radius: 50%; background: #22A06B; }
.net.off { color: var(--red); font-weight: 600; }
.net.off .dot { background: var(--red); animation: blink 1.2s infinite; }
.install-bar { display: flex; align-items: center; gap: 12px; padding: 9px 18px; background: var(--gold-soft);
  border-bottom: 1px solid var(--line); font-size: 14px; }
.install-bar > span { flex: 1; }

.view { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* assistant thread */
.thread { flex: 1; overflow-y: auto; padding: 22px 18px 10px; scroll-behavior: smooth; }
.welcome { max-width: 780px; margin: 5vh auto 0; text-align: center; }
.wlogo { width: 58px; height: 58px; border-radius: 14px; }
.welcome h2 { font-size: 27px; margin: 14px 0 4px; letter-spacing: -.3px; font-weight: 600; }
.wsub { color: var(--muted); margin: 0 0 24px; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; text-align: left; }
.qcard { border: 1px solid var(--line); background: var(--panel); border-radius: 13px; padding: 13px 14px; cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s; }
.qcard:hover { border-color: var(--green-3); box-shadow: var(--shadow); transform: translateY(-1px); }
.qcard b { display: block; font-size: 14.5px; }
.qcard span { font-size: 12.5px; color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin-top: 22px; }
.msgs { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--green-soft); border-radius: 16px 16px 4px 16px; padding: 10px 14px; max-width: 78%;
  white-space: pre-wrap; word-wrap: break-word; }
.msg.user .bubble .files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; white-space: normal; }
.msg.bot .mark { width: 30px; height: 30px; border-radius: 8px; flex: none; margin-top: 2px; }
.msg.bot .body { flex: 1; min-width: 0; }
.msg.bot .tools { display: flex; gap: 4px; margin-top: 6px; opacity: 0; transition: opacity .15s; }
.msg.bot:hover .tools { opacity: 1; }
.md { word-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md p { margin: 0 0 10px; }
.md h2, .md h3, .md h4, .md h5 { margin: 18px 0 8px; line-height: 1.3; }
.md h2 { font-size: 19px; } .md h3 { font-size: 17px; } .md h4, .md h5 { font-size: 15.5px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 24px; }
.md li { margin: 3px 0; }
.md code { background: var(--side); border-radius: 5px; padding: 1px 5px; font-family: Consolas, "Cascadia Mono", monospace; font-size: 13.5px; }
.md pre.code { position: relative; background: #12201A; color: #DDE8E2; border-radius: 11px; padding: 14px; overflow-x: auto; font-size: 13px; }
.md pre.code code { background: none; padding: 0; color: inherit; }
.md pre .copy { position: absolute; top: 8px; right: 8px; font-size: 11.5px; border: 1px solid #34483E; background: #1B2D25;
  color: #DDE8E2; border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.md blockquote { margin: 8px 0 12px; padding: 6px 14px; border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 9px 9px 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.tablewrap { overflow-x: auto; margin: 6px 0 14px; border: 1px solid var(--line); border-radius: 11px; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th { background: var(--green-tint); text-align: left; font-weight: 600; padding: 8px 11px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.md td { padding: 7px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md tr:last-child td { border-bottom: 0; }
.filechip { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line-2); border-radius: 11px;
  padding: 6px 8px 6px 6px; background: var(--panel); text-decoration: none; color: var(--text); margin: 3px 4px 3px 0;
  max-width: 100%; vertical-align: middle; }
.filechip:hover { border-color: var(--green-3); }
.md p .filechip, .md li .filechip { padding: 1px 6px 1px 3px; margin: 0 2px; gap: 6px; border-radius: 8px; vertical-align: -6px; }
.md p .filechip .fi, .md li .filechip .fi { padding: 2px 4px; font-size: 9px; min-width: 28px; }
.filechip .fi { background: var(--green); color: #fff; font-size: 10px; font-weight: 700; border-radius: 6px; padding: 5px 5px; min-width: 34px; text-align: center; }
.filechip .fn { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filechip .dl { color: var(--muted); padding: 2px 6px; border-radius: 6px; font-size: 15px; }
.filechip .dl:hover { background: var(--side); color: var(--text); }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.step { font-size: 12.5px; color: var(--muted); background: var(--side); border-radius: 8px; padding: 3px 9px;
  font-family: Consolas, "Cascadia Mono", monospace; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.sent { background: var(--green-soft); color: var(--green-3); font-family: var(--font); font-weight: 600; }
.step.notsent { background: var(--gold-soft); color: #7a5d00; font-family: var(--font); font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13.5px; margin: 4px 0 8px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--green-3); animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
.berror { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 9px 12px; font-size: 14px; margin: 6px 0; }
.card { border: 1px solid var(--gold); background: var(--gold-soft); border-radius: 14px; padding: 13px 15px; margin: 6px 0 12px; }
.card h4 { margin: 0 0 4px; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.card .cbody { white-space: pre-wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  font-size: 13.5px; max-height: 260px; overflow: auto; margin: 8px 0 10px; }
.card .cbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.card textarea { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; resize: vertical; background: var(--panel); }
.card.done { opacity: .7; border-color: var(--line); background: var(--side); }

/* composer */
.composer-wrap { padding: 8px 18px 12px; }
.composer { max-width: 800px; margin: 0 auto; display: flex; align-items: flex-end; gap: 4px; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 18px; padding: 7px 7px 7px 6px; box-shadow: var(--shadow); }
.composer:focus-within { border-color: var(--green-3); }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; background: none; padding: 8px 6px; max-height: 220px;
  font-size: 15px; line-height: 1.45; }
.cbtn { padding: 8px; }
.mic.rec { background: var(--red); color: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(180,35,24,.5); } 70% { box-shadow: 0 0 0 10px rgba(180,35,24,0); } 100% { box-shadow: 0 0 0 0 rgba(180,35,24,0); } }
.send { width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--green); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex: none; }
.send:hover { background: var(--green-2); }
.send:disabled { background: var(--line-2); cursor: default; }
.send.stop { background: var(--muted); }
.attachments { max-width: 800px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 6px; }
.attachments:not(:empty) { margin-bottom: 7px; }
.att { display: inline-flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 4px 6px 4px 8px; font-size: 13px; }
.att .x { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 2px 5px; border-radius: 6px; }
.att .x:hover { background: var(--side); }
.att.up { opacity: .6; }
.composer-wrap .fine { margin-top: 7px; }
.budget-note { max-width: 800px; margin: 0 auto 8px; background: var(--gold-soft); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; }
.dragover .composer, .dragover.fdrop { outline: 2px dashed var(--green-3); outline-offset: 4px; }

/* messages */
.mhead { padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; }
.mhead b { font-size: 16px; display: block; }
.mhead span { font-size: 12.5px; color: var(--muted); }
.mthread { flex: 1; overflow-y: auto; padding: 16px 20px; }
.empty { max-width: 440px; margin: 10vh auto; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 20px; margin-bottom: 6px; }
.day-sep { text-align: center; font-size: 12px; color: var(--muted); margin: 14px 0 8px; }
.post { display: flex; gap: 11px; padding: 5px 0; max-width: 860px; margin: 0 auto; }
.post .av { margin-top: 2px; }
.post .pb { flex: 1; min-width: 0; }
.post .ph { font-size: 13px; color: var(--muted); }
.post .ph b { color: var(--text); font-size: 14px; margin-right: 6px; }
.post .ptext { white-space: pre-wrap; word-wrap: break-word; }
.post.cont { padding-top: 0; }
.post.cont .av { visibility: hidden; height: 0; }
.post.cont .ph { display: none; }
.post .keep { font-size: 12px; margin-left: 4px; }
.people { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; margin: 6px 0; }
.people .item { padding: 7px 8px; }
.people input { width: 100%; }

/* files */
.ftool { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: var(--panel); flex-wrap: wrap; }
.crumbs { flex: 1; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-weight: 600; min-width: 200px; }
.crumbs button { border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 7px; font-weight: 600; color: var(--muted); }
.crumbs button:hover { background: var(--side); color: var(--text); }
.crumbs button:last-child { color: var(--text); }
.crumbs .sep { color: var(--line-2); }
.fbtns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fbtns input[type=search] { border: 1px solid var(--line-2); border-radius: 9px; padding: 6px 10px; background: var(--panel); width: 200px; }
.fdrop { flex: 1; overflow-y: auto; padding: 16px 20px; }
.fgrid { display: flex; flex-direction: column; gap: 2px; max-width: 1100px; }
.frow { display: grid; grid-template-columns: 40px 1fr 150px 90px 120px; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: 10px; cursor: pointer; }
.frow:hover { background: var(--panel); box-shadow: var(--shadow); }
.frow.head { cursor: default; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.frow.head:hover { background: none; box-shadow: none; }
.frow .fic { width: 34px; height: 34px; border-radius: 8px; background: var(--green-soft); color: var(--green-3); display: flex;
  align-items: center; justify-content: center; font-size: 10px; font-weight: 800; }
.frow .fic.folder { background: var(--gold-soft); color: #8a6a00; }
.frow .fname { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.frow .fname small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.frow .fmeta { font-size: 13px; color: var(--muted); }
.frow .fact { display: flex; gap: 2px; justify-content: flex-end; opacity: .0; }
.frow:hover .fact { opacity: 1; }
.fused { color: var(--muted); font-size: 12.5px; margin-top: 14px; max-width: 1100px; }
.fempty { color: var(--muted); padding: 30px 10px; text-align: center; }

/* dialogs and toast */
.dlg { border: 0; border-radius: 16px; padding: 0; width: min(480px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25);
  background: var(--panel); color: var(--text); }
.dlg::backdrop { background: rgba(10,20,15,.4); }
.dlg form { padding: 20px 22px 18px; }
.dlg h3 { margin: 0 0 12px; font-size: 18px; }
.dlg label { display: block; font-size: 13.5px; font-weight: 600; margin: 0 0 12px; }
.dlg input, .dlg select, .dlg textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid var(--line-2);
  border-radius: 9px; background: var(--panel); }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dlg .helpbody { font-size: 14px; max-height: 60vh; overflow-y: auto; }
.dlg .helpbody h4 { margin: 14px 0 4px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #16241E; color: #fff;
  padding: 10px 18px; border-radius: 12px; font-size: 14px; z-index: 100; box-shadow: 0 8px 30px rgba(0,0,0,.25); max-width: 90vw; }

/* team page (partners only) */
.side-note { padding: 8px 10px; }
.ttool { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line);
  background: var(--panel); flex-wrap: wrap; }
.ttabs { display: flex; gap: 4px; flex-wrap: wrap; }
.ttabs button, .seg button { border: 0; background: none; padding: 7px 13px; border-radius: 9px; cursor: pointer;
  font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.ttabs button:hover, .seg button:hover { background: var(--green-tint); color: var(--text); }
.ttabs button.active, .seg button.active { background: var(--green-soft); color: var(--green); }
.ttabs .badge { margin-left: 2px; }
.tbtns { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tbody { flex: 1; overflow-y: auto; padding: 18px 20px 30px; }
.tday { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.tday b { color: var(--text); }
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
  display: flex; flex-direction: column; box-shadow: var(--shadow); }
.tcard span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.tcard b { font-size: 24px; line-height: 1.25; margin: 2px 0; }
.tcard small { font-size: 12px; color: var(--muted); }
.tcard.ok { border-left: 4px solid #22A06B; }
.tcard.warn { border-left: 4px solid var(--gold); }
.tcard.bad { border-left: 4px solid var(--red); }
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.ttable { border-collapse: collapse; width: 100%; font-size: 14px; }
.ttable th { background: var(--green-tint); text-align: left; font-weight: 600; padding: 8px 11px;
  border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 13px; }
.ttable td { padding: 8px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ttable tr:last-child td { border-bottom: 0; }
.ttable tr.click { cursor: pointer; }
.ttable tr.click:hover td { background: var(--green-tint); }
.ttable .num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.chip.bad { background: var(--red-soft); color: var(--red); }
.tag { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--gold-soft); color: #7a5d00;
  vertical-align: 1px; letter-spacing: .3px; }
.trow { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.trow input[type=search], .trow input[type=month] { padding: 7px 11px; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--panel); min-width: 220px; }
.seg { display: inline-flex; gap: 2px; background: var(--side); padding: 3px; border-radius: 11px; }
.tleave { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--panel);
  border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.pcard { max-height: 70vh; overflow-y: auto; font-size: 14px; padding-right: 4px; }
.pcard h4 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.phead { display: flex; gap: 12px; align-items: flex-start; }
.phead b { font-size: 17px; }
.phead .chip { margin-right: 4px; }
.av.big { width: 46px; height: 46px; font-size: 16px; }
.pbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ptext { background: var(--green-tint); border-radius: 10px; padding: 9px 12px; white-space: pre-wrap; }
.precent { font-size: 13px; display: flex; flex-direction: column; gap: 3px; max-height: 180px; overflow-y: auto; }
pre.letter { background: var(--side); border-radius: 10px; padding: 12px; font-size: 12.5px; white-space: pre-wrap;
  max-height: 50vh; overflow-y: auto; }

/* small screens */
.only-mobile { display: none; }
.scrim { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 290px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 45; }
  .only-mobile { display: inline-flex; }
  .frow { grid-template-columns: 40px 1fr 90px; }
  .frow .fmeta.date, .frow .fmeta.where { display: none; }
  .frow .fact { opacity: 1; }
  .msg.user .bubble { max-width: 90%; }
  .top { padding: 8px 10px; }
  .net #net-text { display: none; }
}

/* office (3D) */
.o3 { position: relative; flex: 1; min-height: 0; overflow: hidden; background: linear-gradient(#dfe9f2, #faf7f2); }
.o3-stage { position: absolute; inset: 0; }
.o3-stage canvas { display: block; width: 100%; height: 100%; outline: none; cursor: grab; }
.o3-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.o3-tag { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; white-space: nowrap; display: flex; align-items: center;
  gap: 7px; font: 500 12.5px/1.2 var(--font); color: #1b2621; background: rgba(255,255,255,.9); border: 1px solid rgba(13,59,35,.14);
  border-radius: 999px; padding: 4px 10px 4px 4px; box-shadow: 0 2px 8px rgba(16,24,20,.14); -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px); transition: background .15s, border-color .15s, opacity .2s; }
.o3-tag[hidden] { display: none; }
.o3-tag:hover, .o3-tag.hover { background: #fff; border-color: var(--green-3); }
.o3-tag:focus-visible { outline: 2px solid var(--green-3); outline-offset: 2px; }
.o3-av { width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; flex: none; }
.o3-av.p { background: var(--gold); color: #1a1408; }
.o3-n { display: grid; font-weight: 600; }
.o3-n small { font-weight: 400; font-size: 10.5px; color: #5b6a63; }
.o3-dot { width: 9px; height: 9px; border-radius: 50%; background: #a5aea9; flex: none; display: inline-block; }
.o3-dot.on { background: #1fa463; box-shadow: 0 0 0 3px rgba(31,164,99,.2); }
.o3-tag.is-away { opacity: .86; }
.o3-tag.is-away .o3-av:not(.p) { background: #7d8a83; }
.o3-tag.is-on { background: var(--green); color: #fff; border-color: var(--green); }
.o3-tag.is-on small { color: rgba(255,255,255,.8); }
.o3-tag.k-desk { padding: 3px 9px; font-size: 11.5px; color: #3e4b45; background: rgba(255,255,255,.72); }
.o3-tag.k-desk.planned { color: #7d8a83; }
.o3-tag.k-board { padding: 3px 10px; font-size: 11.5px; background: rgba(13,59,35,.86); color: #fff; border-color: transparent; }
.o3-labels.far .o3-tag.k-board:not(.hover):not(:focus-visible) { opacity: 0; pointer-events: none; }
.o3-labels.far .o3-tag.k-desk { font-size: 10.5px; padding: 2px 7px; opacity: .85; }
.o3-labels.far .o3-tag.k-person { padding: 2px 8px 2px 2px; gap: 5px; font-size: 11.5px; }
.o3-labels.far .o3-tag.k-person small { display: none; }
.o3-labels.far .o3-av { width: 20px; height: 20px; font-size: 9px; }
.o3-tag.k-info { cursor: default; pointer-events: none; background: rgba(255,255,255,.62); font-size: 11px; color: #4f5d56; padding: 3px 9px; }
.o3-tag.k-info.floor { background: transparent; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(27,38,33,.55); }
.o3-stage.is-night .o3-tag.k-info.floor { color: rgba(226,234,246,.78); }
.o3-bar { position: absolute; top: 12px; right: 12px; display: flex; gap: 10px; align-items: center; z-index: 2; }
.o3-legend { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; background: rgba(255,255,255,.88); border-radius: 999px;
  padding: 5px 12px; border: 1px solid var(--line); color: #1b2621; }
.o3-legend .o3-dot + .o3-dot, .o3-legend .o3-dot:last-of-type { margin-left: 8px; }
.o3-legend .o3-dot:first-child { margin-left: 0; }
.o3-hint { position: absolute; left: 12px; bottom: 10px; background: rgba(255,255,255,.82); border-radius: 8px; padding: 4px 10px; color: #4f5d56; z-index: 2; }
.o3-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted);
  background: var(--bg); z-index: 4; }
.o3-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--green-3); animation: o3spin 1s linear infinite; }
@keyframes o3spin { to { transform: rotate(360deg); } }
.o3-nogl { max-width: 380px; text-align: center; padding: 20px; color: var(--text); }
.o3-card { position: absolute; left: 14px; bottom: 44px; width: min(350px, calc(100% - 28px)); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 8px 30px rgba(16,24,20,.2); padding: 14px; z-index: 3; }
.o3-ch { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; padding-right: 26px; }
.o3-ch b { display: block; font-size: 16px; }
.o3-ch span { display: block; font-size: 13px; color: var(--muted); }
.o3-ch .o3-st { display: flex; align-items: center; gap: 6px; }
.o3-card p { margin: 0 0 10px; }
.o3-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.o3-x { position: absolute; top: 8px; right: 8px; }
.side-search { width: calc(100% - 16px); margin: 4px 8px 8px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); }
#o3-people .item .o3-dot { margin-left: auto; }
@media (max-width: 760px) { .o3-hint, .o3-legend { display: none; } }
