:root {
  --page: #f4f6f3;
  --ink: #171817;
  --muted: #5f665e;
  --line: #d9ded7;
  --panel: #ffffff;
  --panel-strong: #eef2ec;
  --green: #235f4a;
  --green-soft: #dce9df;
  --coral: #b65343;
  --yellow: #d0a83f;
  --blue: #315f8f;
  --shadow: 0 14px 34px rgba(24, 33, 26, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(23, 24, 23, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 24, 23, 0.025) 1px, transparent 1px),
    var(--page);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: Avenir Next, Hiragino Sans, PingFang SC, Helvetica Neue, sans-serif;
}

body,
button,
input,
select {
  overflow-wrap: anywhere;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: #fffdf8;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
}

.brand-lockup strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand-lockup span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.rail-nav {
  display: grid;
  gap: 8px;
}

.rail-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 700;
  line-height: 1.2;
}

.rail-button:hover,
.rail-button.is-active {
  background: var(--green-soft);
  border-color: rgba(35, 95, 74, 0.16);
  color: var(--green);
}

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

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

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

h1 {
  font-size: 36px;
  line-height: 1.08;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

.lede {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.status-panel,
.metric,
.detail-pane,
.control-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.status-panel {
  padding: 14px;
}

.status-panel span,
.metric span,
.select-box span,
.search-box span,
.tag-block span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-panel strong {
  display: block;
  margin: 7px 0 8px;
  font-size: 20px;
  line-height: 1.1;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.metric {
  min-width: 0;
  padding: 14px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.control-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px 190px;
  gap: 12px;
  padding: 12px;
  margin-bottom: 16px;
}

.search-box input,
.select-box select {
  width: 100%;
  height: 40px;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.search-box input {
  padding: 0 12px;
}

.select-box select {
  padding: 0 10px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 350px);
  gap: 16px;
  align-items: start;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 10px;
}

#result-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.content-list {
  display: grid;
  gap: 8px;
}

.content-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: inherit;
  text-align: left;
  box-shadow: 0 10px 24px rgba(34, 31, 24, 0.05);
}

.content-card > * {
  min-width: 0;
}

.content-card:hover,
.content-card.is-selected {
  border-color: rgba(35, 95, 74, 0.45);
  background: #fff;
}

.card-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.pill.high {
  background: #f4ddd7;
  color: var(--coral);
}

.pill.medium {
  background: #f4ead0;
  color: #755a14;
}

.pill.ready {
  background: var(--green-soft);
  color: var(--green);
}

.content-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.28;
}

.content-card p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.48;
}

.content-card .card-translation {
  border-left: 3px solid var(--green-soft);
  padding-left: 10px;
  color: #37443c;
  font-size: 13px;
}

.card-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.detail-pane {
  position: sticky;
  top: 24px;
  min-width: 0;
  padding: 16px;
}

.detail-summary {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.52;
  white-space: pre-line;
}

.detail-list {
  display: grid;
  gap: 9px;
  margin: 0 0 16px;
}

.detail-list div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 4px 0 0;
  line-height: 1.45;
  white-space: pre-line;
}

.tag-block {
  margin-top: 15px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.chip {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  margin-top: 16px;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--ink);
  color: #fffdf8;
  font-weight: 800;
  text-decoration: none;
}

.source-link.is-hidden {
  display: none;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.72);
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    padding: 16px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-lockup {
    margin-bottom: 14px;
  }

  .rail-nav {
    grid-template-columns: repeat(6, minmax(112px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .topbar,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .detail-pane {
    position: static;
  }
}

@media (max-width: 760px) {
  .rail {
    padding: 14px 16px;
  }

  .workspace {
    padding: 16px;
  }

  h1 {
    font-size: 30px;
  }

  .metrics-grid,
  .control-strip,
  .content-card {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 12px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rail-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .rail-button {
    padding: 10px 8px;
  }

  .card-meta {
    text-align: left;
  }
}

@media (max-width: 460px) {
  .rail,
  .workspace {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand-lockup {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

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

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }
}
