/* Volans. The look is the approved demo's (boss, 2026-09-27: "this one"),
   filling the phone instead of drawn inside a picture of one. On a wide
   screen it stays a phone-width column: it is a phone app first. */

:root {
  --sea: #0f4c6e; --sea-2: #1d6a8f; --sea-soft: #e3f0f6; --fin: #e0802a; --fin-soft: #fcefe1;
  --ink: #17232e; --ink-2: #6a7885; --line: #e6ebef; --page: #f2f4f6; --card: #ffffff;
  --bubble-me: #1d6a8f; --bubble-them: #ffffff; --bad: #d13b2c; --good: #2c7a55; --stage: #dde4ea;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #e7edf2; --ink-2: #93a3b0; --line: #24323d; --page: #0f171d; --card: #17232c;
    --bubble-them: #1f2d37; --sea-soft: #173244; --fin-soft: #3a2917; --stage: #080f14;
  }
  .t-fac { color: var(--fin) !important; }
  .t-fwd { background: #17301f !important; }
  .t-us { background: #2a2536 !important; color: #c7b8f0 !important; }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--stage); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
}
button, input, textarea, select { font: inherit; color: inherit; }
.app {
  height: 100dvh; max-width: 520px; margin: 0 auto; background: var(--page);
  display: grid; grid-template-rows: auto 1fr auto; position: relative; overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
}
@media (min-width: 560px) { .app { box-shadow: 0 0 0 1px var(--line); } }

.bar { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 8px; min-height: 50px; }
.bar h1 { font-size: 17px; margin: 0; flex: 1; font-weight: 700; text-align: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .side { width: 72px; display: flex; gap: 4px; }
.bar .side.r { justify-content: flex-end; }
.ib { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--ink); display: grid; place-items: center; }
.ib svg { width: 22px; height: 22px; }
.sub { font-size: 11px; color: var(--ink-2); font-weight: 400; display: block; overflow: hidden; text-overflow: ellipsis; }
.body { overflow-y: auto; min-height: 0; }
.tabs { background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tab { background: none; border: 0; padding: 7px 0 9px; display: grid; justify-items: center; gap: 2px; color: var(--ink-2); font-size: 11px; cursor: pointer; position: relative; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--sea-2); font-weight: 700; }
.dot { position: absolute; top: 3px; left: calc(50% + 7px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; line-height: 17px; font-weight: 700; }
:focus-visible { outline: 2px solid var(--fin); outline-offset: 2px; }

.search { margin: 8px 12px; background: var(--card); border-radius: 8px; padding: 0 12px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.search svg { width: 16px; height: 16px; flex: 0 0 auto; }
.search input { border: 0; background: none; outline: none; padding: 9px 0; width: 100%; font-size: 14px; }
.conv { display: grid; grid-template-columns: 48px 1fr auto; gap: 11px; align-items: center; padding: 11px 14px; background: var(--card); border: 0; width: 100%; text-align: left; cursor: pointer; position: relative; }
.conv.pin { background: color-mix(in srgb, var(--card) 88%, var(--sea-2)); }
.conv + .conv::before { content: ""; position: absolute; left: 73px; right: 0; top: 0; border-top: 1px solid var(--line); }
.av { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px; position: relative; flex: 0 0 auto; }
.av.sm { width: 40px; height: 40px; border-radius: 8px; font-size: 15px; }
.av.grp { grid-template-columns: 1fr 1fr; gap: 2px; padding: 4px; background: var(--line); }
.av.grp i { border-radius: 3px; display: grid; place-items: center; font-style: normal; font-size: 10px; color: #fff; }
.badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; text-align: center; }
.badge.muted { background: var(--ink-2); }
.cname { font-weight: 500; font-size: 15.5px; display: flex; gap: 6px; align-items: center; min-width: 0; }
.cname b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clast { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; display: block; }
.clast .urg { color: var(--bad); font-weight: 700; }
.ctime { font-size: 11.5px; color: var(--ink-2); align-self: start; padding-top: 3px; }
.tag { font-size: 10.5px; font-weight: 700; padding: 0 5px; border-radius: 4px; flex: 0 0 auto; line-height: 17px; white-space: nowrap; }
.t-fac { background: var(--fin-soft); color: #9a5212; }
.t-wh { background: var(--sea-soft); color: var(--sea-2); }
.t-fwd { background: #e3f3ea; color: var(--good); }
.t-us { background: #ece8fb; color: #5b45a8; }
.t-grp { background: var(--line); color: var(--ink-2); }
.t-sys { background: var(--fin); color: #fff; }

.chatwrap { display: grid; grid-template-rows: 1fr auto; min-height: 0; height: 100%; }
.chatwrap .scroll { overflow-y: auto; min-height: 0; }
.chatbody { padding: 12px 12px 8px; display: grid; gap: 12px; align-content: start; }
.time { justify-self: center; font-size: 11.5px; color: var(--ink-2); }
.sysmsg { justify-self: center; font-size: 12px; color: var(--ink-2); background: var(--card); border-radius: 6px; padding: 4px 10px; text-align: center; max-width: 86%; }
.more-old { justify-self: center; background: none; border: 0; color: var(--sea-2); font-size: 12.5px; cursor: pointer; }
.m { display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: start; }
.m.me { grid-template-columns: 1fr 40px; }
.m.me .av { order: 2; }
.m .col { display: grid; gap: 3px; justify-items: start; min-width: 0; }
.m.me .col { justify-items: end; }
.m .nm { font-size: 11.5px; color: var(--ink-2); }
.bub { background: var(--bubble-them); border-radius: 4px 12px 12px 12px; padding: 9px 12px; font-size: 15px; line-height: 1.55; max-width: min(300px, 75vw); word-break: break-word; white-space: pre-wrap; }
.me .bub { background: var(--bubble-me); color: #fff; border-radius: 12px 4px 12px 12px; }
.bub.urgent { box-shadow: inset 0 0 0 2px var(--bad); }
.urgmark { font-size: 11px; font-weight: 700; color: var(--bad); }
.read { font-size: 11px; color: var(--ink-2); }
.pic { max-width: min(220px, 60vw); max-height: 260px; border-radius: 10px; display: block; background: var(--line); }
.file { background: var(--bubble-them); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: 1fr 36px; gap: 10px; width: 240px; max-width: 70vw; text-decoration: none; color: inherit; }
.file b { font-size: 14px; font-weight: 500; word-break: break-all; }
.file span { font-size: 11.5px; color: var(--ink-2); }
.file i { width: 36px; height: 42px; border-radius: 4px; background: var(--good); color: #fff; font-style: normal; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.input { background: var(--card); border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: end; }
.input textarea { border: 0; background: var(--page); border-radius: 6px; padding: 9px 10px; font-size: 16px; color: var(--ink); min-width: 0; outline: none; resize: none; max-height: 120px; line-height: 1.4; }
.urg-btn { font-weight: 700; font-size: 14px; color: var(--bad); background: transparent; border-radius: 6px; padding: 6px; border: 0; cursor: pointer; }
.urg-btn.on { color: #fff; background: var(--bad); }
.plus { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; background: var(--page); padding: 16px 12px 18px; border-top: 1px solid var(--line); }
.pk { background: none; border: 0; display: grid; justify-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.pk i { width: 54px; height: 54px; border-radius: 12px; background: var(--card); display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 700; color: var(--ink); }

.btn { border: 0; border-radius: 6px; padding: 8px 14px; font-size: 14px; font-weight: 700; background: var(--sea-2); color: #fff; cursor: pointer; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.ghost { background: var(--sea-soft); color: var(--sea-2); }
.btn.bad { background: var(--bad); }
.btn.wide { width: 100%; padding: 11px; font-size: 15px; }

.sec { font-size: 12px; color: var(--ink-2); padding: 12px 14px 6px; font-weight: 700; }
.row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 9px 14px; background: var(--card); border: 0; width: 100%; text-align: left; cursor: pointer; position: relative; }
.row.plain { grid-template-columns: 1fr auto; }
.row + .row::before { content: ""; position: absolute; left: 66px; right: 0; top: 0; border-top: 1px solid var(--line); }
.row.plain + .row.plain::before { left: 14px; }
.row .n { font-size: 15px; display: flex; gap: 6px; align-items: center; }
.row .d { font-size: 12px; color: var(--ink-2); display: block; }
.row .r { font-size: 12px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.row input[type="checkbox"] { width: auto; }
.todo { background: var(--card); margin: 8px 12px 0; border-radius: 10px; padding: 11px 12px; display: grid; gap: 6px; border-left: 4px solid var(--fin); }
.todo.bad { border-left-color: var(--bad); }
.todo b { font-size: 14.5px; }
.todo span { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.todo .acts { display: flex; gap: 8px; }
.none { text-align: center; color: var(--ink-2); font-size: 13px; padding: 28px 16px; line-height: 1.6; }
.toast { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); background: rgba(20, 34, 48, 0.92); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 13px; pointer-events: none; max-width: 86%; text-align: center; z-index: 10; }

/* sign in */
.auth { padding: 28px 22px; display: grid; gap: 14px; align-content: start; }
.auth .brand { display: grid; justify-items: center; gap: 8px; margin: 12px 0 8px; }
.auth .brand .av { width: 64px; height: 64px; border-radius: 16px; font-size: 26px; background: var(--sea-2); }
.auth .brand b { font-size: 22px; }
.auth .brand span { font-size: 13px; color: var(--ink-2); text-align: center; }
label.f { display: grid; gap: 5px; font-size: 13px; color: var(--ink-2); }
label.f input, label.f select, .sheet input, .sheet textarea { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 10px 11px; font-size: 16px; color: var(--ink); outline: none; width: 100%; }
label.f input:focus, .sheet input:focus { border-color: var(--sea-2); }
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kinds button { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 4px; font-size: 13px; cursor: pointer; }
.kinds button.on { border-color: var(--sea-2); background: var(--sea-soft); color: var(--sea-2); font-weight: 700; }
.msgline { font-size: 13px; color: var(--bad); min-height: 18px; }
.link { background: none; border: 0; color: var(--sea-2); cursor: pointer; font-size: 14px; padding: 4px; }

/* bottom sheet */
.sheet { position: absolute; inset: 0; background: rgba(8, 20, 30, 0.45); display: grid; align-items: end; z-index: 5; }
.sheet .panel { background: var(--page); border-radius: 14px 14px 0 0; max-height: 86%; display: grid; grid-template-rows: auto 1fr auto; padding-bottom: env(safe-area-inset-bottom, 0px); }
.sheet .ph { display: flex; align-items: center; padding: 12px 14px; font-weight: 700; font-size: 16px; border-bottom: 1px solid var(--line); }
.sheet .ph span { flex: 1; }
.sheet .pb { overflow-y: auto; padding: 12px 0; display: grid; gap: 10px; align-content: start; }
.sheet .pb > label.f, .sheet .pb > p, .sheet .pb > .box { margin: 0 14px; }
.sheet .pf { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.box { background: var(--card); border-radius: 8px; padding: 10px 12px; font-size: 13px; word-break: break-all; }
.switch { width: 44px; height: 26px; border-radius: 13px; background: var(--line); border: 0; position: relative; cursor: pointer; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.switch.on { background: var(--good); }
.switch.on::after { left: 21px; }
.hours { display: flex; gap: 8px; align-items: center; }
.hours input { width: auto; }
