

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/Outfit-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/Outfit-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --ground: #0f0f12;
  --surface: #17171c;
  --surface-2: rgba(255, 255, 255, 0.03);
  --surface-3: rgba(255, 255, 255, 0.07);
  --ink: #f2f1ee;
  --ink-2: #b4b7bd;
  --ink-3: #9a9ea5;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);

  --accent: #f2712f;          
  --accent-hover: #f48147;
  --on-accent: #14120f;
  --accent-text: #ff8a4f;     
  --accent-soft: rgba(242, 113, 47, 0.14);

  --mark: #e3fc5e;            
  --mark-text: #e3fc5e;
  --mark-soft: rgba(227, 252, 94, 0.06);
  --mark-line: rgba(227, 252, 94, 0.35);
  --on-mark: #0e0f11;

  --current-bg: rgba(227, 252, 94, 0.14);
  --current-ink: #e3fc5e;

  --bad: #ff8b82;
  --bad-soft: rgba(255, 139, 130, 0.10);
  --ok: #34d399;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.34), 0 8px 20px rgba(0, 0, 0, 0.36);
  --radius: 26px;
  --radius-sm: 12px;
  --inset: 24px;
  --side: 248px;

  --font: 'Outfit', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --ground: #f0f0f0;
    --surface: #ffffff;
    --surface-2: rgba(20, 24, 30, 0.03);
    --surface-3: rgba(20, 24, 30, 0.06);
    --ink: #14161a;
    --ink-2: #3d434b;
    --ink-3: #525863;
    --line: rgba(20, 24, 30, 0.10);
    --line-2: rgba(20, 24, 30, 0.20);
    --accent-text: #a8400f;
    --accent-soft: rgba(242, 113, 47, 0.12);
    --mark-text: #4d5600;
    --mark-soft: rgba(190, 214, 40, 0.12);
    --mark-line: rgba(120, 140, 0, 0.45);
    --current-bg: #e3fc5e;
    --current-ink: #14161a;
    --bad: #b3261e;
    --bad-soft: rgba(179, 38, 30, 0.08);
    --ok: #0f7a5a;
    --shadow-card: 0 1px 2px rgba(20, 24, 30, 0.05), 0 8px 20px rgba(20, 24, 30, 0.07);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --ground: #f0f0f0;
  --surface: #ffffff;
  --surface-2: rgba(20, 24, 30, 0.03);
  --surface-3: rgba(20, 24, 30, 0.06);
  --ink: #14161a;
  --ink-2: #3d434b;
  --ink-3: #525863;
  --line: rgba(20, 24, 30, 0.10);
  --line-2: rgba(20, 24, 30, 0.20);
  --accent-text: #a8400f;
  --accent-soft: rgba(242, 113, 47, 0.12);
  --mark-text: #4d5600;
  --mark-soft: rgba(190, 214, 40, 0.12);
  --mark-line: rgba(120, 140, 0, 0.45);
  --current-bg: #e3fc5e;
  --current-ink: #14161a;
  --bad: #b3261e;
  --bad-soft: rgba(179, 38, 30, 0.08);
  --ok: #0f7a5a;
  --shadow-card: 0 1px 2px rgba(20, 24, 30, 0.05), 0 8px 20px rgba(20, 24, 30, 0.07);
}

.logo-on-light { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .logo-on-dark { display: none; }
  :root:not([data-theme="dark"]) .logo-on-light { display: block; }
}
:root[data-theme="light"] .logo-on-dark { display: none; }
:root[data-theme="light"] .logo-on-light { display: block; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, p, dl, dd { margin: 0; }

.boot { padding: 56px var(--inset); color: var(--ink-2); }

.shell {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  min-height: 100vh;
  background: linear-gradient(var(--line), var(--line)) no-repeat
              calc(var(--side) - 1px) 0 / 1px 100%;
}
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.side-top { padding: 24px 24px 20px; }
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
}
.logo { width: 86px; height: auto; }
.brand-word {
  font-size: 17px; font-weight: 300; letter-spacing: -0.01em;
  padding-left: 12px; border-left: 1px solid var(--line-2);
  line-height: 24px;
}

.nav { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 0 12px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 15px; text-decoration: none;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--current-bg); color: var(--current-ink); font-weight: 500; }
.nav-count {
  margin-left: auto; min-width: 24px; padding: 0 8px;
  border-radius: 999px; text-align: center;
  font-size: 12px; font-weight: 600; line-height: 20px;
  background: var(--accent); color: var(--on-accent);
  font-variant-numeric: tabular-nums;
}

