:root {
  --teal: #33c6c1;
  --teal-dark: #1f9e9a;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --bg: #eef2f8;
  --card: #fff;
  --danger: #c0392b;
  --ok: #248a3d;
  --on-accent: #fff;
  --pill-new-ink: #fff;
  --radius: 18px;
  --shadow: 0 10px 32px rgba(16, 36, 64, 0.06);
  --sidebar: 252px;
  --sidebar-bg: #fff;
  --accent: #14918c;
  --accent-dark: #0e7571;
  --side: #001535;
  --input: #fff;
  --wash: #f5f5f7;
  --chip: #e8e8ed;
  --chip-on: #fff;
  --quiet: #e8e8ed;
  --quiet-hover: #dedee3;
  --nav: #e7f7f4;
  --hover: #fafafa;
  --flash: #e8f8f7;
  --row-line: #ececf1;
  --new-bg: #f3fbfb;
  --new-hover: #e7f7f4;
  --legal-bg: #f7f4ec;
  --legal-hover: #efe9dc;
  --legal-new-bg: #f6f3ea;
  --legal-new-hover: #efe6d4;
  --legal-bar: #8a6a32;
  --pill: #f5f5f7;
  --work-bg: #d7f4f2;
  --work: #0f766e;
  --sent-bg: #fff4e5;
  --sent: #9a6700;
  --signed-bg: #e7f6ea;
  --signed: #248a3d;
  --now: #f5f5f7;
  --now-ink: #3a3a3c;
  --mine: #f3fbfa;
  --kind-person-bg: #e7f7f4;
  --kind-person: #0f766e;
  --kind-legal-bg: #3d3426;
  --kind-legal: #fff;
  --chev: #aeaeb2;
  --list-quiet: #8e8e93;
  --scroll: #c5ced8;
  --scroll-hover: #14918c;
  --warn: #9a6700;
  --warn-strong: #9a3412;
  color-scheme: light;
}

html.dark {
  --teal-dark: #5ed9d4;
  --ink: #f5f5f7;
  --muted: #98989d;
  --line: #3a3a3c;
  --bg: #0e141d;
  --card: #171e29;
  --danger: #ff6b6b;
  --ok: #4ade80;
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
  --sidebar-bg: #0c1828;
  --accent: #2ec4be;
  --accent-dark: #7ee0d8;
  --side: #001535;
  --input: #2c2c2e;
  --wash: #2c2c2e;
  --chip: #2a2a2e;
  --chip-on: #3a3a3c;
  --quiet: #3a3a3c;
  --quiet-hover: #48484a;
  --nav: #163533;
  --hover: #2a2a2c;
  --flash: #163533;
  --row-line: #2e2e32;
  --new-bg: #132e2c;
  --new-hover: #18403c;
  --legal-bg: #2a241c;
  --legal-hover: #3a3124;
  --legal-new-bg: #322a1c;
  --legal-new-hover: #3d3424;
  --legal-bar: #c4a46a;
  --pill: #2c2c2e;
  --work-bg: #143835;
  --work: #7ee0d8;
  --sent-bg: #3a2c14;
  --sent: #f0c36a;
  --signed-bg: #14301c;
  --signed: #7ddea0;
  --now: #2c2c2e;
  --now-ink: #f5f5f7;
  --mine: #162624;
  --kind-person-bg: #143835;
  --kind-person: #7ee0d8;
  --kind-legal-bg: #3d3426;
  --kind-legal: #fff;
  --chev: #636366;
  --list-quiet: #a1a1a6;
  --scroll: #3d4c60;
  --scroll-hover: #2ec4be;
  --warn: #f0c36a;
  --warn-strong: #f0a070;
  --pill-new-ink: #0e3331;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

html, body { margin: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.45;
}

body.app {
  background:
    radial-gradient(880px 380px at 100% -8%, rgba(20, 145, 140, 0.1), transparent 55%),
    var(--bg);
}

a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.lede, .muted { color: var(--muted); }
.lede { margin: 8px 0 0; font-size: 17px; }

body.auth {
  display: flex;
  align-items: safe center;
  justify-content: center;
  min-height: 100dvh;
  padding: 28px 20px;
  background:
    radial-gradient(880px 420px at 0% 0%, rgba(26, 58, 53, 0.09), transparent 58%),
    radial-gradient(640px 320px at 100% 100%, rgba(51, 198, 193, 0.12), transparent 60%),
    var(--bg);
}

.gate {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  width: min(1080px, 100%);
  min-height: min(680px, calc(100dvh - 56px));
  overflow: clip;
  border-radius: 32px;
  background: var(--card);
  box-shadow: 0 50px 110px -42px rgba(10, 30, 27, 0.5);
}

.gate-side,
.gate-main {
  min-height: 0;
}

.gate-side {
  display: flex;
  flex-direction: column;
  padding: 36px 32px 32px;
  background:
    radial-gradient(80% 50% at 100% 0%, rgba(51, 198, 193, 0.28), transparent 70%),
    radial-gradient(70% 40% at 0% 100%, rgba(51, 198, 193, 0.16), transparent 70%),
    #1a3a35;
  color: #fff;
}

.gate-logo {
  display: block;
  width: fit-content;
  margin-bottom: 36px;
}

.gate-logo img {
  display: block;
  width: min(240px, 100%);
  height: auto;
}

.gate-kicker {
  margin: 0 0 12px;
  color: #8fe3df;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gate-side h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.gate-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.5;
}

.gate-steps {
  display: grid;
  gap: 18px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: gate;
}

.gate-steps li {
  position: relative;
  padding-left: 46px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
  line-height: 1.4;
  counter-increment: gate;
}

.gate-steps li::before {
  content: counter(gate);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(143, 227, 223, 0.45);
  border-radius: 50%;
  color: #8fe3df;
  font-size: 13px;
  font-weight: 800;
}

.gate-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 34px;
  left: 14px;
  width: 1px;
  height: calc(100% - 12px);
  background: rgba(143, 227, 223, 0.28);
}

