:root {
  --bg: #07101c;
  --panel: #0d1a2a;
  --panel-soft: #101f31;
  --line: rgba(177, 207, 223, 0.14);
  --text: #f3f8fa;
  --muted: #97aebd;
  --muted-2: #6c8190;
  --cyan: #55d6e8;
  --teal: #18a6b9;
  --amber: #ffbd66;
  --green: #70d8aa;
  --red: #ff7474;
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--tg-theme-bg-color, var(--bg));
  color: var(--text);
  font-family: Inter, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; padding: 1.1rem 1rem 5.5rem; }

.app-head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.1rem; }
.app-head .dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--cyan), var(--teal)); flex-shrink: 0; }
.app-head h1 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.app-head .sub { font-size: .75rem; color: var(--muted-2); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  margin-bottom: .85rem;
}
.card h2 { font-size: .95rem; font-weight: 800; margin-bottom: .55rem; display: flex; align-items: center; gap: .45rem; }
.card p { font-size: .87rem; color: var(--muted); line-height: 1.5; }
.card.hl { border-color: rgba(85, 214, 232, .4); }

.progress-track { height: 8px; border-radius: 99px; background: var(--panel-soft); overflow: hidden; margin: .5rem 0 .3rem; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--teal), var(--cyan)); transition: width .4s ease; }
.progress-label { font-size: .75rem; color: var(--muted-2); }

.steps { list-style: none; margin-top: .5rem; }
.steps li { display: flex; align-items: center; gap: .7rem; padding: .45rem 0; font-size: .9rem; }
.steps .st-dot {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: .8rem; font-weight: 800;
  background: var(--panel-soft); border: 1.5px solid var(--line); color: var(--muted-2);
}
.steps li.done .st-dot { background: rgba(112,216,170,.15); border-color: var(--green); color: var(--green); }
.steps li.current .st-dot { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 12px rgba(85,214,232,.4); }
.steps li.done .st-t { color: var(--muted-2); text-decoration: line-through; }
.steps li.current .st-t { font-weight: 700; }
.steps .badge { margin-left: auto; }

.badge {
  font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: .18rem .55rem; border-radius: 999px; flex-shrink: 0;
}
.badge.cyan { background: rgba(85,214,232,.14); color: var(--cyan); }
.badge.amber { background: rgba(255,189,102,.14); color: var(--amber); }
.badge.green { background: rgba(112,216,170,.14); color: var(--green); }
.badge.red { background: rgba(255,116,116,.14); color: var(--red); }
.badge.gray { background: rgba(160,180,200,.12); color: var(--muted-2); }

.btn {
  display: block; width: 100%; border: none; cursor: pointer;
  font: inherit; font-weight: 800; font-size: .95rem;
  padding: .85rem 1rem; border-radius: 13px; margin-top: .6rem;
  background: linear-gradient(135deg, var(--teal), var(--cyan)); color: #04222b;
}
.btn.secondary { background: var(--panel-soft); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: rgba(255,116,116,.14); color: var(--red); border: 1px solid rgba(255,116,116,.4); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: .55rem; }
.btn-row .btn { margin-top: .6rem; }

input[type="text"], textarea, select, input[type="file"] {
  width: 100%; font: inherit; color: var(--text);
  background: var(--panel-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: .7rem .8rem; margin-top: .5rem; font-size: .9rem;
}
textarea { resize: vertical; min-height: 4.2rem; }

.item { border-top: 1px solid var(--line); padding: .7rem 0; }
.item:first-child { border-top: none; padding-top: .2rem; }
.item .row { display: flex; align-items: center; gap: .6rem; }
.item .who { font-weight: 700; font-size: .9rem; }
.item .meta { font-size: .75rem; color: var(--muted-2); margin-top: .15rem; }
.item .desc { font-size: .85rem; color: var(--muted); margin-top: .3rem; line-height: 1.45; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; }
.stat .n { font-size: 1.55rem; font-weight: 800; color: var(--cyan); }
.stat .n.nodata { color: var(--muted-2); font-size: 1.05rem; }
.stat .l { font-size: .72rem; color: var(--muted-2); margin-top: .25rem; line-height: 1.35; }

.empty { text-align: center; color: var(--muted-2); font-size: .85rem; padding: 1rem 0; }
.toast {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 50;
  background: var(--panel-soft); border: 1px solid var(--line); border-radius: 13px;
  padding: .8rem 1rem; font-size: .88rem; text-align: center;
  opacity: 0; transform: translateY(8px); transition: all .25s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { border-color: rgba(255,116,116,.5); color: var(--red); }
.auth-error { text-align: center; padding: 3rem 1rem; }
.auth-error .big { font-size: 3rem; margin-bottom: .8rem; }
