:root { color-scheme: dark; }
* { box-sizing: border-box; margin: 0; }
body {
  background: #0f1311; color: #dfe5e1;
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
  padding: 20px; padding-bottom: 60px;
  max-width: 1200px; margin: 0 auto;
}
a { color: inherit; text-decoration: none; }
.muted { color: #94a29a; font-size: 14px; }

/* ---- шапка / панель ---- */
.topbar { margin-bottom: 18px; }
.topbar h1 { font-size: 21px; font-weight: 600; }
.topbar a { color: #94a29a; }
.topbar a:active, .topbar a:hover { color: #dfe5e1; }
.bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

.btn {
  display: inline-block; background: #232b26; color: #dfe5e1; border: 0;
  padding: 9px 15px; border-radius: 9px; font-size: 14px; cursor: pointer;
}
.btn:hover { background: #2e3a32; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-accent { background: #2f7050; }
.btn-accent:hover { background: #388a60; }
.btn-danger { background: #4a2626; }
.btn-danger:hover { background: #5e2f2f; }

.badge-live { font-size: 13px; color: #e8c268 !important; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.flash {
  background: #1b2a1e; border: 1px solid #2e4a33; border-radius: 10px;
  padding: 11px 14px; margin-bottom: 16px; font-size: 14px;
}
.flash a { text-decoration: underline; }
.flash-warn { background: #2f2416; border-color: #5a4423; }

/* ---- сетка идей ---- */
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.idea-card {
  display: flex; flex-direction: column; gap: 5px;
  border-radius: 12px; background: #171d19; padding: 13px 15px;
  border-left: 3px solid #232b26; font-size: 13px; color: #94a29a;
}
.idea-card:hover { background: #1c231e; }
.idea-card b { color: #dfe5e1; font-size: 14px; font-weight: 600; line-height: 1.35; }
.idea-card .desc { color: #b9c2bc; }
.idea-top { display: flex; gap: 8px; align-items: center; }

.status-line-new      { border-left-color: #3f7050; }
.status-line-detailed { border-left-color: #4f7a9a; }
.status-line-building { border-left-color: #e8c268; }
.status-line-built    { border-left-color: #9fd08c; }
.status-line-archived { border-left-color: #3a423d; }

/* оценка */
.score { font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 7px; }
.score-hi  { background: #1d2f22; color: #9fd08c; }
.score-mid { background: #2c2a1a; color: #d0c08c; }
.score-lo  { background: #262626; color: #a8a8a8; }
.score-line { margin: 6px 0 12px; display: flex; gap: 10px; align-items: baseline; }

/* статусы */
.badge-inline { font-size: 12px; padding: 2px 9px; border-radius: 7px; background: #232b26; }
.st-new      { color: #9fd08c; }
.st-detailed { color: #8cb8d0; }
.st-building { color: #e8c268; }
.st-built    { color: #9fd08c; background: #1d2f22; }
.st-archived { color: #94a29a; }

/* ---- поиск и фильтры ---- */
.search {
  margin-left: auto; background: #171d19; border: 1px solid #2e3a32;
  border-radius: 9px; color: #dfe5e1; padding: 9px 12px; font-size: 14px;
  width: min(320px, 100%);
}
.search:focus { outline: none; border-color: #2f7050; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  background: #171d19; border: 1px solid #2e3a32; color: #94a29a;
  border-radius: 20px; padding: 6px 13px; font-size: 13px; cursor: pointer;
}
.chip:hover { color: #dfe5e1; }
.chip.on { background: #2f7050; border-color: #2f7050; color: #dfe5e1; }

/* ---- страница карточки ---- */
.card-page { max-width: 760px; }
.card-head { display: flex; gap: 20px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h1 { font-size: 22px; margin-bottom: 8px; }
.card-head > div { flex: 1; min-width: 260px; }
.passport-table { border-collapse: collapse; font-size: 14px; margin-bottom: 14px; }
.passport-table td { padding: 3px 0; }
.passport-table td:first-child { color: #94a29a; padding-right: 18px; white-space: nowrap; }
.passport-table a { text-decoration: underline; text-underline-offset: 3px; }
.actions { margin-bottom: 6px; }

.md-body { font-size: 15px; line-height: 1.65; }
.md-body h2 {
  font-size: 17px; margin: 26px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid #232b26;
}
.md-body p, .md-body ul, .md-body ol { margin-bottom: 12px; }
.md-body ul, .md-body ol { padding-left: 22px; }
.md-body pre {
  background: #171d19; border: 1px solid #232b26;
  border-radius: 12px; padding: 14px 16px; margin-bottom: 14px;
  white-space: pre-wrap; word-break: break-word;
  font: 13.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color: #c4cdc7;
}
.md-body code { font: 13.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.md-body p code { background: #171d19; padding: 1px 6px; border-radius: 5px; }

/* ---- заметки ---- */
.notes { margin-top: 30px; }
.notes h2 { font-size: 17px; margin-bottom: 4px; }
.notes p { margin-bottom: 10px; }
.notes textarea {
  width: 100%; background: #171d19; border: 1px solid #2e3a32;
  border-radius: 10px; color: #dfe5e1; padding: 12px 14px; font-size: 15px;
  font-family: inherit; line-height: 1.5; resize: vertical; margin-bottom: 10px;
}
.notes textarea:focus { outline: none; border-color: #2f7050; }

/* ---- блок билда ---- */
.run-box { background: #171d19; border-radius: 14px; padding: 18px 20px; margin-bottom: 20px; }
.run-line { font-size: 15px; }
.run-box pre {
  margin-top: 12px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #d98383; white-space: pre-wrap; word-break: break-word;
}

/* ---- вход ---- */
.login-wrap { min-height: 82vh; display: flex; align-items: center; justify-content: center; }
.login-box {
  background: #171d19; padding: 34px 30px; border-radius: 14px;
  display: flex; flex-direction: column; gap: 14px; width: min(92vw, 330px);
}
.login-box h1 { font-size: 20px; text-align: center; }
.login-box input {
  background: #0f1311; border: 1px solid #2e3a32; border-radius: 9px;
  color: #dfe5e1; padding: 11px 13px; font-size: 16px;
}
.login-box input:focus { outline: none; border-color: #2f7050; }
.login-error { color: #d98383; font-size: 14px; text-align: center; }

/* ---- телефон ---- */
@media (max-width: 600px) {
  body { padding: 12px; }
  .grid { grid-template-columns: 1fr; gap: 8px; }
  .topbar h1 { font-size: 18px; }
}
