/* Design H «Ваш профиль»: the owner sees his Instagram as it will look after the week, and one button. */
:root {
  --bg: #ffffff; --ink: #0f0f10; --mute: #737373; --line: #dbdbdb; --soft: #efefef;
  --new: #0095f6; --new-soft: #e8f4fe; --new-ink: #0b5394; --good: #1f9d55; --weak: #c27c00; --bad: #c4523d;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --brand: "Instrument Serif", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f0f10; --ink: #f2f2f2; --mute: #a3a3a3; --line: #2c2c2e; --soft: #1e1e20; --new-soft: #0d2638; --new-ink: #8fcaf5; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.4 var(--font); }
body { padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid var(--new); outline-offset: 2px; }
.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.state { margin: 40vh 24px 0; text-align: center; color: var(--mute); }

.top { display: flex; justify-content: space-between; align-items: center; padding: 10px max(14px, env(safe-area-inset-left, 0px)) 8px; }
.top b { font-size: 18px; }
.note-week { color: var(--mute); font-size: 12.5px; }
.prof { display: flex; align-items: center; gap: 18px; padding: 0 14px; }
.av { width: 64px; height: 64px; border-radius: 50%; background: #1f2326; color: #d9b670; display: grid; place-items: center; font-family: var(--brand); font-size: 32px; flex: none; }
.stats { display: flex; gap: 18px; text-align: center; }
.stats b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.stats small { font-size: 12px; color: var(--mute); }
.bio { padding: 8px 14px; font-size: 13px; }
.bio b { display: block; }
.note { margin: 0 14px 10px; background: var(--new-soft); color: var(--new-ink); border-radius: 10px; padding: 8px 11px; font-size: 13px; }
.note.good { background: color-mix(in srgb, var(--good) 14%, var(--bg)); color: var(--good); font-weight: 600; }
.stories { display: flex; gap: 12px; padding: 4px 14px 12px; overflow-x: auto; }
.story { all: unset; cursor: pointer; display: grid; justify-items: center; gap: 4px; font-size: 11px; color: var(--mute); width: 62px; text-align: center; }
.story .ring { width: 58px; height: 58px; border-radius: 50%; padding: 2px; background: conic-gradient(var(--new), #7cc6ff, var(--new)); }
.story img { width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--bg); object-fit: cover; display: block; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.tile { all: unset; cursor: pointer; position: relative; aspect-ratio: 4 / 5; background: var(--soft); overflow: hidden; display: block; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.old { opacity: .5; cursor: default; }
.tile.new::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px var(--new); pointer-events: none; }
.tile.ok::after { box-shadow: inset 0 0 0 3px var(--good); }
.tile.warn::after { box-shadow: inset 0 0 0 3px var(--weak); }
.badge { position: absolute; left: 5px; bottom: 5px; background: var(--new); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; }
.badge.k { background: rgba(15, 15, 16, .8); }
.badge.g { background: var(--good); }
.badge.w { background: var(--weak); }
.empty-grid { padding: 24px 14px; color: var(--mute); text-align: center; }

.bar { position: sticky; bottom: 0; margin-top: auto; padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--bg); display: grid; gap: 6px; text-align: center; }
.bar small { color: var(--mute); font-size: 12px; }
.big { all: unset; cursor: pointer; text-align: center; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 16px; padding: 16px; border-radius: 12px; }
.big.done { background: var(--good); color: #fff; cursor: default; }
.big.ghost { background: var(--soft); color: var(--ink); }
.big[disabled] { opacity: .6; cursor: default; }

/* one post */
.ph { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.ph .back { all: unset; cursor: pointer; font-size: 22px; padding: 0 6px 0 0; }
.ph .a { width: 30px; height: 30px; border-radius: 50%; background: #1f2326; color: #d9b670; display: grid; place-items: center; font-family: var(--brand); font-size: 16px; }
.ph small { margin-left: auto; color: var(--mute); }
.media { position: relative; background: var(--soft); }
.media img, .media video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.vars { display: flex; gap: 8px; align-items: center; padding: 10px 12px 2px; font-size: 13px; }
.vars button { all: unset; cursor: pointer; width: 44px; }
.vars img { width: 44px; height: 44px; object-fit: cover; border-radius: 7px; outline: 2px solid transparent; outline-offset: 1px; display: block; }
.vars button.on img { outline-color: var(--new); }
.vars span { color: var(--mute); }
.cap { padding: 8px 12px; font-size: 13.5px; white-space: pre-wrap; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 12px 10px; }
.chip { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: var(--soft); }
.chip.ok::before { content: "✓ "; color: var(--good); font-weight: 700; }
.chip.warn::before { content: "! "; color: var(--weak); font-weight: 700; }
.row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.row button { all: unset; cursor: pointer; text-align: center; padding: 13px; border-radius: 10px; font-weight: 700; background: var(--soft); }
.row .pri { background: var(--ink); color: var(--bg); }
.fix { padding: 0 12px 12px; display: grid; gap: 8px; }
.fix textarea { width: 100%; min-height: 90px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; background: var(--bg); color: var(--ink); }
.fix .hint { color: var(--mute); font-size: 12px; }
.cancel { all: unset; cursor: pointer; color: var(--bad); font-size: 13px; text-align: center; padding: 6px; }
.status { margin: 0 12px 10px; font-size: 13px; color: var(--mute); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(14px + env(safe-area-inset-top, 0px)); width: min(452px, calc(100% - 28px)); background: var(--good); color: #fff; border-radius: 12px; padding: 11px 13px; font-weight: 600; font-size: 13.5px; box-shadow: 0 8px 20px rgba(0, 0, 0, .15); z-index: 10; }
.toast.err { background: var(--bad); }
@media (prefers-reduced-motion: no-preference) { .toast { transition: opacity .2s; } }
