* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0d0d0d;
    --bg-sidebar: #0a0a0a;
    --bg-secondary: #161616;
    --bg-tertiary: #1a1a1a;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #7c9885;
    --accent-hover: #9ab8a3;
    --border: #2a2a2a;
    --error: #c75050;
    --success: #5c8a5c;
    --red: #c75050;
    --amber: #d9a441;
    --bg-window: #111;
    --bg-titlebar: #181818;
    --mono: "SF Mono", Monaco, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
    --sidebar-width: 15rem;
    /* tool windows grow with the screen, like the redcloud.pw card */
    --content-width: clamp(50rem, 52vw, 66rem);
}

/* Sizes are in rem: a touch larger on big monitors, unchanged on phones */
html {
    font-size: clamp(16px, 13px + 0.18vw, 18px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 60% -10%, rgba(199, 80, 80, 0.07), transparent 50%),
        radial-gradient(ellipse at 60% 110%, rgba(124, 152, 133, 0.06), transparent 50%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.5px;
}

.logo svg {
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 0.5rem;
}

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    text-transform: lowercase;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
    user-select: none;
}

/* "# сетевые", collapse arrow on the right */
.nav-section-title::before {
    content: "#";
    color: var(--red);
}

.nav-section-title .section-arrow {
    order: 2;
    margin-left: auto;
}

.nav-section-title:hover {
    color: var(--text);
}

.section-arrow {
    font-size: 0.6rem;
    transition: transform 0.2s;
}

.nav-section.collapsed .section-arrow {
    transform: rotate(-90deg);
}

.nav-section-items {
    overflow: hidden;
    transition: max-height 0.2s ease;
    max-height: 500px;
}

