/* ============ base ============ */
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

::selection { background: #1A1A1A; color: #fff; }

/* ============ typography ============ */
.eyebrow {
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.eyebrow.tight { letter-spacing: .2em; }
.eyebrow.dark  { color: var(--ink); }
.eyebrow.fire  { color: var(--primary); }
.mono { font-family: var(--font-mono); letter-spacing: 0; }
.mono-alt { font-family: var(--font-mono-alt); }
.display { font-family: var(--font-display); letter-spacing: -0.5px; line-height: 1.05; }

/* ============ chrome ============ */
.lgsnap-header {
  background: var(--ink);
  color: #fff;
  height: 80px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 30;
}
.lgsnap-header .brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-caps);
  letter-spacing: .26em;
  font-size: 12px;
}
.lgsnap-header .brand .logo {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: var(--ink);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
}
.lgsnap-header nav {
  display: flex; gap: 32px;
  font-family: var(--font-caps);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #FFFFFFB3;
}
.lgsnap-header nav .item { cursor: pointer; padding: 8px 0; border-bottom: 1px solid transparent; }
.lgsnap-header nav .item.active { color: #fff; border-bottom-color: var(--primary); }
.lgsnap-header nav .item:hover { color: #fff; }
.lgsnap-header .right { display: flex; align-items: center; gap: 14px; font-size: 12px; }
.lgsnap-header .right .who { color: #FFFFFFB3; font-family: var(--font-mono); }
.lgsnap-header .right .av {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; color: #fff;
  border: 1px solid #FFFFFF33;
}
.lgsnap-header .right .logout {
  font-family: var(--font-caps);
  letter-spacing: .18em;
  font-size: 11px;
  color: #FFFFFF99;
  background: transparent;
  border: none;
}
.lgsnap-header .right .logout:hover { color: #fff; }

.lgsnap-footer {
  background: var(--ink);
  color: #fff;
  padding: 40px var(--gutter);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.lgsnap-footer .col h4 {
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--muted-2);
  margin: 0 0 16px 0;
  text-transform: uppercase;
  font-weight: 500;
}
.lgsnap-footer .col p, .lgsnap-footer .col li {
  font-family: var(--font-sans);
  font-size: 14px;
  color: #fff;
  margin: 0 0 8px 0;
}
.lgsnap-footer .col .copy { color: var(--muted-2); font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; }
.lgsnap-footer .col ul { list-style: none; padding: 0; margin: 0; }

/* ============ buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 500;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  transition: background .12s, color .12s;
}
.btn:hover { background: var(--sand); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #000; }
.btn.fire { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.btn.fire:hover { background: #FF9B22; border-color: #FF9B22; color: #fff; }
.btn.ghost { background: transparent; border-color: var(--muted); color: var(--ink); }
.btn.ghost:hover { background: var(--sand); }
.btn.lg { padding: 16px 20px; font-size: 14px; height: 56px; }

/* ============ chips / pills ============ */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  border: 1px solid var(--ink);
  background: #fff;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.chip.dim { color: var(--muted); border-color: var(--muted); }
.chip.fire { background: var(--primary); color: var(--ink); border-color: var(--primary); font-weight: 600; }
.chip.dark { background: var(--ink); color: #fff; }

.ru-pill {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  padding: 6px 12px;
  min-width: 80px;
  border: 1px solid transparent;
  letter-spacing: .02em;
  white-space: nowrap;
}
.ru-pill.clickable, .seg .s.clickable, .pchip.clickable { cursor: pointer; transition: filter .12s, transform .08s; }
.ru-pill.clickable:hover { filter: brightness(1.15); outline: 2px solid var(--primary); outline-offset: 1px; }
.seg .s.clickable:hover { background: var(--sand); color: var(--ink); }
.seg .s.clickable.on:hover { background: var(--ink); filter: brightness(1.2); }
.pchip.clickable:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ============ segmented (status) ============ */
.seg {
  display: inline-flex;
  border: 1px solid var(--ink);
  height: 28px;
}
.seg .s {
  padding: 2px 16px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--muted);
  display: grid; place-items: center;
  border-left: 1px solid var(--ink);
  background: #fff;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  min-width: 56px;
}
.seg .s:first-child { border-left: none; }
.seg .s.on { background: var(--ink); color: #fff; }
.seg .s.draft.on { background: var(--success); color: #fff; }
.seg .s.escalated { background: var(--primary); color: var(--ink); font-weight: 600; }

/* ============ inputs ============ */
.fld { display: flex; flex-direction: column; gap: 8px; }
.fld label {
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.fld input, .fld textarea, .fld select {
  font: inherit;
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 14px 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.fld textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.fld input:focus, .fld textarea:focus, .fld select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255,132,0,.18);
}
.fld .hint { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* ============ avatar ============ */
.av-ring {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid #fff;
  outline: 1px solid var(--border);
  display: inline-grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  color: #fff;
}
.av-ring.lg { width: 36px; height: 36px; font-size: 12px; }
.av-stack { display: inline-flex; }
.av-stack .av-ring + .av-ring { margin-left: -8px; }

/* ============ table ============ */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  table-layout: fixed;
}
.tbl thead th {
  font-family: var(--font-caps);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ink);
}
.tbl thead th:first-child { padding-left: 0; }

.tbl tbody td {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tbl tbody td:first-child { padding-left: 0; padding-right: 0; }
.tbl thead th:last-child,
.tbl tbody td:last-child  { padding-right: 12px; }

.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--sand-2); }
/* completed rows — soft sage background; hover still works */
.tbl tbody tr.row-closed { background: #ECF1ED; }
.tbl tbody tr.row-closed:hover { background: #E1E8E3; }

/* plain ticket-no cell — no gradient, just mono text */
.tbl .ticket-no {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink);
  padding-left: 0;
}

/* inline due-date PICKER in queue — Element-UI el-date-picker, skinned minimal */
.tbl .due-picker.el-date-editor.el-input,
.tbl .due-picker.el-date-editor--date {
  width: 86px;                          /* MM.DD + a little hover/border slack */
  vertical-align: middle;
}
.tbl .due-picker .el-input__inner {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  height: 28px;
  line-height: 28px;
  padding: 0 6px;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  box-shadow: none;                     /* never let a glow spill past the cell */
}
.tbl .due-picker:hover .el-input__inner {
  border-color: var(--border);
  background: #fff;
}
.tbl .due-picker .el-input__inner:focus,
.tbl .due-picker.is-focus .el-input__inner {
  border-color: var(--ink);             /* solid ink border in lieu of outer glow */
  background: #fff;
  box-shadow: none;
}
/* hide the default calendar icon — the cell is tight; clicking the value opens the picker */
.tbl .due-picker .el-input__prefix,
.tbl .due-picker .el-input__suffix {
  display: none;
}
.tbl .due-picker .el-input__inner { padding-left: 6px; padding-right: 6px; }
/* state colors flow through from the wrapping class */
.tbl .due-picker.overdue .el-input__inner { color: var(--burnt); }
.tbl .due-picker.closed .el-input__inner  { color: var(--muted); }
/* disabled (no permission) — strip the hover affordance */
.tbl .due-picker.is-disabled:hover .el-input__inner,
.tbl .due-picker .el-input.is-disabled .el-input__inner {
  background: transparent;
  border-color: transparent;
  cursor: default;
  color: var(--muted);
}

/* ===========================================================
   Element-UI calendar popup — themed to match LegalSnap.
   Unscoped because the popup mounts at <body>.
   =========================================================== */
.el-picker-panel.el-date-picker {
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: 0;
  box-shadow: 0 14px 48px rgba(20, 14, 8, .18);
  color: var(--ink);
  font-family: var(--font-sans);
}
/* Header bar: month/year + nav arrows */
.el-picker-panel.el-date-picker .el-date-picker__header {
  margin: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.el-picker-panel.el-date-picker .el-date-picker__header-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--ink);
  font-weight: 500;
  padding: 0 6px;
}
.el-picker-panel.el-date-picker .el-date-picker__header-label:hover { color: var(--primary); }
.el-picker-panel.el-date-picker .el-picker-panel__icon-btn {
  color: var(--muted);
  font-size: 13px;
}
.el-picker-panel.el-date-picker .el-picker-panel__icon-btn:hover { color: var(--primary); }

/* Weekday header row */
.el-picker-panel.el-date-picker .el-date-table th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
}
/* Day cells */
.el-picker-panel.el-date-picker .el-date-table td {
  padding: 2px;
  font-family: var(--font-mono);
}
.el-picker-panel.el-date-picker .el-date-table td .el-date-table-cell {
  height: 30px; line-height: 30px;
  padding: 0;
}
.el-picker-panel.el-date-picker .el-date-table td .el-date-table-cell__text {
  width: 26px; height: 26px; line-height: 26px;
  border-radius: 0;                     /* match the no-radius design system */
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  transition: background .12s, color .12s;
}
.el-picker-panel.el-date-picker .el-date-table td:not(.disabled):hover .el-date-table-cell__text {
  background: var(--sand);
  color: var(--ink);
}
.el-picker-panel.el-date-picker .el-date-table td.next-month .el-date-table-cell__text,
.el-picker-panel.el-date-picker .el-date-table td.prev-month .el-date-table-cell__text {
  color: var(--muted);
  opacity: .5;
}
.el-picker-panel.el-date-picker .el-date-table td.disabled .el-date-table-cell__text {
  background: transparent;
  color: #C9C5C0;
}
/* Today — orange outline ring */
.el-picker-panel.el-date-picker .el-date-table td.today .el-date-table-cell__text {
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--primary);
}
/* Selected — solid ink block (matches the design's dark fills) */
.el-picker-panel.el-date-picker .el-date-table td.current:not(.disabled) .el-date-table-cell__text {
  background: var(--primary) !important;
  color: #fff !important;
  font-weight: 600;
}
/* Footer (Today / clear shortcuts if any) */
.el-picker-panel.el-date-picker .el-picker-panel__footer {
  background: var(--sand);
  border-top: 1px solid var(--border);
  padding: 8px 16px;
}
.el-picker-panel.el-date-picker .el-picker-panel__footer .el-button--text {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
}
.el-picker-panel.el-date-picker .el-picker-panel__footer .el-button--text:hover { color: var(--primary); }
.el-picker-panel.el-date-picker .el-picker-panel__link-btn {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
}
/* Year / month sub-panels (when clicking the header label) */
.el-picker-panel.el-date-picker .el-year-table td .cell,
.el-picker-panel.el-date-picker .el-month-table td .cell {
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
}
.el-picker-panel.el-date-picker .el-year-table td.current:not(.disabled) .cell,
.el-picker-panel.el-date-picker .el-month-table td.current:not(.disabled) .cell {
  color: var(--primary);
  font-weight: 600;
}
.el-picker-panel.el-date-picker .el-year-table td .cell:hover,
.el-picker-panel.el-date-picker .el-month-table td .cell:hover {
  color: var(--primary);
}

/* completed segment — green bg + white text */
.seg .s.closed.on {
  background: var(--success);
  color: #fff;
}
.tbl .id-cell {
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  height: 56px;
  display: flex; align-items: center;
  background: linear-gradient(90deg, var(--burnt-dark), #fff);
  width: 100%;
}
.tbl .id-cell.warm  { background: linear-gradient(90deg, var(--burnt-deep), #fff); }
.tbl .id-cell.mid   { background: linear-gradient(90deg, #B07A52, #fff); }
.tbl .id-cell.light { background: linear-gradient(90deg, #DBC1AB, #fff); }
.tbl .id-cell.cool  { background: linear-gradient(90deg, #F2EBE3, #fff); }

/* ============ cards ============ */
.card {
  background: #fff;
  border: 1px solid var(--ink);
  padding: 24px;
}
.card.lg { padding: 32px; }
.card .hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

/* ============ misc ============ */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.divider.ink { background: var(--ink); }
.row { display: flex; align-items: center; gap: 16px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 16px; }
.shell { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.shell main { flex: 1; }
.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--sand);
  border: 1px solid var(--border);
  padding: 1px 6px;
}

/* ============ element-ui overrides (dialog only — Element-UI is hidden by tokens elsewhere) ============ */
.el-dialog { border-radius: 0; border: 1px solid var(--ink); }
.el-dialog__header { padding: 0; }
.el-dialog__body { padding: 0; }
.el-message-box { border-radius: 0; }
.el-message { border-radius: 0; }

/* ============ auth ============ */
.auth-shell {
  display: grid;
  grid-template-columns: 880px 1fr;
  min-height: 100vh;
  background: var(--bg);
}
@media (max-width: 1100px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-left { display: none; }
}
.auth-left {
  background: var(--ink); color: #fff;
  padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-left .meta-strip {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: .22em;
  color: #FFFFFF99;
}
.auth-left .meta-strip .lhs { display: flex; gap: 24px; align-items: center; }
.auth-left .meta-strip .brand-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: var(--ink);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  margin-right: 12px;
}
.auth-left .hero h1 {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 600;
  letter-spacing: -1.2px;
  line-height: 1.05;
  margin: 28px 0 0 0;
  color: #fff;
}
.auth-left .hero h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
  margin: 12px 0 0 0;
  color: #FFFFFFB3;
}
.auth-left .hero p {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.65;
  color: #FFFFFFA0;
  max-width: 580px;
  margin-top: 22px;
}
.auth-left .ornament {
  display: flex; flex-direction: column; gap: 14px;
}
.auth-left .ornament .ornament-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: #FFFFFF66;
}
.auth-left .ornament .grid {
  display: grid;
  grid-template-columns: repeat(5, 36px);
  grid-auto-rows: 36px;
  gap: 6px;
}
.auth-left .ornament .grid .c {
  width: 36px; height: 36px;
}
.auth-left .quote-row {
  border-top: 1px solid #FFFFFF26;
  padding-top: 20px;
}
.auth-left .quote-row .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--primary);
  margin-bottom: 10px;
}
.auth-left .quote-row p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  line-height: 1.6;
  color: #FFFFFFB3;
  margin: 0;
}
.auth-left .copyrow {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #FFFFFF80;
  letter-spacing: .04em;
}
.auth-left .copyrow .tagline { letter-spacing: .26em; color: #FFFFFF66; }

.auth-right {
  background: #fff;
  padding: 48px 80px;
  display: flex; flex-direction: column;
}
.auth-right .topbar {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--muted);
}
.auth-right .topbar .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--leaf); display: inline-block; margin-right: 8px; }
.auth-right .center { flex: 1; display: grid; place-items: center; }
.auth-right .form { width: 480px; display: flex; flex-direction: column; gap: 28px; }
.auth-right .form .h-eyebrow { font-family: var(--font-caps); font-size: 10px; letter-spacing: .24em; color: var(--primary); text-transform: uppercase; font-weight: 600; }
.auth-right .form h2 { font-family: var(--font-display); font-size: 34px; font-weight: 600; letter-spacing: -.5px; margin: 4px 0 0 0; }
.auth-right .form .sub { font-family: var(--font-mono); font-size: 14px; color: var(--muted); margin: 8px 0 12px 0; letter-spacing: .02em; }
.auth-right .form .row-line { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-sans); font-size: 12px; color: var(--muted); }
.auth-right .form .row-line a { color: var(--primary); }
.auth-right .form .or {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--muted);
}
.auth-right .form .or::before, .auth-right .form .or::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.auth-right .form .helper {
  text-align: center;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted);
}
.auth-right .form .helper a { color: var(--primary); font-weight: 500; }
.auth-right .footer {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted);
}
.auth-right .footer .status { display: flex; gap: 8px; align-items: center; font-family: var(--font-caps); font-size: 11px; letter-spacing: .14em; }
.auth-right .footer .status .ok { width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); }

