:root {
  --bg: #f3efe8;
  --panel: rgba(255, 251, 245, 0.86);
  --panel-strong: #fffaf3;
  --ink: #18211e;
  --muted: #5d665f;
  --line: rgba(24, 33, 30, 0.12);
  --accent: #bb5a36;
  --accent-soft: rgba(187, 90, 54, 0.14);
  --ok: #2f7d57;
  --warn: #b9821f;
  --danger: #b24733;
  --shadow: 0 18px 60px rgba(61, 46, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(187, 90, 54, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(47, 125, 87, 0.15), transparent 22%),
    var(--bg);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.sidebar {
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 248, 238, 0.9);
}

.content {
  padding: 28px;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(320px, 420px) minmax(420px, 1fr);
}

.content.single-column {
  grid-template-columns: minmax(320px, 960px);
  justify-content: center;
}

.install-shell {
  grid-template-columns: 1fr;
}

.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.card {
  padding: 18px;
}

.runtime-state-card {
  margin-top: 18px;
}

.runtime-state-card[data-variant="loading"] {
  border-color: rgba(185, 130, 31, 0.28);
  background: rgba(255, 248, 230, 0.72);
}

.runtime-state-card[data-variant="empty"] {
  border-color: rgba(47, 125, 87, 0.24);
  background: rgba(238, 249, 242, 0.8);
}

.runtime-state-card[data-variant="found"] {
  border-color: rgba(187, 90, 54, 0.28);
  background: rgba(255, 243, 236, 0.82);
}

.runtime-state-card[data-variant="error"] {
  border-color: rgba(178, 71, 51, 0.32);
  background: rgba(255, 239, 236, 0.82);
}

.detail-panel {
  min-height: calc(100vh - 56px);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.sidebar-section + .sidebar-section,
.card + .card {
  margin-top: 18px;
}

.chip-row,
.summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.chip.active {
  background: var(--accent-soft);
  border-color: rgba(187, 90, 54, 0.35);
}

.summary-item {
  flex: 1 1 120px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}

.panel-header,
.card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.duplicate-list {
  display: grid;
  gap: 12px;
}

.duplicate-item {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.duplicate-item:hover,
.duplicate-item.active {
  transform: translateY(-1px);
  border-color: rgba(187, 90, 54, 0.35);
}

.duplicate-item p:last-child {
  margin-bottom: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.detail-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.hidden {
  display: none;
}

.grid.two-columns {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.list {
  display: grid;
  gap: 10px;
  padding-left: 20px;
}

.resolve-form {
  display: grid;
  gap: 16px;
}

.field-group {
  display: grid;
  gap: 8px;
}

select,
textarea,
.field-box {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.merge-fields {
  display: grid;
  gap: 14px;
}

.option-grid {
  display: grid;
  gap: 8px;
}

.option-row {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.runtime-debug {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.runtime-debug summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.runtime-debug[open] summary {
  margin-bottom: 14px;
}

button {
  font: inherit;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
}

.link-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.primary-button {
  background: var(--accent);
  color: white;
}

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

.risk-high {
  color: var(--danger);
}

.risk-medium {
  color: var(--warn);
}

.risk-low {
  color: var(--ok);
}

@media (max-width: 1080px) {
  .page-shell,
  .content,
  .grid.two-columns {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    min-height: auto;
  }
}
