:root {
    color-scheme: dark;
    --hub-bg: #0a0a14;
    --hub-bg-deep: #06060d;
    --hub-surface: #11111d;
    --hub-surface-raised: #151522;
    --hub-border: rgba(255, 200, 130, 0.09);
    --hub-border-strong: rgba(255, 200, 130, 0.18);
    --hub-border-warm: rgba(255, 140, 50, 0.34);
    --hub-text: #fff6e5;
    --hub-text-soft: #c5b7a0;
    --hub-text-muted: #8a7d6e;
    --hub-text-faint: #5f554b;
    --hub-saffron: #ff8c32;
    --hub-saffron-bright: #ffb562;
    --hub-saffron-deep: #e76a1a;
    --hub-success: #4ade80;
    --hub-radius-lg: 24px;
    --hub-radius-md: 18px;
    --hub-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html {
    min-width: 320px;
    background: var(--hub-bg-deep);
}

body.dashboard-page {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--hub-text);
    background:
        radial-gradient(circle at 88% -8%, rgba(255, 140, 50, 0.13), transparent 32rem),
        radial-gradient(circle at 4% 72%, rgba(244, 228, 193, 0.045), transparent 27rem),
        linear-gradient(155deg, var(--hub-bg) 0%, var(--hub-bg-deep) 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.dashboard-page::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    opacity: 0.22;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.dashboard-page a { color: inherit; }

.dashboard-shell {
    width: min(100% - 48px, 1152px);
    margin: 0 auto;
    padding: 62px 0 72px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 285px;
    gap: 64px;
    align-items: end;
    margin-bottom: 42px;
    animation: dashboard-enter 420ms ease-out both;
}

.dashboard-eyebrow,
.service-kicker,
.console-label {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.dashboard-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    color: var(--hub-saffron-bright);
    font-size: 11px;
    font-weight: 700;
}

.dashboard-eyebrow::before {
    width: 24px;
    height: 1px;
    content: "";
    background: linear-gradient(90deg, var(--hub-saffron), transparent);
}

.dashboard-title {
    max-width: 760px;
    margin: 0;
    color: var(--hub-text);
    font-size: clamp(38px, 6vw, 70px);
    font-weight: 820;
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.dashboard-title span {
    color: transparent;
    background: linear-gradient(100deg, var(--hub-saffron-bright), #f4e4c1 52%, var(--hub-saffron));
    background-clip: text;
    -webkit-background-clip: text;
}

.dashboard-description {
    max-width: 660px;
    margin: 22px 0 0;
    color: var(--hub-text-soft);
    font-size: 15px;
    line-height: 1.75;
}

.dashboard-console {
    overflow: hidden;
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-md);
    background: rgba(17, 17, 29, 0.84);
    box-shadow: var(--hub-shadow);
}

.console-header {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 15px;
    border-bottom: 1px solid var(--hub-border);
    background: rgba(255, 255, 255, 0.018);
}

.console-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--hub-text-faint);
}

.console-dot:first-child { background: var(--hub-saffron); }

.console-title {
    margin-left: auto;
    color: var(--hub-text-faint);
    font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.12em;
}

.console-rows {
    margin: 0;
    padding: 9px 16px;
}

.console-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 38px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.console-row:last-child { border-bottom: 0; }

.console-label {
    color: var(--hub-text-faint);
    font-size: 9px;
}

.console-value {
    color: var(--hub-text-soft);
    font: 600 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.console-value.is-online {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--hub-success);
}

.console-value.is-online::before {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    content: "";
    background: currentColor;
    box-shadow: 0 0 9px rgba(74, 222, 128, 0.52);
}

.service-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.service-section-title {
    margin: 0;
    color: var(--hub-text);
    font-size: 18px;
    letter-spacing: -0.02em;
}

.service-section-copy {
    margin: 0;
    color: var(--hub-text-muted);
    font-size: 12px;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    animation: dashboard-enter 440ms 80ms ease-out both;
}

.service-card {
    position: relative;
    display: flex;
    min-height: 248px;
    flex-direction: column;
    grid-column: span 4;
    overflow: hidden;
    padding: 24px;
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-lg);
    color: var(--hub-text);
    background: linear-gradient(145deg, rgba(21, 21, 34, 0.94), rgba(13, 13, 23, 0.96));
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    transform: translateY(0);
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.service-card::before {
    position: absolute;
    top: -90px;
    right: -90px;
    width: 210px;
    height: 210px;
    border-radius: 999px;
    pointer-events: none;
    content: "";
    opacity: 0;
    background: radial-gradient(circle, rgba(255, 140, 50, 0.16), transparent 68%);
    transition: opacity 180ms ease;
}

.service-card--wide { grid-column: span 7; }
.service-card--medium { grid-column: span 5; }

.service-card:hover,
.service-card:focus-visible {
    border-color: var(--hub-border-warm);
    outline: none;
    background: linear-gradient(145deg, rgba(24, 23, 36, 0.98), rgba(14, 14, 24, 0.98));
    box-shadow: 0 22px 65px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 140, 50, 0.035);
    transform: translateY(-3px);
}