/* email-code row: input + "send code" button side by side */
.auth-right .form .code-row,
.auth-modal .code-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.auth-right .form .code-row > input,
.auth-modal .code-row > input { flex: 1; }
.auth-right .form .code-btn,
.auth-modal .code-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  height: 42px;
}
.auth-right .form .code-btn:hover:not(:disabled),
.auth-modal .code-btn:hover:not(:disabled) {
  background: var(--ink); color: #fff;
}
.auth-right .form .code-btn:disabled,
.auth-modal .code-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Consent row — "I agree to terms / privacy" on the register page */
.auth-right .form .consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--sand-2, #FAF7F2);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.auth-right .form .consent-row input[type=checkbox] {
  margin-top: 3px;
  accent-color: var(--primary);
  width: 14px; height: 14px;
  flex: 0 0 auto;
}
.auth-right .form .consent-row a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}
.auth-right .form .consent-row a:hover { text-decoration: underline; }
.auth-right .form .btn.fire:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Forgot-password modal — light, matches the auth-right pane */
.auth-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 8, .42);
  z-index: 2000;
  display: grid;
  place-items: center;
}
.auth-modal {
  background: #fff;
  border: 1px solid var(--ink);
  width: 480px;
  max-width: 92vw;
  padding: 28px 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-modal h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}
