:root {
  color-scheme: light;
  --bg: #f8f7f2;
  --paper: #fffefa;
  --ink: #172e31;
  --sub: #5f706d;
  --line: #d9dfd7;
  --accent: #225c53;
  --pale: #e3ede6;
  --nav: #102d32;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  font:
    15px/1.5 "Source Sans 3",
    "Avenir Next",
    "Segoe UI",
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #152427;
  --paper: #1e3032;
  --ink: #e7eee6;
  --sub: #b0c2ba;
  --line: #3a4b49;
  --accent: #a9d8bf;
  --pale: #304a42;
  --nav: #0d2226;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a {
  touch-action: manipulation;
}
button,
a.filepick,
.filepick {
  cursor: pointer;
}
button,
.exportgrid a,
.filepick {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  min-height: 40px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}
button:hover,
.exportgrid a:hover {
  background: var(--pale);
}
button:disabled {
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #bd7f27;
  outline-offset: 3px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  padding: 10px 12px;
  min-width: 0;
}
textarea {
  resize: vertical;
  min-height: 82px;
}
input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--accent);
}
input[type="range"] {
  accent-color: var(--accent);
  padding: 0;
}
a {
  color: var(--accent);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.16;
}
h1 {
  font: 500 clamp(2rem, 4vw, 3rem)/1.12 var(--serif);
  letter-spacing: -0.045em;
}
h2 {
  font: 500 clamp(1.45rem, 2.4vw, 2rem)/1.2 var(--serif);
  letter-spacing: -0.03em;
}
h3 {
  font: 600 1.12rem/1.25 var(--serif);
}
small,
.muted,
.field > small {
  color: var(--sub);
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}
.shell > aside,
.auth-art {
  background: var(--nav);
  color: #e7eee9;
}
.shell > aside {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 32px 16px 18px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.17rem;
  letter-spacing: -0.04em;
}
.brand img {
  height: 36px;
  width: 36px;
  border-radius: 9px;
}
.brand b {
  font-weight: 450;
  color: #b8d1c5;
}
.switcher {
  margin: 38px 0 25px;
  justify-content: flex-start;
  background: #1a3b40;
  color: #eff4ed;
  border-color: #385357;
  text-align: left;
  width: 100%;
  min-height: 60px;
}
.switcher:hover,
.shell > aside button:hover {
  background: #26494a;
}
.switcher > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}
.switcher small,
.switcher strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.switcher small {
  font-size: 0.68rem;
  color: #adc4b9;
}
.swatch {
  color: #c4cda2;
}
.shell nav button,
.sidefoot button {
  border: 0;
  background: transparent;
  justify-content: flex-start;
  color: #bdccc8;
  width: 100%;
  padding: 12px 15px;
  min-height: 46px;
  gap: 12px;
}
.shell nav button.active {
  background: #2c4c49;
  color: #f4f4dd;
}
.shell > aside nav {
  display: grid;
  gap: 5px;
}
.sidefoot {
  margin-top: auto;
  border-top: 1px solid #42605e;
  padding-top: 16px;
}
.workspace {
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px clamp(18px, 4vw, 65px);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  min-height: 68px;
}
.crumb,
.actions,
.toolbar,
.detailtools,
.subhead,
.sectionhead,
.inline-check,
.auth-tools,
.filterrow,
.pager {
  display: flex;
  gap: 10px;
  align-items: center;
}
.crumb {
  font-size: 0.82rem;
  color: var(--sub);
}
.crumb > span {
  opacity: 0.5;
}
.quiet,
.iconbtn,
.subtle {
  background: transparent;
  border-color: transparent;
}
.iconbtn {
  width: 40px;
  padding: 8px;
}
.assistant {
  background: var(--pale);
  border-color: transparent;
  color: var(--accent);
}
.primary {
  background: #245d51;
  color: white;
  border: 1px solid #245d51;
}
.primary:hover {
  background: #17483e;
}
.sectionhead,
.subhead,
.detailtools {
  justify-content: space-between;
}
.sectionhead {
  margin-bottom: 24px;
}
.subhead {
  margin: 32px 0 15px;
}
.sectionhead small {
  display: block;
  margin-bottom: 5px;
}
.workspace main {
  max-width: 1530px;
  margin: auto;
  padding: 30px clamp(18px, 4vw, 65px) 65px;
}
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(115deg, #113239, #265f65);
  color: #fff7e2;
  min-height: 242px;
  display: flex;
  align-items: center;
}
.heroart {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  inset: 0;
}
.hero:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(8, 28, 33, 0.93),
    rgba(8, 28, 33, 0.7) 42%,
    transparent 80%
  );
}
.herocopy {
  position: relative;
  z-index: 1;
  max-width: 570px;
  padding: 26px 34px;
}
.herocopy > span {
  color: #e2c58d;
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 650;
}
.hero h2 {
  color: #fff6e3;
  font-size: clamp(2rem, 4vw, 3.8rem);
  margin: 7px 0;
}
.hero p {
  max-width: 470px;
  color: #e3e7df;
  font-size: 0.92rem;
}
.glass {
  margin-top: 15px;
  background: #1d373cc4;
  color: white;
  border-color: #798c87;
}
.glass:hover {
  background: #345257;
}
.metrics,
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}
.metrics {
  margin: 18px 0 25px;
}
.metric {
  background: var(--paper);
  min-height: 72px;
  justify-content: flex-start;
  gap: 15px;
  text-align: left;
}
.metric svg,
.rowicon {
  color: var(--accent);
}
.metric b {
  font: 500 1.55rem/1.1 var(--serif);
}
.metric small,
.recordrow small,
.card small,
.budget p,
.timeevent small {
  display: block;
  font-size: 0.77rem;
}
.card {
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  background: var(--paper);
  display: block;
  text-align: left;
  min-width: 0;
}
.card img,
.placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1.55;
  object-fit: cover;
  object-position: center 38%;
  background: var(--pale);
}
.placeholder {
  display: grid;
  place-items: center;
}
.cardbody {
  padding: 10px 14px 14px;
}
.cardbody h3 {
  margin-top: 3px;
}
.columns,
.editlayout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 30px;
}
.recordrow,
.timeevent {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  padding: 13px 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  min-width: 0;
}
.rowtext {
  flex: 1;
  min-width: 0;
}
.rowtext strong {
  overflow-wrap: anywhere;
}
.rowicon {
  display: grid;
  place-items: center;
  background: var(--pale);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.status,
.contextpill {
  border-radius: 20px;
  background: var(--pale);
  color: var(--accent);
  padding: 4px 9px;
  font-size: 0.72rem;
}
.status.draft,
.status.planned {
  background: #f1e8d8;
  color: #71532c;
}
.budget,
.time-controls,
.editor,
.inspector {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 20px;
}
.budget p {
  margin: 10px 0;
}
.bottom {
  display: none;
}
.tabs,
.rail {
  overflow-x: auto;
}
.tabs {
  display: flex;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sub);
  white-space: nowrap;
}
.tabs button.selected {
  border-bottom: 3px solid var(--accent);
  color: var(--accent);
}
.list {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.list .recordrow {
  padding: 15px;
}
.empty,
.loading {
  padding: 24px;
  color: var(--sub);
}
.pager {
  justify-content: flex-end;
  margin-top: 18px;
}
.detailtools {
  margin-bottom: 15px;
}
#save-status {
  font-size: 0.8rem;
  color: var(--sub);
}
.editlayout {
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.8fr);
  align-items: start;
}
.editor,
.inspector {
  margin: 0;
}
.inspector > * {
  margin-bottom: 12px;
}
.portrait,
.pagepreview,
.variant img {
  width: 100%;
  border-radius: 8px;
}
.portrait {
  max-height: 430px;
  object-fit: contain;
  background: var(--pale);
}
.field,
.fieldgroup,
.structured label {
  display: grid;
  gap: 6px;
}
.field {
  margin-bottom: 14px;
  font-size: 0.84rem;
  font-weight: 600;
}
.field label {
  font-weight: 600;
}
.fieldgroup {
  margin-top: 16px;
}
.fieldgroup > .field {
  margin-bottom: 8px;
}
.inline-check {
  font-size: 0.9rem;
  font-weight: 450;
}
.inline-check input {
  flex-shrink: 0;
}
.upload-preview {
  display: block;
  max-height: 140px;
  max-width: 100%;
  margin-bottom: 8px;
}
.filepick {
  position: relative;
  margin: 7px 7px 0 0;
}
.filepick input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.filepick:focus-within {
  outline: 2px solid #b98332;
}
.toolbar,
.actions,
.filterrow {
  flex-wrap: wrap;
}
.toolbar {
  margin: 12px 0;
}
.danger {
  color: #a24535;
}
.pair {
  display: flex;
  gap: 5px;
  margin-bottom: 4px;
}
.pair input {
  min-width: 0;
}
.pair button {
  padding: 5px;
}
.structured {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 6px 0;
  padding: 12px;
  display: grid;
  gap: 7px;
}
.picker {
  position: relative;
}
.chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.chip {
  background: var(--pale);
  padding: 4px 8px;
  min-height: 30px;
  margin-bottom: 3px;
}
.suggestions:not(:empty) {
  position: absolute;
  z-index: 3;
  max-height: 220px;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px #102d3222;
  width: 100%;
}
.suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
}
.prose,
.writer textarea {
  font: 1.05rem/1.7 var(--serif);
}
.prose {
  white-space: pre-wrap;
  padding: 10px;
}
.writer .toolbar {
  margin: 0 0 5px;
}
.writer .toolbar button {
  min-height: 32px;
  padding: 4px 10px;
}
.writer textarea {
  width: 100%;
}
details {
  margin: 13px 0;
}
summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  padding: 6px 0;
}
dialog {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
  width: min(560px, calc(100% - 24px));
  max-height: 88dvh;
  padding: 0;
  box-shadow: 0 22px 90px #001c2440;
}
dialog::backdrop {
  background: #08212688;
  backdrop-filter: blur(3px);
}
#dialog-body {
  padding: 22px;
}
.modalhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.modalhead h2 {
  font-size: 1.7rem;
}
dialog p {
  margin: 0.7rem 0;
}
dialog h3 {
  margin: 15px 0;
}
output,
.warning {
  display: block;
  color: #a0422d;
  margin: 0.6rem 0;
}
pre,
code {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 0.8rem;
}
.toast {
  position: fixed;
  z-index: 10;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #102e33;
  color: white;
  border: 1px solid #708d7e;
  padding: 12px 20px;
  border-radius: 9px;
  max-width: 90vw;
}
.exportgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.exportgrid a {
  text-decoration: none;
}
.time-controls form,
.filterrow {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.time-controls form > .field,
.filterrow > label {
  flex: 1;
  min-width: 150px;
}
.filterrow {
  margin: 14px 0;
}
.time-controls form > .field {
  margin: 0;
}
.rail {
  margin: 15px 0 22px;
}
.rail > div {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 85px;
}
.point {
  display: grid;
  flex-shrink: 0;
  text-align: left;
  background: var(--pale);
  min-width: 140px;
}
.timeevent > *:last-child {
  margin-left: auto;
}
.graph {
  display: block;
  width: 100%;
  max-height: 330px;
  background: var(--pale);
  border-radius: 12px;
}
.graph line {
  stroke: var(--accent);
  stroke-width: 2;
}
.graph circle {
  fill: var(--accent);
}
.graph text {
  fill: var(--ink);
  font: 14px system-ui;
}
.graph g {
  cursor: pointer;
}
.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.08fr 1fr;
}
.auth-art {
  position: relative;
  min-height: 250px;
  padding: 36px;
  background:
    linear-gradient(0deg, #10292ebf, transparent 55%),
    url(/static/art/cover.webp) 73% center/cover;
}
.auth-art .brand {
  width: max-content;
  background: #102d32d9;
  padding: 8px 14px;
  border-radius: 9px;
}
.cover-caption {
  position: absolute;
  bottom: 8%;
  left: 7%;
  font: clamp(2.5rem, 5vw, 5rem)/1 var(--serif);
  max-width: 6em;
  color: #fcf1d5;
}
.auth-panel {
  padding: 5%;
  display: grid;
  place-items: center;
  position: relative;
}
.auth-panel form {
  max-width: 400px;
  width: 100%;
}
.auth-panel p {
  color: var(--sub);
  margin: 15px 0 26px;
}
.auth-panel .inline-check {
  margin: 15px 0;
}
.auth-tools {
  position: absolute;
  right: 5%;
  top: 3%;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 10px;
  top: 10px;
  z-index: 5;
  background: var(--paper);
  padding: 10px;
}
.offline {
  max-width: 760px;
  margin: auto;
  padding: 30px;
}
.offline h2 {
  margin: 15px 0;
}
.revision {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.revision p {
  white-space: pre-wrap;
  max-height: 200px;
  overflow: auto;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .shell > aside {
    padding: 20px 10px;
  }
  .metrics,
  .cards {
    gap: 9px;
  }
  .metric {
    padding: 8px;
    gap: 7px;
  }
  .columns {
    gap: 18px;
  }
  .editlayout {
    grid-template-columns: minmax(0, 1.4fr) minmax(190px, 0.75fr);
  }
  .workspace main {
    padding: 24px;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .shell > aside {
    display: none;
  }
  .bottom {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 4;
    background: var(--nav);
    padding: 4px 2px max(4px, env(safe-area-inset-bottom));
    box-shadow: 0 -1px 5px #0001;
  }
  .shell .bottom button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 50px;
    padding: 4px 0;
    gap: 1px;
    font-size: 0.67rem;
    border-radius: 7px;
  }
  .topbar {
    padding: 8px 14px;
    min-height: 56px;
  }
  .crumb {
    overflow: hidden;
    white-space: nowrap;
    font-size: 0;
  }
  .crumb .quiet {
    font-size: 0.8rem;
    text-overflow: ellipsis;
    display: block;
    overflow: hidden;
    max-width: 37vw;
    padding-left: 0;
  }
  .topbar .actions {
    gap: 2px;
    flex-wrap: nowrap;
  }
  .workspace main {
    padding: 20px 15px 95px;
  }
  .sectionhead {
    margin-bottom: 15px;
    gap: 8px;
    align-items: flex-start;
  }
  .sectionhead h1 {
    font-size: 2rem;
  }
  .sectionhead .actions {
    justify-content: end;
  }
  .herocopy {
    padding: 21px;
    max-width: 78%;
  }
  .hero {
    min-height: 215px;
  }
  .hero p {
    font-size: 0.83rem;
  }
  .metrics,
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .metric {
    min-height: 58px;
  }
  .metric b {
    font-size: 1.3rem;
  }
  .cards .card img {
    aspect-ratio: 1.5;
  }
  .cardbody {
    padding: 9px;
  }
  .columns,
  .editlayout {
    display: flex;
    flex-direction: column;
  }
  .editor,
  .inspector {
    width: 100%;
    padding: 15px;
  }
  .inspector .portrait {
    max-height: 320px;
  }
  .subhead {
    margin: 22px 0 12px;
  }
  .subhead input {
    max-width: 140px;
  }
  .toast {
    bottom: 76px;
  }
  .auth {
    display: flex;
    flex-direction: column;
  }
  .auth-art {
    min-height: 175px;
    padding: 16px;
    background-position: 75% 55%;
  }
  .auth-art .brand img {
    width: 25px;
    height: 25px;
  }
  .cover-caption {
    font-size: 1.8rem;
    max-width: none;
    bottom: 14px;
    left: 20px;
  }
  .auth-panel {
    padding: 44px 22px 20px;
  }
  .auth-tools {
    top: 3px;
  }
  .actions button,
  .toolbar button,
  .tabs button,
  .filepick,
  .subtle {
    min-height: 44px;
  }
  .graph {
    min-height: 170px;
  }
  .time-controls {
    padding: 12px;
  }
  .filterrow {
    flex-direction: column;
    align-items: stretch;
  }
  .sectionhead .primary {
    white-space: nowrap;
  }
  dialog {
    max-height: 90dvh;
  }
  .rowtext {
    max-width: 100%;
  }
  .toolbar {
    gap: 5px;
  }
  .assistant {
    font-size: 0.75rem;
    padding: 8px;
  }
  .pair {
    flex-wrap: wrap;
  }
  .pair input {
    flex: 1;
    min-width: 70px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
#railinner {
  display: block;
  width: 100%;
  min-width: 440px;
}
.track {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  margin: 7px 0;
}
.track > strong {
  font-size: 0.8rem;
  color: var(--sub);
}
.track-body {
  position: relative;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(10% - 1px),
    var(--line) 10%
  );
}
.time-marker {
  position: absolute;
  width: 146px;
}
.time-marker button {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--pale);
  overflow: hidden;
  padding: 5px 8px;
  line-height: 1.2;
}
.time-marker button b,
.time-marker button small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timecursor {
  position: absolute;
  height: 100%;
  border-left: 2px solid #c48e48;
}
.duration {
  height: 3px;
  background: var(--accent);
  position: absolute;
}
.mask-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  border-radius: 8px;
}
#maskeditor label {
  display: block;
  margin: 10px 0;
}
.rich {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: normal;
  font-weight: 400;
}
.rich p,
.rich blockquote {
  margin: 0.65em 0;
}
.rich:focus {
  outline: 2px solid var(--accent);
}
.portrait-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  overflow: hidden;
}
.portrait-button img {
  display: block;
}
.mobileportrait {
  display: none;
}
.imageviewport {
  max-height: 65dvh;
  overflow: auto;
}
.imageviewport img {
  width: 100%;
  max-width: none;
  display: block;
}
@media (max-width: 760px) {
  .mobileportrait {
    display: block;
    margin-bottom: 14px;
  }
  .mobileportrait .portrait {
    max-height: 300px;
    object-fit: contain;
  }
  .inspector > .portrait-button {
    display: none;
  }
}