.side-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 12px 24px;
}
.who {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  text-decoration: none;
}
.who:hover { background: var(--surface-2); }
.avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--ground);
  font-size: 12px; font-weight: 600;
}
.who-text { min-width: 0; display: flex; flex-direction: column; }
.who-name, .who-mail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-name { font-size: 14px; font-weight: 500; }
.who-mail { font-size: 12px; color: var(--ink-3); }

.main {
  min-width: 0;
  width: 100%; max-width: 1240px;
  padding: 40px 40px 56px;
}
.main:focus { outline: none; }

.page-head { margin-bottom: 24px; }
.page-title {
  font-size: 32px; font-weight: 300; letter-spacing: -0.02em; line-height: 40px;
  overflow-wrap: anywhere;
}
.page-sub { margin-top: 4px; color: var(--ink-2); }

.stack { display: flex; flex-direction: column; gap: 24px; }
.narrow { max-width: 640px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card-pad { padding: var(--inset); display: flex; flex-direction: column; gap: 16px; }
.card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 20px var(--inset) 12px;
}
.card-title {
  font-size: 13px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
}

.link { color: var(--accent-text); text-decoration: none; font-size: 14px; }
.link:hover { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 20px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent;
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-quiet { border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { color: var(--ink); border-color: transparent; }
.btn-sm { padding: 4px 12px; font-size: 13px; }

.seg {
  display: inline-flex; align-self: flex-start; gap: 4px; padding: 4px;
  border-radius: 999px; background: var(--surface-3);
}
.seg-btn {
  border: 0; background: transparent; cursor: pointer;
  padding: 4px 16px; border-radius: 999px;
  font-size: 14px; color: var(--ink-2);
}
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 500;
  box-shadow: var(--shadow-card); }
.seg-btn:disabled { display: none; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2); white-space: nowrap;
}
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip[data-status="open"] { color: var(--accent-text); }
.chip[data-status="waiting"] { color: var(--ink-2); }
.chip[data-status="solved"], .chip[data-status="closed"] { color: var(--ink-3); }

.pri {
  display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 20px; vertical-align: 2px;
  background: var(--surface-3); color: var(--ink-2);
}
.pri[data-priority="urgent"] { background: var(--accent); color: var(--on-accent); }

.notice { padding: 16px 0; color: var(--ink-2); }
.notice[data-tone="bad"] { color: var(--bad); }
.empty { padding: 24px var(--inset); color: var(--ink-2); }
.hint { font-size: 13px; color: var(--ink-3); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.tile {
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px var(--inset) 24px;
  border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-card);
  text-decoration: none;
}
.tile:hover { background-image: linear-gradient(var(--surface-2), var(--surface-2)); }
.tile-n { font-size: 40px; font-weight: 200; line-height: 48px; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; }
.tile-k { font-size: 14px; color: var(--ink-2); }
.tile[data-lit="yes"] { background: var(--accent); color: var(--on-accent); }
.tile[data-lit="yes"] .tile-k { color: var(--on-accent); }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font-size: 14px;
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab[aria-current="true"] { background: var(--current-bg); color: var(--current-ink); font-weight: 500; }
.tab-n { font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.8; }
.search {
  flex: 0 1 320px; min-width: 0;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface);
  font-size: 14px;
}
.search::placeholder { color: var(--ink-3); }

