:root {
  --ink: #181614;
  --muted: #77726a;
  --paper: #fbfaf7;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(31, 28, 23, 0.1);
  --line-strong: rgba(31, 28, 23, 0.16);
  --gold: #a4894d;
  --gold-soft: rgba(164, 137, 77, 0.16);
  --green: #2d6d45;
  --green-soft: rgba(45, 109, 69, 0.1);
  --blue: #3e5f86;
  --blue-soft: rgba(62, 95, 134, 0.1);
  --danger: #9b3830;
  --danger-soft: rgba(155, 56, 48, 0.09);
  --shadow: 0 22px 70px rgba(42, 34, 21, 0.1);
  --soft-shadow: 0 12px 30px rgba(42, 34, 21, 0.06);
}

* {
  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(135deg, #ffffff 0%, #faf9f6 45%, #f0ede6 100%);
  overflow-x: hidden;
}

button,
input,
textarea,
select,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.asaria-app {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
}

.side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 30px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 280px;
  font-size: 34px;
  line-height: 1;
}

h2 {
  font-size: 42px;
  line-height: 1.04;
}

.side h2,
.panel-title h2 {
  font-size: 17px;
  line-height: 1.2;
}

.content {
  min-width: 0;
  padding: 30px;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.top-actions {
  min-width: 210px;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.feedback {
  min-height: 18px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.button,
.plain,
.status-button {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(180deg, #24211d, #11100f);
  box-shadow: 0 16px 34px rgba(17, 16, 15, 0.16);
}

.button.secondary,
.plain,
.status-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  box-shadow: none;
}

.button:hover,
.card-actions a:hover,
.card-actions button:hover,
.quick-tags button:hover {
  transform: translateY(-1px);
}

.button,
.card-actions a,
.card-actions button,
.quick-tags button {
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.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;
}

.panel.compact,
.form-panel {
  display: grid;
  gap: 13px;
}

.panel-title {
  min-height: 24px;
  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: 999px;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.78);
  font-size: 20px;
  font-weight: 700;
}

.field {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

textarea {
  min-height: 118px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(164, 137, 77, 0.52);
  box-shadow: 0 0 0 4px var(--gold-soft);
}

.filter-section {
  min-width: 0;
}

.quick-tags {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-tags + .quick-tags {
  margin-top: 10px;
}

.quick-tags button,
.chip {
  min-height: 34px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.quick-tags button.active {
  color: #fff;
  background: #24211d;
  border-color: #24211d;
  box-shadow: 0 12px 28px rgba(17, 16, 15, 0.14);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.stat-card span,
.source-line,
.text-block span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.stat-card strong {
  font-size: 22px;
  line-height: 1.1;
}

.muted-card strong {
  font-size: 14px;
}

.search-panel {
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.64);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 240px;
  gap: 12px;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 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;
  gap: 12px;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--line);
}

.column-title h3 {
  font-size: 18px;
}

.column-title span {
  min-width: 34px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.topic-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.topic-card.featured {
  border-color: rgba(164, 137, 77, 0.34);
  background: rgba(255, 252, 244, 0.9);
  box-shadow: var(--shadow);
}

.card-top {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.category-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(164, 137, 77, 0.28);
  border-radius: 999px;
  padding: 0 12px;
  color: #7d6330;
  background: rgba(164, 137, 77, 0.12);
  font-size: 13px;
  font-weight: 800;
}

.score {
  width: 64px;
  min-width: 64px;
  display: grid;
  justify-items: end;
  gap: 1px;
  color: var(--gold);
}

.score span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.score strong {
  font-size: 28px;
  line-height: 1;
}

.source-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topic-card h4 {
  font-size: 18px;
  line-height: 1.18;
}

.text-block {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(31, 28, 23, 0.08);
  border-radius: 14px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.58);
}

.text-block p {
  display: -webkit-box;
  overflow: hidden;
  color: #3a3630;
  font-size: 14px;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
}

.brief {
  border-color: rgba(62, 95, 134, 0.16);
  background: var(--blue-soft);
}

.brief p {
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  cursor: default;
  line-height: 1.2;
}

.chip.success {
  color: var(--green);
  border-color: rgba(45, 109, 69, 0.24);
  background: var(--green-soft);
}

.angle-chip {
  max-width: 100%;
  height: auto;
  padding-top: 7px;
  padding-bottom: 7px;
  white-space: normal;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.card-actions a,
.card-actions button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.card-actions a:first-child,
.card-actions button[data-copy-url],
.card-actions button[data-copy] {
  border-color: rgba(164, 137, 77, 0.26);
  background: rgba(164, 137, 77, 0.1);
}

.card-actions .danger-action {
  color: var(--danger);
  border-color: rgba(155, 56, 48, 0.22);
  background: var(--danger-soft);
}

.empty,
.empty-board {
  border: 1px dashed rgba(31, 28, 23, 0.16);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.46);
}

.empty {
  padding: 14px;
  font-size: 14px;
}

.empty-board {
  grid-column: 1 / -1;
  min-height: 330px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 28px;
  text-align: center;
}

.empty-board h3 {
  color: var(--ink);
  font-size: 24px;
}

.empty-board p:last-child {
  max-width: 460px;
  line-height: 1.45;
}

@media (max-width: 1220px) {
  .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 {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    min-width: 0;
    justify-items: stretch;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  h2 {
    font-size: 34px;
  }
}

@media (max-width: 560px) {
  .side,
  .content {
    width: 100vw;
    max-width: 100vw;
    justify-items: start;
    padding: 20px;
  }

  .panel,
  .filter-section,
  .search-panel,
  .board,
  .top {
    width: 100%;
    max-width: min(100%, 340px);
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 30px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .quick-tags {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quick-tags button {
    width: 100%;
    justify-content: center;
    padding-right: 8px;
    padding-left: 8px;
  }

  .card-top,
  .source-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .score {
    width: auto;
    min-width: 0;
    justify-items: start;
  }
}