.nav-section.collapsed .nav-section-items {
    max-height: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.nav-item:hover {
    color: var(--text);
    background: var(--bg-secondary);
}

.nav-item.active {
    color: var(--accent);
    background: var(--bg-secondary);
    border-left-color: var(--accent);
}

.nav-icon {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

.made-by {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.stats {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stats span {
    color: var(--accent);
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2.5rem 2rem;
}

/* Each tool is a window: title bar with three dots and its path */
.tool-section {
    display: none;
    width: 100%;
    max-width: var(--content-width);
    background: var(--bg-window);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    animation: fadeIn 0.2s ease;
    /* a #tool link scrolls to the section: keep the page padding above it */
    scroll-margin-top: 2.5rem;
}

.tool-section::before {
    content: "~/tools/" attr(id);
    display: block;
    height: 2.25rem;
    line-height: 2.25rem;
    padding: 0 4.5rem;
    border-bottom: 1px solid var(--border);
    border-radius: 10px 10px 0 0;
    background:
        radial-gradient(circle closest-side, rgba(199, 80, 80, 0.75) 92%, transparent) 0.9rem 50% / 0.7rem 0.7rem no-repeat,
        radial-gradient(circle closest-side, rgba(217, 164, 65, 0.75) 92%, transparent) 2.05rem 50% / 0.7rem 0.7rem no-repeat,
        radial-gradient(circle closest-side, rgba(124, 152, 133, 0.75) 92%, transparent) 3.2rem 50% / 0.7rem 0.7rem no-repeat,
        var(--bg-titlebar);
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#news::before { content: "~/news"; }
#about::before { content: "~/about"; }

.tool-section > .tool-header {
    padding: 1.75rem 2rem 0;
}

.tool-section > .tool-body {
    padding: 0 2rem 2rem;
}

.tool-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.tool-header {
    margin-bottom: 2rem;
}

.tool-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tool-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tool-body {
    width: 100%;
}

/* Input group */
.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.input-group input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 1rem;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--accent);
}

.input-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.input-group button {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: var(--bg);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

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

.input-group button:active {
    transform: scale(0.98);
}

/* Clear button inside input fields */
.input-wrap {
    position: relative;
    flex: 1;
}

.input-wrap input {
    flex: none;
    width: 100%;
    box-sizing: border-box;
    padding-right: 2.25rem;
}

.input-group .input-clear {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    border-radius: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: normal;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    white-space: normal;
    transition: none;
}

/* Results grid */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.result-item--full {
    grid-column: 1 / -1;
}

.result-row {
    display: flex;
    gap: 0.75rem;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.result-half {
    flex: 1;
}

.result-item--full .result-value {
    font-size: 0.8rem;
    word-break: break-all;
}

.result-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
}

.result-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    transition: color 0.2s;
}

.result-value:hover {
    color: var(--accent);
}

.result-flags {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    grid-column: 1 / -1;
}

.flag {
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.flag.active {
    opacity: 1;
    border-color: var(--accent);
    color: var(--accent);
}

/* Vendor result card */
.result-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
}

/* "Vendor not found" notice in MAC Tools */
.vendor-notfound {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.vendor-notfound-icon {
    opacity: 0.7;
}

/* Gap above the conversion grid. It only appears for a full MAC, which always
   has the vendor card or the "not found" notice above it. */
#mac-convert-result:not(.hidden) {
    margin-top: 1.5rem;
}

.vendor-info {
    margin-bottom: 0.75rem;
}

.vendor-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.vendor-name {
    display: block;
    font-size: 1.25rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.vendor-country-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.vendor-details {
    margin: 1rem 0;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.vendor-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.9rem;
}

.vendor-detail:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    color: var(--text);
    font-weight: 500;
}

.vendor-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.vendor-cached {
    padding: 0.15rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.vendor-cached.from-cache {
    color: var(--success);
}

/* Error */
.error {
    background: rgba(199, 80, 80, 0.1);
    border: 1px solid var(--error);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: var(--error);
    font-size: 0.9rem;
}

/* Password Generator */
.password-output-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.password-output {
    flex: 1;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 1.1rem;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    letter-spacing: 1px;
}

.btn-icon {
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.strength-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.strength-bar-bg {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 75%;
    background: var(--success);
    border-radius: 3px;
    transition: all 0.3s;
}

.strength-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 80px;
}

.option-group {
    margin-bottom: 1.5rem;
}

.option-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.option-label span {
    color: var(--accent);
    font-weight: 600;
}

.slider {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    background: var(--accent-hover);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

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

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.checkbox-option:hover {
    border-color: var(--accent);
    color: var(--text);
}

.checkbox-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-option input[type="checkbox"]:checked + span {
    color: var(--text);
}

.btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: var(--bg);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Translit */
.translit-output {
    letter-spacing: normal;
}

.translit-output::placeholder {
    color: var(--text-muted);
    opacity: 0.4;
}

.translit-length {
    min-height: 1.2rem;
    margin: -0.5rem 0 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
}

.translit-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.translit-preset {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.translit-preset:hover {
    border-color: var(--accent);
    color: var(--text);
}

.translit-preset.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
    font-weight: 500;
}

.translit-settings {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

@media (max-width: 600px) {
    .translit-settings {
        grid-template-columns: repeat(2, 1fr);
    }
}

.translit-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.translit-field span {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.translit-field select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    padding: 0.2rem 0.3rem;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    min-width: 0;
}

.translit-field select:focus {
    border-color: var(--accent);
}

.translit-field--wide span {
    font-weight: 400;
    color: var(--text-muted);
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Mobile navigation: top bar + full-screen menu (shown only ≤768px) */
.mobile-bar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 300;
    align-items: center;
    gap: 0.6rem;
    height: 3.25rem;
    padding: 0 0.5rem 0 1rem;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.mobile-bar-logo {
    flex: none;
    width: 1.6rem;
    height: 1.6rem;
}

.mobile-bar-path {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 0.85rem;
    color: var(--accent);
}

.mobile-bar-btn {
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
}

.mobile-bar-btn:active {
    background: var(--bg-secondary);
}

.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    animation: menuIn 0.15s ease;
}

.mobile-menu[hidden] {
    display: none;
}

@keyframes menuIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.25rem;
    padding: 0 0.5rem 0 1rem;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.mobile-menu-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.5rem 1rem 2rem;
}

.mobile-menu-group {
    margin: 1.1rem 0 0.5rem;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mobile-menu-divider {
    height: 1px;
    margin: 1.25rem 0 0.75rem;
    background: var(--border);
}

.mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.mobile-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 3.25rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}

.mobile-tile:active {
    border-color: var(--accent);
}

.mobile-tile.active {
    border-color: var(--accent);
    color: var(--accent);
}

.mobile-tile-icon {
    flex: none;
    width: 1.3rem;
    text-align: center;
}

.mobile-tile-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-tile-badge {
    margin-left: auto;
    padding: 0 0.45rem;
    background: var(--accent);
    border-radius: 10px;
    color: var(--bg);
    font-size: 0.75rem;
    font-weight: 600;
}

.mobile-menu-feedback {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.8rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.mobile-menu-feedback:active {
    border-color: var(--accent);
}

body.menu-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .mobile-bar {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
        /* flex items don't shrink below their content by default */
        min-width: 0;
    }

    /* Opening a #tool link scrolls to its section: keep it below the bar */
    .tool-section {
        scroll-margin-top: 3.25rem;
    }

    /* The top bar is the sticky element on phones */
    .maintenance-banner {
        position: static;
        margin-left: 0;
    }

    /* No window frame on phones: the top bar already shows the path */
    .tool-section {
        padding: 1.25rem 1rem 2rem;
        background: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .tool-section::before {
        display: none;
    }

    .tool-section > .tool-header,
    .tool-section > .tool-body {
        padding: 0;
    }

    .input-group {
        flex-direction: column;
    }

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

/* DNS Lookup */
.dns-type-group {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.dns-type-btn {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.15s;
}

.dns-type-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.dns-type-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.dns-result {
    margin-top: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.dns-result-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text);
}

.dns-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.dns-records {
    padding: 0.5rem 0;
}

.dns-record {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    cursor: pointer;
    transition: background 0.1s;
}

.dns-record:last-child {
    border-bottom: none;
}

.dns-record:hover {
    background: var(--bg-tertiary);
}

.dns-record-value {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text);
    word-break: break-all;
}

.dns-record-ttl {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* User Agent */
.ua-raw-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 1rem 0 0.4rem;
}

.ua-raw {
    display: block;
    font-size: 0.8rem;
    color: var(--text);
    word-break: break-all;
    cursor: pointer;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border);
    transition: border-color 0.15s;
}

.ua-raw:hover {
    border-color: var(--accent);
}

/* Whois */
.whois-result {
    margin-top: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.whois-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text);
}

.whois-text {
    padding: 1rem;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 500px;
    overflow-y: auto;
    line-height: 1.6;
}

/* IP Map */
.map-tiles {
    filter: brightness(1.6) saturate(0.7);
}

.ip-map {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-top: 1rem;
    overflow: hidden;
}

/* About page */
.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 1.5rem;
}

.about-intro {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.about-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    margin-top: 0.25rem;
}

.about-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.about-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.about-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.about-icon {
    font-size: 1.1rem;
}

.about-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.about-card code {
    background: var(--bg-tertiary);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-size: 0.8rem;
    color: var(--accent-hover);
}


/* ── Maintenance Banner ──────────────────────────────────────────────────── */

.maintenance-banner {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #2a1f00;
    border-bottom: 1px solid #dc9632;
    color: #f0c060;
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    margin-left: var(--sidebar-width);
}

.maintenance-banner.hidden { display: none; }

.maintenance-icon { font-size: 1rem; flex-shrink: 0; }

.maintenance-text { flex: 1; }

.maintenance-text strong { font-weight: 600; }

.maintenance-close {
    background: none;
    border: none;
    color: #f0c060;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
    padding: 0 0.25rem;
    flex-shrink: 0;
}

.maintenance-close:hover { opacity: 1; }

/* ── News section ────────────────────────────────────────────────────────── */

.news-loading,
.news-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 2rem 0;
}

.news-list { display: flex; flex-direction: column; gap: 0.75rem; }

.news-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.news-card:hover { border-color: #3a3a3a; }

.news-card-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.news-card-title {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
}

.news-toggle-icon {
    color: var(--text-muted);
    font-size: 0.65rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.news-card--open .news-toggle-icon { transform: rotate(90deg); }

.news-card-body {
    display: none;
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border);
}

.news-card--open .news-card-body { display: block; }

.news-content {
    padding-top: 1rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text);
}

.news-content p { margin-bottom: 0.75rem; }
.news-content p:last-child { margin-bottom: 0; }
.news-content h1, .news-content h2, .news-content h3 {
    margin: 1rem 0 0.5rem;
    font-weight: 600;
}
.news-content ul, .news-content ol {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}
.news-content code {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.1em 0.35em;
    font-size: 0.85em;
    font-family: "SF Mono", "Monaco", monospace;
}
.news-content pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 0.75rem;
}
.news-content pre code { background: none; border: none; padding: 0; }
.news-content a { color: var(--accent-hover); }
.news-content a:hover { text-decoration: underline; }
.news-content table { width: 100%; border-collapse: collapse; margin-bottom: 0.75rem; }
.news-content th, .news-content td { padding: 0.5rem 0.75rem; border: 1px solid var(--border); }
.news-content th { background: var(--bg); font-weight: 600; }

/* News badges */
.news-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
}

