:root {
    --bg: #f1eadf;
    --bg-strong: #e7ddcf;
    --panel: rgba(255, 252, 246, 0.82);
    --panel-line: rgba(55, 37, 20, 0.14);
    --text: #1d1711;
    --muted: #6d6257;
    --accent: #b7410e;
    --accent-soft: #f07f3c;
    --success: #12664f;
    --danger: #9d1d20;
    --warning: #8e5d05;
    --shadow: 0 24px 80px rgba(59, 35, 10, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(240, 127, 60, 0.22), transparent 28rem),
        radial-gradient(circle at top right, rgba(18, 102, 79, 0.16), transparent 30rem),
        linear-gradient(180deg, #f8f2e8 0%, var(--bg) 100%);
    color: var(--text);
    font-family: "Space Grotesk", sans-serif;
}

.shell {
    width: min(1380px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 3rem;
}

.hero,
.panel {
    backdrop-filter: blur(14px);
    background: var(--panel);
    border: 1px solid var(--panel-line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 1.5rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.eyebrow,
.note-label,
label span,
.table th,
.metric-label,
.flag {
    display: inline-block;
    font: 500 0.78rem/1 "IBM Plex Mono", monospace;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.eyebrow,
.note-label {
    margin-bottom: 0.75rem;
    color: var(--accent);
}

.hero h1 {
    margin: 0;
    max-width: 12ch;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    line-height: 0.96;
}

.lede,
.panel-copy,
.empty,
.table td small,
.metric-muted {
    color: var(--muted);
}

.lede {
    max-width: 62ch;
    font-size: 1rem;
    line-height: 1.7;
}

.hero-note {
    display: grid;
    gap: 0.7rem;
    align-content: center;
    padding: 1.5rem;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(183, 65, 14, 0.11), rgba(29, 23, 17, 0.02));
}

code,
.json-box {
    font-family: "IBM Plex Mono", monospace;
}

.panel {
    padding: 1.4rem;
    margin-bottom: 1.5rem;
}

.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.dashboard {
    display: grid;
    gap: 0;
}

.diagnostic-layout {
    align-items: start;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-header h2,
.item-card h3 {
    margin: 0;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 0.45rem;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    width: 100%;
    border: 1px solid rgba(58, 43, 28, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--text);
    padding: 0.95rem 1rem;
    transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: rgba(183, 65, 14, 0.55);
    box-shadow: 0 0 0 4px rgba(183, 65, 14, 0.12);
    transform: translateY(-1px);
}

button {
    border: 0;
    border-radius: 999px;
    padding: 0.88rem 1.2rem;
    cursor: pointer;
    font-weight: 700;
    transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

button:hover {
    transform: translateY(-1px);
}

button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.primary {
    color: #fffdf9;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    box-shadow: 0 10px 30px rgba(183, 65, 14, 0.26);
}

.ghost {
    background: rgba(29, 23, 17, 0.06);
    color: var(--text);
}

.feedback {
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(29, 23, 17, 0.05);
    border: 1px solid rgba(29, 23, 17, 0.08);
}

.feedback.muted {
    color: var(--muted);
}

.feedback.success {
    color: var(--success);
    border-color: rgba(18, 102, 79, 0.24);
    background: rgba(18, 102, 79, 0.08);
}

.feedback.error {
    color: var(--danger);
    border-color: rgba(157, 29, 32, 0.28);
    background: rgba(157, 29, 32, 0.08);
}

.empty {
    padding: 0.25rem 0 0;
}

.table-wrap {
    overflow: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.table th,
.table td {
    padding: 0.95rem 0.8rem;
    border-bottom: 1px solid rgba(35, 23, 10, 0.08);
    text-align: left;
    vertical-align: top;
}

.table th {
    color: var(--muted);
}

.table td strong {
    display: block;
}

.metric-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
    margin-top: 1rem;
}

.metric-board.empty,
.cards.empty,
.json-box.empty,
.flag-row:empty {
    display: none;
}

.metric-card,
.item-card {
    border-radius: 20px;
    border: 1px solid rgba(35, 23, 10, 0.1);
    background: rgba(255, 255, 255, 0.64);
    padding: 1rem;
}

.metric-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--muted);
}

.metric-value {
    display: block;
    font-size: 1.08rem;
}

.flag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.flag {
    padding: 0.62rem 0.8rem;
    border-radius: 999px;
    background: rgba(29, 23, 17, 0.06);
    color: var(--text);
}

.flag.success {
    background: rgba(18, 102, 79, 0.1);
    color: var(--success);
}

.flag.error {
    background: rgba(157, 29, 32, 0.1);
    color: var(--danger);
}

.flag.warning {
    background: rgba(142, 93, 5, 0.12);
    color: var(--warning);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.44rem 0.72rem;
    border-radius: 999px;
    font: 500 0.76rem/1 "IBM Plex Mono", monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(29, 23, 17, 0.06);
}

.status-pill.success {
    background: rgba(18, 102, 79, 0.1);
    color: var(--success);
}

.status-pill.error {
    background: rgba(157, 29, 32, 0.1);
    color: var(--danger);
}

.status-pill.warning {
    background: rgba(142, 93, 5, 0.12);
    color: var(--warning);
}

.status-pill.neutral {
    color: var(--muted);
}

.json-box {
    margin: 0;
    overflow: auto;
    max-height: 520px;
    white-space: pre-wrap;
    border-radius: 22px;
    border: 1px solid rgba(38, 28, 16, 0.12);
    background: #1f1a16;
    color: #f4e9dd;
    padding: 1rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 0.25rem;
}

.item-card h3 {
    margin-bottom: 0.9rem;
    font-size: 1rem;
}

.item-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px dashed rgba(35, 23, 10, 0.08);
}

.item-row:last-child {
    border-bottom: 0;
}

.item-row span:first-child {
    color: var(--muted);
}

@media (max-width: 1080px) {
    .workspace,
    .hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .shell {
        width: min(100% - 1rem, 1380px);
        padding-top: 1rem;
    }

    .grid.two {
        grid-template-columns: 1fr;
    }

    .panel-header {
        flex-direction: column;
    }
}