.auth-modal .auth-modal-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin: -8px 0 4px;
  line-height: 1.55;
}
.auth-modal .fld { display: flex; flex-direction: column; gap: 6px; }
.auth-modal .fld label {
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--muted);
}
.auth-modal .fld input {
  border: 1px solid var(--ink);
  background: #fff;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  height: 42px;
  box-sizing: border-box;
}
.auth-modal .fld input:focus { border-color: var(--primary); }
.auth-modal .auth-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ============ overview ============ */
.ov-hero {
  background: var(--ink);
  color: #fff;
  padding: 80px var(--gutter);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  min-height: 560px;
}
.ov-hero .left { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.ov-hero .left .display {
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -1.2px;
  margin: 16px 0 0 0;
}
.ov-hero .left p { font-family: var(--font-sans); font-size: 15px; line-height: 1.6; color: #FFFFFFA0; max-width: 520px; }
.ov-hero .right {
  background: #111;
  border: 1px solid #2A2A2A;
  padding: 40px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.ov-hero .right h3 {
  font-family: var(--font-caps);
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 16px;
  font-weight: 500;
}
.ov-hero .right .leader {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: #FFFFFFA0;
}
.ov-hero .right .top-rows .row-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #2A2A2A;
  font-family: var(--font-sans);
  font-size: 13px;
}
.ov-hero .right .top-rows .row-item .ru {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  background: var(--primary); color: var(--ink); font-weight: 600;
}
.ov-hero .right .top-rows .row-item .ru.overdue {
  background: var(--destructive); color: #fff;
}

.kpis {
  background: #fff;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 160px;
}
.kpis .k {
  padding: 24px 32px;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  border-right: 1px solid var(--ink);
}
.kpis .k:last-child { border-right: none; }
.kpis .k .cap { font-family: var(--font-caps); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.kpis .k .val { font-family: var(--font-mono); font-size: 44px; font-weight: 500; letter-spacing: -1px; color: var(--ink); line-height: 1; }
.kpis .k .delta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.kpis .k .delta.warn { color: var(--burnt); }
.kpis .k .delta.ok { color: var(--success); }

.matrix-panel {
  background: var(--bg);
  padding: 64px var(--gutter);
  display: grid;
  gap: 40px;
}
.matrix-panel header { display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; }
.matrix-panel header h2 {
  font-family: var(--font-display);
  font-size: 44px;
  letter-spacing: -1px;
  margin: 8px 0 0 0;
  font-weight: 500;
}
.matrix-panel .body { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.matrix-grid {
  display: grid;
  grid-template-columns: 32px repeat(5, 1fr);
  grid-template-rows: 24px repeat(5, 64px);
  gap: 4px;
}
.matrix-grid .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  display: grid; place-items: center;
}
.matrix-grid .cell {
  position: relative;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
}
.matrix-grid .cell.clickable { cursor: pointer; transition: outline .1s; }
.matrix-grid .cell.clickable:hover { outline: 2px dashed var(--ink); outline-offset: -2px; }
.matrix-grid .cell.sel {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
  position: relative;
  z-index: 1;
}

/* matrix cell drawer — replaces the right-hand category-bars when a cell is selected */
.cell-drawer {
  background: var(--ink); color: #fff;
  padding: 18px 20px;
  margin: -8px -10px;
}
.cell-drawer .hdr {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid #ffffff22;
}
.cell-drawer .hdr .title {
  font-family: var(--font-display); font-size: 18px; font-weight: 500;
  color: #fff;
}
.cell-drawer .cell-list {
  display: flex; flex-direction: column;
  max-height: 480px; overflow-y: auto;
  margin-top: 6px;
}
.cell-drawer .cell-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 0;
  border-bottom: 1px dashed #ffffff22;
  cursor: pointer;
}
.cell-drawer .cell-item:hover { background: #ffffff0a; padding-left: 6px; padding-right: 6px; margin: 0 -6px; }
.cell-drawer .cell-item .row1 {
  display: flex; gap: 10px; align-items: baseline;
}
.cell-drawer .cell-item .row1 .no {
  font-family: var(--font-mono); font-size: 12px; color: var(--primary);
}
.cell-drawer .cell-item .row1 .title {
  font-family: var(--font-sans); font-size: 14px; color: #fff; font-weight: 500;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cell-drawer .cell-item .row2 {
  display: flex; gap: 18px;
  font-family: var(--font-mono); font-size: 11px;
  color: #FFFFFFA0;
}
.cell-drawer .cell-item .row2 strong { color: #fff; font-weight: 500; }
.cell-drawer .cell-item .row3 {
  display: flex; gap: 8px; min-height: 0;
}
.cell-drawer .cell-item .row3 .micro {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .05em;
  padding: 2px 7px;
  background: #ffffff14;
  color: #FFFFFFA0;
  border-radius: 0;
}
.cell-drawer .cell-item .row3 .micro.red { background: var(--destructive); color: #fff; }

/* ---- monthly board (replaces old impact block) ---- */
.month-board {
  background: var(--burnt);
  color: #fff;
  padding: 70px var(--gutter);
  display: flex; flex-direction: column; gap: 30px;
}
.month-board .board-head .cap {
  font-family: var(--font-caps); font-size: 12px; letter-spacing: .24em;
  text-transform: uppercase; color: #fff;
}
.month-board .board-head .board-sub {
  font-family: var(--font-sans); font-size: 14px;
  color: #FFFFFFB3; margin-top: 8px;
}
.month-board .board-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  gap: 30px;
  padding-top: 12px;
}
.month-board .board-vdiv { background: #fff; opacity: .25; }
.month-board .board-col {
  display: flex; flex-direction: column; gap: 14px;
}
.month-board .board-cap {
  font-family: var(--font-caps); font-size: 12px;
  letter-spacing: .24em; text-transform: uppercase;
  color: #fff;
}
.month-board .board-num {
  font-family: var(--font-mono); font-size: 88px; line-height: 1;
  letter-spacing: -2px; color: #fff;
}
.month-board .board-num .unit {
  font-size: 36px; letter-spacing: 0; margin-left: 4px;
}
.month-board .board-desc {
  font-family: var(--font-sans); font-size: 13px; line-height: 1.5;
  color: #FFFFFFB3;
}

.narrative {
  background: var(--bg);
  padding: 96px var(--gutter);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px;
}
.narrative .headline {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -1px;
  max-width: 1100px;
}
.narrative .body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 720px;
}

.impact {
  background: var(--burnt);
  color: #fff;
  padding: 80px var(--gutter);
  display: grid;
  grid-template-columns: 1.2fr 1px 1fr 1px 1fr 1px 1fr;
  gap: 40px;
  min-height: 320px;
}
.impact .vdiv { background: #fff; }
.impact .col { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.impact .col .cap { font-family: var(--font-caps); font-size: 12px; letter-spacing: .24em; color: #fff; text-transform: uppercase; font-weight: 500; }
.impact .col .num { font-family: var(--font-mono); font-size: 88px; letter-spacing: -2px; line-height: 1; }
.impact .col .desc { font-family: var(--font-sans); font-size: 13px; line-height: 1.5; }
.impact .col .footnote { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; }

.hub {
  background: #fff;
  padding: 80px var(--gutter);
  display: flex; flex-direction: column; gap: 48px;
}
.hub header {
  display: flex; align-items: flex-end; justify-content: space-between;
}
.hub header h2 {
  font-family: var(--font-display);
  font-size: 44px; font-weight: 500; letter-spacing: -1px; margin: 8px 0 0 0;
}
.hub .cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.hub .cards .card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px;
  cursor: pointer; transition: background .12s;
}
.hub .cards .card:hover { background: var(--sand-2); }
.hub .cards .card .id { font-family: var(--font-mono); font-size: 13px; color: var(--ink); }
.hub .cards .card .title { font-family: var(--font-display); font-size: 18px; line-height: 1.3; font-weight: 500; margin: 8px 0 6px 0; }
.hub .cards .card .meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.hub .cards .card .meta .ru { padding: 2px 6px; background: var(--burnt-dark); color: #fff; font-weight: 600; }
.hub .chips { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hub .chips a.more { font-family: var(--font-sans); font-size: 12px; color: var(--burnt); cursor: pointer; }

/* ============ tab strip (tickets-context tabs) ============ */
.tabstrip {
  background: var(--bg);
  height: 48px;
  border-bottom: 1px solid var(--ink);
  padding: 0 var(--gutter);
  display: flex; align-items: stretch; gap: 0;
}
.tabstrip .tab {
  display: flex; align-items: center; gap: 8px;
  padding: 0 18px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border-right: 1px solid var(--ink);
  cursor: pointer;
  user-select: none;
}
.tabstrip .tab:first-child { border-left: 1px solid var(--ink); }
.tabstrip .tab.active {
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1px solid #fff;
  margin-bottom: -1px;
}
.tabstrip .tab .x {
  opacity: 0; font-family: var(--font-mono); font-size: 11px; color: var(--muted);
}
.tabstrip .tab:hover .x { opacity: 1; }
.tabstrip .tab.active .x { opacity: 1; }
.tabstrip .tab .id { font-family: var(--font-mono); font-size: 12px; }
.tabstrip .add {
  display: grid; place-items: center;
  padding: 0 18px;
  font-family: var(--font-mono);
  color: var(--muted);
}

/* ============ queue ============ */
.title-bar {
  background: #fff;
  border-bottom: 1px solid var(--ink);
  padding: 40px var(--gutter) 28px;
}
.title-bar .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.title-bar h1 {
  font-family: var(--font-display);
  font-size: 56px;
  letter-spacing: -1.2px;
  line-height: 1.05;
  margin: 16px 0 0 0;
  font-weight: 500;
}
.title-bar .crumb { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.title-bar .crumb .here { color: var(--ink); }

/* page-level action buttons (top right of title bar) */
.title-bar .page-actions {
  display: flex; align-items: center; gap: 12px;
  padding-top: 8px;
}
.title-bar .page-actions .btn-fire-tall { height: 48px; padding: 0 22px; }
.btn-icon-lg {
  width: 48px; height: 48px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  cursor: pointer; transition: background .12s;
}
.btn-icon-lg:hover { background: #000; }
.btn-icon-lg .iconfont { font-size: 24px; color: #fff; }

/* subtitle row with overdue prominent left, then secondary count pills */
.counts-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 18px;
  font-family: var(--font-mono); font-size: 13px;
}
.counts-row .overdue-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--destructive); color: #fff;
  font-family: var(--font-mono); font-size: 13px;
  letter-spacing: .02em; font-weight: 500;
  border: 1px solid var(--destructive);
}
.counts-row .overdue-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.8s ease-in-out infinite; }
.counts-row .overdue-badge.zero {
  background: transparent; color: var(--muted); border-color: var(--border);
}
.counts-row .overdue-badge.zero .dot { background: var(--muted); animation: none; }
.counts-row .overdue-badge strong { font-weight: 700; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.counts-row .sep { color: var(--muted-2); margin: 0 4px; }
.counts-row .count-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: #fff;
}
.counts-row .count-pill strong { color: var(--muted); font-weight: 500; }

/* SLA markers — compact triplet shown on each ticket row + in detail status row */
.sla-markers {
  display: inline-flex; gap: 6px; align-items: center;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .02em;
}
.sla-markers .sla {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
}
.sla-markers .sla.ok    { color: var(--success); border-color: rgba(45,94,58,.4); background: #DFE6E1; }
.sla-markers .sla.warn  { color: var(--burnt);  border-color: var(--burnt);  background: #FBEFE6; }
.sla-markers .sla.breach{ color: #fff; border-color: var(--destructive); background: var(--destructive); }
.sla-markers .sla .lbl  { letter-spacing: .14em; font-size: 9px; text-transform: uppercase; }
.counts-row .count-pill.dashed { border-style: dashed; }

.qsec { background: #fff; padding: 40px var(--gutter) 80px; }

/* search + sort + clear — one tight row */
.qsec .toolbar {
  display: flex; align-items: stretch; gap: 10px;
  margin-bottom: 16px;
}
.qsec .search {
  flex: 1; display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--ink);
  height: 48px; padding: 0 16px;
  background: #fff;
}
.qsec .search .magnifier {
  width: 20px; height: 20px;
  color: var(--ink);
  flex-shrink: 0;
}
.qsec .search input {
  border: none; outline: none; flex: 1; font: inherit;
  font-family: var(--font-sans); font-size: 14px; color: var(--ink);
  background: transparent;
  padding: 12px 0;
}
.qsec .search input::placeholder { color: var(--muted); }
.qsec .search .count {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--muted); white-space: nowrap;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

/* sort dropdown — one button that opens a popover */
.sort-wrap { position: relative; }
.sort-btn {
  height: 48px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--ink);
  background: #fff; color: var(--ink);
  font-family: var(--font-sans); font-size: 13px;
  cursor: pointer; white-space: nowrap;
}
.sort-btn:hover { background: var(--sand-2); }
.sort-btn.dirty {
  border-color: var(--primary);
  box-shadow: inset 0 -2px 0 var(--primary);
}
.sort-btn.dirty .caps { color: var(--primary); }
.sort-btn .caps {
  font-family: var(--font-caps); font-size: 10px;
  letter-spacing: .2em; color: var(--muted);
}
.sort-btn .val { font-weight: 500; }
.sort-btn .arr { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.sort-pop {
  position: absolute; top: calc(100% + 4px); right: 0;
  z-index: 30; min-width: 200px;
  background: #fff; border: 1px solid var(--ink);
  box-shadow: 0 2px 0 rgba(0,0,0,.06);
}
.sort-pop .opt {
  padding: 10px 14px;
  font-family: var(--font-sans); font-size: 13px;
  color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
}
.sort-pop .opt:hover { background: var(--sand-2); }
.sort-pop .opt.on { background: var(--ink); color: #fff; }
.sort-pop .opt .desc { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-left: 12px; }
.sort-pop .opt.on .desc { color: #fff9; }
.sort-pop .opt.reset {
  border-top: 1px solid var(--border);
  color: var(--primary);
  font-family: var(--font-mono); font-size: 12px;
}
.sort-pop .opt.reset:hover { background: var(--primary); color: var(--ink); }

/* clear-filters button — independent, only shows when filters active */
.clear-btn {
  height: 48px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--destructive);
  background: #fff; color: var(--destructive);
  font-family: var(--font-sans); font-size: 13px;
  cursor: pointer; white-space: nowrap;
}
.clear-btn:hover { background: var(--destructive); color: #fff; }
.clear-btn .num { font-family: var(--font-mono); font-weight: 600; }

/* btn-fire-tall (matches title bar action) */
.btn-fire-tall {
  height: 48px; padding: 0 22px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff;
  border: 1px solid var(--primary);
  font-family: var(--font-sans); font-weight: 600; font-size: 14px;
  cursor: pointer;
}
.btn-fire-tall:hover { background: #FF9B22; }

/* filter rows — stacked, full-width, label + chips */
.filter-rows {
  display: flex; flex-direction: column; gap: 10px;
  padding: 4px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.filter-rows .frow {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.filter-rows .frow .flabel {
  font-family: var(--font-caps); font-size: 10px;
  letter-spacing: .2em; color: var(--muted);
  text-transform: uppercase;
  /* fixed width so the divider line aligns across rows */
  width: 88px;
  flex: 0 0 88px;
  padding-right: 14px;
  margin-right: 6px;
  border-right: 1px solid var(--border);
  box-sizing: border-box;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.fchip {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: all .1s;
}
.fchip:hover { background: var(--sand-2); border-color: var(--ink); color: var(--ink); }
.fchip.on {
  background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 500;
}
.fchip.fire.on {
  background: var(--primary); color: var(--ink); border-color: var(--primary);
}
.fchip.dashed { border-style: dashed; }
.fchip.dashed.on { border-style: solid; }
.fchip .num {
  font-family: var(--font-mono); font-size: 10px;
  margin-left: 6px; opacity: .8;
}

.qsec .meta-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.qsec .pgrow {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 24px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.qsec .pgrow .pager { display: flex; gap: 6px; align-items: center; }
.qsec .pgrow .pager .pg {
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid var(--border);
  cursor: pointer;
}
.qsec .pgrow .pager .pg.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ============ ticket detail ============ */
.tsec { background: #fff; padding: 40px var(--gutter) 80px; }
.tsec .head {
  display: flex; align-items: center; gap: 28px;
  padding-bottom: 24px;
}
.tsec .head .idbox {
  border-right: 1px solid var(--border);
  padding-right: 28px;
  display: flex; flex-direction: column; gap: 6px;
  align-self: center;
}
.tsec .head .idbox .cap { font-family: var(--font-caps); font-size: 10px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.tsec .head .idbox .id { font-family: var(--font-mono); font-size: 28px; font-weight: 500; letter-spacing: -.5px; }
.tsec .head .title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -.5px;
  line-height: 1.2;
  flex: 1;
  align-self: center;
  margin: 0;
}
.tsec .lifebar {
  padding: 20px 0 0 0;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 20px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.tsec .lifebar .track {
  flex: 1; height: 14px; background: var(--sand);
  position: relative;
  border: 1px solid var(--border);
}
.tsec .lifebar .track .fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: var(--primary);
}
.tsec .lifebar .track .marker {
  position: absolute; top: -3px; bottom: -3px;
  width: 2px; background: var(--ink);
}
.tsec .status-row {
  display: grid;
  /* two rows × 4 columns instead of 1×7 — breathing room */
  grid-template-columns: 1.4fr 1fr 1.1fr 1.2fr;
  gap: 24px 32px;
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--border);
}
.tsec .status-row .sg .cap {
  font-family: var(--font-caps);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.tsec .status-row .sg .pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  background: #fff;
  white-space: nowrap;
}
.tsec .status-row .sg .pill.dark { background: var(--burnt-dark); color: #fff; border-color: var(--burnt); font-family: var(--font-mono); }
.tsec .status-row .sg .pill.sand { background: #fff; }
.tsec .status-row .sg .pill .sub {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted); margin-left: 4px;
}
.tsec .status-row .sg .pill.dark .sub { color: #fff9; }

/* doc-type cell embedded in status row — owns its own row but the chip is
   sized like the items above it (≈ one grid column) so they line up. */
.tsec .status-row .sg.sg-docs .doc-chip { width: 100%; max-width: 340px; }
/* readonly variant — no action buttons, the whole chip is one click target */
.doc-chip.readonly .action-btn,
.doc-chip.readonly .x { display: none !important; }

/* unified edit button — same across detail page (top-right, description, analysis, docs) */
.btn-edit {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  background: #fff; color: var(--ink);
  border: 1px solid var(--ink);
  box-sizing: border-box;
  cursor: pointer;
  transition: background .12s;
}
.btn-edit:hover { background: var(--sand-2); }
/* iconfont edit pen inside small "btn-edit" actions */
.btn-edit .iconfont,
.btn-edit i.iconfont.icon-bianji {
  font-size: 14px;
  line-height: 1;
  margin-right: 2px;
  color: inherit;
}
.ico-paperclip { display: inline-block; transform: scaleX(-1); }

/* "+" glyph used on upload-style buttons in place of the old 📎/📷 emojis */
.upload-plus {
  display: inline-grid;
  place-items: center;
  width: 16px; height: 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  margin-right: 4px;
  color: inherit;
}

/* tame the loud "eyebrow tight dark" used on description/analysis card heads */
.card .hdr .eyebrow.tight.dark { color: var(--muted); font-weight: 500; }
.card .hdr .mono-11.fg-muted   { color: var(--muted-2); }

/* user-typed content in detail cards should dominate */
.card .descBody,
.card .analysisBody {
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.7;
}
.card .descBody img.inline-image {
  display: block;
  max-width: 100%;
  max-height: 420px;
  margin: 12px 0;
  border: 1px solid var(--border);
  cursor: zoom-in;
}
.desc-edit-toolbar {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--ink); border-bottom: none;
  background: var(--sand-2);
}
.desc-edit-toolbar .tool-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: #fff; border: 1px solid var(--border);
  font-family: var(--font-sans); font-size: 12px;
  color: var(--ink);
  cursor: pointer;
}
.desc-edit-toolbar .tool-btn:hover { background: var(--sand); border-color: var(--ink); }
.desc-edit-toolbar .tip { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* save badge top-right of detail header — borderless, aligned to .btn baseline */
.save-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  line-height: 1;
  font-family: var(--font-mono); font-size: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  box-sizing: border-box;
  vertical-align: middle;
}
.save-badge.saving { color: var(--burnt); border-color: var(--burnt); }
.save-badge.saved  { color: var(--success); border-color: var(--success); }
.save-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}

/* category popover */
.cat-pop {
  position: absolute; z-index: 50;
  background: #fff; border: 1px solid var(--ink);
  box-shadow: 0 2px 0 rgba(0,0,0,.08);
  padding: 12px;
  display: grid;
  grid-template-columns: 180px 200px;
  gap: 0;
  min-width: 400px;
}
.cat-pop .col {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  padding-right: 12px;
}
.cat-pop .col:last-child { border-right: none; padding-right: 0; padding-left: 12px; }
.cat-pop .col .h {
  font-family: var(--font-caps); font-size: 10px;
  letter-spacing: .2em; color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.cat-pop .col .item {
  padding: 6px 10px;
  font-family: var(--font-sans); font-size: 13px;
  color: var(--ink); cursor: pointer; user-select: none;
}
.cat-pop .col .item:hover { background: var(--sand-2); }
.cat-pop .col .item.on { background: var(--ink); color: #fff; }
.cat-pop .col .item .arr {
  float: right; font-family: var(--font-mono); font-size: 11px; opacity: .5;
}
.cat-pop .col .empty {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted); padding: 6px 10px;
}

.tsec .three-col { display: grid; grid-template-columns: 1fr 1px 1fr 1px 1fr; gap: 0; }
.tsec .three-col .vdiv { background: var(--border); }
.tsec .three-col .colx { padding: 0 24px; display: flex; flex-direction: column; gap: 10px; }
.tsec .three-col .colx:first-child { padding-left: 0; padding-right: 24px; }
.tsec .three-col .colx:last-child { padding-right: 0; padding-left: 24px; }
.tsec .three-col .colx .cap {
  font-family: var(--font-caps); font-size: 11px; letter-spacing: .2em;
  color: var(--ink); font-weight: 500; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.tsec .three-col .colx .cap .num { font-family: var(--font-mono); color: var(--primary); }
.tsec .three-col .colx .body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
}

/* ============ feishu docs card ============ */
.docs-card .group {
  padding: 18px 0;
  border-bottom: 1px dashed var(--border);
}
.docs-card .group:last-child { border-bottom: none; padding-bottom: 0; }
.docs-card .group:first-of-type { padding-top: 4px; }
.docs-card .group .gh {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.docs-card .group .gh .gh-l {
  display: flex; align-items: baseline; gap: 12px;
}
.docs-card .group .gh .gh-l .num {
  font-family: var(--font-mono); font-size: 11px; color: var(--primary);
}
.docs-card .group .gh .gh-l .name {
  font-family: var(--font-sans); font-size: 14px; font-weight: 500; color: var(--ink);
}
.docs-card .group .gh .gh-l .en {
  font-family: var(--font-caps); font-size: 10px; letter-spacing: .2em; color: var(--muted);
  text-transform: uppercase;
}
.docs-card .group .gh .gh-l .count {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted-2);
}
/* doc chip — light-blue feishu-accent button with icon · title · arrow + actions */
.doc-chip {
  display: inline-flex; align-items: stretch;
  border: 1px solid #3370FF;        /* feishu blue */
  background: #EAF1FF;              /* soft feishu */
  font-family: var(--font-sans); font-size: 13px; color: #1B3766;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  max-width: 100%;
  height: 40px;
  box-sizing: border-box;
}
.doc-chip .main {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 14px;
  flex: 1; min-width: 0;
}
.doc-chip .ico-doc {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #3370FF;
  flex-shrink: 0;
}
.doc-chip .ico-doc svg { display: block; width: 18px; height: 18px; }
.doc-chip .name {
  font-weight: 500;
  max-width: 320px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1;
}
.doc-chip .arr {
  width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #3370FF; flex-shrink: 0;
}
.doc-chip .arr svg { display: block; width: 14px; height: 14px; }
.doc-chip .action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px;
  color: #3370FF;
  border-left: 1px solid #3370FF;
  font-family: var(--font-mono); font-size: 14px; line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
  transition: color .12s, background .12s;
}
.doc-chip:hover { background: #DBE7FF; border-color: #1F5AE0; }
.doc-chip:hover .ico-doc { color: #1F5AE0; }
.doc-chip:hover .arr     { color: #1F5AE0; }
.doc-chip .action-btn:hover { background: #3370FF; color: #fff; }
.doc-chip .action-btn.del:hover { background: var(--destructive); color: #fff; border-left-color: var(--destructive); }

.doc-edit-form {
  display: grid; grid-template-columns: 1fr 200px auto auto;
  gap: 6px; align-items: center;
  padding: 8px; margin-bottom: 8px;
  background: #EAF1FF; border: 1px solid #3370FF;
}
.doc-edit-form input {
  height: 32px; padding: 0 10px;
  border: 1px solid #1F5AE0; background: #fff;
  font: inherit; font-family: var(--font-mono); font-size: 12px;
  outline: none;
}
.doc-edit-form input.title { font-family: var(--font-sans); }

.doc-add-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: 1px dashed var(--border);
  background: #fff;
  font-family: var(--font-sans); font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.doc-add-btn:hover { background: var(--sand-2); border-color: var(--ink); color: var(--ink); }

.doc-add-form {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--sand-2);
  border: 1px solid var(--border);
  margin-top: 4px;
}
.doc-add-form input {
  height: 34px; padding: 0 10px;
  border: 1px solid var(--ink);
  background: #fff;
  font-family: var(--font-sans); font-size: 13px;
  outline: none;
}
.doc-add-form .actions { display: flex; gap: 6px; }

/* unified docs add form at the top of the docs card */
.doc-add-unified {
  background: var(--sand-2);
  border: 1px solid var(--ink);
  padding: 16px 18px;
  margin: 4px 0 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.doc-add-unified .row {
  display: flex; align-items: center; gap: 16px;
}
.doc-add-unified .row .cap-row {
  flex: 0 0 100px;
  font-family: var(--font-caps); font-size: 10px; letter-spacing: .2em;
  color: var(--muted); text-transform: uppercase;
}
.doc-add-unified .row .chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.doc-add-unified .row input {
  flex: 1; height: 36px; padding: 0 12px;
  border: 1px solid var(--ink); background: #fff;
  font: inherit; font-family: var(--font-sans); font-size: 13px;
  outline: none;
}
.doc-add-unified .row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255,132,0,.18);
}
.doc-add-unified .row.foot { justify-content: flex-end; gap: 10px; }

.composer { display: flex; gap: 14px; padding-top: 20px; border-top: 1px solid var(--ink); position: relative; }
.composer .box { flex: 1; border: 1px solid var(--ink); background: #fff; display: flex; flex-direction: column; position: relative; }
.composer .box textarea {
  border: none; outline: none; resize: vertical;
  min-height: 120px; padding: 14px;
  font: inherit; font-family: var(--font-sans);
  font-size: 14px; line-height: 1.6;
}
.composer .box .preview-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 12px 12px;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}
.composer .box .preview-row .att {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  padding: 4px 8px;
  font-family: var(--font-sans); font-size: 12px;
  background: var(--sand-2);
}
.composer .box .preview-row .att img {
  width: 22px; height: 22px; object-fit: cover; border: 1px solid var(--border);
}
.composer .box .preview-row .att.img-only {
  position: relative;
  padding: 0;
  background: transparent; border-color: var(--border);
}
.composer .box .preview-row .att.img-only img {
  width: 64px; height: 64px;
  object-fit: cover; display: block;
  border: 1px solid var(--border);
}
.composer .box .preview-row .att.img-only .x {
  position: absolute; top: -8px; right: -8px;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  background: var(--ink); color: #fff;
  border-radius: 50%;
  font-size: 10px; line-height: 1;
  cursor: pointer;
}
.composer .box .preview-row .att.img-only .x:hover { background: var(--destructive); }
.composer .box .preview-row .att .x {
  cursor: pointer; color: var(--muted); margin-left: 2px;
}
.composer .box .tools {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-top: 1px solid var(--ink);
  background: var(--sand);
  font-family: var(--font-mono);
  font-size: 12px; color: var(--muted);
}
.composer .box .tools .left {
  display: flex; align-items: center; gap: 8px;
}
.composer .box .tools .upload-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border: 1px solid var(--border); background: #fff;
  cursor: pointer; font-family: var(--font-sans); color: var(--ink);
}
.composer .box .tools .upload-btn:hover { background: var(--sand); }

/* @ mention popover */
.mention-pop {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 60px;
  background: #fff; border: 1px solid var(--ink);
  z-index: 30; min-width: 240px;
  max-height: 240px; overflow: auto;
  box-shadow: 0 -2px 0 rgba(0,0,0,.06);
}
.mention-pop .item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer;
  font-family: var(--font-sans); font-size: 13px;
}
.mention-pop .item:hover, .mention-pop .item.on {
  background: var(--ink); color: #fff;
}
.mention-pop .item:hover .role, .mention-pop .item.on .role { color: #fff9; }
.mention-pop .item .role { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-left: auto; }

/* @ chip inside rendered body */
.comment .body p .at-mention {
  color: var(--primary);
  font-weight: 600;
  background: rgba(255,132,0,.08);
  padding: 0 4px;
  border-radius: 2px;
}

/* comment attachments grid */
.comment .att-grid {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px;
}
.comment .att-grid .img {
  border: 1px solid var(--border);
  width: 120px; height: 120px; overflow: hidden;
  display: block;
}
.comment .att-grid .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.comment .att-grid .file {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  font-family: var(--font-sans); font-size: 12px;
  background: var(--sand-2);
  cursor: pointer;
}
.comment .att-grid .file:hover { background: var(--sand); }
.comment .att-grid .file .size { color: var(--muted); font-family: var(--font-mono); }

.comment {
  display: flex; gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.comment.pinned { background: var(--sand-2); border-left: 3px solid var(--burnt); padding-left: 16px; }

/* System messages (timeline events rendered inline in the comments feed).
   Deliberately thin: one row, mono font, no per-comment chrome. */
.comment.system {
  padding: 6px 0 6px 12px;
  border-bottom: 1px dashed var(--border);
  align-items: center;
  gap: 10px;
  background: var(--sand-2);
  border-left: 3px solid var(--burnt);     /* left stripe — distinct from regular comments */
}
/* Small "系统" chip on the left, before the icon */
.comment.system .sys-tag {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  height: 20px;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--burnt-dark, var(--ink));
  background: var(--sand);
  border: 1px solid var(--burnt);
  text-transform: uppercase;
}
.comment.system .sys-dot {
  width: 24px; height: 24px;
  display: inline-grid; place-items: center;
  flex: 0 0 24px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid var(--border);
}
.comment.system .sys-body {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  min-width: 0;
}
.comment.system .sys-actor {
  color: var(--ink);
  font-weight: 500;
  flex: 0 0 auto;
}
.comment.system .sys-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.comment.system .sys-text strong { color: var(--ink); font-weight: 500; }
.comment.system .sys-when {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted);
}

/* Modify-log modal — drives the "📜 日志" button on detail page */
.el-dialog.log-modal { border-radius: 0; box-shadow: 0 18px 48px rgba(20,14,8,.24); }
.el-dialog.log-modal .el-dialog__header { display: none; }
.el-dialog.log-modal .el-dialog__body { padding: 0; }
.log-modal .eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .26em;
  color: var(--primary);
}
.log-modal .log-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  border-bottom: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
}
.log-modal .log-row:last-child { border-bottom: 0; }
.log-modal .log-row:hover { background: var(--sand-2); }
.log-modal .log-ico {
  width: 24px; height: 24px;
  display: inline-grid; place-items: center;
  flex: 0 0 24px;
  background: var(--sand);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--ink);
}
.log-modal .log-mid { flex: 1; min-width: 0; }
.log-modal .log-actor {
  font-size: 11px;
  color: var(--ink);
  font-weight: 500;
}
.log-modal .log-text {
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
  font-size: 12px;
}
.log-modal .log-text strong { color: var(--ink); font-weight: 500; }
.log-modal .log-time {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted);
}

/* description before/after snippet inside a log row */
.log-modal .log-diff {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--sand-2);
  border-left: 3px solid var(--border);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
}
.log-modal .log-diff.old { border-left-color: var(--burnt); }
.log-modal .log-diff.new { border-left-color: var(--primary); }
.log-modal .log-diff .lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--muted);
  text-transform: uppercase;
  padding-top: 2px;
}
.log-modal .log-diff .snip {
  white-space: pre-wrap;
  word-break: break-word;
}
.comment .parent-quote {
  display: flex; gap: 8px; align-items: flex-start;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-left: 3px solid var(--border);
  background: var(--sand-2);
  font-family: var(--font-sans); font-size: 12px; color: var(--muted);
}
.comment .parent-quote .who { color: var(--ink); font-weight: 500; margin-right: 6px; }
.comment .actions {
  display: inline-flex; gap: 10px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted);
}
.comment .actions a { cursor: pointer; }
.comment .actions a:hover { color: var(--ink); }
.comment .actions a.del:hover { color: var(--destructive); }
.comment .edited-tag {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--muted-2); margin-left: 8px;
}
.composer .reply-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  background: var(--sand);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans); font-size: 12px; color: var(--muted);
}
.composer .reply-banner .who { color: var(--ink); font-weight: 500; }
.composer .reply-banner .x { cursor: pointer; font-family: var(--font-mono); }
.comment .body { flex: 1; }
.comment .head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-sans); font-size: 13px;
}
.comment .head .who { font-weight: 600; }
.comment .head .when { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.comment p { font-family: var(--font-sans); font-size: 14px; line-height: 1.6; margin: 6px 0 0 0; }

/* ============ R×U picker ============ */
.ru-picker { width: 380px; }
.ru-picker .ru-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.ru-picker .ru-header h3 { font-family: var(--font-display); font-size: 18px; margin: 4px 0 6px; font-weight: 500; }
.ru-picker .ru-header .sub { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.ru-picker .grid {
  padding: 14px 20px;
  display: grid;
  grid-template-columns: 28px repeat(5, 1fr);
  grid-template-rows: 24px repeat(5, 44px);
  gap: 4px;
}
.ru-picker .grid .lbl { display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.ru-picker .grid .c {
  cursor: pointer;
  border: 1px solid transparent;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px;
}
.ru-picker .grid .c.sel { border-color: var(--primary); outline: 2px solid var(--primary); }
.ru-picker .ru-foot {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--sand);
  border-top: 1px solid var(--ink);
  padding: 14px 20px;
}
.ru-picker .legend { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.ru-picker .legend .swatch { width: 14px; height: 14px; display: inline-block; }

/* ============ legal analysis modal ============ */
.la-modal { width: 820px; max-width: 92vw; }
.la-modal .topbar { height: 6px; background: var(--burnt); }
.la-modal .head { padding: 24px 32px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-end; }
.la-modal .head h3 { font-family: var(--font-display); font-size: 22px; margin: 0; font-weight: 500; }
.la-modal .head .sub { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 4px; }
.la-modal .body { padding: 24px 32px; display: flex; flex-direction: column; gap: 28px; }
.la-modal .body .section .secHead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.la-modal .body .section .secHead .num { font-family: var(--font-mono); font-size: 11px; color: var(--primary); }
.la-modal .body .section .secHead .name {
  font-family: var(--font-caps); font-size: 12px; letter-spacing: .2em;
  text-transform: uppercase; font-weight: 600;
}
.la-modal .body .section .secHead .alt { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.la-modal .body .section textarea {
  width: 100%; min-height: 80px;
  font-family: var(--font-sans); font-size: 13px; line-height: 1.65;
  border: 1px solid var(--ink); padding: 12px; resize: vertical;
  background: #fff;
  outline: none;
}
.la-modal .foot { display: flex; justify-content: space-between; align-items: center; padding: 18px 32px; background: var(--sand); border-top: 1px solid var(--ink); }
.la-modal .foot .meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.la-modal .foot .actions { display: flex; gap: 10px; }

/* ============ new ticket modal (inline-picker rebuild) ============ */
.ntk-modal { width: 920px; max-width: 95vw; }
.ntk-modal .body { padding: 28px 36px 12px; display: flex; flex-direction: column; gap: 24px; }
.ntk-modal .body .row-split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: start; }

.ntk-modal .picker { display: flex; flex-direction: column; gap: 10px; }
.ntk-modal .picker .picker-head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--font-caps);
  font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.ntk-modal .picker .picker-head .hint {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0;
  color: var(--muted); text-transform: none;
}
.picker .req {
  color: var(--destructive, #D93C15);
  font-family: var(--font-mono);
  font-weight: 700;
  margin-left: 2px;
}

.ntk-modal .picker .chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}

/* unified inline chip used for category / status / due preset / tag suggestion */
.pchip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.pchip:hover { background: var(--sand-2); border-color: var(--ink); }
.pchip.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 500; }
.pchip.on .dot { background: var(--primary); }
.pchip.fire.on { background: var(--primary); color: var(--ink); border-color: var(--primary); }
.pchip.dashed { border-style: dashed; color: var(--muted); }
.pchip.dashed.on { background: var(--ink); color: var(--primary); border-style: solid; }
.pchip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.pchip .av-ring { width: 22px; height: 22px; font-size: 9px; }
.pchip.fire-dim { background: #fff5e6; color: var(--burnt); border-color: var(--burnt); }
.pchip.fire-dim.on { background: var(--burnt); color: #fff; border-color: var(--burnt); }

/* inline R×U mini-matrix inside new-ticket modal */
.ru-inline {
  display: grid;
  grid-template-columns: 28px repeat(5, 56px);
  grid-template-rows: 22px repeat(5, 44px);
  gap: 5px;
  width: 318px;
}
.ru-inline .ru-lbl {
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
}
.ru-inline .ru-cell {
  cursor: pointer;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px;
  border: 1px solid transparent;
  transition: outline .1s;
}
.ru-inline .ru-cell:hover { outline: 1px dashed var(--ink); }
.ru-inline .ru-cell.sel {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  position: relative;
}
.ru-inline .ru-cell.sel::after {
  content: ""; position: absolute; inset: -4px;
  border: 1px solid var(--primary);
  pointer-events: none;
}
.ru-inline-meta {
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  padding-top: 22px;
}
.ru-inline-meta .ru-val {
  font-family: var(--font-mono); font-size: 28px; letter-spacing: -.5px;
  color: var(--ink); line-height: 1;
}
.ru-inline-meta .ru-sev {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--burnt-dark); color: #fff;
  font-family: var(--font-mono); font-size: 11px;
}
.ru-inline-meta .ru-sev.mild { background: var(--sand); color: var(--ink); border: 1px solid var(--border); }
.ru-inline-meta .ru-sev.warm { background: var(--burnt); color: #fff; }
.ru-inline-meta .ru-sev.mid  { background: var(--burnt-deep); color: #fff; }

/* assignee inline avatars */
.assignee-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.assignee-grid .pchip { padding: 6px 12px 6px 6px; }
.assignee-grid .pchip .role {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--muted); letter-spacing: .04em; margin-left: 4px;
}
.assignee-grid .pchip.on .role { color: #fff9; }

/* tag input with chips */
.tag-input-row {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--ink);
  padding: 6px 8px 6px 12px;
  background: #fff;
  min-height: 40px;
  flex-wrap: wrap;
}
.tag-input-row .tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  background: var(--sand);
  border: 1px solid var(--border);
  font-family: var(--font-sans); font-size: 12px;
}
.tag-input-row .tag-chip .x { cursor: pointer; color: var(--muted); }
.tag-input-row input {
  flex: 1; min-width: 120px;
  border: none; outline: none;
  font: inherit; font-family: var(--font-sans);
  font-size: 13px; padding: 4px 0;
  background: transparent;
}

/* draft accent — soft green when active */
.seg .s.draft.on,
.qsec .seg .s.draft.on,
.tsec .seg .s.draft.on {
  background: #DFE6E1;          /* soft sage — pairs with --color-success token */
  color: #1B3A28;               /* deep green ink for contrast */
  font-family: var(--font-sans);
  font-weight: 500;
  border-left-color: var(--ink);
}
.seg .s.clickable.draft.on:hover { background: #C9D6CD; filter: none; }

/* feishu integration dialog */
.fs-modal { width: 720px; max-width: 92vw; }
.fs-modal .topbar { height: 6px; background: var(--leaf); }
.fs-modal .head {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 24px 32px 20px;
  border-bottom: 1px solid var(--border);
}
.fs-modal .body { padding: 24px 32px; display: flex; flex-direction: column; gap: 22px; }
.fs-modal .body .step {
  display: grid; grid-template-columns: 28px 1fr; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
}
.fs-modal .body .step:last-of-type { border-bottom: none; }
.fs-modal .body .step .n {
  width: 26px; height: 26px; border: 1px solid var(--ink);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 500; font-size: 12px;
  background: var(--sand);
}
.fs-modal .body .step .name {
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  margin-bottom: 6px;
}
.fs-modal .body .step .desc {
  font-family: var(--font-sans); font-size: 12px; color: var(--muted);
  line-height: 1.55;
}
.fs-modal .body .step .copy-row {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--primary);
  font-family: var(--font-mono); font-size: 12px;
  padding: 8px 12px;
}
.fs-modal .body .step .copy-row .v {
  flex: 1; overflow: auto; white-space: nowrap;
}
.fs-modal .body .step .copy-row .cp {
  font-family: var(--font-caps); font-size: 10px;
  letter-spacing: .2em; color: #fff;
  cursor: pointer; padding: 2px 8px;
  border: 1px solid #fff3;
}
.fs-modal .body .step .copy-row .cp:hover { background: #fff1; }
.fs-modal .foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 32px; background: var(--sand); border-top: 1px solid var(--ink);
}
.fs-modal .foot .badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
}
.fs-modal .foot .badge .ok { width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); }
.fs-modal .foot .badge .off { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }

/* ============ categories management ============ */
.cat-add-form {
  border: 1px solid var(--ink);
  background: #fff;
  padding: 14px;
}
.cat-add-form input {
  height: 40px; padding: 0 14px;
  border: 1px solid var(--ink); background: #fff;
  font: inherit; font-family: var(--font-sans); font-size: 14px;
  outline: none;
}
.cat-add-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255,132,0,.18);
}

.cat-card {
  background: #fff;
  border: 1px solid var(--ink);
  padding: 22px;
  display: flex; flex-direction: column;
  /* Min height so all cards in a row share a baseline; children with margin-top:auto pin to bottom */
}
.cat-card-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.cat-card-caps {
  font-family: var(--font-caps);
  font-size: 10px; letter-spacing: .26em;
  color: var(--muted); text-transform: uppercase; font-weight: 500;
}
.cat-card-name {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 500;
  border: 1px solid transparent; outline: none; background: transparent;
  padding: 6px 8px; min-width: 0; width: 100%;
  color: var(--ink);
}
.cat-card-name:hover, .cat-card-name:focus { border-color: var(--ink); }
.cat-card-name:focus { background: #fff; box-shadow: 0 0 0 2px rgba(255,132,0,.18); border-color: var(--primary); }
.cat-card-del {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: #fff; color: var(--muted);
  border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 14px;
  cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.cat-card-del:hover { background: var(--destructive); color: #fff; border-color: var(--destructive); }

/* two-column grid so the chip block spans the full card width and the right
   edge of column 2 lines up with the delete (✕) button above */
.cat-card-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.cat-chip {
  display: flex; align-items: center;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--sand-2);
  padding: 4px 6px 4px 10px;
  font-family: var(--font-sans); font-size: 12px;
  color: var(--ink);
  min-width: 0;
}
.cat-chip:hover { border-color: var(--ink); background: var(--sand); }
.cat-chip .cat-chip-name {
  border: none; outline: none; background: transparent;
  font: inherit; font-family: var(--font-sans); font-size: 12px;
  color: var(--ink);
  flex: 1; min-width: 0;
  padding: 2px 0;
}
/* empty-state placeholder should span both columns */
.cat-card-chips > .mono-11.fg-muted { grid-column: 1 / -1; }
.cat-chip .x {
  cursor: pointer; color: var(--muted-2);
  font-family: var(--font-mono); font-size: 11px;
  padding: 2px 6px; margin-left: 4px;
}
.cat-chip .x:hover { color: var(--destructive); }

.cat-add-l2-btn {
  width: 100%; padding: 8px 10px;
  background: #fff;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-family: var(--font-sans); font-size: 12px;
  cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.cat-add-l2-btn:hover { background: var(--sand-2); border-color: var(--ink); color: var(--ink); }

.cat-l2-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  padding: 8px;
  background: var(--sand-2);
  border: 1px solid var(--ink);
  align-items: stretch;
}
.cat-l2-form input {
  height: 34px; padding: 0 10px;
  border: 1px solid var(--ink); background: #fff;
  font: inherit; font-family: var(--font-sans); font-size: 13px;
  outline: none;
  box-sizing: border-box;
}
.cat-l2-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255,132,0,.18);
}
/* Force buttons in the L2 add form to match input height exactly */
.cat-l2-form .btn,
.cat-l2-form .btn.fire {
  height: 34px;
  padding: 0 14px;
  box-sizing: border-box;
  display: inline-flex; align-items: center;
}

.cat-card-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
}

/* utility */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-6 { gap: 6px; }
.gap-10 { gap: 10px; }
.gap-14 { gap: 14px; }
.gap-20 { gap: 20px; }
.gap-32 { gap: 32px; }
.fg-muted { color: var(--muted); }
.fg-primary { color: var(--primary); }
.fg-ink { color: var(--ink); }
.mono-12 { font-family: var(--font-mono); font-size: 12px; }
.mono-11 { font-family: var(--font-mono); font-size: 11px; }
