:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --panel: #ffffff;
    --ink: #1f2933;
    --muted: #697586;
    --line: #d9e2ec;
    --primary: #255f85;
    --primary-hover: #1d4d6d;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    --soft: #eef6f8;
    --ok: #176b4d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

.page-shell {
    width: min(920px, calc(100% - 32px));
    margin: 40px auto;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 12px 30px rgba(31, 41, 51, 0.08);
}

.panel-header {
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.section-title {
    margin: 24px 0 10px;
    font-size: 18px;
}

.form-grid {
    display: grid;
    gap: 22px;
}

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

.field span,
.field-label {
    font-weight: 700;
}

.field input,
.keyword-row input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}

.field input:focus,
.keyword-row input:focus {
    outline: 3px solid rgba(37, 95, 133, 0.18);
    border-color: var(--primary);
}

.field-group-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.field-group-header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.field-group > div > p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 14px;
}

#keyword-count {
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

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

.keyword-row {
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 8px;
}

.icon-button {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
}

.icon-button:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.primary-button,
.secondary-button,
.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 42px;
    border-radius: 6px;
    border: 1px solid transparent;
    padding: 9px 14px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    background: var(--primary);
    color: #fff;
}

.primary-button:hover {
    background: var(--primary-hover);
}

.secondary-button,
.secondary-link {
    background: #fff;
    border-color: var(--line);
    color: var(--primary);
}

.channel-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.channel-options label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 12px;
    background: #fff;
    cursor: pointer;
}

.channel-options input {
    width: 16px;
    height: 16px;
}

.destination-panel {
    display: grid;
    gap: 12px;
}

.destination-panel[hidden] {
    display: none;
}

.parse-card,
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 22px;
}

.compact-parse-card {
    background: #fbfcfd;
}

.parse-card div,
.summary-grid div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.parse-card strong,
.summary-grid strong {
    overflow-wrap: anywhere;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.notice,
.alert {
    border-radius: 8px;
    padding: 14px 16px;
}

.notice {
    border: 1px solid var(--line);
    background: #fbfcfd;
}

.notice p {
    margin: 6px 0 0;
    color: var(--muted);
}

.notice code {
    display: block;
    margin-top: 8px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.inline-form {
    margin-top: 12px;
}

.run-output {
    margin-top: 16px;
}

.run-output pre {
    margin: 10px 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.alert-error {
    margin-bottom: 18px;
    border: 1px solid #ffb4ab;
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-success {
    margin-bottom: 18px;
    border: 1px solid #a6e7c8;
    background: #eefbf5;
    color: var(--ok);
}

.alert p {
    margin: 0;
}

.alert p + p {
    margin-top: 6px;
}

.table-wrap {
    overflow-x: auto;
    margin-bottom: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

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

th {
    color: var(--muted);
    font-size: 13px;
}

.status-pill {
    display: inline-flex;
    border-radius: 999px;
    background: #e7f5ef;
    color: var(--ok);
    padding: 4px 9px;
    font-size: 13px;
    font-weight: 700;
}

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

td a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

td a:hover {
    text-decoration: underline;
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 20px, 920px);
        margin: 20px auto;
    }

    .panel {
        padding: 20px;
    }

    .parse-card,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .field-group-header {
        align-items: start;
        flex-direction: column;
    }

    .action-panel {
        align-items: start;
        flex-direction: column;
    }
}

.account-nav{max-width:1100px;margin:16px auto;display:flex;align-items:center;justify-content:space-between;padding:0 24px;gap:16px;flex-wrap:wrap}.account-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:16px}
