:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --line: #dfe3e8;
    --text: #1d232a;
    --muted: #667085;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}

a {
    color: inherit;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 56px;
    padding: 0 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 700;
    text-decoration: none;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
}

.page {
    width: min(1200px, calc(100% - 32px));
    margin: 28px auto;
}

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

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 26px;
    line-height: 1.25;
}

h2 {
    font-size: 18px;
    line-height: 1.3;
}

p {
    color: var(--muted);
    margin-top: 6px;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    background: #f9fafb;
    color: #475467;
    font-weight: 600;
}

tfoot td {
    background: #f3f8f7;
    font-weight: 700;
}

tr:last-child td {
    border-bottom: 0;
}

.actions {
    text-align: right;
}

.button {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 6px;
    background: var(--accent);
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
}

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

.run-form {
    flex: 0 0 auto;
}

button.button {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.alert {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.alert strong {
    display: block;
}

.alert pre {
    margin: 12px 0 0;
}

.alert-success {
    border-color: #9fd8cf;
    background: #edf8f6;
}

.alert-error {
    border-color: #f3b5ad;
    background: #fff4f2;
}

.panel {
    margin-top: 18px;
}

.empty {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
}

.empty-inline {
    padding: 16px 0;
}

.error {
    color: var(--danger);
}

pre {
    overflow-x: auto;
    padding: 12px;
    background: #111827;
    color: #f9fafb;
    border-radius: 6px;
}

@media (max-width: 640px) {
    .topbar {
        padding: 0 16px;
    }

    .page {
        width: calc(100% - 24px);
        margin: 18px auto;
    }

    .page-header,
    .panel-header {
        display: block;
    }

    .page-header .button {
        margin-top: 12px;
    }

    .header-actions {
        align-items: stretch;
        margin-top: 12px;
    }

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

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.button.secondary {
    background: #344054;
}

.button.secondary:hover {
    background: #1f2937;
}

.nav {
    display: flex;
    gap: 18px;
}

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

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

.form-grid label {
    display: grid;
    gap: 7px;
}

.form-grid span {
    color: #344054;
    font-weight: 600;
}

input,
select {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus {
    outline: 2px solid #99d6ce;
    outline-offset: 1px;
    border-color: var(--accent);
}

.field-error {
    color: var(--danger);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}


@media (max-width: 640px) {
    .header-actions {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        margin-top: 12px;
    }

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

    .header-actions .button,
    .header-actions button.button {
        justify-content: center;
    }

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

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

.shop-picker {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0;
    border: 0;
}

.shop-picker legend {
    margin-bottom: 8px;
    color: #344054;
    font-weight: 600;
}

.shop-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.checkbox-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
}

.checkbox-row input {
    width: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
}

.checkbox-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-weight: 500;
}

.checkbox-row code {
    color: var(--muted);
}


@media (max-width: 640px) {
    .shop-options {
        grid-template-columns: 1fr;
    }
}

.home-section {
    margin-top: 24px;
}

.home-section h2 {
    margin-bottom: 12px;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.home-card {
    display: grid;
    gap: 8px;
    min-height: 112px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    text-decoration: none;
}

.home-card:hover {
    border-color: #99d6ce;
}

.home-card strong {
    font-size: 16px;
}

.home-card span,
.notice-panel p {
    color: var(--muted);
    line-height: 1.6;
}

.notice-panel {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid #f3b5ad;
    border-radius: 8px;
    background: #fff4f2;
}

.doc-content {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    line-height: 1.75;
}

.doc-content h1,
.doc-content h2,
.doc-content h3,
.doc-content h4 {
    margin: 28px 0 10px;
}

.doc-content h1:first-child {
    margin-top: 0;
}

.doc-content ul {
    margin: 8px 0 18px;
    padding-left: 22px;
}

.doc-content li {
    margin: 5px 0;
}

.doc-content p {
    color: var(--text);
    margin: 8px 0 14px;
}

.doc-content pre {
    margin: 12px 0 18px;
}

.doc-table {
    overflow-x: auto;
    margin: 14px 0 20px;
}

.doc-table table {
    min-width: 520px;
}

@media (max-width: 900px) {
    .home-grid {
        grid-template-columns: 1fr;
    }

    .doc-content {
        padding: 18px;
    }
}
