:root {
    --bg: #edf3f8;
    --surface: #ffffff;
    --surface-alt: #f4f8fb;
    --line: #d6e0ea;
    --line-strong: #c4d2df;
    --text: #17212b;
    --muted: #5f6f80;
    --primary: #0f766e;
    --primary-dark: #0b5a54;
    --primary-soft: #d9f3ef;
    --success: #2b8a3e;
    --warning: #b08900;
    --danger: #c92a2a;
    --shadow: 0 14px 34px rgba(15, 23, 32, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 24%),
        linear-gradient(180deg, #f8fbfd 0%, var(--bg) 100%);
    color: var(--text);
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 18px 0;
}

.brand-block {
    min-width: 260px;
}

.brand {
    display: inline-block;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text);
}

.subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 640px;
}

.topbar-actions,
.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.topbar-actions {
    justify-content: flex-end;
    flex: 1;
}

.nav a {
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text);
}

.nav a:hover {
    background: var(--surface-alt);
    text-decoration: none;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.session-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--muted);
    border: 1px solid var(--line);
}

main.container {
    padding: 34px 0 56px;
}

.panel,
.stat-card,
.hint-card,
.execution-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.panel,
.execution-card {
    padding: 24px;
    margin-bottom: 22px;
}

.panel-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.hero-panel {
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.06), rgba(15, 118, 110, 0.01)),
        var(--surface);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.section-head h1,
.section-head h2 {
    margin: 0;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lead {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 1.02rem;
    max-width: 760px;
}

.lead.small {
    font-size: 0.98rem;
}

.stat-grid,
.hint-grid,
.meta-grid,
.output-grid,
.field-row {
    display: grid;
    gap: 16px;
}

.stat-grid,
.hint-grid,
.meta-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.output-grid,
.field-row {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.stat-card,
.hint-card {
    padding: 16px;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.8rem;
}

.stat-label,
.muted {
    color: var(--muted);
}

.meta-grid strong {
    display: block;
    margin-top: 6px;
}

.status-list div {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.status-list div:last-child {
    border-bottom: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
}

th,
td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
    background: var(--surface-alt);
}

.actions {
    display: flex;
    gap: 12px;
    white-space: nowrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    text-decoration: none;
    transform: translateY(-1px);
}

.button.secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line-strong);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stack {
    display: grid;
    gap: 18px;
}

.form-shell {
    padding: 20px;
    border-radius: 14px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
}

label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

textarea {
    resize: vertical;
}

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

.settings-section {
    padding-top: 4px;
}

.settings-section h2 {
    margin: 0 0 4px;
    font-size: 1.02rem;
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--surface-alt);
    color: var(--text);
}

.badge.ready,
.badge.success {
    background: #e6f6ea;
    color: var(--success);
}

.badge.failed {
    background: #ffe3e3;
    color: var(--danger);
}

.badge.running,
.badge.approved {
    background: #fff3bf;
    color: var(--warning);
}

.badge.planned,
.badge.draft {
    background: #dbeafe;
    color: var(--primary-dark);
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin: 0 0 16px;
}

.alert.error {
    background: #fff5f5;
    color: var(--danger);
    border: 1px solid #ffc9c9;
}

.alert.success {
    background: #ebfbee;
    color: var(--success);
    border: 1px solid #b2f2bb;
}

.empty {
    color: var(--muted);
    padding: 18px 0 6px;
}

.code-block {
    margin: 0;
    background: #0f1720;
    color: #e6edf3;
    border-radius: 12px;
    padding: 14px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-block.soft {
    background: #14303b;
}

.plain-list {
    margin: 0;
    padding-left: 18px;
}

.auth-panel {
    max-width: 460px;
    margin: 48px auto;
}

@media (max-width: 860px) {
    .site-header-inner,
    .topbar-actions,
    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-actions {
        width: 100%;
    }

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

    table {
        display: block;
        overflow-x: auto;
    }
}
