:root {
  color-scheme: light;
  --bg: #f4efe8;
  --panel: #fffdf8;
  --panel-2: #f7f8f4;
  --ink: #252421;
  --muted: #6a6860;
  --line: rgba(62, 61, 55, .16);
  --imagineer: #66799f;
  --fluxcell: #648f89;
  --sarrus: #81977f;
  --clay: #bd715f;
  --gold: #c89549;
  --shadow: 0 18px 38px rgba(48, 43, 36, .08), inset 0 1px 0 rgba(255, 255, 255, .78);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #ebe4da 0%, #f5f1eb 46%, #fbfaf6 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(calc(100% - 32px), 1120px);
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.kicker {
  margin: 0 0 8px;
  color: #686158;
  font-size: 14px;
  font-weight: 820;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(48px, 8vw, 84px);
  line-height: .95;
  letter-spacing: 0;
}

.summary-line {
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 680;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.state-grid div,
.entry-panel,
.table-panel,
.category-item,
.gate-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, .9);
  box-shadow: var(--shadow);
}

.state-grid div {
  min-height: 88px;
  padding: 14px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

dd {
  margin: 8px 0 0;
  font-size: 32px;
  line-height: 1;
  font-weight: 820;
}

.entry-panel {
  padding: 14px;
  margin-bottom: 14px;
}

.entry-form {
  display: grid;
  grid-template-columns: 160px 140px 112px minmax(0, 1fr);
  gap: 10px;
}

select,
input,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(37, 36, 33, .18);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  grid-column: 1 / -1;
  min-height: 82px;
  resize: vertical;
}

#artifact,
#next-step {
  grid-column: span 2;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.form-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

button {
  min-height: 42px;
  border: 1px solid rgba(37, 36, 33, .16);
  border-radius: 8px;
  background: #252421;
  color: #fffdf8;
  padding: 9px 16px;
  font-weight: 800;
}

button:disabled {
  opacity: .58;
  cursor: default;
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.category-item {
  --accent: var(--imagineer);
  position: relative;
  min-height: 84px;
  padding: 14px;
  overflow: hidden;
}

.category-item::before,
.entry-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
}

.category-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.category-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.category-item.imagineer,
.entry-row.imagineer {
  --accent: var(--imagineer);
}

.category-item.fluxcell,
.entry-row.fluxcell {
  --accent: var(--fluxcell);
}

.category-item.sarrus,
.entry-row.sarrus {
  --accent: var(--sarrus);
}

.table-panel {
  padding: 14px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 20px;
  letter-spacing: 0;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.entry-table {
  display: grid;
  gap: 8px;
}

.entry-row {
  --accent: var(--imagineer);
  position: relative;
  display: grid;
  grid-template-columns: 170px minmax(220px, 1.35fr) minmax(160px, .8fr) minmax(160px, .8fr) 84px;
  gap: 12px;
  align-items: start;
  min-height: 76px;
  padding: 12px 12px 12px 18px;
  border: 1px solid rgba(62, 61, 55, .12);
  border-radius: 8px;
  background: #fffdf8;
}

.entry-time strong,
.entry-time span,
.entry-work,
.entry-artifact,
.entry-next,
.entry-meta {
  overflow-wrap: anywhere;
}

.entry-time strong {
  display: block;
  font-size: 14px;
}

.entry-time span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.entry-work {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 680;
}

.entry-artifact,
.entry-next,
.entry-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 650;
}

.entry-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.entry-meta button {
  min-height: 30px;
  padding: 5px 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.empty-row {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed rgba(62, 61, 55, .20);
  border-radius: 8px;
  background: rgba(255, 253, 248, .72);
}

.locked {
  background:
    linear-gradient(180deg, #ebe4da 0%, #f5f1eb 100%);
}

.gate-shell {
  min-height: calc(100vh - 63px);
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.gate-panel {
  width: min(100%, 420px);
  padding: 24px;
}

.gate-panel h1 {
  font-size: 54px;
}

.gate-panel p {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 720;
}

.gate-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.remember-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.remember-line input {
  width: 18px;
  min-height: 18px;
}

@media (max-width: 860px) {
  .topline,
  .entry-form,
  .category-strip,
  .entry-row {
    grid-template-columns: 1fr;
  }

  #artifact,
  #next-step,
  textarea,
  .form-actions {
    grid-column: 1;
  }

  .entry-meta {
    justify-items: start;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(calc(100% - 24px), 390px);
    padding-top: 22px;
  }

  h1 {
    font-size: 52px;
  }

  .state-grid {
    grid-template-columns: 1fr;
  }

  .state-grid div {
    min-height: 72px;
  }

  dd {
    font-size: 26px;
  }
}

