:root {
    color-scheme: light dark;
    --bg: #0f1419;
    --panel: #1a2332;
    --text: #e8eef7;
    --muted: #9fb0c3;
    --accent: #3d8bfd;
    --danger: #ff6b6b;
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, sans-serif;
    background: radial-gradient(1200px 600px at 20% -10%, #1f3a5f 0%, transparent 55%), var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.brand {
    font-weight: 650;
    letter-spacing: 0.02em;
}

.topbar a {
    color: var(--accent);
    text-decoration: none;
}

.topnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.menu-box {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.35rem 1.4rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(160deg, rgba(36, 52, 78, 0.95), rgba(20, 28, 40, 0.92));
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    transition: border-color 0.15s ease, transform 0.15s ease;
    min-height: 210px;
}

.menu-box:hover {
    border-color: rgba(61, 139, 253, 0.55);
    transform: translateY(-2px);
}

.menu-box h2 {
    margin: 0;
    font-size: 1.15rem;
}

.menu-box p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
    flex: 1;
}

.menu-box code {
    font-size: 0.85em;
}

.menu-meta {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.menu-cta {
    font-weight: 650;
    color: var(--accent);
}

.breadcrumb {
    margin: 0 0 0.75rem;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.table-wrap {
    overflow: auto;
    max-height: 560px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    position: sticky;
    top: 0;
    background: #152033;
    color: var(--muted);
    font-weight: 600;
}

.data-table th.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.data-table th.sortable-th:hover {
    color: #e8eef8;
}

.data-table th.sortable-th::after {
    content: " ↕";
    opacity: 0.35;
    font-weight: 400;
}

.data-table th.sortable-th.is-sorted-asc::after {
    content: " ↑";
    opacity: 0.9;
}

.data-table th.sortable-th.is-sorted-desc::after {
    content: " ↓";
    opacity: 0.9;
}

.result-list {
    margin: 0;
    padding-left: 1.1rem;
}

.result-list .ok {
    color: #9ee4b0;
}

.result-list .ko {
    color: #ffb4b4;
}

.shell {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem 3rem;
}

.card {
    background: rgba(26, 35, 50, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    margin-bottom: 1.25rem;
}

.card h1,
.card h2 {
    margin-top: 0;
    font-size: 1.35rem;
}

.card h2 {
    font-size: 1.15rem;
}

label {
    display: block;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 20, 25, 0.85);
    color: var(--text);
}

.field {
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.btn:hover {
    filter: brightness(1.05);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.35);
    color: #ffb4b4;
}

.alert-info {
    background: rgba(61, 139, 253, 0.12);
    border: 1px solid rgba(61, 139, 253, 0.35);
    color: #cfe4ff;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 420px;
    overflow: auto;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.debug-panel .mono.debug-log {
    max-height: 520px;
}

.debug-details {
    margin-top: 1rem;
}

.debug-details summary {
    cursor: pointer;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.preview-window {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    margin: 1rem 0 1.25rem;
}

.preview-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.55rem 0.85rem;
    background: #121820;
    color: var(--text);
    font-size: 0.85rem;
}

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

.preview-frame {
    display: block;
    width: 100%;
    height: min(70vh, 720px);
    border: 0;
    background: #fff;
}

.code-inputs {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

.code-digit,
input.code-digit[type="text"] {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 56px;
    flex: 0 0 48px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 20, 25, 0.85);
    color: var(--text);
    padding: 0;
}

.code-digit:focus {
    outline: none;
    border-color: var(--accent);
}

.remember-row {
    margin-top: 1.25rem;
}

.remember-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    cursor: pointer;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text);
    text-decoration: none;
}

.btn-ghost:hover {
    border-color: rgba(255, 255, 255, 0.35);
}

.captcha-embed {
    background: #f0f2f5;
    color: #222;
}

.captcha-embed .captcha-container {
    margin: 0 auto;
}

.alert-changes {
    border-left: 4px solid #e6a817;
}

.alert-changes h2 {
    color: #f0d78c;
    margin-top: 0;
}

.changes-list {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
}

.changes-list > li {
    margin-bottom: 0.85rem;
}

.changes-list ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
    color: var(--muted);
}

.change-from {
    text-decoration: line-through;
    opacity: 0.85;
}

.change-to {
    color: #f0d78c;
    font-weight: 600;
}

