@font-face {
  font-family: Inter;
  src: url("/app/inter.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #263643;
  --muted: #536575;
  --line: #8baab8;
  --accent: #345c78;
  --surface: #fafbfc;
  --selected: #c8dae4;
  --glass: rgb(255 255 255 / 62%);
  --rim: rgb(255 255 255 / 80%);
  --shadow: 0 12px 32px rgb(38 54 67 / 9%);
  font: 15px/1.45 Inter, system-ui, sans-serif;
  color: var(--ink);
  background: #eef1f3;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(133deg, var(--selected) 5%, #eef1f3 33%, #dfeaf0 57%, var(--line) 85%) fixed;
}
.rail, article, form, .panel, .auth-panel {
  background: var(--glass);
  border: 1px solid var(--rim);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.rail {
  position: fixed;
  inset: 8px auto 8px 8px;
  width: 196px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: auto;
}
.wordmark { display: block; max-width: 100%; height: auto; }
.shell { margin-left: 204px; padding: 24px clamp(18px, 2.4vw, 48px); }
main { max-width: 1440px; margin: auto; min-width: 0; }
#preferences { margin-top: auto; display: grid; gap: 4px; }
nav { display: grid; gap: 6px; }
nav .more { display: none; }
button, summary, input, select, textarea {
  font: inherit;
  border-radius: 8px;
  min-height: 44px;
}
button, summary {
  padding: 9px 14px;
  font-weight: 600;
  cursor: pointer;
}
button { border: 1px solid transparent; background: var(--accent); color: white; }
button:hover { filter: brightness(.93); }
button:disabled { opacity: .65; cursor: wait; }
nav button, #preferences button, summary {
  color: var(--ink);
  background: transparent;
  text-align: left;
}
nav button[aria-current="page"], nav .more:has([aria-current="page"]) summary { background: var(--selected); }
input, select, textarea {
  padding: 8px 10px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  max-width: 100%;
  min-width: 0;
}
label { display: grid; gap: 5px; font-size: 14px; color: var(--muted); min-width: 0; }
.email-preference { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.email-preference input { flex: none; width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
h1, h2, p { overflow-wrap: anywhere; }
h1 { font-size: clamp(26px, 2.7vw, 34px); line-height: 1.2; margin: 0; }
h2 { font-size: 21px; margin: 0; }
.breadcrumb { color: var(--muted); margin: 0 0 34px; }
.page-heading, .actions, form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-heading { justify-content: space-between; margin-bottom: 36px; }
form, article, .panel { padding: 20px; margin: 12px 0; }
form { align-items: end; }
form h2 { width: 100%; }
article p { white-space: pre-wrap; }
article button { margin: 4px 6px 2px 0; }
small { color: var(--muted); }
#notice { color: #a33732; white-space: pre-wrap; }
#notice:empty { display: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.dashboard article { margin: 0; min-height: min(554px, 65vh); }
.dashboard article:last-child { border-top: 4px solid var(--accent); }
.dashboard ul { padding: 0; margin: 28px 0; list-style: none; }
.dashboard li { padding: 16px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.dashboard li small { display: block; }
.task-labels, .dashboard article:first-child li {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 12px;
  padding-inline: 12px;
}
.task-labels { background: #dfeaf0; margin-top: 28px; padding-block: 10px; font-size: 13px; }
.task-labels + ul { margin-top: 0; }
body:has(.intro) .rail { display: none; }
body:has(.intro) .shell { margin: 0; padding: 64px; }
body:has(.intro) #view {
  min-height: calc(100svh - 128px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: clamp(24px, 6vw, 80px);
  align-items: center;
}
.intro { display: grid; gap: 24px; }
.intro p, .intro strong { white-space: pre-line; margin: 0; }
.intro strong { font-size: 46px; font-weight: 600; line-height: 1.45; }
.intro p { font-size: 18px; color: var(--muted); }
.intro > div { padding-top: 24px; }
.intro b { text-transform: uppercase; font-size: 11px; color: var(--accent); }
.intro > div p { margin-top: 8px; font-size: 15px; }
.compact-intro { display: none; }
.auth-area, .auth-panel, .auth-panel form, .auth-options[open] { display: grid; gap: 20px; }
.auth-panel { padding: 32px; }
.login, .login form { gap: 16px; }
.login input { height: 46px; }
.login .social-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.login .social-buttons button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 10px;
  border-color: var(--line);
  background: white;
  color: var(--ink);
  font-size: 13px;
}
.email-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.email-divider::before, .email-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); opacity: .45; }
.login > button:last-of-type { min-height: 46px; color: var(--accent); background: #dfeaf0; }
.login button.auth-link, .login form button.secondary { min-height: 0; padding: 0; }
.login form button:not([type]) { min-height: 46px; }
.login-extras { grid-column: -2 / -1; display: grid; justify-items: center; gap: 12px; }
@media (min-width: 761px) {
  body:has(.login) #view { grid-template-rows: minmax(calc(100svh - 128px), auto) auto; row-gap: 24px; }
}
.auth-area:has(.login) { container-type: inline-size; }
@container (max-width: 365px) {
  .login .social-buttons { grid-template-columns: 1fr; }
}
.auth-panel h1 { font-size: 26px; font-weight: 600; line-height: 1.45; }
.auth-panel p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.auth-panel form { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.auth-panel label { color: var(--ink); font-weight: 600; font-size: 13px; gap: 7px; }
.auth-panel input { padding: 13px 14px; font-weight: 400; font-size: 14px; width: 100%; }
.auth-panel button { font-size: 14px; }
.auth-panel small { font-size: 12px; white-space: pre-line; }
.auth-panel > small, .auth-options { text-align: center; }
.auth-panel .secondary, .auth-options summary {
  color: var(--accent);
  background: transparent;
  min-height: 24px;
  padding: 0;
  font-size: 13px;
}
.auth-panel .secondary { text-align: start; }
.auth-area > select { justify-self: center; }
.auth-options > button { margin: 4px; }
.settings summary { list-style: none; }
.settings button { display: block; }
#account select {
  width: 100%;
  color: var(--accent);
  border: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  padding: 4px 0;
}
dialog {
  margin: auto;
  max-width: min(600px, 92vw);
  max-height: 85svh;
  border: 1px solid var(--rim);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgb(38 54 67 / 30%); }
dialog form { margin: 0; border: 0; background: none; box-shadow: none; }
dialog form label { width: 100%; }
@media (max-width: 760px) {
  .rail { position: static; width: auto; border: 0; box-shadow: none; background: transparent; }
  .rail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px; }
  #preferences { grid-column: 1 / -1; display: flex; flex-wrap: wrap; }
  .shell { margin: 0; padding: 8px 14px 96px; }
  nav:not(:empty) {
    position: fixed;
    inset: auto 8px max(8px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--rim);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 4px;
    z-index: 2;
  }
  nav > button { display: none; }
  nav > button:nth-child(-n+2), nav > button:nth-child(5), nav .more { display: block; }
  nav button, nav summary { text-align: center; padding: 8px 3px; font-size: 14px; }
  nav .more[open] {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(230px, 80vw);
    max-height: 75dvh;
    overflow: auto;
    padding: 8px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow);
  }
  nav .more #preferences { display: grid; border-top: 1px solid var(--line); }
  nav .more button { display: block; width: 100%; }
  .dashboard { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .dashboard article { min-height: auto; }
  .task-labels { display: none; }
  .dashboard article:first-child li { display: block; padding-inline: 0; }
  .dashboard article:first-child { min-height: 250px; }
  .dashboard article:last-child { border-top: 1px solid var(--rim); }
  .page-heading { flex-direction: column; align-items: start; }
  .rail .wordmark { width: 108px; }
  .breadcrumb { margin-bottom: 14px; }
  .page-heading { margin-bottom: 16px; }
  body:has(.intro) .shell { padding: 28px 24px; }
  body:has(.intro) #view { min-height: auto; display: grid; grid-template-columns: 1fr; gap: 28px; }
  .intro > :not(.wordmark, .compact-intro) { display: none; }
  .intro .compact-intro { display: block; font-size: 14px; }
  .auth-panel { padding: 32px 24px; }
  .settings { display: none; }
  form label { width: 100%; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root { --glass: var(--surface); --rim: var(--line); }
}
.record-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
  margin-block: 14px;
}
.record-list {
  min-width: 0;
  padding: 20px;
  background: var(--glass);
  border: 1px solid var(--rim);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.record-list h2 { margin-bottom: 24px; }
.record-list button {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: start;
  overflow-wrap: anywhere;
}
.record-list button[aria-current] { background: var(--selected); }
.record-layout article { margin: 0; }
@media (max-width: 760px) {
  .record-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
h1, h2, strong, b { font-weight: 600; }
.dashboard article, .record-list, .record-layout > div > article {
  display: flex;
  flex-direction: column;
  min-height: 554px;
  padding: 20px 15px;
}
.dashboard article:last-child, .record-layout > div > article {
  border-top: 1px solid var(--rim);
  padding: 22px;
  align-items: flex-start;
}
.dashboard h2, .record-list h2 { font-size: 20px; line-height: 28px; }
.dashboard article:last-child ul { margin: 26px 0; }
.dashboard article:last-child li { padding: 10px 0; border: 0; }
.dashboard article:last-child > button {
  background: #dfeaf0;
  color: var(--accent);
  margin-top: auto;
  margin-bottom: 160px;
}
.dashboard footer, .record-list footer { margin-top: auto; padding-top: 20px; color: var(--muted); font-size: 13px; }
.task-labels, .record-labels {
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  border-radius: 8px 8px 0 0;
}
.task-labels, .dashboard article:first-child li { grid-template-columns: 1.3fr 1fr 1fr; }
.dashboard article:first-child li, .record-list button {
  min-height: 60px;
  align-items: center;
  font-size: 14px;
  border-color: rgb(139 170 184 / 42%);
}
.dashboard li small, .record-list button small { font-size: inherit; font-weight: 400; }
.record-layout { margin-top: 0; }
.record-labels, .record-list button { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; padding: 10px 16px; }
.record-layout > div > article > small { margin-block: 28px; }
.rail { gap: 0; padding: 10px 13px; }
.rail #account { margin: 12px 0 32px; }
.rail > nav { margin-inline: -9px; gap: 4px; }
.rail nav > button, .settings summary { min-height: 44px; font-weight: 400; }
.rail nav > button[aria-current] { color: var(--accent); font-weight: 600; }
#preferences { font-size: 13px; }
#preferences button { padding: 4px; min-height: 28px; }
#preferences select { font-size: 13px; min-height: 32px; }
@media (min-width: 761px) {
  .page-heading > button { margin-right: clamp(0px, 8vw, 110px); }
  .rail #account { margin-top: 22px; }
  .shell { padding-right: 28px; }
}
@media (max-width: 760px) {
  body { background-image: linear-gradient(105deg, var(--selected) 5%, #eef1f3 33%, #dfeaf0 57%, var(--line) 85%); }
  .rail { padding: 8px 18px; min-height: 60px; }
  .rail #account { margin: 0; }
  #account select { font-size: 14px; }
  .breadcrumb, .page-heading { margin-inline: 4px; }
  .breadcrumb { font-size: 13px; line-height: 18px; margin-bottom: 10px; }
  .breadcrumb span { display: none; }
  .page-heading { gap: 16px; }
  .rail > nav { margin: 0; border-radius: 24px; background: rgb(238 241 243 / 94%); }
  .rail nav > button[aria-current] { background: transparent; }
  .rail nav > button, .rail nav summary { color: var(--accent); font-weight: 600; list-style: none; }
  .dashboard article, .record-list, .record-layout > div > article { padding: 13px; min-height: 249px; }
  .dashboard article:first-child { min-height: 284px; }
  .dashboard article:last-child { min-height: 249px; }
  .dashboard h2, .record-list h2 { font-size: 17px; line-height: 24px; }
  .dashboard article:first-child ul { margin: 15px 0 0; }
  .dashboard article:first-child li { display: block; min-height: 72px; padding: 8px 0; font-size: 15px; }
  .dashboard li strong { display: block; margin-bottom: 4px; }
  .dashboard li small { display: inline; font-size: 14px; }
  .dashboard li small + small::before { content: " · "; }
  .dashboard article:last-child > button { margin-bottom: 6px; }
  .dashboard footer, .record-list footer, .record-labels { display: none; }
  .record-list button { display: grid; grid-template-columns: 1fr; padding-inline: 0; gap: 2px; }
}

.record-list [hidden] { display: none; }
.channels { position: relative; }
.channels summary { color: var(--accent); }
.channels[open] { padding: 12px; background: var(--surface); border-radius: 16px; }
.page-heading:has(.channels) { justify-content: flex-start; }
.page-heading:has(.channels) h1 { margin-right: auto; }
.page-heading:has(.channels) button { margin-right: 0; }
.record-layout article > label { margin-block: 42px; width: 100%; }
.auth-options > summary { text-align: center; list-style: none; }
@media (min-width: 761px) {
  .rail #account { margin-bottom: 22px; }
}
@media (max-width: 760px) {
  .dashboard article:last-child { padding: 13px; }
  body { background-attachment: scroll; }
}

.profile summary { font-size: 14px; overflow-wrap: anywhere; list-style: none; }
.profile[open] { display: grid; gap: 4px; }
.profile[open] button { width: 100%; }
dialog [role=status]:empty { display: none; }
dialog [role=status] { color: #a33732; }

.auth-panel .auth-link, .auth-panel.recovery > button {
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  text-align: center;
}
.auth-panel.recovery > p { margin: 0; overflow-wrap: anywhere; }
.registration, .registration form { gap: 16px; }
.registration h1 { white-space: pre-line; }
.registration .step-label, .recovery .step-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent);
}
.registration > .step-label + div { margin: 0; }
.registration .auth-link { min-height: 46px; background: #dfeaf0; }
.registration small { color: var(--muted); font-size: 12px; }
.registration .address-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; }
.registration .onboard-note, .company-choice {
  border-radius: 12px; background: #dfeaf0; padding: 16px; font-size: 14px;
}
.registration .onboard-note.success { background: #e1eee8; color: #2e6658; }
.registration .onboard-note.success strong:last-child { display: block; margin-top: 8px; }
.registration .invite-list, .registration .invite { display: grid; gap: 8px; }
.registration .invite-list { gap: 16px; }
.registration .invite { padding: 14px; border-radius: 10px; }
.registration .invite-role { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.registration .invite-role .secondary { min-height: 20px; font-size: 12px; }
.registration input.invite-name { background: transparent; border: 0; padding: 0; font-weight: 600; }
.registration .company-choice { border: 2px solid var(--accent); padding: 18px 16px; border-radius: 10px; }
.registration .company-choice select { width: 100%; font-weight: 600; border: 0; padding: 0; background: transparent; }
.registration .auth-link:disabled { opacity: .65; }
.registration [hidden] { display: none; }
.registration > small { text-align: start; }
.registration .invite label { font-size: 12px; }
.registration-footer { text-align: center; color: var(--muted); font-size: 12px; }
.registration-footer p { margin: 0 0 14px; color: var(--accent); }
.registration-footer small { font-size: 11px; }
@media (max-width: 760px) {
  body:has(.registration) { background-image: linear-gradient(105deg, var(--selected) 5%, #eef1f3 33%, #dfeaf0 57%, var(--line) 85%); }
  .registration { padding: 32px 24px; }
  .registration .address-row { grid-template-columns: 80px minmax(0, 1fr); }
}

.auth-panel.recovery { gap: 16px; }
.recovery-note { background: #dfeaf0; border-radius: 10px; padding: 16px; }
.recovery-note strong { font-size: 14px; }
.recovery .success-note { background: #e1eee8; color: #2e6658; padding: 14px; border-radius: 10px; }
.auth-panel.login #notice:not(:empty) { background: #f9e9e7; padding: 12px; border-radius: 8px; }

#view > div:has(.workspace-editor[open]) > :not(.workspace-editor, .breadcrumb) { display: none; }
.workspace-editor[open] {
  position: static;
  width: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  border: 0;
  box-shadow: none;
}
.workspace-editor form { border: 0; background: transparent; box-shadow: none; margin: 0; padding: 0; }
.workspace-editor .dashboard article { min-width: 0; }
.workspace-editor form > [hidden] { display: none; }

.invalid-login .social-buttons, .invalid-login .email-divider, .invalid-login form > small { display: none; }
.invalid-login [aria-invalid=true] { border-color: #a33732; }
.auth-panel.recovery > button.primary { color: white; background: var(--accent); }
