@font-face {
  font-family: Onest;
  src: url("/assets/fonts/Onest-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #f4f5f9;
  --surface: #fff;
  --ink: #182035;
  --muted: #586176;
  --line: #d9dfe9;
  --accent: #304fc5;
  --accent-hover: #233ea7;
  --selected: #edeafb;
  --selected-ink: #4e3693;
  --danger: #aa303b;
  --success: #236745;
  --field: #fff;
  --shadow: 0 18px 50px rgba(24, 32, 53, 0.16);
  font-family: Onest, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  font-synthesis: none;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131826;
  --surface: #1c2334;
  --ink: #e9edf8;
  --muted: #b0bbd2;
  --line: #39445c;
  --accent: #a9b9ff;
  --accent-hover: #c6d1ff;
  --selected: #343152;
  --selected-ink: #dfd7ff;
  --danger: #ffacb4;
  --success: #91d8b3;
  --field: #182032;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button,
a {
  touch-action: manipulation;
}
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 14px;
  font-weight: 560;
}
button:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--muted);
}
.primary {
  background: var(--accent);
  color: var(--surface);
  border-color: transparent;
}
.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: transparent;
}
.danger {
  color: var(--danger);
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
a:hover {
  text-decoration-thickness: 2px;
}
::selection {
  background: var(--selected);
  color: var(--selected-ink);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
input,
textarea {
  caret-color: var(--accent);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--muted) var(--bg);
}
[hidden] {
  display: none !important;
}
.skip-link {
  position: fixed;
  top: -70px;
  left: 16px;
  z-index: 50;
  background: var(--surface);
  padding: 12px;
}
.skip-link:focus {
  top: 12px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(1.9rem, 3.1vw, 2.8rem);
  line-height: 1.13;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1rem;
}
p {
  max-width: 72ch;
}
.muted,
small {
  color: var(--muted);
}
small {
  font-size: 0.85rem;
}
strong {
  font-weight: 650;
}
svg {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.number,
time {
  font-variant-numeric: tabular-nums;
}
.preline {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100dvh;
}
.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  border-right: 1px solid var(--line);
  padding: 28px 16px 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.workspace-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0 8px 24px;
  overflow-wrap: anywhere;
}
.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--accent);
}
.rail nav {
  display: grid;
  gap: 4px;
}
.nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
  font-weight: 500;
}
.nav-button[aria-current="page"] {
  background: var(--selected);
  color: var(--selected-ink);
  font-weight: 650;
}
.rail-bottom {
  margin-top: auto;
  padding: 28px 8px 0;
  display: grid;
  gap: 12px;
}
.rail-bottom .identity {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.rail-actions {
  display: flex;
  gap: 8px;
}
.icon-button {
  padding: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.main-wrap {
  min-width: 0;
}
.utility {
  min-height: 68px;
  padding: 12px 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  justify-content: space-between;
}
.utility p {
  font-size: 0.88rem;
  color: var(--muted);
}
.utility-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.utility a {
  font-size: 0.9rem;
}
.workspace-main {
  padding: 36px 40px 70px;
  max-width: 1560px;
  margin: 0 auto;
  min-width: 0;
}
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.page-heading p {
  margin-top: 10px;
  color: var(--muted);
}
.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.section-heading {
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
  margin: 30px 0 14px;
}
.section-heading small {
  font-variant-numeric: tabular-nums;
}
.agenda-date {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 12px;
}
.agenda {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
}
.agenda-side {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}
.agenda-side p {
  margin-top: 12px;
}
.agenda-side button {
  margin-top: 18px;
}
.agenda-group + .agenda-group {
  margin-top: 32px;
}
.agenda-group h2 {
  margin-bottom: 14px;
}
.list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(100px, 1fr) 145px auto;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  text-align: left;
  width: 100%;
  border-radius: 0;
  min-height: 78px;
}
.row:first-child {
  border-top: 0;
}
.row-button {
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  font-weight: 400;
}
.row-button:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--line);
}
.row-title {
  display: block;
  font-weight: 620;
  overflow-wrap: anywhere;
}
.row-subtitle {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.row-message {
  font-size: 0.9rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-date {
  color: var(--muted);
  font-size: 0.85rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  padding: 4px 8px;
  background: var(--bg);
  border-radius: 5px;
  color: var(--muted);
  width: max-content;
  max-width: 100%;
}
.badge.overdue {
  background: transparent;
  color: var(--danger);
  padding-left: 0;
}
.badge.active {
  background: var(--selected);
  color: var(--selected-ink);
}
.row-icon {
  color: var(--muted);
}
.empty {
  padding: 32px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.empty h2 {
  margin-bottom: 8px;
}
.empty p {
  color: var(--muted);
}
.empty button {
  margin-top: 18px;
}
.filters {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.filters label {
  margin: 0;
  min-width: 180px;
}
.filters .search {
  flex: 1;
}
.filters input,
.filters select {
  min-height: 44px;
}
.search-count {
  color: var(--muted);
  margin-left: auto;
  font-size: 0.9rem;
  padding-bottom: 11px;
}
.split {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(380px, 1.4fr);
  gap: 24px;
  align-items: start;
}
.compact-list .row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 15px 18px;
}
.compact-list .row-message,
.compact-list .row-date {
  display: none;
}
.selected-row {
  background: var(--selected);
}
.detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  min-width: 0;
}
.detail-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.detail-heading h2 {
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}
.detail-heading p {
  margin-top: 6px;
  overflow-wrap: anywhere;
}
.detail h3 {
  margin: 28px 0 12px;
}
.detail .lead-message {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-bottom: 24px;
}
.back-button {
  display: none;
}
.detail-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.detail-tabs button {
  border: 0;
  background: transparent;
}
.detail-tabs button[aria-pressed="true"] {
  background: var(--selected);
  color: var(--selected-ink);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 560;
  margin-bottom: 18px;
}
input,
select,
textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 11px 12px;
  line-height: 1.45;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
textarea {
  resize: vertical;
  min-height: 100px;
}
.form-grid label {
  margin-bottom: 0;
}
.form-help {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
}
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.form-status {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 12px;
  min-height: 1.35em;
}
.form-status:empty {
  display: none;
}
fieldset {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
legend {
  padding: 0 6px;
  font-weight: 600;
  font-size: 0.9rem;
}
.checklist {
  display: grid;
  gap: 12px;
  max-height: 300px;
  overflow: auto;
}
.checklist label,
.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  font-weight: 450;
}
.checklist input,
.checkbox input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: none;
  accent-color: var(--accent);
}
.editor {
  max-width: 840px;
}
.editor > .muted {
  margin-bottom: 24px;
}
.note {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.note p {
  margin-top: 6px;
}
.note .meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}
.task-row {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.task-row:first-child {
  border-top: 0;
}
.task-row > div {
  flex: 1;
  min-width: 0;
}
.task-row button {
  flex: none;
}
.task-row.done .row-title {
  text-decoration: line-through;
  color: var(--muted);
}
.entity-grid {
  display: grid;
  gap: 16px;
}
.entity {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
}
.entity h2 {
  overflow-wrap: anywhere;
}
.entity p {
  margin-top: 8px;
  color: var(--muted);
}
.entity .page-actions {
  align-items: flex-start;
  justify-content: end;
}
.entity small {
  display: block;
  margin-top: 6px;
}
.entity .price {
  font-size: 1.4rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.inline-result {
  padding: 20px;
  background: var(--selected);
  color: var(--selected-ink);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow-wrap: anywhere;
}
.inline-result input {
  margin-top: 12px;
  background: var(--surface);
  color: var(--ink);
}
.inline-result button {
  margin-top: 12px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
th {
  font-weight: 600;
  background: var(--bg);
}
th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tr:last-child td {
  border-bottom: 0;
}
td {
  overflow-wrap: anywhere;
}
.notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: min(440px, calc(100vw - 32px));
  padding: 16px 22px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow);
}
.loading-screen {
  margin: 15vh auto;
  padding: 28px;
  max-width: 560px;
}
.loading-screen p {
  margin-top: 20px;
  color: var(--muted);
}
.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
}
.login-story {
  background: #253fab;
  color: #fff;
  padding: clamp(32px, 7vw, 100px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-story h1 {
  font-size: clamp(2.5rem, 4.8vw, 4.5rem);
  max-width: 11ch;
}
.login-story p {
  margin-top: 28px;
  color: #dce4ff;
  max-width: 35ch;
}
.login-form {
  align-self: center;
  max-width: 440px;
  width: 100%;
  padding: 40px;
  margin: auto;
}
.login-form h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}
.login-form > .muted {
  margin-bottom: 28px;
}
.login-form .primary {
  width: 100%;
}
.login-form small {
  display: block;
  margin-top: 24px;
}
.loading-line {
  padding: 24px;
  color: var(--muted);
}
details {
  margin-top: 24px;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
}
.json-editor {
  font:
    13px/1.6 ui-monospace,
    monospace;
  min-height: 360px;
}
.readonly-fact {
  margin: 14px 0;
}
.readonly-fact dt {
  color: var(--muted);
  font-size: 0.85rem;
}
.readonly-fact dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}
@media (min-width: 1500px) {
  .workspace-main {
    padding: 48px 60px;
  }
  .utility {
    padding-inline: 60px;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .workspace-main {
    padding: 28px 24px 60px;
  }
  .utility {
    padding-inline: 24px;
  }
  .agenda {
    grid-template-columns: 1fr;
  }
  .agenda-side {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 24px 0 0;
  }
  .split {
    grid-template-columns: minmax(240px, 0.75fr) minmax(300px, 1fr);
  }
  .detail {
    padding: 20px;
  }
  .row {
    gap: 12px;
    grid-template-columns: minmax(140px, 1fr) minmax(90px, 0.7fr) 105px auto;
  }
  .row-date {
    display: none;
  }
}
@media (max-width: 800px) {
  .shell {
    display: block;
  }
  .rail {
    height: auto;
    position: static;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .workspace-brand {
    padding: 0 0 14px;
  }
  .rail nav {
    display: flex;
    overflow: auto;
    padding-bottom: 4px;
    gap: 6px;
  }
  .nav-button {
    width: auto;
    white-space: nowrap;
    padding: 10px 12px;
  }
  .nav-button svg {
    display: none;
  }
  .rail-bottom {
    position: absolute;
    right: 16px;
    top: 8px;
    padding: 0;
  }
  .rail-bottom .identity {
    display: none;
  }
  .rail-bottom .rail-actions {
    gap: 4px;
  }
  .utility {
    min-height: 54px;
    padding: 8px 20px;
  }
  .utility p {
    font-size: 0.8rem;
  }
  .utility a {
    font-size: 0.8rem;
  }
  .workspace-main {
    padding: 26px 20px 70px;
  }
  .page-heading {
    margin-bottom: 24px;
    gap: 16px;
  }
  .page-heading h1 {
    font-size: 2rem;
  }
  .page-heading p {
    font-size: 0.9rem;
  }
  .page-heading > .page-actions {
    flex: none;
  }
  .page-heading > .page-actions button {
    padding: 9px 12px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .split.has-selection > .compact-list {
    display: none;
  }
  .split.has-selection > .detail {
    display: block;
  }
  .split:not(.has-selection) > .detail {
    display: none;
  }
  .back-button {
    display: inline-flex;
  }
  .detail {
    padding: 22px;
  }
  .row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    padding: 16px;
  }
  .row-message {
    display: none;
  }
  .row-icon {
    display: none;
  }
  .filters label {
    min-width: 130px;
  }
  .search-count {
    display: none;
  }
  .entity {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .entity .page-actions {
    justify-content: start;
  }
  .login-shell {
    display: block;
  }
  .login-story {
    padding: 32px;
    min-height: 260px;
  }
  .login-story h1 {
    font-size: 2.6rem;
    max-width: 14ch;
  }
  .login-story p {
    margin-top: 16px;
  }
  .login-form {
    padding: 32px;
    max-width: 500px;
  }
  .secondary-column {
    display: none;
  }
  .notice {
    right: 16px;
    bottom: 16px;
  }
  .form-grid {
    gap: 16px;
  }
  .agenda-side {
    padding-top: 24px;
  }
  .page-actions .button-label {
    display: none;
  }
}
@media (max-width: 460px) {
  .workspace-main {
    padding: 24px 16px 60px;
  }
  .page-heading {
    flex-direction: column;
    gap: 16px;
  }
  .page-heading > .page-actions {
    width: 100%;
  }
  .page-heading > .page-actions .primary {
    flex: 1;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .wide {
    grid-column: auto;
  }
  .detail {
    padding: 18px;
  }
  .utility {
    padding-inline: 16px;
  }
  .utility p {
    max-width: 25ch;
  }
  .row .badge {
    font-size: 0.74rem;
  }
  .workspace-brand {
    font-size: 1rem;
    max-width: calc(100% - 100px);
  }
  .task-row {
    padding: 14px;
    gap: 12px;
  }
  .task-row button {
    padding: 8px 10px;
  }
  .filters {
    gap: 10px;
  }
  .filters label {
    min-width: 110px;
  }
  .list .empty {
    border: 0;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  a,
  input,
  select,
  textarea {
    transition:
      background-color 140ms ease-out,
      color 140ms ease-out,
      border-color 140ms ease-out;
  }
  .notice {
    animation: notice-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes notice-in {
    from {
      transform: translateY(8px);
      filter: blur(2px);
    }
    to {
      transform: translateY(0);
      filter: blur(0);
    }
  }
}
.followup-time { display:block; font-size:0.79rem; color:var(--muted); margin-top:6px; }
.followup-time.overdue { color:var(--danger); }
@media (max-width: 760px) {
  .agenda .row-message { display:block; grid-column:1 / -1; grid-row:2; white-space:normal; overflow:visible; font-size:0.82rem; }
}
