:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #141a22; --muted: #5d6878; --line: #dfe3e8;
  --ok: #1f9d55; --ok-soft: #e3f4ea; --warn: #b7791f; --warn-soft: #fbf1df; --wait: #5d6878; --wait-soft: #eef0f3;
  --upd: #2e6bc6; --upd-soft: #e5eefb; --shade: rgba(8, 12, 18, 0.7);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1418; --panel: #171e24; --ink: #e7edf2; --muted: #9aa7b3; --line: #2a343d;
    --ok: #3ecf7e; --ok-soft: #173326; --warn: #f2b33d; --warn-soft: #3a2e14; --wait: #9aa7b3; --wait-soft: #222b33;
    --upd: #7fb0ff; --upd-soft: #1b2a40; --shade: rgba(0, 0, 0, 0.8); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 20px 24px 96px; display: flex; flex-direction: column; gap: 14px; }
.head h1 { margin: 2px 0 4px; font-size: 24px; font-weight: 650; letter-spacing: -0.01em; }
.biz { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.sub { color: var(--muted); font-size: 15px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.p { display: inline-block; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.p.waiting { background: var(--wait-soft); color: var(--wait); }
.p.approved { background: var(--ok-soft); color: var(--ok); }
.p.comments { background: var(--warn-soft); color: var(--warn); }
.p.updated { background: var(--upd-soft); color: var(--upd); }
.p.posted { background: var(--ok-soft); color: var(--ok); }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.key { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; opacity: 0.85; }
.key .p { font-size: 11.5px; padding: 2px 9px; }
.btn { font: inherit; font-size: 15px; font-weight: 600; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.soft { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.btn.wide { width: 100%; }
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.err { color: #d64545; font-size: 14px; min-height: 0; }
.note { color: var(--muted); font-size: 13px; }

/* the month: a grid on a wide screen, a list by day on a phone */
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); gap: 1px; }
.dow { background: var(--panel); font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.day { background: var(--panel); min-height: 96px; padding: 6px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.day.out { background: var(--bg); }
.day .n { display: flex; justify-content: space-between; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.hol { font-size: 11px; font-weight: 600; color: var(--upd); text-align: right; }
.card { display: flex; flex-direction: column; gap: 6px; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--panel); color: inherit; font: inherit; cursor: pointer; min-width: 0; }
.card:hover, .card:focus-visible { border-color: var(--ok); outline: none; }
.card img { width: 100%; height: 84px; object-fit: cover; border-radius: 6px; display: block; background: var(--line); }
.meta { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.ic { width: 14px; height: 14px; flex: none; }
.first { font-size: 12.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 4px; flex-wrap: wrap; }
.foot .p { font-size: 11.5px; padding: 2px 8px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.lrow { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: start; }
.ldate { text-align: center; font-size: 12px; color: var(--muted); text-transform: uppercase; padding-top: 6px; }
.ldate b { display: block; font-size: 20px; color: var(--ink); }
.lcard { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--panel); color: inherit; font: inherit; cursor: pointer; width: 100%; }
.lcard img { width: 76px; height: 95px; object-fit: cover; border-radius: 8px; background: var(--line); }
.lcard > span { display: block; min-width: 0; }
.lrow > * { min-width: 0; }
.lcard { min-width: 0; overflow: hidden; }
.lcard .t { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.lcard .m { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.sticky { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--panel); border-top: 1px solid var(--line); }

/* one post, as it will look, with its comments beside it */
.view { position: fixed; inset: 0; background: var(--shade); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.sheet { background: var(--panel); border-radius: 16px; width: min(980px, 100%); max-height: 100%; overflow: auto; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.ig { border-right: 1px solid var(--line); min-width: 0; }
.ig-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 600; font-size: 14px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.pic { position: relative; background: #000; }
.pic img { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; display: block; }
.arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.9); color: #141a22; font-size: 24px; line-height: 1; cursor: pointer; }
.arrow.l { left: 10px; } .arrow.r { right: 10px; }
.dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); }
.dots i.on { background: #fff; }
.cap { padding: 12px 14px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.55; }
.side { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.side-top { display: flex; justify-content: space-between; gap: 10px; }
.when { font-weight: 650; }
.where { color: var(--muted); font-size: 14px; }
.x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 22px; cursor: pointer; flex: none; }
.thread { display: flex; flex-direction: column; gap: 8px; }
.cm { background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 14.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.cm.team { border-left: 3px solid var(--ok); }
.cm .who { font-weight: 650; font-size: 13px; }
textarea { font: inherit; font-size: 16px; width: 100%; min-height: 96px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 10px 12px; resize: vertical; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.test { background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px; margin-left: 8px; vertical-align: middle; }
.x.float, .sheetbar { display: none; }
.row.tight { margin-top: 0; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  .wrap { padding-bottom: 110px; }
  .head h1 { font-size: 21px; }
  .sheet { grid-template-columns: minmax(0, 1fr); }
  .ig { border-right: 0; border-bottom: 1px solid var(--line); }
  .view { padding: 0; align-items: stretch; }
  .sheet { border-radius: 0; padding-bottom: 76px; }
  .side-top .x { display: none; }
  .x.float { display: grid; place-items: center; margin-left: auto; }
  .sheetbar { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--panel); border-top: 1px solid var(--line); }
  .sheetbar .btn { flex: 1; }
}
