@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url('/fonts/inter-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url('/fonts/inter-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url('/fonts/inter-cyrillic-700-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url('/fonts/inter-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --canvas: #0a0a0a;
  --bg: #141414;
  --bar: #1a1a19;
  --card: #262522;
  --border: rgb(255 255 255 / 6%);
  --input: #1e1d1b;
  --input-border: #3d3b36;
  --text: #ffffff;
  --muted: #9b978c;
  --accent: #ffc83d;
  --on-accent: #2b2100;
  --accent-bg: #3a2f0a;
  --danger: #ff7b6b;
  --notice-bg: #3a1f1c;
  --notice-text: #ffb3a7;
  --frame-edge: rgb(255 200 61 / 30%);
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
h1, h2 { margin: 0 0 8px; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 8px; }

/* Device canvas: on a phone the app fills the screen, on a wide screen it sits in a centered phone shell */
.device-canvas { min-height: 100dvh; }

.device-frame {
  position: relative;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.brandbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bar);
  border-bottom: 1px solid var(--border);
}

.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: .01em; }
.logo svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.page {
  flex: 1;
  width: 100%;
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
  display: grid;
  align-content: start;
  gap: 12px;
}
.page-title { margin: 4px 4px 0; }

.tabs {
  position: fixed;
  inset: auto 0 0;
  z-index: 5;
  display: flex;
  justify-content: space-around;
  background: var(--bar);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 10;
  max-width: 400px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 14px;
  background: #ffffff;
  color: #121212;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 12px 32px rgb(0 0 0 / 45%);
}

@media (min-width: 480px) {
  .device-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100dvh;
    padding: 28px 0;
    background-color: var(--canvas);
    background-image: radial-gradient(ellipse 34% 60% at 50% 50%, var(--canvas) 60%, transparent), url('/canvas-bg.svg');
    background-size: auto, 180px 180px;
  }
  .device-frame {
    width: 430px;
    height: calc(100dvh - 56px);
    min-height: 0;
    max-height: 940px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 44px;
    box-shadow: 0 24px 70px rgb(0 0 0 / 60%), inset 0 0 0 1px var(--frame-edge);
  }
  .brandbar { position: static; padding-top: 14px; }
  .page { overflow-y: auto; padding-bottom: 20px; scrollbar-width: none; }
  .page::-webkit-scrollbar { display: none; }
  .tabs { position: static; padding-bottom: 12px; }
  .toast { position: absolute; bottom: 88px; }
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.empty { text-align: center; padding: 28px 18px; }
.empty .btn { margin-top: 10px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 4px; }

.notice {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--notice-bg);
  color: var(--notice-text);
  font-size: 13px;
}

.progress { height: 6px; border-radius: 99px; background: var(--input); overflow: hidden; margin: 12px 0 6px; }
.progress-fill { height: 100%; background: var(--accent); transition: width .3s; }

.list, .rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.post { display: flex; align-items: center; justify-content: space-between; gap: 12px; transition: opacity .4s, transform .4s; }
.post.done { opacity: 0; transform: translateX(24px); }
.post-meta { min-width: 0; flex: 1; }
.post-author { font-weight: 600; }
.post-link { word-break: break-all; font-weight: 600; text-decoration: none; }

.counter { display: grid; justify-items: center; min-width: 64px; }
.counter strong { font-size: 24px; line-height: 1; color: var(--accent); }

/* Forms */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { color: var(--muted); font-size: 13px; margin-left: 4px; }

input[type="text"], input[type="url"], input[type="search"], input[type="password"], input:not([type]) {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--input-border);
  border-radius: 14px;
  background: var(--input);
  color: var(--text);
  font: inherit;
}
input::placeholder { color: #6b6b6b; }

select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--input-border);
  border-radius: 14px;
  background: var(--input);
  color: var(--text);
  font: inherit;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@supports (-webkit-touch-callout: none) {
  input { font-size: 16px !important; }
}

.rules { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
.rules legend { font-weight: 600; margin-bottom: 12px; padding: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 1.5px solid rgb(255 255 255 / 85%);
  border-radius: 5px;
  cursor: pointer;
  background: transparent center no-repeat;
}
.check input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232b2100' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--input-border);
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, background-color .15s ease;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.danger { color: var(--danger); border-color: rgb(255 107 107 / 40%); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.card > input[type="search"] { margin: 8px 0 12px; }

.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row.removed .row-main > a, .row.removed .row-main > strong { opacity: .5; }
.row-main { min-width: 0; flex: 1 1 200px; }
.row-main > a { font-weight: 600; text-decoration: none; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Tab bar */
.tab {
  position: relative;
  flex: 1;
  max-width: 96px;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 6px 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--accent); }
.badge {
  position: absolute;
  top: 0;
  left: calc(50% + 6px);
  min-width: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}


.notice.warning { background: var(--accent-bg); color: var(--accent); }

.check-report { padding: 12px 14px; border-radius: 14px; font-size: 14px; display: grid; gap: 8px; }
.check-report ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.check-report p { margin: 0; }
.check-report.error { background: var(--notice-bg); color: var(--notice-text); }
.check-report.warning { background: var(--accent-bg); color: var(--accent); }
.check-report.warning .btn:not(.primary) { color: var(--text); }