.plist { display: flex; flex-direction: column; }
.prow {
  display: grid;
  grid-template-columns: 8px 96px minmax(0, 1fr) 96px 104px 112px 56px;
  column-gap: 16px; align-items: center;
  padding: 12px var(--inset);
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.plist > .prow:first-child { border-top: 0; }
a.prow:hover { background: var(--accent-soft); }
.prow-head {
  font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); background: var(--surface-2);
}
.prow-meta { display: contents; }
.prow-dot { width: 8px; height: 8px; border-radius: 50%; }
.prow[data-unread="yes"] .prow-dot { background: var(--accent); }
.prow-ref { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.prow-main { min-width: 0; display: flex; flex-direction: column; }
.prow-subject { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow[data-unread="yes"] .prow-subject { color: var(--ink); }
.prow-who { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-source, .prow-owner { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-status { white-space: nowrap; }
.prow-owner[data-empty="yes"] { color: var(--ink-3); }
.prow-age { font-size: 13px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prow-head .prow-main, .prow-head .prow-source, .prow-head .prow-owner,
.prow-head .prow-age, .prow-head .prow-ref { font-size: 12px; color: var(--ink-3); }

.list-foot {
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between;
  padding: 16px var(--inset) 0; font-size: 13px; color: var(--ink-3);
}
.more { color: var(--ink-2); }

.back { display: inline-block; margin-bottom: 16px; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.back:hover { color: var(--ink); }
.phead { margin-bottom: 32px; }
.phead-ref { font-size: 14px; font-weight: 500; color: var(--accent-text); margin-bottom: 4px; }
.phead-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin-top: 12px; font-size: 14px; color: var(--ink-2);
}

.pgrid { display: grid; grid-template-columns: minmax(0, 1fr) 352px; gap: 24px; align-items: start; }
.pthread { min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.pside { display: flex; flex-direction: column; gap: 24px; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field-k { font-size: 13px; color: var(--ink-3); }
.field-row { display: flex; gap: 8px; align-items: center; }
.field-row .select-wrap { flex: 1; min-width: 0; }
.select-wrap { position: relative; display: block; }
.select-wrap::after {
  content: ''; position: absolute; right: 16px; top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: translateY(-75%) rotate(45deg); pointer-events: none;
}
.select {
  appearance: none; -webkit-appearance: none;
  width: 100%; padding: 8px 40px 8px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface); font-size: 14px; cursor: pointer;
}
.select:disabled { cursor: default; opacity: 0.7; }
.saved { font-size: 13px; color: var(--ink-3); }
.saved:empty, .compose-result:empty { display: none; }

.facts-list { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; font-size: 14px; }
.facts-list dt { color: var(--ink-3); }
.facts-list dd { overflow-wrap: anywhere; }
.facts { border-top: 1px solid var(--line); padding-top: 12px; }
.facts summary { cursor: pointer; font-size: 14px; color: var(--accent-text); }
.facts-text {
  margin: 12px 0 0; padding: 12px; max-height: 480px; overflow: auto;
  border-radius: var(--radius-sm); background: var(--surface-3);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

.thread { display: flex; flex-direction: column; gap: 16px; }
.msg {
  padding: 20px var(--inset);
  border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-card);
}
.msg[data-kind="staff"] { box-shadow: inset 4px 0 0 var(--accent), var(--shadow-card); }
.msg[data-kind="note"] {
  background: var(--mark-soft); box-shadow: none;
  border: 1px dashed var(--mark-line);
}
.msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.msg-who { font-weight: 500; }
.msg-tag { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.msg[data-kind="staff"] .msg-tag { color: var(--accent-text); }
.msg[data-kind="note"] .msg-tag { color: var(--mark-text); }
.msg-at { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }

.composer {
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px var(--inset) var(--inset);
  border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-card);
}
.composer[data-mode="note"] { background: var(--mark-soft); box-shadow: none; border: 1px dashed var(--mark-line); }
.compose-text {
  width: 100%; min-height: 120px; resize: vertical;
  padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--ground);
  line-height: 1.5;
}
.compose-text::placeholder { color: var(--ink-3); }
.compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.compose-result { font-size: 14px; color: var(--ink-2); }

@media (max-width: 1180px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prow { grid-template-columns: 8px 88px minmax(0, 1fr) 104px 56px; }
  .prow-source, .prow-owner { display: none; }
}
@media (max-width: 960px) {
  .pgrid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .side {
    position: static; height: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
    display: grid; grid-template-columns: 1fr auto; align-items: center;
    padding: 12px 16px; gap: 12px;
  }
  .side-top { padding: 0; }
  .nav { grid-column: 1 / -1; grid-row: 2; flex-direction: row; padding: 0; gap: 4px; }
  .nav-item { padding: 8px 12px; }
  .side-foot { grid-column: 2; grid-row: 1; padding: 0; }
  .who-text, .side-foot .btn { display: none; }
  .who { padding: 4px; }

  .main { padding: 24px 16px 48px; }
  .page-title { font-size: 23px; line-height: 32px; }
  .tiles { gap: 12px; }
  .tile { padding: 16px; }
  .tile-n { font-size: 32px; line-height: 40px; }
  .tile-k { font-size: 13px; }
  .search { flex: 1 1 100%; }
  .card-head { padding: 16px 16px 8px; }
  .empty { padding: 20px 16px; }
  .list-foot { padding: 16px 0 0; }

  .prow-head { display: none; }
  .prow {
    grid-template-columns: 8px minmax(0, 1fr) auto;
    grid-template-areas: "dot ref age" ". main main" ". meta meta";
    row-gap: 4px; column-gap: 12px;
    padding: 12px 16px;
  }
  .plist > .prow-head + .prow { border-top: 0; }
  .prow-dot { grid-area: dot; }
  .prow-ref { grid-area: ref; }
  .prow-age { grid-area: age; }
  .prow-main { grid-area: main; }
  .prow-subject { white-space: normal; }
  .prow-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
  .prow-source, .prow-owner { display: inline; font-size: 13px; }

  .msg, .composer { padding: 16px; }
  .card-pad { padding: 16px; }
  .compose-foot { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
