:root {
  --red: #e5202e;
  --red-dark: #b5121f;
  --orange: #f25c1f;
  --yellow: #ffc93c;
  --ink: #1d1a19;
  --muted: #6b6461;
  --line: #e7e1dc;
  --bg: #f7f3ef;
  --card: #ffffff;
  --ok: #157a4a;
  --ok-bg: #e5f4ec;
  --warn: #a8530a;
  --warn-bg: #fdf0e1;
  --info: #2c5aa0;
  --info-bg: #e8effa;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--red-dark); }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px calc(96px + var(--safe-b)); }
.wide .wrap { max-width: 760px; }

.top { position: sticky; top: 0; z-index: 20; background: rgba(247, 243, 239, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.top img { width: 40px; height: 40px; border-radius: 12px; background: #fff; object-fit: contain; }
.top .t1 { font-weight: 700; font-size: 16px; line-height: 1.2; }
.top .t2 { font-size: 13px; color: var(--muted); }
.top .grow { flex: 1; min-width: 0; }

.hero { margin: 16px 0 12px; padding: 16px; border-radius: var(--radius); background: linear-gradient(135deg, var(--red), var(--orange)); color: #fff; }
.hero h1 { margin: 0 0 4px; font-size: 22px; line-height: 1.25; }
.hero p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; opacity: .95; }
.hero .rule { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .16); font-size: 13.5px; line-height: 1.45; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--muted); }
.tab[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab .n { margin-left: 6px; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--yellow); color: var(--ink); }

.dates { position: sticky; top: 61px; z-index: 15; display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 10px; background: var(--bg); scrollbar-width: none; }
.dates::-webkit-scrollbar { display: none; }
.dchip { flex: none; width: 56px; padding: 6px 0 8px; border-radius: 14px; border: 1px solid var(--line); background: #fff; text-align: center; }
.dchip .dw { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dchip .dd { font-size: 19px; font-weight: 700; line-height: 1.2; }
.dchip .dots { display: flex; justify-content: center; gap: 3px; height: 6px; margin-top: 3px; }
.dchip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dot.s-review { background: var(--yellow); } .dot.s-revise { background: var(--warn); }
.dot.s-ok { background: var(--ok); } .dot.s-live { background: var(--info); }
.dchip.today { border-color: var(--red); }
.dchip[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.dchip[aria-current="true"] .dw { color: #ddd; }

.day { margin: 18px 0 8px; display: flex; align-items: baseline; gap: 8px; scroll-margin-top: 140px; }
.day h2 { margin: 0; font-size: 17px; }
.day .sub { font-size: 13px; color: var(--muted); }

.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 14px; overflow: hidden; }
.card-b { padding: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #f1ece8; color: var(--ink); }
.pill { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.pill.review { background: #fff4d6; color: #7a5600; }
.pill.revise { background: var(--warn-bg); color: var(--warn); }
.pill.approved, .pill.approved_auto { background: var(--ok-bg); color: var(--ok); }
.pill.scheduled { background: var(--info-bg); color: var(--info); }
.pill.published { background: #ece9ff; color: #4b3aa8; }
.pill.draft { background: #eee; color: #555; }
.title { margin: 8px 0 2px; font-size: 17px; font-weight: 700; line-height: 1.3; }
.code { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.deadline { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #fff8e6; font-size: 13.5px; line-height: 1.45; }
.deadline.soon { background: #ffe9e2; }
.deadline b { font-weight: 700; }
.note-ok { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); font-size: 13.5px; line-height: 1.45; }
.note-warn { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: 13.5px; line-height: 1.45; }

.media { position: relative; background: #111; }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.track::-webkit-scrollbar { display: none; }
.slide { flex: none; width: 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; background: #111; aspect-ratio: 4 / 5; }
.slide.tall { aspect-ratio: 9 / 16; max-height: 78vh; }
.slide img, .slide video { width: 100%; height: 100%; object-fit: contain; display: block; }
.counter { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.pager { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.pager i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.pager i.on { background: #fff; }
.textonly { aspect-ratio: auto; min-height: 220px; padding: 28px 22px; background: linear-gradient(160deg, var(--red), var(--orange)); color: #fff; font-size: 17px; line-height: 1.5; white-space: pre-wrap; align-items: flex-start; justify-content: flex-start; }
.textonly small { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }

.caption { margin-top: 10px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.caption.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.linkbtn { border: 0; background: none; padding: 4px 0; color: var(--red-dark); font-weight: 600; font-size: 14px; }

.thread { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.thread h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.cmt { padding: 8px 10px; border-radius: 12px; background: #f6f2ee; margin-bottom: 6px; font-size: 14px; line-height: 1.45; }
.cmt.reviewer { background: #fff4e8; }
.cmt .who { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.cmt .slidetag { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; }
.cmt .old { font-size: 11.5px; color: var(--muted); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn { border: 0; border-radius: 14px; padding: 13px 14px; font-weight: 700; font-size: 15.5px; min-height: 48px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn:disabled { opacity: .55; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.rev { background: #fff; color: var(--warn); border: 1.5px solid #f0c896; }
.btn.pri { background: var(--red); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn.sm { min-height: 38px; padding: 8px 12px; font-size: 14px; border-radius: 11px; }
.btn.full { width: 100%; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.composer { margin-top: 12px; }
.composer textarea, .field textarea, .field input, .field select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; font-size: 16px; }
.composer textarea { min-height: 92px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 8px 0; color: var(--muted); }
.check input { width: 20px; height: 20px; }
.mine { margin-top: 12px; font-size: 13.5px; color: var(--muted); }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 14px; font-weight: 600; }

.list-row { display: flex; gap: 12px; padding: 12px; align-items: center; cursor: pointer; }
.thumb { width: 64px; height: 80px; flex: none; border-radius: 10px; background: #eee center / cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); font-weight: 700; overflow: hidden; }
.thumb video { width: 100%; height: 100%; object-fit: cover; }
.list-row .t { font-weight: 700; font-size: 15px; line-height: 1.3; }
.list-row .grow { flex: 1; min-width: 0; }
.alert { margin: 10px 0; padding: 12px; border-radius: 12px; background: #ffe9e2; color: #8a1c0c; font-size: 14px; line-height: 1.45; }

.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .4); display: flex; align-items: flex-end; justify-content: center; }
.sheet-in { width: 100%; max-width: 640px; max-height: 94vh; overflow-y: auto; background: var(--bg); border-radius: 20px 20px 0 0; padding: 0 0 calc(24px + var(--safe-b)); }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.sheet-head .grow { flex: 1; font-weight: 700; }
.sheet-body { padding: 14px 16px; }
.section { margin: 18px 0 8px; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.events { font-size: 13px; color: var(--muted); line-height: 1.5; }
.events div { padding: 4px 0; border-bottom: 1px dashed var(--line); }
pre.payload { white-space: pre-wrap; word-break: break-all; font-size: 11.5px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: 180px; overflow: auto; }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.gate { max-width: 420px; margin: 18vh auto 0; padding: 24px; text-align: center; }
.gate img { width: 96px; }
.gate h1 { font-size: 21px; }
.gate p { color: var(--muted); line-height: 1.5; }
.gate .pin { display: block; width: 180px; margin: 18px auto 8px; padding: 12px; text-align: center; font-size: 32px; letter-spacing: .5em; text-indent: .5em; border: 2px solid var(--line); border-radius: 16px; background: #fff; }
.gate .pin:focus { outline: none; border-color: var(--red); }
.gate .pin-msg { min-height: 22px; color: var(--red-dark); font-weight: 600; margin: 4px 0 14px; }

#toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; z-index: 90; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14.5px; max-width: 90vw; transition: all .2s; pointer-events: none; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.foot { margin: 28px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }
@media (min-width: 700px) {
  .slide { aspect-ratio: 1 / 1; }
  .slide.tall { aspect-ratio: 9 / 16; max-height: 70vh; }
}

