@font-face {
  font-family: Instrument Sans;
  src: url("/assets/InstrumentSans-VF.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: Dragon;
  src: url("/assets/Dragon-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Instrument Serif;
  src: url("/assets/InstrumentSerif-Regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #1e1e1e;
  --paper: #f1f0ee;
  --surface: #faf9f7;
  --line: #dfdcd7;
  --muted: #625e59;
  --accent: #f55617;
  --accent-ink: #9c330e;
  --accent-tint: #ffece2;
  --danger: #942d35;
  --dark: #191918;
  --beige: #e5e1cc;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --display: "Dragon", "Arial Narrow", sans-serif;
  --side: 230px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.icons { width: 0; height: 0; position: absolute; overflow: hidden; }

.startup { display: grid; min-height: 100svh; place-items: center; padding: 20px; color: var(--muted); }
.login { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); min-height: 100svh; }
.login-hero {
  background: linear-gradient(180deg, #19191870, #19191800 37%, #191918ec), url("/assets/jungla.webp") center / cover, var(--dark);
  color: var(--beige);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 460px;
  padding: clamp(28px, 5vw, 72px);
}
.login-logo { width: 108px; height: auto; }
.login-intro h1 {
  font-family: var(--display);
  font-size: clamp(60px, 7.4vw, 118px);
  font-weight: 840;
  letter-spacing: .012em;
  line-height: .78;
  text-transform: uppercase;
}
.login-intro h1 span { color: var(--accent); }
.login-intro p { margin-top: 24px; font-family: var(--serif); font-size: clamp(26px, 3vw, 36px); }
.login-access { display: grid; place-items: center; padding: 52px clamp(28px, 6vw, 78px); }
.login-content { width: 100%; max-width: 408px; }
.login-mark {
  width: 52px;
  height: 52px;
  background: var(--accent-tint);
  border: 1px solid #f3d9cd;
  border-radius: 12px;
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  margin-bottom: 24px;
}
.login-mark svg { width: 24px; height: 24px; }
.login-content h2 { font-family: var(--serif); font-size: clamp(45px, 4vw, 60px); font-weight: 400; line-height: 1; }
.login-content > p:not(.form-message) { color: var(--muted); line-height: 1.5; max-width: 33ch; margin: 14px 0 32px; }
.stack { display: grid; gap: 8px; }
.stack .button { margin-top: 8px; }
.stack input { min-height: 52px; }
.stack .button svg { margin-left: auto; }
.form-message { padding: 12px 14px; margin-top: 16px; border-left: 2px solid var(--accent); background: var(--accent-tint); color: #53210f; line-height: 1.5; border-radius: 0 6px 6px 0; }
.form-message.error { background: #fae9e9; border-color: var(--danger); color: var(--danger); }

.workspace { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100svh; }
.sidebar { position: sticky; top: 0; height: 100svh; background: var(--dark); color: var(--beige); display: flex; flex-direction: column; justify-content: space-between; padding: 24px 16px 16px; }
.brand { display: flex; align-items: center; gap: 13px; margin: 4px 8px 34px; font-size: 18px; font-weight: 700; line-height: 1.1; }
.brand img { width: 35px; height: auto; }
.navigation { display: grid; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px; color: #bfbab1; border-radius: 7px; font-weight: 600; }
.nav-link:hover { color: var(--beige); background: #242323; }
.nav-link[aria-current="page"] { color: #fff3e7; background: #302623; }
.nav-link[aria-current="page"] svg { color: #ff7448; }
.account { display: flex; align-items: center; gap: 8px; padding-top: 16px; border-top: 1px solid #3b3935; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; color: #ffe2d4; background: #4a2d24; font-size: 12px; text-transform: uppercase; }
.account-email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.account .icon-button { min-width: 32px; width: 32px; height: 38px; color: #c9c4b8; }
.account .icon-button:hover { background: #302d29; color: #fff; }
.skip { position: fixed; z-index: 20; left: 20px; top: 12px; padding: 12px; background: var(--surface); transform: translateY(-180%); }
.skip:focus { transform: translateY(0); }
.content { min-width: 0; padding: 52px clamp(28px, 5vw, 72px) 48px; }
.content:focus { outline: none; }
#page { max-width: 1400px; margin-inline: auto; }
.heading { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 24px; }
.heading h1 { font-family: var(--display); text-transform: uppercase; font-size: clamp(42px, 6vw, 79px); font-weight: 810; line-height: .92; letter-spacing: .015em; overflow-wrap: anywhere; }
.heading p { color: var(--muted); margin-top: 10px; line-height: 1.45; }
.heading .button { flex: none; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; max-width: 100%; padding: 8px 14px; border: 1px solid transparent; border-radius: 7px; white-space: normal; font-weight: 650; line-height: 1.25; }
.button svg, .icon-button svg { width: 17px; height: 17px; }
.button.primary { background: var(--accent); color: #191918; }
.button.primary:hover:not(:disabled) { background: #ff7448; }
.button.wide { width: 100%; padding-inline: 16px; justify-content: flex-start; min-height: 50px; }
.button.secondary { border-color: var(--line); background: var(--surface); }
.button.secondary:hover:not(:disabled) { background: #ebe8e3; border-color: #d3cec7; }
.button.danger { background: var(--danger); color: #fff; }
.button.danger:hover:not(:disabled) { background: #7a232b; }
.button.light { background: transparent; color: var(--muted); }
.button.light:hover:not(:disabled) { background: #e9e6e1; color: var(--ink); }
.icon-button { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.icon-button:hover { background: #eeebe6; color: var(--ink); }
.icon-button.destructive:hover { color: var(--danger); background: #fae9e9; }
label { font-weight: 650; }
input, textarea, select { color: var(--ink); width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px; background: var(--surface); border: 1px solid #d5d1cb; border-radius: 7px; }
textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
input::placeholder { color: var(--muted); opacity: 1; }
select { padding-right: 20px; }
input[type="file"] { font-size: 14px; }
input[type="file"]::file-selector-button { font: inherit; padding: 5px 8px; margin-right: 7px; border: 0; border-radius: 4px; background: #e8e4de; cursor: pointer; }
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-bottom: 16px; }
.filters { min-width: 0; flex: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.search { position: relative; display: block; min-width: min(230px, 100%); max-width: 380px; flex: 1 1 230px; }
.search svg { color: var(--muted); position: absolute; top: 11px; left: 11px; pointer-events: none; }
.search input { padding-left: 40px; }
.filters select { width: auto; max-width: 100%; }
.segment { display: flex; flex-wrap: wrap; gap: 3px; border: 1px solid var(--line); border-radius: 8px; padding: 3px; background: #eae8e4; }
.segment button { border: 1px solid transparent; border-radius: 5px; background: transparent; min-height: 34px; padding: 4px 10px; color: var(--muted); font-weight: 600; }
.segment button:hover { color: var(--ink); }
.segment button[aria-pressed="true"] { border-color: var(--line); background: var(--surface); color: var(--ink); }
.list-summary { color: var(--muted); font-size: 14px; padding: 0 0 8px; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.transcript-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.transcript-table th { background: #f5f3ef; color: var(--muted); font-weight: 650; text-align: left; font-size: 14px; }
.transcript-table th, .transcript-table td { border-bottom: 1px solid var(--line); padding: 12px 14px; overflow-wrap: anywhere; }
.transcript-table th:first-child { width: 42%; }
.transcript-table th:nth-child(2) { width: 25%; }
.transcript-table th:nth-child(3) { width: 17%; }
.transcript-table th:nth-child(4) { width: 16%; }
.transcript-table tr:last-child td { border-bottom: 0; }
.transcript-table tbody tr:hover { background: #f5f2ee; }
.row-link { display: inline-flex; align-items: flex-start; gap: 10px; font-weight: 700; line-height: 1.35; }
.row-link:hover { color: var(--accent-ink); }
.row-link svg { width: 18px; height: 18px; color: var(--accent-ink); }
.row-link span { min-width: 0; overflow-wrap: anywhere; }
.subtle { color: var(--muted); font-size: 14px; line-height: 1.4; }
.subline { display: block; margin-top: 4px; }
.mobile-date { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.pill::before { content: ""; display: block; width: 7px; height: 7px; flex: none; background: currentColor; border-radius: 50%; }
.pill.pending { color: #9b360f; }
.pill.assigned { color: #35614c; }
.empty { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 44px 20px; text-align: center; }
.empty > svg { width: 28px; height: 28px; color: var(--accent-ink); }
.empty h2 { font-family: var(--serif); font-size: 36px; font-weight: 400; margin: 8px 0; }
.empty p { color: var(--muted); margin-inline: auto; max-width: 52ch; line-height: 1.45; }
.empty .button { margin-top: 20px; }

.detail-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.detail-heading h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(42px, 5vw, 64px); line-height: 1; max-width: 22ch; overflow-wrap: anywhere; }
.detail-heading .meta { margin-top: 10px; }
.back { margin: -5px 0 16px -10px; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.detail-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.85fr) minmax(246px, 1fr); align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.panel-header { padding: 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); }
.panel h2 { font-size: 17px; font-weight: 700; }
.panel-body { padding: 16px; }
.transcript-body { padding: 22px 18px; font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.assignment { display: grid; gap: 14px; }
.assignment .field { gap: 6px; }
.assignment .button { justify-self: start; }
.suggestion { border-top: 1px solid var(--line); display: grid; gap: 12px; }
.suggestion p { overflow-wrap: anywhere; }
.suggestion .button { justify-self: start; }
.suggestion-note { background: var(--accent-tint); color: #53210f; border-left: 2px solid var(--accent); border-radius: 0 5px 5px 0; padding: 10px 12px; line-height: 1.45; }
.suggestion-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.client { margin-bottom: 14px; }
.client-head { border-bottom: 0; padding: 18px 20px; }
.client-head h2 { font-family: var(--serif); font-size: 33px; font-weight: 400; line-height: 1; overflow-wrap: anywhere; }
.client-summary { margin-top: 5px; word-break: break-word; }
.client-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.project-column { min-width: 0; padding: 12px 16px 16px; }
.project-column + .project-column { border-left: 1px solid var(--line); }
.project-column h3 { font-size: 15px; }
.project-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; border-top: 1px solid var(--line); min-height: 44px; padding: 4px 0; }
.project-row a { font-weight: 650; overflow-wrap: anywhere; min-width: 0; padding: 4px 0; }
.project-row a:hover { color: var(--accent-ink); }
.project-row .row-actions { flex: none; gap: 0; }

.load-error { display: flex; gap: 18px; align-items: center; justify-content: space-between; margin-bottom: 16px; background: #fae9e9; border-radius: 8px; padding: 14px; color: var(--danger); }
.toast { z-index: 2; position: fixed; inset: auto 20px 20px auto; width: max-content; max-width: min(430px, calc(100vw - 40px)); padding: 13px 15px; background: var(--dark); color: var(--beige); border: 1px solid #3d3b37; border-radius: 8px; line-height: 1.4; box-shadow: 0 6px 24px #19191825; }
.toast.error { background: #7a232b; color: #fff; }
dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100svh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); box-shadow: 0 12px 40px #19191830; }
dialog::backdrop { background: #19191891; }
.dialog-form { padding: 20px; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.dialog-header h2 { font-family: var(--serif); font-size: 36px; font-weight: 400; line-height: 1; overflow-wrap: anywhere; }
.dialog-fields { display: grid; gap: 12px; }
.dialog-fields p { line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.plaud-inbox { display: flex; align-items: flex-end; gap: 8px; }
.plaud-inbox label { flex: 1; }
.plaud-steps { display: grid; gap: 10px; margin: 0; padding-inline-start: 22px; line-height: 1.5; }
.field { display: grid; gap: 5px; min-width: 0; }
.field small { color: var(--muted); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 20px; }

@media (max-width: 1000px) {
  :root { --side: 190px; }
  .content { padding-inline: 24px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(220px, .7fr); }
}

@media (max-width: 800px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { min-height: 330px; padding: 24px; }
  .login-intro h1 { font-size: clamp(56px, 12vw, 84px); }
  .login-intro p { margin-top: 16px; }
  .login-access { padding: 32px 24px 44px; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { height: auto; position: static; padding: 12px 16px 8px; }
  .sidebar-top { display: contents; }
  .brand { margin: 0 0 8px; }
  .brand span { font-size: 15px; }
  .brand br { display: none; }
  .navigation { order: 2; display: flex; }
  .nav-link { min-height: 40px; }
  .sidebar-bottom { position: absolute; top: 9px; right: 12px; }
  .account { border: 0; padding: 0; }
  .account-email { display: none; }
  .content { padding: 26px 20px; }
}

@media (max-width: 600px) {
  .login-hero { min-height: 258px; }
  .login-logo { width: 82px; }
  .login-intro h1 { font-size: clamp(52px, 13vw, 72px); }
  .login-mark { width: 42px; height: 42px; margin-bottom: 12px; }
  .login-content > p:not(.form-message) { margin-bottom: 20px; }
  .heading { padding-bottom: 16px; margin-bottom: 16px; }
  .heading h1 { font-size: clamp(38px, 10.5vw, 62px); }
  .heading-actions { flex: 1 1 100%; gap: 4px; }
  .heading-actions .button { font-size: 14px; padding-inline: 9px; }
  .filters { flex: 1 1 100%; }
  .search { flex-basis: 100%; max-width: none; }
  .filters select { flex: 1 1 120px; }
  .filter-bar { gap: 8px; }
  .transcript-table, .transcript-table tbody, .transcript-table tr, .transcript-table td { display: block; width: 100%; }
  .transcript-table thead { clip-path: inset(50%); position: absolute; width: 1px; height: 1px; overflow: hidden; }
  .transcript-table tr { padding: 12px; }
  .transcript-table tr + tr { border-top: 1px solid var(--line); }
  .transcript-table td { border: 0; padding: 3px 0; }
  .transcript-table .source-inline { display: inline; margin-left: 8px; }
  .transcript-table .mobile-date { display: inline; }
  .transcript-table .date-cell { display: none; }
  .detail-grid, .client-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-grid > :last-child { grid-row: 1; }
  .project-column + .project-column { border-left: 0; border-top: 1px solid var(--line); }
  .client-head { padding: 14px; }
  .plaud-inbox { align-items: flex-start; flex-direction: column; }
  .plaud-inbox label { width: 100%; }
}

@media (max-width: 360px) {
  .content { padding-inline: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .segment button { padding-inline: 8px; }
}