.gate-steps b {
  display: block;
  margin-bottom: 2px;
  color: #fff;
  font-size: 15px;
}

.gate-person {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 28px;
}

.gate-person img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.gate-person p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.35;
}

.gate-person b {
  display: block;
  color: #fff;
  font-size: 15px;
}

.gate-main {
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  padding: 44px 48px 36px;
}

.auth h1 { font-size: 36px; }

.auth .lede { margin: 8px 0 22px; }

.auth .panel {
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.auth .quiet {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 18px;
  margin: 20px 0 0;
  text-align: left;
}

.auth .quiet a { font-weight: 700; }

.auth .btn {
  min-height: 52px;
  border-radius: 16px;
  background: #1a3a35;
}

.auth .btn:hover { background: #14302c; }

html.dark .auth .btn {
  background: var(--accent);
  color: #0e3331;
}

html.dark .auth .btn:hover { background: var(--accent-dark); }

.auth input,
.auth select,
.auth textarea {
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--wash);
}

.auth textarea { min-height: 96px; }

.auth input:focus,
.auth select:focus,
.auth textarea:focus {
  border-color: #1a3a35;
  background: var(--card);
}

html.dark .auth input:focus,
html.dark .auth select:focus,
html.dark .auth textarea:focus {
  border-color: var(--accent);
}

@supports not (align-items: safe center) {
  @media (max-height: 900px) {
    body.auth { align-items: flex-start; }
  }
}

@media (max-width: 860px) {
  body.auth {
    align-items: stretch;
    padding: 0;
  }

  .gate {
    width: 100%;
    min-height: 100dvh;
    overflow: visible;
    border-radius: 0;
    grid-template-columns: 1fr;
  }

  .gate-side { padding: 28px 22px 24px; }

  .gate-logo { margin-bottom: 22px; }

  .gate-side h2 { font-size: 28px; }

  .gate-steps,
  .gate-person { display: none; }

  .gate-main {
    justify-content: flex-start;
    padding: 28px 22px calc(48px + env(safe-area-inset-bottom, 0px));
  }
}

html.dark .brand img {
  filter: invert(1) hue-rotate(180deg);
  mix-blend-mode: lighten;
}

.auth .brand img { height: 42px; width: auto; }

.sidebar .brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 4px 0 8px;
  background: none;
}

.sidebar .brand img,
html.dark .sidebar .brand img {
  width: 100%;
  height: auto;
  filter: none;
  mix-blend-mode: normal;
}

.auth .brand { display: inline-block; margin-bottom: 28px; }

.card, .group, .panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel { margin-top: 22px; padding: 22px; }

.quiet { margin: 18px 0 0; color: var(--muted); font-size: 15px; text-align: center; }

.flash {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--flash);
  color: var(--teal-dark);
  font-weight: 600;
}

.segment {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 0 18px;
  padding: 3px;
  background: var(--chip);
  border-radius: 12px;
}

.segment input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.segment label {
  display: block;
  padding: 10px 8px;
  border-radius: 10px;
  text-align: center;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}