.news-badge--news { background: rgba(124,152,133,0.15); color: #7c9885; }
.news-badge--changelog { background: rgba(100,130,220,0.15); color: #6482dc; }
.news-badge--maintenance { background: rgba(220,150,50,0.15); color: #dc9632; }

.news-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Sidebar news badge */
.nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    line-height: 1.4;
}

.nav-badge.hidden { display: none; }

/* ── Feedback button in sidebar ──────────────────────────────────────────── */

.feedback-open-btn {
    display: block;
    width: 100%;
    margin: 0.75rem 0 0.5rem;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    text-align: center;
}

.feedback-open-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Modal ───────────────────────────────────────────────────────────────── */

.modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.hidden { display: none; }

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.modal-box {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    z-index: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: color 0.15s;
}

.modal-close:hover { color: var(--text); }

.modal-field {
    margin-bottom: 1rem;
}

.modal-field label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.modal-input {
    display: block;
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 0.875rem;
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.modal-input:focus { border-color: var(--accent); }

select.modal-input { cursor: pointer; }

.modal-textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.6;
}

.modal-error {
    background: rgba(199, 80, 80, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 0.6rem 0.875rem;
    border-radius: 6px;
    font-size: 0.825rem;
    margin-bottom: 1rem;
}

.modal-submit {
    display: block;
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.7rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 1.25rem;
    transition: background 0.15s;
}

.modal-submit:hover:not(:disabled) { background: var(--accent-hover); }
.modal-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.modal-success {
    text-align: center;
    padding: 1.5rem 0;
}

.modal-success-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.modal-success-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.modal-success-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ── Star rating ─────────────────────────────────────────────────────────── */

.star-rating {
    display: flex;
    gap: 0.25rem;
}

.star {
    font-size: 1.75rem;
    color: var(--border);
    cursor: pointer;
    transition: color 0.1s, transform 0.1s;
    user-select: none;
    line-height: 1;
}

.star:hover,
.star.active {
    color: #f0a830;
}

.star:hover {
    transform: scale(1.15);
}
