:root {
    color-scheme: light;
    --bg: #f3f5f8;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --text: #17202d;
    --muted: #64748b;
    --border: #d9e0ea;
    --border-strong: #c4cedb;
    --primary: #145da0;
    --primary-hover: #0f4d86;
    --primary-soft: #e8f1fb;
    --success: #147a4a;
    --success-soft: #e9f7ef;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    --shadow: 0 16px 40px rgba(23, 32, 45, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, #ffffff 0, #f7f9fc 240px, var(--bg) 240px),
        var(--bg);
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 44px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding: 18px 0 10px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 10px 26px rgba(20, 93, 160, 0.08);
}

.brand-mark img {
    width: 42px;
    height: 42px;
}

.brand-copy {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.brand-logo {
    width: 164px;
    max-width: 100%;
    height: auto;
    display: block;
}

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

h1,
h2,
h3 {
    line-height: 1.15;
}

h1 {
    font-size: 30px;
    letter-spacing: 0;
}

h2 {
    font-size: 18px;
}

h3 {
    font-size: 14px;
    margin: 18px 0 10px;
}

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

.actions,
.token-toolbar,
.section-heading {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.actions {
    align-self: flex-end;
    justify-content: flex-end;
    padding-bottom: 1px;
}

.actions form {
    display: flex;
    margin: 0;
}

.token-toolbar,
.section-heading {
    justify-content: space-between;
}

.token-toolbar {
    margin: 18px 0 8px;
}

button,
.button {
    min-height: 42px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 0 17px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
    white-space: nowrap;
}

button:hover,
.button:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 8px 18px rgba(20, 93, 160, 0.18);
}

button.secondary {
    color: var(--primary);
    background: var(--panel);
}

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

button.small {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

button:disabled {
    color: #8994a3;
    border-color: var(--border);
    background: #eef2f6;
    cursor: not-allowed;
    box-shadow: none;
}

.grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.92fr) minmax(360px, 1.08fr);
    gap: 18px;
    align-items: start;
}

section {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    padding: 22px;
    min-width: 0;
    box-shadow: var(--shadow);
}

.section-heading {
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.status {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 10px;
    color: var(--muted);
    background: var(--panel-soft);
    font-size: 12px;
    font-weight: 700;
}

.status.active {
    color: var(--success);
    border-color: #b9dfc9;
    background: var(--success-soft);
}

.summary {
    display: grid;
    gap: 10px;
    margin: 0;
}

.summary div {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 14px;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid #edf1f6;
}

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

.summary.compact {
    margin-bottom: 18px;
}

.empty-state {
    min-height: 24px;
    display: flex;
    align-items: center;
}

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

dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.mono,
pre,
.token-box {
    font-family: "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

pre,
.token-box {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--panel-soft);
    padding: 14px;
    font-size: 13px;
    line-height: 1.55;
    color: #1f2937;
}

pre {
    margin: 0 0 18px;
    overflow: auto;
    max-height: 520px;
}

.token-box {
    min-height: 170px;
    resize: vertical;
}

.notice {
    margin-bottom: 18px;
    border: 1px solid #b8dac4;
    border-radius: 8px;
    background: var(--success-soft);
    padding: 12px 14px;
    font-weight: 600;
}

.notice.error {
    color: var(--danger);
    border-color: #f3b5ae;
    background: var(--danger-bg);
}

@media (max-width: 860px) {
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .actions {
        justify-content: flex-start;
        width: 100%;
    }

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

@media (max-width: 560px) {
    main {
        width: min(100% - 24px, 1180px);
        padding: 18px 0 28px;
    }

    .brand-block {
        align-items: flex-start;
        gap: 12px;
    }

    .brand-mark {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
    }

    .brand-mark img {
        width: 34px;
        height: 34px;
    }

    .brand-logo {
        width: 132px;
    }

    h1 {
        font-size: 24px;
    }

    .actions,
    .actions form,
    .actions .button,
    .actions button {
        width: 100%;
    }

    section {
        padding: 18px;
    }

    .summary div {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
