:root {
  --ink: #14171c;
  --rail: #1b1e24;
  --line: #31363f;
  --field: #11141a;
  --text: #f4f0e8;
  --muted: #a39e93;
  --accent: #e5484d;
  --desk: #c9c3b6;
  --desk-deep: #b3ac9e;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text); }
body { font: 15px/1.4 "Source Sans 3", sans-serif; }
button, input, textarea { font: inherit; color: inherit; }
.app { display: grid; grid-template-columns: 300px minmax(0, 1fr) 330px; height: 100vh; }
aside, .inspector { background: var(--rail); overflow: auto; }
aside { border-right: 1px solid var(--line); padding: 18px 16px 28px; }
.inspector { border-left: 1px solid var(--line); padding: 8px 16px 32px; }
.mast { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.mast img { width: 54px; height: 54px; object-fit: contain; background: #fff; border-radius: 8px; padding: 5px; }
.eyebrow { margin: 0; font-family: Newsreader, serif; font-style: italic; color: var(--accent); font-size: 15px; }
h1, h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: 0; }
h2 { font-size: 13px; color: var(--muted); font-weight: 650; }
.search, label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 13px; }
input[type=search], input[type=text], textarea {
  width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px;
}
textarea { min-height: 76px; resize: vertical; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=color] { width: 48px; height: 34px; padding: 3px; background: var(--field); border: 1px solid var(--line); border-radius: 8px; }
.filters, .formats, .templates, .checks, .sheetActions, .savedHead { display: flex; gap: 6px; flex-wrap: wrap; }
.filters { margin: 10px 0; }
.filters button, .formats button {
  background: var(--field); color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; cursor: pointer;
}
.filters button[aria-pressed=true], .formats button[aria-pressed=true] { background: var(--text); color: #17191e; border-color: var(--text); }
.stories, .posts { display: flex; flex-direction: column; gap: 6px; }
.stories { max-height: 46vh; overflow: auto; }
.story, .post {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; width: 100%; text-align: left;
  background: #12151b; border: 1px solid var(--line); border-radius: 8px; padding: 7px; cursor: pointer;
}
.post { grid-template-columns: 1fr auto; align-items: center; }
.story img, .ph { width: 48px; height: 64px; object-fit: cover; border-radius: 4px; background: #0c0e12; }
.story b, .post b { display: block; font-size: 13px; line-height: 1.3; }
.story small, .post small { color: var(--muted); font-size: 11px; }
.story[aria-current=true], .post[aria-current=true] { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.savedHead { align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.empty { color: var(--muted); font-size: 13px; margin: 4px 0; }
main {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-width: 0;
  background: radial-gradient(circle at 50% 42%, var(--desk), var(--desk-deep) 72%); padding: 22px;
}
.sheetWrap { display: flex; max-width: 100%; max-height: min(72vh, 820px); }
canvas {
  display: block; width: auto; height: auto; max-width: 100%; max-height: min(72vh, 820px);
  background: #111; box-shadow: 0 22px 48px rgba(48, 38, 22, .28);
}
.btn, .textBtn { border: 1px solid #2a241c; background: #f7f4ee; color: #1b1a17; border-radius: 8px; padding: 9px 14px; font-weight: 650; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.textBtn { background: none; border: 0; color: var(--muted); padding: 4px 0; }
.drop { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; text-align: center; cursor: pointer; }
.drop input { display: none; }
.status { margin: 0; max-width: 520px; text-align: center; color: #3f3a32; font-size: 14px; }
.status a { color: #7a1d22; }
fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0; }
legend { padding: 0; font-weight: 700; }
.templates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.templates button { background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 7px; cursor: pointer; color: var(--muted); font-size: 12px; }
.templates button[aria-pressed=true] { border-color: var(--accent); color: var(--text); }
.mini { display: block; aspect-ratio: 4/5; border-radius: 4px; margin-bottom: 6px; background: #6a6258; position: relative; overflow: hidden; }
.mini.bulletin::before { content: ""; position: absolute; left: 10%; right: 10%; bottom: 14%; height: 38%; background: #fff; }
.mini.bulletin::after { content: ""; position: absolute; left: 16%; bottom: 40%; width: 34%; height: 7%; background: var(--accent); }
.mini.banner::before { content: ""; position: absolute; inset: auto 0 0; height: 48%; background: linear-gradient(transparent, #1a1a1a); }
.mini.banner::after { content: ""; position: absolute; left: 10%; bottom: 28%; width: 42%; height: 8%; background: var(--accent); }
.mini.feature::before { content: ""; position: absolute; left: 12%; bottom: 16%; width: 4%; height: 34%; background: var(--accent); }
.mini.feature::after { content: ""; position: absolute; left: 22%; right: 12%; bottom: 22%; height: 8%; background: #fff; box-shadow: 0 14px 0 #fff, 0 28px 0 rgba(255,255,255,.7); }
.formats { margin-top: 10px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 12px; }
.checks label { display: flex; gap: 6px; align-items: center; margin: 0; }
.checks input { accent-color: var(--accent); }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #f0c36a; outline-offset: 2px; }
@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; height: auto; }
  main { order: -1; min-height: 78vh; }
  .stories { max-height: none; }
}
