:root {
  font: 16px/1.5 system-ui, sans-serif;
  color: #191c16;
  background: #f4f5f0;
  --ink: #191c16;
  --muted: #555d50;
  --line: #dce0d6;
  --accent: #d0f378;
  --focus: #45691e;
  --gutter: clamp(16px, 4vw, 48px);
  --page-width: 1280px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 66px;
  padding-inline: max(var(--gutter), calc((100% - var(--page-width)) / 2 + var(--gutter)));
  color: #f7faf2;
  background: var(--ink);
}

.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 1.15rem; font-weight: 740; letter-spacing: -.035em; text-decoration: none; }
.brand-mark {
  display: block;
  width: 24px;
  height: 19px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  box-shadow: inset 0 4px var(--ink), inset 0 6px var(--accent);
}
.text-button { padding: 0; color: inherit; background: none; border: 0; text-decoration: underline; text-underline-offset: .2em; }
.site-header .text-button { color: #e3e8de; font-size: .875rem; }
main { width: min(var(--page-width), 100%); margin: auto; padding: clamp(30px, 5vw, 64px) var(--gutter) 72px; }
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-bottom: 32px;
}
.page-heading h1 { margin-top: 10px; }
.page-heading .muted { margin-top: 10px; }
.page-heading > .badge { margin-bottom: 4px; }
.muted { margin: 0; color: var(--muted); }
h1 { margin: 0; font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.06; letter-spacing: -.067em; overflow-wrap: anywhere; }
h2 { margin: 0; font-size: 1.25rem; line-height: 1.25; letter-spacing: -.03em; }
h3 { margin: 0 0 7px; font-size: 1rem; }
p { margin: 0 0 14px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.editor-sidebar { display: grid; gap: 20px; min-width: 0; }
.panel { background: #fff; border: 1px solid var(--line); padding: clamp(18px, 3vw, 28px); border-radius: 14px; }
.panel-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.stack { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
label { font-size: .95rem; font-weight: 650; }
.field > label { overflow-wrap: anywhere; }
label small { margin-left: .35em; color: var(--muted); font-size: .84rem; font-weight: 450; }
input, select { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; color: inherit; background: #fff; border: 1px solid #aab2a7; border-radius: 8px; }
input[type="file"] { padding: 6px 8px; background: #f7f8f4; }
input::file-selector-button {
  margin-right: 10px;
  padding: 5px 8px;
  border: 0;
  border-radius: 5px;
  background: #e9eee3;
  color: var(--ink);
  font: 650 .875rem/1.4 system-ui, sans-serif;
  cursor: pointer;
}
.hint, .upload-feedback { margin: 0; color: var(--muted); font-size: .875rem; }
:is(input, select, a, button, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.site-header :is(a, button):focus-visible { outline-color: var(--accent); }
.button, .primary, .secondary, .destructive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  min-height: 46px;
  width: fit-content;
  padding: 8px 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}
.primary { background: var(--accent); }
.primary:hover { background: #c3ec61; }
.secondary { background: white; border-color: #aab2a4; }
.secondary:hover { background: #f0f3eb; border-color: #7e8978; }
.destructive { background: #9f2420; color: #fff; }
.destructive:hover { background: #781a17; }
.plus { font-size: 1.28em; line-height: 1; }
.quiet-link { color: var(--muted); font-size: .9rem; font-weight: 650; text-underline-offset: .2em; }
.quiet-link:hover { color: var(--ink); }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.action-row form { margin: 0; }
.access-view { min-height: 55vh; display: grid; place-items: center; }
.access-panel { width: min(100%, 490px); }
.access-panel h1 { margin-bottom: 16px; font-size: clamp(2rem, 4vw, 3rem); }
.access-panel p { color: var(--muted); }
.access-panel .stack { margin-top: 24px; gap: 8px; }
.access-panel button { margin-top: 7px; }
.back { color: var(--muted); font-size: .9rem; font-weight: 650; text-underline-offset: .18em; }
.library-tabs { display: flex; gap: 20px; margin-bottom: 12px; }
.library-tabs a { color: var(--muted); font-weight: 650; text-decoration: none; padding-bottom: 5px; }
.library-tabs a[aria-current="page"] { color: var(--ink); border-bottom: 2px solid var(--ink); }
.path-field { display: flex; align-items: center; gap: 6px; }
.path-field > span { color: var(--muted); font-family: ui-monospace, monospace; font-size: .85rem; }
.path-field > input { flex: 1; }
.path-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.path-label > button { font-size: .85rem; }
.library-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(148px, max-content);
  justify-content: space-between;
  gap: 12px;
  padding-block: 16px;
  margin-bottom: 12px;
  border-top: 1px solid var(--line);
}
.search-field { position: relative; }
.search-field input { padding-inline-start: 38px; }
.search-field::before, .search-field::after { content: ""; position: absolute; pointer-events: none; }
.search-field::before { inset: 14px auto auto 14px; width: 9px; height: 9px; border: 2px solid var(--muted); border-radius: 50%; }
.search-field::after { inset: 26px auto auto 24px; width: 7px; height: 2px; background: var(--muted); transform: rotate(45deg); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card-grid, .font-list { padding: 0; margin: 0; list-style: none; }
.brief-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 3px #191c1608;
}
.brief-card:hover { border-color: #aab2a4; box-shadow: 0 4px 12px #191c160c; }
.deck-cover {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  aspect-ratio: 16 / 9;
  background: radial-gradient(ellipse at 50% 34%, #3c492d, #242a20);
  overflow: hidden;
}
.deck-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #181b16; }
.cover-placeholder {
  display: block;
  position: relative;
  width: 30%;
  aspect-ratio: 16 / 10;
  border: 1px solid #d0f37880;
  border-radius: 6px;
  box-shadow: 6px 6px 0 #d0f37826;
}
.cover-placeholder::before, .cover-placeholder::after {
  content: "";
  position: absolute;
  inset-inline-start: 16%;
  height: 1px;
  background: #d0f37880;
}
.cover-placeholder::before { top: 38%; width: 47%; }
.cover-placeholder::after { top: 60%; width: 30%; }
.card-content { flex: 1; padding: 18px 18px 16px; }
.card-content h2 { margin-top: 10px; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.card-date { margin: 5px 0 0; color: var(--muted); font-size: .875rem; }
.card-date:empty { margin: 0; }
.card-facts { display: grid; gap: 4px; margin: 12px 0 0; font-size: .8125rem; }
.card-facts div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; }
.card-facts dt { color: var(--muted); }
.card-facts dd { margin: 0; font-weight: 650; }
.missing-font-link { color: #675016; text-underline-offset: .2em; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 24px;
  background: #eff0eb;
  color: #4e5649;
  font-size: .75rem;
  line-height: 1.3;
  font-weight: 700;
}
.badge::before { content: ""; width: .45em; height: .45em; background: currentColor; border-radius: 50%; }
.badge-live, .badge-ready { color: #395419; background: #e7f4d7; }
.badge-working { color: #675016; background: #fbf1d7; }
.badge-problem { color: #842c21; background: #ffebe5; }
.card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; border-top: 1px solid var(--line); padding: 12px 18px; }
.card-actions .button { min-height: 40px; padding-inline: 12px; font-size: .9rem; }
.empty-state { padding: clamp(34px, 7vw, 72px) 16px; text-align: center; border: 1px dashed #aab2a4; border-radius: 14px; }
.empty-state p { margin: 8px 0 0; color: var(--muted); }
.empty-state button { margin-top: 18px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.presentation-panel { display: grid; gap: 16px; }
.presentation-panel .deck-cover { border-radius: 8px; }
.source-file { display: flex; align-items: center; gap: 12px; min-width: 0; overflow-wrap: anywhere; }
.file-icon { flex: none; width: 26px; height: 32px; border-radius: 4px; border: 1px solid #a7b597; background: #eff5e7; }
.font-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.font-list + .hint { margin-top: 8px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 450; }
.check input { flex: none; width: 16px; height: 16px; min-height: auto; margin: 3px 0 0; accent-color: var(--focus); }
.disclosure { border-top: 1px solid var(--line); padding-top: 12px; }
summary { width: fit-content; cursor: pointer; font-weight: 650; }
summary small { color: var(--muted); font-weight: 450; }
.disclosure[open] > summary { margin-bottom: 12px; }
.notice { border: 1px solid #e2baad; padding: 10px 12px; border-radius: 6px; color: #801a0a; background: #fff4ef; }
.render-notes { color: var(--muted); background: #f7f8f4; border-color: var(--line); font-size: .875rem; }
.render-notes ul { margin: 8px 0 0; padding-inline-start: 20px; }
.saved { margin: 0; color: #395419; background: #eef7e2; border-radius: 6px; padding: 9px 12px; font-size: .9rem; }
.published { padding-top: 16px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.published .action-row { margin-top: 12px; }
.published .text-button, .published-url { font-size: .88rem; }
@media (max-width: 980px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .editor-grid { grid-template-columns: 1fr; }
  .site-header { min-height: 62px; }
}
@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
  .library-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .page-heading { margin-bottom: 24px; }
}