.segment input:checked + label {
  background: var(--chip-on);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.segment input:focus-visible + label {
  outline: 3px solid rgba(51, 198, 193, 0.35);
}

body:has(#role-legal:checked) .only-individual { display: none; }
body:has(#role-individual:checked) .only-legal { display: none; }

.fields { display: flex; flex-direction: column; gap: 14px; }

label.field, .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
}

textarea { min-height: 96px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(51, 198, 193, 0.35);
  border-color: var(--teal);
}

.password { position: relative; }

.password input { padding-right: 44px; }

.password .eye {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password .eye:hover { color: var(--ink); }

.password .eye:focus-visible {
  outline: 3px solid rgba(51, 198, 193, 0.35);
  outline-offset: -6px;
  border-radius: 10px;
}

.password .eye svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password .eye .eye-off { display: none; }
.password .eye.is-open .eye-open { display: none; }
.password .eye.is-open .eye-off { display: block; }

.ghost, .text-btn {
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  padding: 0 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { background: var(--accent-dark); text-decoration: none; }

.btn.btn-line {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(16, 36, 64, 0.05);
}
.btn.btn-line:hover { background: var(--hover); }
.btn.btn-danger {
  background: var(--card);
  color: var(--danger);
  border: 1px solid #e4b4ae;
  box-shadow: none;
}
.btn.btn-danger:hover { background: #fdecea; color: var(--danger); }
html.dark .btn.btn-danger { border-color: #6e3030; }
html.dark .btn.btn-danger:hover { background: rgba(255, 107, 107, 0.14); color: var(--danger); }

.top-actions .btn { gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.top-actions .btn svg,
.docs .btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.top-actions .status-form select {
  height: 42px;
  min-height: 42px;
  padding: 0 40px 0 14px;
  border-radius: 12px;
  background-color: var(--card);
  font-size: 14px;
  line-height: 40px;
}

.btn-block { width: 100%; margin-top: 16px; }

.btn-quiet {
  background: var(--quiet);
  color: var(--ink);
}

.btn-quiet:hover { background: var(--quiet-hover); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  min-height: 36px;
  padding: 0 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--wash);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pill-work { background: var(--work-bg); color: var(--work); }
.pill-new { background: var(--teal); color: var(--pill-new-ink); }
.pill-sent { background: var(--sent-bg); color: var(--sent); }
.pill-signed { background: var(--signed-bg); color: var(--signed); }
.pill-done { background: var(--pill); color: var(--muted); }

.field-error { color: var(--danger); font-size: 13px; font-weight: 650; }
.field-error a { text-decoration: underline; }

label.field.consent {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
}

label.field.consent input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 1px 0 0;
  padding: 0;
  flex: none;
  accent-color: var(--teal);
}

label.field.consent span { flex: 1; min-width: 0; }

.strip {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--wash);
  color: var(--muted);
  font-size: 15px;
}

.strip b { display: block; color: var(--ink); font-size: 17px; }

.company-card {
  padding: 14px;
  border-radius: 12px;
  background: var(--wash);
}

.company-card + .company-card { margin-top: 8px; }

.company-card button.pick {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.company-card strong { display: block; color: var(--ink); font-size: 17px; }
.company-card p { margin: 4px 0 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.warn { color: var(--warn-strong); }

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 14px 16px;
  background-color: var(--side);
  background-image: url("side-art.jpg?v=6");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 125% auto;
  color: #e7eef8;
}

.sidebar .me {
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(8, 16, 28, 0.46);
}
.sidebar .me b,
.sidebar .me span {
  text-shadow: none;
}

.sidebar > * { position: relative; z-index: 1; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.side-nav svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.side-nav a:hover { background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.side-nav a.active { background: var(--accent); color: #fff; text-decoration: none; }
.side-nav a.active .nav-badge { background: #fff; color: var(--accent-dark); }

.side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }

.sidebar .theme {
  margin-left: auto;
  margin-right: auto;
  background: rgba(255, 255, 255, 0.12);
}
.sidebar .theme button { color: rgba(255, 255, 255, 0.72); }
html:not(.dark) .sidebar .theme button[data-theme="light"],
html.dark .sidebar .theme button[data-theme="dark"] { color: #10243c; }

.theme {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 76px;
  height: 36px;
  margin: 0 12px 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--chip);
}
.theme-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  transition: transform 0.22s ease;
}
html.dark .theme-thumb { transform: translateX(100%); }
.theme button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
html:not(.dark) .theme button[data-theme="light"],
html.dark .theme button[data-theme="dark"],
.theme button[aria-pressed="true"] { color: var(--ink); }
.theme button:focus-visible { outline: 3px solid rgba(51, 198, 193, 0.35); outline-offset: 2px; border-radius: 999px; }
.theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme button[data-theme="dark"] svg { fill: currentColor; stroke: none; }

.me { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.sidebar .me b { color: #fff; font-size: 14px; }
.sidebar .me span { color: rgba(255, 255, 255, 0.62); font-size: 12px; }

.main { padding: 32px 36px 64px; }

.hello {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-block { min-width: 0; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.back::before { content: "←"; }
.back:hover { color: var(--accent); text-decoration: none; }

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.top-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.top-actions .confirm-form { margin: 0; }
.top-actions .confirm-strip { min-height: 42px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  max-width: none;
  padding: 0;
  overflow: visible;
  background: transparent;
  border-radius: 0;
}

.filters a {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.warn { display: block; margin-top: 4px; color: var(--warn); font-size: 14px; font-weight: 650; }

.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--teal);
  vertical-align: 1px;
}
.filters a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.filters a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.filters a span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin: 0;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
}
.filters a.on span { background: rgba(255, 255, 255, 0.22); color: #fff; }

.search { margin: 0; }
.board-tools .search { flex: 0 0 360px; min-width: 0; }
.search input {
  width: min(100%, 360px);
  min-height: 44px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background-color: var(--input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 16px;
}

.board {
  padding: 16px 16px 8px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.board-tools {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.board-tools .filters { margin: 0; flex: 1; }
.board-tools-end { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.search-wide { flex: 1 1 720px; max-width: 720px; min-width: 0; }
.search-wide input { width: 100%; }

.board > .group, .board > .group.list {
  background: transparent;
  box-shadow: none;
  border-radius: 14px;
}

.board > .empty { background: transparent; box-shadow: none; }

.sheet-head, a.sheet {
  display: grid;
  gap: 12px;
  align-items: center;
}

.cols { grid-template-columns: 92px minmax(140px, 1.4fr) minmax(110px, 0.9fr) minmax(140px, 0.8fr) minmax(110px, 0.9fr); }
.cols-m { grid-template-columns: 92px minmax(120px, 1.15fr) minmax(120px, 1fr) minmax(108px, 0.8fr) minmax(140px, 0.7fr) minmax(108px, 0.8fr); }

.sheet-head {
  padding: 4px 14px 8px;
  color: var(--list-quiet);
  font-size: 12px;
  font-weight: 600;
}

a.sheet {
  padding: 12px 14px;
  border-top: 1px solid var(--row-line);
  border-radius: 0;
  color: inherit;
  text-decoration: none;
}

a.sheet:hover { background: var(--hover); text-decoration: none; }

.c-no, .c-title, .c-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.c-no b, .c-title b, .c-who b { font-size: 15px; font-weight: 750; line-height: 1.25; }
.c-no b { color: var(--list-quiet); font-size: 13px; font-weight: 500; }
.c-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-title small, .c-who small { font-size: 12px; font-weight: 500; }
.c-title small, .c-who small > span:not(.kind) { color: var(--list-quiet); }
.c-who small { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
a.sheet .wait { color: var(--warn); font-weight: 700; }
.c-date { color: var(--ink); font-size: 14px; font-weight: 500; }
.c-got, .c-date.is-empty { color: var(--list-quiet); font-size: 13px; font-weight: 500; }
.c-status { display: flex; justify-content: flex-start; }
.c-status .pill { min-width: 0; }

.open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--quiet);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  flex: none;
}

.row > .open-btn { color: var(--ink); font-size: 14px; font-weight: 700; }
a.row:hover .open-btn { background: var(--accent); color: #fff; }

a.sheet .pill { padding: 3px 10px; font-size: 12px; font-weight: 700; }
a.sheet .pill-work { background: #c9e2fb; color: #1a6bb5; }
a.sheet .pill-sent { background: #ffe3c2; color: #b86a12; }
a.sheet .pill-signed { background: #cfeedd; color: #1d7a3a; }
a.sheet .pill-done { background: #e4e0ea; color: #6b6280; }
a.sheet .pill-new { background: #c9efec; color: #0f766e; }
html.dark a.sheet .pill-work { background: #1d3d5c; color: #8ec8f5; }
html.dark a.sheet .pill-sent { background: #543c1c; color: #f3c27a; }
html.dark a.sheet .pill-signed { background: #1e4632; color: #86efac; }
html.dark a.sheet .pill-done { background: #3c3948; color: #c4bdd4; }
html.dark a.sheet .pill-new { background: #1c4542; color: #7ee0d8; }

.now {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--wash);
  color: var(--now-ink);
  font-weight: 700;
}
.now::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.now p { margin: 0; flex: 1; }
.now .btn { margin: 0; }
.now-work { background: var(--work-bg); color: var(--work); }
.now-sent { background: var(--sent-bg); color: var(--sent); }
.now-signed { background: var(--signed-bg); color: var(--signed); }
.now-done, .now-new { background: var(--now); color: var(--now-ink); }

.app-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 16px;
  align-items: start;
}
.app-main, .app-side { min-width: 0; }
.app-side { display: flex; flex-direction: column; gap: 16px; }
.app-main > .panel { margin-top: 16px; }
.app-main > .panel:first-child { margin-top: 0; }
.docs .file-add { padding: 4px 4px 12px; }
.docs .doc-empty { margin: 0; padding: 4px 4px 12px; color: var(--muted); font-size: 14px; }

.docs {
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px 16px 8px;
}
.docs h2 {
  margin: 0 0 4px;
  padding: 0 4px 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.doc {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 4px;
  border-top: 1px solid var(--row-line);
}
.doc:first-of-type { border-top: 0; }
.docs .doc-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  margin: 0;
}
.doc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}
.doc-ico { width: 34px; height: 42px; flex: none; }
.doc-ico path { fill: #14918c; }
.doc-ico .doc-fold { fill: #d7f4f2; }
.doc-ico .doc-lines { fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; }
.doc-signed .doc-ico path { fill: #1f9e9a; }
.doc-signed .doc-ico .doc-fold { fill: #c9efe8; }
.doc-later .doc-ico path { fill: #b7c0cc; }
.doc-later .doc-ico .doc-fold { fill: #e8edf3; }
.doc-voucher .doc-ico path { fill: #3b6ea5; }
.doc-voucher .doc-ico .doc-fold { fill: #d9e6f5; }
.doc-main { min-width: 0; flex: 1; }
.doc-main b { display: block; font-size: 15px; line-height: 1.3; }
.doc-main span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.doc-file .doc-main b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-file .doc-main span { overflow-wrap: normal; white-space: nowrap; }
.doc-side { display: flex; align-items: center; gap: 2px; flex: none; }
.doc-side form { display: flex; align-items: center; margin: 0; }
.docs .confirm-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}
.docs .confirm-strip > span { flex: 1 1 100%; min-width: 0; line-height: 1.35; }
.docs .confirm-strip .btn { min-height: 32px; }
.docs .field-error { margin: 0 4px 8px; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fact { min-width: 0; padding: 10px 14px; }
.fact b { display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.fact span { color: var(--ink); font-size: 15px; font-weight: 600; }

.row span.wait { color: var(--warn); font-weight: 700; }
.confirm-strip span { color: var(--ink); }

.group { overflow: hidden; }
.client-pass { margin-bottom: 22px; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-top: 1px solid var(--row-line);
  color: inherit;
  text-decoration: none;
}

.row:first-child { border-top: 0; }
a.row:hover { background: var(--hover); text-decoration: none; }

.row .grow { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.row strong { display: block; font-size: 17px; }
.row strong .num { margin-right: 6px; color: var(--muted); font-size: 14px; font-weight: 700; }
.group.list .row { padding: 8px 14px; gap: 12px; }
.group.list .row .grow { gap: 0; }
.group.list .row strong { font-size: 15px; line-height: 1.25; }
.group.list .row .grow > span { font-size: 13px; line-height: 1.3; }
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.pager a, .pager span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.pager a:hover { background: var(--nav); text-decoration: none; }
.pager span.on { background: var(--teal); color: var(--on-accent); }
.pager span.off { background: transparent; color: var(--muted); }
.row span, .meta { color: var(--muted); font-size: 14px; font-weight: 500; }
.row span.pill-work { color: var(--work); }
.row span.pill-new { color: var(--pill-new-ink); }
.row span.pill-sent { color: var(--sent); }
.row span.pill-signed { color: var(--signed); }
.row span.pill-done { color: var(--muted); }
.row-end { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: none; }
.row-end .pill { min-width: 11.5rem; justify-content: center; }
a.row.is-new { background: var(--new-bg); }
a.row.is-new:hover { background: var(--new-hover); }
a.row.is-legal { background: var(--legal-bg); box-shadow: inset 3px 0 0 var(--legal-bar); }
a.row.is-legal:hover { background: var(--legal-hover); }
a.row.is-new.is-legal { background: var(--legal-new-bg); }
a.row.is-new.is-legal:hover { background: var(--legal-new-hover); }
.row b.company { color: var(--ink); font-weight: 800; }
.kind {
  display: inline-flex;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.kind-legal, .row span.kind-legal { background: var(--kind-legal-bg); color: var(--kind-legal); }
.kind-person, .row span.kind-person { background: var(--kind-person-bg); color: var(--kind-person); }
.group.list.clients .row { padding: 5px 12px; gap: 8px; }
.group.list.clients .row .grow { flex-direction: row; align-items: center; gap: 10px; min-width: 0; }
.group.list.clients .row strong {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group.list.clients .row .grow > span {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-kind { margin: 0 0 16px; }
.log-line {
  margin: 0;
  padding: 6px 14px;
  border-top: 1px solid var(--row-line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.log-line:first-child { border-top: 0; }
.log-line b { color: var(--ink); font-weight: 650; }
.log-no {
  display: inline-block;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--nav);
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.log-no:hover { background: var(--accent); color: #fff; text-decoration: none; }
.chev { color: var(--chev); font-size: 22px; line-height: 1; }

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}

.empty .btn { margin-top: 16px; }

.section-label {
  margin: 28px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kv { display: block; }
.kv b { display: block; margin-bottom: 2px; color: var(--muted); font-size: 13px; font-weight: 650; }
.kv span { color: var(--ink); font-size: 17px; font-weight: 500; }

.thread {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(420px, 52vh);
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--bg);
}
.thread + .composer { border-top: 1px solid var(--row-line); padding: 10px 12px 12px; }
.thread + .composer textarea {
  height: 44px;
  min-height: 44px;
  max-height: 120px;
  padding: 10px 12px;
  line-height: 22px;
  border-radius: 14px;
  background: var(--wash);
}
.chat-empty { margin: 0; color: var(--muted); font-size: 13px; }
.thread,
.inbox-thread,
.inbox-list {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll) transparent;
}
.thread::-webkit-scrollbar,
.inbox-thread::-webkit-scrollbar,
.inbox-list::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
.thread::-webkit-scrollbar-track,
.inbox-thread::-webkit-scrollbar-track,
.inbox-list::-webkit-scrollbar-track {
  background: transparent;
}
.thread::-webkit-scrollbar-thumb,
.inbox-thread::-webkit-scrollbar-thumb,
.inbox-list::-webkit-scrollbar-thumb {
  background: var(--scroll);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
.thread::-webkit-scrollbar-thumb:hover,
.inbox-thread::-webkit-scrollbar-thumb:hover,
.inbox-list::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-hover);
  border: 3px solid transparent;
  background-clip: padding-box;
}
.message { padding: 16px 18px; border-top: 1px solid var(--row-line); }
.message:first-child { border-top: 0; }
.message .who { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.message .who b { font-size: 15px; }
.message p { margin: 0; white-space: pre-wrap; }
.message.mine { background: var(--mine); }

.attach-btn { position: relative; cursor: pointer; }
.attach-btn.is-busy { opacity: 0.7; pointer-events: none; }

.file-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-add form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
}

.confirm-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.confirm-strip { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; }
.confirm-strip .btn { min-height: 36px; padding: 0 12px; }
.message .confirm-form { margin-top: 8px; }

.composer, .file-add, .inline {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 14px 18px 18px;
}

.composer textarea { flex: 1; }

.file-row { align-items: center; }
.file-row form { margin: 0; }
.file-line { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.file-line .confirm-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--teal-dark);
  flex: none;
}
button.dl { border: 0; background: transparent; padding: 0; cursor: pointer; }
.dl svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dl:hover { background: var(--quiet); text-decoration: none; }
.dl-x { color: var(--danger); }
.dl-x:hover { background: rgba(192, 57, 43, 0.1); }
html.dark .dl-x:hover { background: rgba(255, 107, 107, 0.16); }

.status-form { display: flex; gap: 8px; align-items: center; }
.status-form select {
  width: auto;
  min-height: 40px;
  padding-right: 40px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}
html.dark .status-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.apps-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.apps-main { min-width: 0; }
.apps-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.side-card {
  padding: 16px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.side-card h2 { margin: 0 0 12px; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.status-picks {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.status-pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 8px;
  padding: 12px 14px 10px;
  border-radius: 18px;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.status-pick:hover { text-decoration: none; transform: translateY(-2px); }
.status-ico {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
}
.status-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.status-pick strong { grid-column: 1; grid-row: 1; font-size: 32px; line-height: 1; letter-spacing: -0.04em; }
.status-pick > span:last-child {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.status-pick i { color: inherit; font-style: normal; opacity: 0.7; }
.tone-all { background: #eef2fb; }
.tone-all .status-ico { background: #d7e3f8; color: #3b6ea5; }
.tone-new { background: #e7f7f6; }
.tone-new .status-ico { background: #c9efec; color: #0f766e; }
.tone-work { background: #e5f2ff; }
.tone-work .status-ico { background: #c9e2fb; color: #1a6bb5; }
.tone-sent { background: #fff4e8; }
.tone-sent .status-ico { background: #ffe3c2; color: #b86a12; }
.tone-signed { background: #e8f7ec; }
.tone-signed .status-ico { background: #cfeedd; color: #1d7a3a; }
.tone-done { background: #f3f1f6; }
.tone-done .status-ico { background: #e4e0ea; color: #6b6280; }
.tone-all.on { box-shadow: 0 0 0 2px #3b6ea5, var(--shadow); }
.tone-new.on { box-shadow: 0 0 0 2px #0f766e, var(--shadow); }
.tone-work.on { box-shadow: 0 0 0 2px #1a6bb5, var(--shadow); }
.tone-sent.on { box-shadow: 0 0 0 2px #b86a12, var(--shadow); }
.tone-signed.on { box-shadow: 0 0 0 2px #1d7a3a, var(--shadow); }
.tone-done.on { box-shadow: 0 0 0 2px #6b6280, var(--shadow); }
html.dark .tone-all { background: #1c2a42; }
html.dark .tone-all .status-ico { background: #2a3d62; color: #9ec0ef; }
html.dark .tone-new { background: #14302e; }
html.dark .tone-new .status-ico { background: #1c4542; color: #7ee0d8; }
html.dark .tone-work { background: #15283d; }
html.dark .tone-work .status-ico { background: #1d3d5c; color: #8ec8f5; }
html.dark .tone-sent { background: #3a2a16; }
html.dark .tone-sent .status-ico { background: #543c1c; color: #f3c27a; }
html.dark .tone-signed { background: #163024; }
html.dark .tone-signed .status-ico { background: #1e4632; color: #86efac; }
html.dark .tone-done { background: #2a2833; }
html.dark .tone-done .status-ico { background: #3c3948; color: #c4bdd4; }
.near-card {
  padding: 0;
  overflow: hidden;
  background-color: var(--card);
  background-image: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%);
}
.near {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  color: inherit;
  text-decoration: none;
}
.near-card { transition: transform 0.18s ease, box-shadow 0.18s ease; }
a.near:hover { text-decoration: none; }
.near-card:has(a.near:hover) {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--accent) 24%, transparent);
}
.near-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  transition: background 0.18s ease;
}
.near:hover .near-date { background: var(--accent-dark); }
.near-date b { font-size: 28px; line-height: 1; letter-spacing: -0.04em; }
.near-date small { margin-top: 2px; font-size: 12px; font-weight: 650; }
.near.is-empty .near-date { background: var(--wash); color: var(--muted); }
.near-date svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.near-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.near-main small { color: var(--muted); font-size: 12px; font-weight: 650; }
.near-main b {
  overflow: hidden;
  font-size: 16px;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.near-main span { color: var(--muted); font-size: 13px; }
.near-go { color: var(--accent); font-size: 20px; line-height: 1; transition: transform 0.18s ease; }
.near:hover .near-go { transform: translateX(4px); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-size: 16px; }
.cal-head a {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
}
.cal-head a:hover { background: var(--wash); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { padding: 4px 0 6px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; }
.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}
.cal-day b { font-weight: 600; }
.cal-day.is-pad { visibility: hidden; }
.cal-day.is-today { background: var(--accent); color: #fff; }
.cal-day.has-trip b { font-weight: 700; }
.cal-dot { width: 4px; height: 4px; margin-top: 2px; border-radius: 50%; background: var(--accent); }
.cal-day.is-today .cal-dot { background: #fff; }
.cal-day.is-pick { box-shadow: inset 0 0 0 1px var(--accent); }
.cal-picks { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.cal-picks a {
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
}
.cal-picks a:hover b { color: var(--accent); }
.side-line h2 { margin-bottom: 8px; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.side-head h2 { margin-bottom: 8px; }
.see-all { color: var(--accent); font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.side-empty { margin: 0; color: var(--muted); font-size: 14px; }
.apps-side .log-line { padding: 8px 0; font-size: 12px; }
.apps-side .log-line span, .apps-side .log-line b { display: block; }

@media (max-width: 1100px) {
  .app-split, .apps-split { grid-template-columns: 1fr; }
  .sheet-head { display: none; }
  a.sheet, .cols, .cols-m {
    grid-template-columns: 1fr auto;
  }
  .c-title { grid-column: 1 / -1; }
  .c-who, .c-date, .c-got { grid-column: 1; }
  .c-status { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .open-btn { grid-column: 2; justify-self: end; }
}

@media (max-width: 800px) {
  .shell { display: block; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    width: 100%;
    border-right: 0;
    border-bottom: 0;
    padding: 12px 16px;
    gap: 10px;
  }
  .sidebar .brand { width: auto; padding: 0; justify-content: flex-start; }
  .sidebar .brand img,
  html.dark .sidebar .brand img { width: auto; height: 36px; }
  .side-nav { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .side-nav a { padding: 8px 10px; }
  .me { display: none; }
  .sidebar { background-image: none; }
  .side-foot { margin-top: 0; grid-column: 2; grid-row: 1; align-items: flex-end; }
  .sidebar .theme { margin: 0; }
  .main { padding: 24px 16px 48px; }
  h1 { font-size: 28px; }
  .top { align-items: stretch; flex-direction: column; }
  .top-actions { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
  .status-form { width: auto; }
  a.sheet, .cols, .cols-m {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 2px 8px;
    align-items: center;
    padding: 8px 12px;
  }
  .c-no {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
  }
  .c-no b { font-size: 13px; }
  .c-got {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    color: var(--list-quiet);
    font-size: 12px;
    font-weight: 500;
  }
  .c-status { grid-column: 3; grid-row: 1; }
  .c-status .pill { padding: 2px 8px; font-size: 12px; }
  .c-title {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
  }
  .c-title b { flex: 1; min-width: 0; font-size: 15px; }
  .c-title small { flex: none; font-size: 12px; }
  .c-who {
    grid-column: 1 / 3;
    grid-row: 3;
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }
  .c-who b {
    overflow: hidden;
    font-size: 13px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .c-who small { flex: none; font-size: 12px; }
  .c-date {
    grid-column: 3;
    grid-row: 3;
    justify-self: end;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
  }
  .status-picks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board-tools, .board-tools-end { flex-direction: column; align-items: stretch; }
  .board-tools-end { margin-left: 0; }
  .board-tools .search { flex: 1 1 auto; width: 100%; }
  .search-wide { flex: none; width: 100%; max-width: none; }
  .search input { width: 100%; }
  .status-form select { flex: 1; min-width: 140px; }
  .composer, .file-add { flex-direction: column; align-items: stretch; }
  .nav-badge { margin-left: 6px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .group.list.clients .row .grow { flex-direction: column; align-items: flex-start; gap: 1px; }
  .group.list.clients .row strong,
  .group.list.clients .row .grow > span { white-space: normal; }
}

.inbox {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: calc(100vh - 220px);
  min-height: 520px;
  overflow: hidden;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.inbox-list, .inbox-chat { min-height: 0; min-width: 0; }
.inbox-list {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--row-line);
  overflow: auto;
}
.inbox-search { padding: 14px; border-bottom: 1px solid var(--row-line); }
.inbox-search input {
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--wash);
}
.inbox-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--row-line);
  color: inherit;
  text-decoration: none;
}
.inbox-row:hover { background: var(--hover); text-decoration: none; }
.inbox-row.is-on { background: var(--nav); }
.inbox-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--nav);
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}
.inbox-row-main, .inbox-head-text { display: flex; flex-direction: column; min-width: 0; }
.inbox-row-main b, .inbox-head-text b { font-size: 15px; font-weight: 750; }
.inbox-row-main span {
  overflow: hidden;
  color: var(--list-quiet);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.inbox-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.inbox-row-side time { color: var(--list-quiet); font-size: 12px; }
.inbox-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.inbox-chat { display: flex; flex-direction: column; }
.inbox-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--row-line);
}
.inbox-back {
  display: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.inbox-head-text a { color: var(--list-quiet); font-size: 13px; font-weight: 650; text-decoration: none; }
.inbox-head-text a:hover { color: var(--accent); }
.inbox-thread {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--bg);
}
.bubble {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-self: flex-start;
  max-width: min(78%, 480px);
  padding: 6px 8px 4px 10px;
  border-radius: 14px 14px 14px 5px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(16, 36, 64, 0.06);
}
.bubble.mine {
  align-self: flex-end;
  border-radius: 14px 14px 5px 14px;
  background: var(--accent);
  color: #fff;
}
.bubble b { display: block; margin: 0; font-size: 11px; line-height: 1.2; }
.bubble p { margin: 0; font-size: 14px; line-height: 1.35; white-space: pre-wrap; }
.bubble-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-height: 16px; }
.bubble time { margin: 0; color: var(--list-quiet); font-size: 10px; line-height: 1; }
.bubble.mine time { color: rgba(255, 255, 255, 0.78); }
.bubble .confirm-form { margin: 0; gap: 4px; }
.bubble .text-btn { min-height: 0; padding: 0 4px; color: inherit; font-size: 12px; }
.bubble .confirm-strip { font-size: 12px; }
.bubble .confirm-strip .btn { min-height: 28px; padding: 0 8px; }
.bubble .chat-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  opacity: 0.55;
}
.bubble .chat-x svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}
.bubble .chat-x:hover { opacity: 1; }
.inbox-compose {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 12px 14px;
  border-top: 1px solid var(--row-line);
}
.inbox-compose textarea {
  flex: 1;
  height: 44px;
  min-height: 44px;
  max-height: 140px;
  padding: 10px 14px;
  line-height: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--wash);
  resize: vertical;
}
.inbox-send { min-height: 44px; border-radius: 14px; }
.inbox-empty { margin: 0; padding: 28px 16px; color: var(--muted); }

@media (max-width: 800px) {
  .inbox { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .inbox.is-open .inbox-list { display: none; }
  .inbox:not(.is-open) .inbox-chat { display: none; }
  .inbox-back { display: inline-flex; }
  .inbox-thread { max-height: 58vh; }
}

.danger-row { margin-top: 14px; }
.danger-row .text-btn { color: var(--danger); }
.trip-panel { padding: 8px 8px 18px; }
.trip-sheet { display: grid; gap: 14px; padding: 8px 18px 0; }
.trip-client { margin: 0; color: var(--muted); font-size: 14px; }
.trip-client b { color: var(--ink); }
.trip-group {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 4px 0 0;
  border: 0;
}
.trip-group legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  padding: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 750;
}
.trip-group legend span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.trip-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.trip-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trip-row-party { grid-template-columns: minmax(0, 1.15fr) repeat(3, minmax(0, 1fr)); }
.trip-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.trip-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.trip-label i, .trip-note i { color: var(--accent); font-style: normal; }
.trip-sheet input:not([type="checkbox"], [type="radio"]),
.trip-sheet select,
.trip-sheet textarea {
  width: 100%;
  height: 48px;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: var(--wash);
  font-size: 16px;
  font-weight: 650;
  line-height: 46px;
}
.trip-sheet select {
  padding-right: 40px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
html.dark .trip-sheet select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2398989d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
}
.trip-sheet input::placeholder,
.trip-sheet textarea::placeholder { color: var(--muted); font-weight: 550; opacity: 1; }
.trip-sheet input[type="date"]::-webkit-calendar-picker-indicator { margin: 0; padding: 0; opacity: 0.55; cursor: pointer; }
.trip-sheet textarea { height: auto; min-height: 88px; padding: 12px 14px; line-height: 1.45; }
.trip-sheet input:focus,
.trip-sheet textarea:focus {
  border-color: var(--accent);
  background: var(--card);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(20, 145, 140, 0.16);
}
.trip-sheet select:focus {
  border-color: var(--accent);
  background-color: var(--card);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(20, 145, 140, 0.16);
}
.trip-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 4px;
  height: 48px;
  padding: 4px;
  border-radius: 14px;
  background: var(--wash);
}
.trip-step input {
  height: 40px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent;
  line-height: 40px;
  text-align: center;
  box-shadow: none;
  -moz-appearance: textfield;
}
.trip-step input:focus { background: var(--card); box-shadow: none; outline: 0; }
.trip-step input::-webkit-inner-spin-button,
.trip-step input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.trip-step button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(16, 36, 64, 0.12);
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.trip-step button:hover { background: var(--accent); color: var(--on-accent); }
.trip-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.trip-chips button {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.trip-chips button.is-on,
.trip-chips button:hover { border-color: var(--accent); color: var(--ink); }
.trip-chips button.is-on { background: var(--accent); color: var(--on-accent); }
.trip-segment {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--wash);
}
.trip-segment label { position: relative; display: block; min-width: 0; cursor: pointer; }
.trip-segment input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.trip-segment span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 40px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.trip-segment input:checked + span {
  background: var(--card);
  box-shadow: 0 1px 3px rgba(16, 36, 64, 0.14);
  color: var(--ink);
}
.trip-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding: 8px 18px 4px;
}
.trip-note { margin: 0; color: var(--muted); font-size: 13px; }
.trip-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 16px;
  background: var(--side);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.trip-submit:hover { background: var(--accent); }
@media (max-width: 800px) {
  .trip-row, .trip-row-3, .trip-segment { grid-template-columns: 1fr; }
  .trip-foot { align-items: stretch; flex-direction: column; }
  .trip-submit { width: 100%; }
}
