:root {
    --bg: #f6f7f9;
    --card: #ffffff;
    --card-muted: #eef1f5;
    --border: #d8dee8;
    --text: #17202a;
    --muted: #5f6b7a;
    --nav: #212529;
    --nav-hover: #343a40;
    --accent: #0d6efd;
    --accent-dark: #0a58ca;
    --ok: #177245;
    --bad: #c62828;
    --warn: #9a6700;
    --shadow: 0 8px 28px rgba(23, 32, 42, 0.06);
}

* { box-sizing: border-box; }

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav);
    color: #fff;
}

.header-container {
    display: flex;
    width: min(1100px, calc(100% - 32px));
    min-height: 62px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 6px;
    background: rgba(255,255,255,.08);
    font-size: .72rem;
    letter-spacing: .04em;
}

.app-name { color: #adb5bd; font-size: .92rem; }

.menu-toggle {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.menu-toggle:hover,
.menu-toggle:focus-visible { background: var(--nav-hover); }

.menu-icon,
.menu-icon::before,
.menu-icon::after {
    display: block;
    width: 21px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.menu-icon { position: relative; }
.menu-icon::before,
.menu-icon::after {
    position: absolute;
    left: 0;
    content: '';
}
.menu-icon::before { top: -7px; }
.menu-icon::after { top: 7px; }

.main-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: max(20px, calc((100% - 1100px) / 2 + 22px));
    width: min(330px, calc(100vw - 32px));
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    border: 1px solid #343a40;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: var(--nav);
    box-shadow: var(--shadow);
}

.main-menu.active { display: block; }
.main-menu ul {
    margin: 0;
    padding: 8px;
    list-style: none;
}

.main-menu a,
.submenu-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-decoration: none;
}

.main-menu a:hover,
.main-menu a:focus-visible,
.submenu-toggle:hover,
.submenu-toggle:focus-visible {
    background: var(--nav-hover);
    outline: none;
}

.submenu-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.menu-group.open > .submenu-toggle .submenu-chevron { transform: rotate(225deg); }

.submenu {
    display: none;
    margin: 0 0 5px 12px !important;
    padding: 3px 0 3px 10px !important;
    border-left: 2px solid rgba(255, 255, 255, 0.28);
}

.menu-group.open .submenu { display: block; }
.submenu a { font-size: .94rem; }

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

.header {
    margin-bottom: 28px;
    text-align: center;
}

h1 { margin: 0 0 8px; font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1; }
h2 { margin-top: 0; font-size: 1.35rem; }
.subtitle { max-width: 680px; margin: 0 auto; color: var(--muted); }

.version {
    display: inline-block;
    margin-top: 12px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.card {
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.form-row { display: flex; gap: 10px; }

input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    outline: none;
}

input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13,110,253,.14); }

button,
.button {
    display: inline-block;
    padding: 14px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

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

.button.secondary,
button.secondary { border: 1px solid var(--border); background: var(--card-muted); color: var(--text); }
.button.secondary:hover,
button.secondary:hover { background: #e2e7ed; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-muted);
}

.label { margin-bottom: 5px; color: var(--muted); font-size: .9rem; }
.value { font-weight: 700; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 900; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.small { color: var(--muted); font-size: .92rem; }

pre {
    margin: 0;
    padding: 14px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-muted);
    white-space: pre-wrap;
    word-break: break-word;
}

code { color: var(--accent-dark); }
a { color: var(--accent-dark); }
details { margin-top: 12px; }
summary { margin-bottom: 10px; color: var(--accent-dark); cursor: pointer; font-weight: 700; }
.copy-status { display: none; margin-top: 8px; color: var(--ok); font-size: .9rem; }
.footer { margin-top: 24px; color: var(--muted); font-size: .85rem; text-align: center; }

@media (max-width: 720px) {
    .container { padding: 32px 0; }
    .app-name { display: none; }
    .form-row,
    .grid { display: grid; grid-template-columns: 1fr; }
    button,
    .button { width: 100%; }
    .actions { display: grid; grid-template-columns: 1fr; }
}
