:root {
  --ink: #171614;
  --muted: #706b63;
  --paper: #f7f5ef;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(31, 28, 23, 0.11);
  --line-strong: rgba(31, 28, 23, 0.19);
  --gold: #9b7c3e;
  --gold-soft: rgba(155, 124, 62, 0.13);
  --navy: #202b3b;
  --navy-soft: rgba(32, 43, 59, 0.08);
  --green: #356d49;
  --green-soft: rgba(53, 109, 73, 0.1);
  --amber: #946528;
  --amber-soft: rgba(148, 101, 40, 0.1);
  --danger: #933b35;
  --danger-soft: rgba(147, 59, 53, 0.08);
  --shadow: 0 18px 50px rgba(43, 36, 25, 0.08);
  --soft-shadow: 0 8px 24px rgba(43, 36, 25, 0.05);
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: hidden; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(145deg, #fff 0%, #faf9f6 46%, #eeeae1 100%);
}
button, input, textarea, select, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4, p { margin: 0; }

.asaria-app { min-height: 100vh; display: grid; grid-template-columns: 360px minmax(0, 1fr); }
.side {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 30px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}
.side-heading { display: grid; gap: 7px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1 { font-size: 36px; line-height: 1; }
h2 { font-size: clamp(32px, 3vw, 46px); line-height: 1.02; letter-spacing: -.035em; }
.side h2, .panel-title h2 { font-size: 17px; letter-spacing: 0; }
.side-intro, .top-description { color: var(--muted); font-size: 14px; line-height: 1.5; }
.side-intro { max-width: 280px; }
.top-description { max-width: 680px; margin-top: 10px; }

.content { min-width: 0; padding: 30px; }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.top-actions { min-width: 215px; display: grid; justify-items: stretch; gap: 8px; }
.feedback { min-height: 18px; color: var(--gold); font-size: 13px; font-weight: 750; text-align: right; }

.panel, .topic-card, .stat-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}
.panel { padding: 16px; }
.form-panel, .stats-panel { display: grid; gap: 13px; }
.panel-title { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-mark { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); font-size: 20px; }
.field { display: grid; gap: 7px; }
.field span, .filter-label { color: var(--muted); font-size: 12px; font-weight: 800; }
.filter-label { margin-top: 13px; text-transform: uppercase; letter-spacing: .05em; }

input, textarea, select {
  width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 14px; outline: 0;
  padding: 13px 14px; color: var(--ink); background: rgba(255, 255, 255, 0.8);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: rgba(155, 124, 62, .52); box-shadow: 0 0 0 4px var(--gold-soft); }

.button {
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 14px;
  padding: 0 18px; cursor: pointer; color: #fff; background: linear-gradient(180deg, #26231f, #12110f);
  box-shadow: 0 14px 30px rgba(17, 16, 15, .14); font-weight: 800;
}
.button.secondary { color: var(--ink); background: rgba(255,255,255,.8); border: 1px solid var(--line); box-shadow: none; }
.button:disabled { opacity: .55; cursor: wait; }
.text-button { border: 0; padding: 4px; color: var(--gold); background: transparent; cursor: pointer; font-size: 12px; font-weight: 800; }
.button:hover, .card-actions button:hover, .card-actions a:hover, .quick-tags button:hover { transform: translateY(-1px); }
.button, .card-actions button, .card-actions a, .quick-tags button { transition: 150ms ease; }

.quick-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.quick-tags button, .pill, .meta-chip {
  min-height: 32px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px;
  padding: 0 11px; color: var(--ink); background: rgba(255,255,255,.78); font-size: 12px; font-weight: 750;
}
.quick-tags button { cursor: pointer; }
.quick-tags button.active { color: #fff; border-color: #24211d; background: #24211d; box-shadow: 0 8px 18px rgba(17,16,15,.12); }
.category-tags { max-height: 170px; overflow-y: auto; padding-right: 3px; }
.check-filter { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; color: #4d4942; font-size: 13px; line-height: 1.35; }
.check-filter input { width: 16px; min-width: 16px; margin-top: 1px; accent-color: #24211d; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stat-card { min-height: 72px; display: grid; align-content: center; gap: 4px; padding: 11px; background: rgba(255,255,255,.72); }
.stat-card span { color: var(--muted); font-size: 11px; font-weight: 750; }
.stat-card strong { font-size: 21px; }
.stat-card.date strong { font-size: 12px; line-height: 1.3; }
.source-health { color: var(--muted); font-size: 12px; line-height: 1.4; }

.search-panel { margin-bottom: 18px; background: rgba(255,255,255,.66); }
.toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 285px; gap: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.board { display: grid; grid-template-columns: repeat(3, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.column { min-width: 0; display: grid; align-content: start; gap: 12px; }
.column-title { min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; border-bottom: 1px solid var(--line); }
.column-title h3 { font-size: 18px; }
.column-title span { min-width: 32px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-weight: 800; }

.topic-card { display: grid; gap: 11px; padding: 15px; background: rgba(255,255,255,.82); }
.topic-card.featured { border-color: rgba(155,124,62,.4); background: rgba(255,252,244,.94); box-shadow: var(--shadow); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pill.category { color: #735a2b; border-color: rgba(155,124,62,.27); background: var(--gold-soft); }
.pill.poland { color: var(--navy); border-color: rgba(32,43,59,.18); background: var(--navy-soft); }
.score { min-width: 62px; display: grid; justify-items: end; color: var(--gold); }
.score span { color: var(--muted); font-size: 10px; font-weight: 800; }
.score strong { font-size: 29px; line-height: 1; }
.source-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 750; }
.topic-card h4 { font-size: 19px; line-height: 1.18; letter-spacing: -.015em; }
.teaser { color: #3e3933; font-size: 14px; line-height: 1.45; }
.summary-box { border: 1px solid rgba(32,43,59,.12); border-radius: 14px; padding: 11px 12px; background: var(--navy-soft); }
.summary-box > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.summary-box p { color: #302d29; font-size: 14px; line-height: 1.48; }
.details { border-top: 1px solid var(--line); padding-top: 9px; }
.details summary { color: var(--gold); cursor: pointer; font-size: 13px; font-weight: 800; }
.details-content { display: grid; gap: 10px; margin-top: 10px; }
.info-block { display: grid; gap: 4px; }
.info-block strong { font-size: 12px; }
.info-block p { color: #4b4640; font-size: 13px; line-height: 1.45; }
.source-list { display: grid; gap: 5px; margin: 0; padding-left: 18px; }
.source-list a { color: var(--ink); font-size: 12px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-chip { min-height: 29px; cursor: default; color: #4f4a43; }
.meta-chip.good { color: var(--green); border-color: rgba(53,109,73,.22); background: var(--green-soft); }
.meta-chip.warning { color: var(--amber); border-color: rgba(148,101,40,.23); background: var(--amber-soft); }
.card-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.card-actions a, .card-actions button {
  min-height: 35px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px;
  padding: 0 11px; color: var(--ink); background: rgba(255,255,255,.8); text-decoration: none; cursor: pointer; font-size: 12px; font-weight: 750;
}
.card-actions a.primary { border-color: rgba(155,124,62,.28); background: var(--gold-soft); }
.card-actions .danger { color: var(--danger); border-color: rgba(147,59,53,.2); background: var(--danger-soft); }
.empty, .empty-board { border: 1px dashed var(--line-strong); border-radius: 16px; color: var(--muted); background: rgba(255,255,255,.46); }
.empty { padding: 15px; font-size: 13px; }
.empty-board { grid-column: 1 / -1; min-height: 340px; display: grid; place-content: center; justify-items: center; gap: 9px; padding: 28px; text-align: center; }
.empty-board h3 { color: var(--ink); font-size: 25px; }
.empty-board p { max-width: 520px; line-height: 1.45; }
.build-marker { margin-top: 24px; color: rgba(112,107,99,.65); font-size: 10px; text-align: right; }

@media (max-width: 1500px) { .board { grid-template-columns: 1fr; } }
@media (max-width: 920px) {
  .asaria-app { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .top { flex-direction: column; }
  .top-actions { width: 100%; }
  .feedback { text-align: left; }
}
@media (max-width: 620px) {
  .side, .content { padding: 20px; }
  .toolbar { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .card-top, .source-line { align-items: flex-start; flex-direction: column; }
  .score { justify-items: start; }
  .quick-tags button { min-height: 36px; }
}