.service-card:hover::before,
.service-card:focus-visible::before { opacity: 1; }

.service-card-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
}

.service-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--hub-border-strong);
    border-radius: 15px;
    color: var(--hub-saffron-bright);
    background: rgba(255, 140, 50, 0.075);
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.service-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.service-card:hover .service-icon,
.service-card:focus-visible .service-icon {
    border-color: var(--hub-border-warm);
    background: rgba(255, 140, 50, 0.12);
    transform: scale(1.04);
}

.service-kicker {
    padding-top: 3px;
    color: var(--hub-text-muted);
    font-size: 9px;
    font-weight: 700;
}

.service-card-body {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 38px;
}

.service-name {
    margin: 0;
    color: var(--hub-text);
    font-size: clamp(21px, 2.2vw, 27px);
    font-weight: 760;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.service-description {
    max-width: 520px;
    margin: 10px 0 0;
    color: var(--hub-text-muted);
    font-size: 13px;
    line-height: 1.65;
}

.service-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 22px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.service-stack {
    color: var(--hub-text-faint);
    font: 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.service-arrow {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--hub-border);
    border-radius: 10px;
    color: var(--hub-text-muted);
    transition: color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.service-arrow svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.service-card:hover .service-arrow,
.service-card:focus-visible .service-arrow {
    border-color: var(--hub-border-warm);
    color: var(--hub-saffron-bright);
    transform: translate(1px, -1px);
}

.dashboard-footnote {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 26px;
    color: var(--hub-text-faint);
    font: 9px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.dashboard-footnote::before {
    height: 1px;
    flex: 1;
    content: "";
    background: linear-gradient(90deg, var(--hub-border-strong), transparent);
}

@keyframes dashboard-enter {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .dashboard-shell { padding-top: 46px; }
    .dashboard-hero { grid-template-columns: 1fr; gap: 30px; }
    .dashboard-console { max-width: 520px; }
    .service-card,
    .service-card--wide,
    .service-card--medium { grid-column: span 6; }
}

@media (max-width: 640px) {
    .dashboard-shell {
        width: min(100% - 30px, 1152px);
        padding: 36px 0 54px;
    }
    .dashboard-title { font-size: clamp(37px, 13vw, 54px); }
    .dashboard-description { margin-top: 17px; font-size: 14px; }
    .service-section-head { align-items: start; flex-direction: column; gap: 6px; }
    .service-card,
    .service-card--wide,
    .service-card--medium {
        min-height: 230px;
        grid-column: 1 / -1;
        padding: 21px;
    }
    .service-grid { gap: 13px; }
    .dashboard-footnote { justify-content: flex-end; }
    .dashboard-footnote::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-hero,
    .service-grid { animation: none; }
    .service-card,
    .service-icon,
    .service-arrow,
    .service-card::before { transition: none; }
}

/* Shared visual treatment for the existing tools. Page structure and behavior stay in each HTML file. */
:root {
    --hub-bg: #0c0b16;
    --hub-bg-deep: #090812;
    --hub-surface: #191522;
    --hub-surface-raised: #211a2d;
    --hub-border: rgba(227,206,246,.13);
    --hub-border-strong: rgba(223,197,246,.24);
    --hub-border-warm: rgba(171,132,234,.42);
    --hub-text: #f8f6f3;
    --hub-text-soft: #c2bbca;
    --hub-text-muted: #9e96a8;
    --hub-text-faint: #777084;
    --hub-saffron: #a280e9;
    --hub-saffron-bright: #efaaa4;
    --hub-saffron-deep: #5369ff;
    --hub-shadow: 0 20px 60px rgba(0,0,0,.24);
}

body.hub-ui, body.dashboard-page.hub-ui {
    color: var(--hub-text);
    background:
        radial-gradient(ellipse 580px 400px at 92% -10%,rgba(124,94,215,.14),transparent 78%),
        radial-gradient(ellipse 500px 380px at -8% 32%,rgba(237,130,145,.06),transparent 72%),
        var(--hub-bg);
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans KR",sans-serif;
}
body.dashboard-page.hub-ui::before { display:none; }
body.hub-ui .glass {
    background: linear-gradient(150deg,rgba(29,24,40,.91),rgba(17,16,27,.94));
    border-color: var(--hub-border);
    box-shadow: var(--hub-shadow);
}
body.hub-ui .glass-hover:hover { border-color: rgba(184,148,237,.52); }
body.hub-ui > header {
    background: rgba(12,11,22,.89);
    border-bottom-color: var(--hub-border);
}
body.hub-ui main input:not([type="checkbox"]):not([type="radio"]),
body.hub-ui main textarea,
body.hub-ui main select,
body.hub-ui #editor-panel input,
body.hub-ui #editor-panel textarea {
    color: var(--hub-text);
    border-color: rgba(219,199,237,.16);
    background-color: rgba(8,8,17,.28);
}
body.hub-ui input:focus-visible,
body.hub-ui textarea:focus-visible,
body.hub-ui select:focus-visible,
body.hub-ui button:focus-visible,
body.hub-ui a:focus-visible {
    outline: 2px solid #a492ff;
    outline-offset: 2px;
}
body.hub-ui input::placeholder,body.hub-ui textarea::placeholder { color:#80798d; }
body.hub-ui .tool-input,body.hub-ui .result-box,body.hub-ui .stat { border-color: var(--hub-border); background: rgba(8,8,17,.34); }
body.hub-ui .tab-active { color:#f8f6f3; background:rgba(137,100,225,.18); border-color:rgba(171,132,234,.4); }
body.hub-ui .bg-violet-600,body.hub-ui .bg-indigo-600,
body.hub-ui #dns-button,body.hub-ui #ping-button,body.hub-ui #tcp-button,
body.hub-ui #http-button,body.hub-ui #ssl-button {
    color: #fff;
    background: linear-gradient(112deg,#ad6ed3,#6564e8);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(83,89,202,.16);
}
body.hub-ui .bg-violet-600:hover,body.hub-ui .bg-indigo-600:hover,
body.hub-ui #dns-button:hover,body.hub-ui #ping-button:hover,body.hub-ui #tcp-button:hover,
body.hub-ui #http-button:hover,body.hub-ui #ssl-button:hover { filter: brightness(1.12); }
body.hub-ui .text-violet-300,body.hub-ui .text-indigo-300 { color:#cbb4ff; }

/* The common header is generated by hub-header.js on every authenticated page. */
#hub-header .hub-topbar { background:rgba(10,9,19,.96); border-bottom-color:var(--hub-border); }
#hub-header .hub-logo { color:#fff; background:linear-gradient(135deg,#f18580,#a280e9 54%,#5369ff); box-shadow:0 5px 20px rgba(116,93,205,.26); }
#hub-header .hub-icon-btn:hover,#hub-header .hub-text-btn:hover { border-color:rgba(171,132,234,.45); }
#hub-header .hub-menu-panel { background:#191522; border-color:var(--hub-border-strong); }
#hub-header .hub-menu-link:hover { background:#2a2237; }
#hub-header .hub-public-row b { color:#ab9dfb; }

body.hub-ui .browser-card,body.hub-ui .notice-card,body.hub-ui .vpn-card,body.hub-ui .panel {
    background:linear-gradient(150deg,#1d1828,#111019 82%);
    border-color:var(--hub-border);
}
body.hub-ui .browser-icon { color:#d5b3e7; background:linear-gradient(135deg,rgba(241,133,128,.17),rgba(83,105,255,.15)); }
body.hub-ui .primary,body.hub-ui .manage { color:#fff; border-color:#a280e9; background:linear-gradient(110deg,#aa79cf,#6163dc); }
body.hub-ui .tool-kicker,body.hub-ui .kicker,body.hub-ui .protocol { color:#d9a3cf; }
body.hub-ui .mode.recommended { border-color:rgba(171,132,234,.42); }

body.login-page .glow { background:radial-gradient(circle,rgba(139,98,223,.38),transparent 64%) !important; }
body.login-page .glow:last-child { background:radial-gradient(circle,rgba(241,133,128,.27),transparent 64%) !important; }
body.login-page .glass { border-color:var(--hub-border-strong); }
body.login-page #login-brand { color:white; background:linear-gradient(135deg,#f18580,#a280e9 58%,#5369ff); box-shadow:0 9px 25px rgba(115,87,207,.24); }
body.login-page #btn { color:white; background:linear-gradient(105deg,#e0889c,#a477d8,#6268e9); box-shadow:0 10px 28px rgba(112,94,210,.2); }
body.login-page input:focus { border-color:#a280e9; }

@media(max-width:640px) {
    body.hub-ui .glass { border-radius:18px; }
    body.hub-ui main { scroll-margin-top:110px; }
}
@media(prefers-reduced-motion:reduce) {
    body.hub-ui *,body.hub-ui *::before,body.hub-ui *::after { animation-duration:.01ms!important; transition-duration:.01ms!important; }
}
