:root {
  --night: #120B0A; --ink: #2A1614; --steel: #CFC6BC; --muted: #6B5F58;
  --light: #E8341C; --paper: #F5F1EC; --line: #D5DAE3; --danger: #B3261E;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Archivo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--night); font: 400 1.0625rem/1.5 var(--body); }
:focus-visible { outline: 3px solid #FF9A2E; outline-offset: 2px; }
button, input, textarea { font: inherit; color: inherit; }

.bar {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 1px solid var(--line); padding: 12px clamp(16px, 4vw, 32px);
}
.bar h1 { font: 700 1.05rem/1.2 var(--body); margin: 0; }
.bar h1 span { font-weight: 400; color: var(--muted); margin-left: 6px; }
.bar__right { display: flex; gap: 14px; align-items: center; }
.status { font-size: 0.9rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2E9E5B; }
.status.is-dirty { color: var(--night); }
.status.is-dirty::before { background: #E89B1C; }
.viewsite { color: var(--night); font-size: 0.95rem; font-weight: 500; }
.publish { background: var(--light); color: #fff; border: 0; border-radius: 6px; padding: 10px 20px; font-weight: 700; font-size: 1rem; cursor: pointer; }
.publish:disabled { background: #E9E5E0; color: var(--muted); cursor: default; }
.demo { margin: 0; padding: 8px clamp(16px, 4vw, 32px); font-size: 0.85rem; color: var(--muted); background: #FBF8F4; border-bottom: 1px solid var(--line); }

.layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); max-width: 1000px; margin: 0 auto; gap: 40px; padding: 32px clamp(16px, 4vw, 32px) 80px; }
.tabs { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 80px; align-self: start; }
.tabs button {
  text-align: left; background: none; border: 0; border-left: 3px solid transparent; padding: 9px 12px; cursor: pointer;
  font: 500 1rem/1.2 var(--body); color: var(--night); border-radius: 0 6px 6px 0;
}
.tabs button:hover { background: #EFEAE4; }
.tabs button[aria-current="true"] { border-left-color: var(--light); background: #fff; font-weight: 700; }
.tabs hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; width: 100%; }
.tabs #logout { color: var(--muted); }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; gap: 12px; padding-top: 16px; }
  .tabs { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .tabs button { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0; }
  .tabs button[aria-current="true"] { border-bottom-color: var(--light); }
  .tabs hr { display: none; }
  .bar h1 span { display: none; }
}

.panel h2 { font: 700 1.6rem/1.2 var(--body); margin: 0 0 6px; }
.panel .help { color: var(--muted); margin: 0 0 22px; max-width: 60ch; }
.item { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 14px; }
.item__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.item__head strong { font: 700 1.05rem/1.3 var(--body); }
.item__tools { display: flex; gap: 6px; }
.small { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: 0.9rem; }
.small:hover { border-color: var(--night); }
.small.danger { color: var(--danger); }
.add { background: var(--night); color: var(--paper); border: 0; border-radius: 6px; padding: 12px 18px; font-weight: 700; cursor: pointer; }
.add:hover { background: var(--ink); }

.field { display: block; margin: 14px 0 0; }
.field > span { display: block; font-weight: 700; margin-bottom: 6px; }
.field > em { display: block; font-style: normal; font-size: 0.9rem; color: var(--muted); margin: -2px 0 6px; }
.field input[type="text"], .field input[type="url"], .field input[type="email"], .field input[type="date"], .field input[type="password"], .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid #CFC8C0; border-radius: 6px; background: #fff; font-size: 1rem;
}
.field input:focus, .field textarea:focus { border-color: var(--night); outline: none; }
.field textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.field textarea.tall { min-height: 340px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }

.image { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.image img, .image .none { width: 120px; height: 120px; object-fit: cover; background: var(--steel); display: grid; place-items: center; color: var(--muted); font-size: 0.85rem; text-align: center; }
.image label.small { display: inline-block; }
.image input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; }

.past { opacity: 0.6; }
.tag { font: 400 0.85rem var(--body); background: var(--line); padding: 2px 8px; margin-left: 8px; vertical-align: middle; }

.versions li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.versions { list-style: none; padding: 0; margin: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--night); color: var(--paper); padding: 12px 20px; border-radius: 8px; font-weight: 600; z-index: 9; max-width: calc(100% - 32px); }
.toast.bad { background: var(--danger); }


/* sign-in screen */
.gate { position: fixed; inset: 0; z-index: 20; background: var(--paper); display: grid; place-items: center; padding: 16px; overflow: auto; }
.gate__card { background: #fff; width: min(420px, 100%); padding: 28px; border-radius: 10px; }
.gate__card h2 { font: 700 1.6rem/1.2 var(--body); margin: 0 0 8px; }
.gate__card .publish { width: 100%; margin-top: 8px; }
.gate__show { display: flex; gap: 8px; align-items: center; margin: 12px 0 0; font-size: 0.95rem; }
.gate__err { color: var(--danger); min-height: 1.4em; margin: 10px 0 0; font-weight: 700; }
@media (max-width: 760px) {
  .bar { padding: 10px 16px; }
  .bar h1 { font-size: 0.95rem; }
  .bar__right { gap: 10px; }
  .status { font-size: 0; gap: 0; } /* just the coloured dot on phones */
  .status::before { width: 10px; height: 10px; }
  .viewsite { font-size: 0.9rem; }
  .publish { padding: 9px 14px; font-size: 0.95rem; }
}

/* Layout tab */
.layout-list { list-style: none; padding: 0; margin: 0; }
.layout-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; }
.layout-num { width: 28px; height: 28px; border-radius: 50%; background: var(--night); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; flex: none; }
.layout-name { flex: 1 1 160px; }
.layout-name strong { display: block; font-size: 1.05rem; }
.layout-name small { color: var(--muted); font-size: 0.85rem; }
.layout-show { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.layout-show input { width: 18px; height: 18px; accent-color: var(--light); }
.layout-row.is-off { opacity: 0.55; }
