:root {
    color-scheme: dark;
    --background: #020706;
    --panel: #06110f;
    --panel-raised: #091915;
    --panel-soft: #0b211b;
    --green: #62ffad;
    --green-bright: #d9ffeb;
    --green-muted: #5a9278;
    --green-dark: #193f31;
    --amber: #ffc368;
    --red: #ff5369;
    --line: rgba(98, 255, 173, 0.2);
    --line-strong: rgba(98, 255, 173, 0.42);
    font-family: "Cascadia Mono", "Courier New", Courier, monospace;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    color: var(--green);
    background:
        radial-gradient(circle at 75% 5%, #0b271e 0, transparent 36%),
        radial-gradient(circle at 15% 80%, #071a15 0, transparent 38%),
        var(--background);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 3px,
        rgba(0, 0, 0, 0.2) 4px
    );
}

.noise {
    position: fixed;
    inset: 0;
    opacity: 0.045;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.shell {
    width: 100vw;
    height: 100vh;
    position: relative;
    z-index: 1;
    padding-bottom: 3px;
}

.identity-panel {
    position: absolute;
    inset: 0;
    min-height: 0;
    overflow: hidden;
    background: #030503;
}

.login-vignette,
.login-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.login-vignette {
    z-index: 1;
    background: radial-gradient(ellipse 60% 55% at 50% 46%, transparent 0%, rgba(3, 5, 3, 0.55) 55%, rgba(3, 5, 3, 0.96) 100%);
}

.login-scanlines {
    z-index: 2;
    opacity: 0.4;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 2px, rgba(0, 0, 0, 0.3) 3px);
    mix-blend-mode: multiply;
}

.login-stage {
    position: relative;
    z-index: 4;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 34px 20px 76px;
    text-align: center;
}

.login-as0-mark {
    margin-bottom: 5px;
    color: var(--green-bright);
    font-size: 1.38rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    opacity: 1;
    animation: none;
}

.login-as0-mark span,
.login-kicker span,
.login-prompt > span {
    color: var(--amber);
}

.login-kicker {
    margin-bottom: 12px;
    color: var(--green-muted);
    font-size: 0.75rem;
    letter-spacing: 0.36em;
    line-height: 1.6;
    opacity: 1;
    animation: none;
}

.login-title {
    position: relative;
    margin: 0;
    color: var(--green-bright);
    font-size: clamp(3.25rem, 9vw, 4.1rem);
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.05;
    text-align: center;
    text-shadow: -1px -1px 0 #1b2320, 1px -1px 0 #1b2320, -1px 1px 0 #1b2320, 1px 1px 0 #1b2320, 0 0 30px rgba(79, 224, 163, 0.35), 0 0 80px rgba(79, 224, 163, 0.15);
    opacity: 1;
    animation: none;
}

.login-title > span {
    color: var(--amber);
}

.login-title::before,
.login-title::after {
    display: none;
    content: none;
}

.login-title::before {
    color: #ff5f7a;
    opacity: 0.6;
    animation: login-glitch-top 0.3s infinite linear;
}

.login-title::after {
    color: #4dd6ff;
    opacity: 0.6;
    animation: login-glitch-bottom 0.7s infinite linear;
}

.login-subtitle {
    margin: 12px 0 0;
    color: var(--green-muted);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    opacity: 1;
    animation: none;
}

.login-form {
    display: grid;
    justify-items: center;
    margin-top: 52px;
    opacity: 1;
    animation: none;
}

.login-prompt {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--green-muted);
    font-size: 1.15rem;
    letter-spacing: 0.04em;
}

.login-prompt + .login-prompt {
    margin-top: 10px;
}

.login-prompt i {
    color: var(--green-muted);
    font-style: normal;
}

.login-prompt input {
    width: min(260px, 42vw);
    padding: 3px 2px 5px;
    border: 0;
    border-bottom: 1px solid var(--green-muted);
    outline: 0;
    color: var(--green-bright);
    background: transparent;
    caret-color: var(--green-bright);
    font: inherit;
}

.login-prompt input::placeholder {
    color: rgba(207, 232, 221, 0.22);
}

.login-submit {
    margin-top: 17px;
    padding: 4px 7px;
    border: 0;
    color: var(--green-muted);
    background: transparent;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
}

.login-submit kbd {
    padding: 1px 6px;
    border: 1px solid var(--green-muted);
    border-radius: 2px;
    color: var(--green-bright);
    font: inherit;
}

.login-submit:hover,
.login-submit:focus-visible {
    color: var(--green-bright);
    outline: none;
}

.form-error {
    min-height: 1.2em;
    margin: 12px 0 0;
    color: var(--red);
    font-size: 0.75rem;
}

.login-corner {
    position: absolute;
    z-index: 5;
    color: var(--green-muted);
    font-size: 0.62rem;
    letter-spacing: 0.15em;
}

.login-corner span {
    color: var(--amber);
}

.login-corner-tl { top: 22px; left: 26px; }
.login-corner-tr { top: 22px; right: 26px; text-align: right; }
.login-corner-bl { bottom: 22px; left: 26px; }
.login-corner-br { right: 26px; bottom: 22px; text-align: right; }

.studio-logo {
    position: absolute;
    bottom: 43px;
    left: 26px;
    z-index: 6;
    width: 62px;
    height: auto;
    opacity: 0.62;
    mix-blend-mode: screen;
    filter: saturate(0.75) brightness(0.82);
}

@keyframes login-fade-in {
    to { opacity: 1; }
}

@keyframes login-flicker {
    0%, 93%, 100% { opacity: 0; }
    94% { opacity: 1; }
    95% { opacity: 0; }
    96% { opacity: 0.6; }
    97% { opacity: 0; }
}

@keyframes login-glitch-top {
    0%, 89%, 100% { clip-path: inset(0 0 100% 0); transform: translate(0, 0); }
    90% { clip-path: inset(0 0 45% 0); transform: translate(-3px, -1px); }
    91% { clip-path: inset(30% 0 20% 0); transform: translate(3px, 1px); }
    92% { clip-path: inset(0 0 100% 0); transform: translate(0, 0); }
}

@keyframes login-glitch-bottom {
    0%, 84%, 100% { clip-path: inset(100% 0 0 0); transform: translate(0, 0); }
    85% { clip-path: inset(55% 0 0 0); transform: translate(3px, 1px); }
    86% { clip-path: inset(20% 0 35% 0); transform: translate(-2px, -1px); }
    87% { clip-path: inset(100% 0 0 0); transform: translate(0, 0); }
}

.terminal-panel {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: rgba(2, 8, 7, 0.96);
}

.app-topbar {
    min-height: 56px;
    display: grid;
    grid-template-areas: "brand resources spacer state";
    grid-template-columns: 232px max-content minmax(20px, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 6px 16px;
    border-bottom: 1px solid var(--line-strong);
    background: rgba(5, 17, 14, 0.98);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.22);
}

.brand-lockup {
    grid-area: brand;
}

.brand-lockup strong {
    display: block;
    color: var(--green-bright);
    font-size: 0.94rem;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.brand-lockup em {
    color: var(--green);
    font-style: normal;
}

.brand-lockup span,
.phase-readout span,
.resource-strip span {
    display: block;
    margin-top: 2px;
    color: var(--green-muted);
    font-size: 0.72rem;
    letter-spacing: 0.13em;
}

.resource-strip {
    grid-area: resources;
    display: grid;
    grid-template-columns: repeat(4, minmax(84px, auto));
    gap: 10px;
}

.resource-strip strong {
    display: block;
    margin-top: 1px;
    color: var(--green-bright);
    font-size: 0.92rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.phase-readout {
    grid-area: state;
    text-align: right;
}

.phase-readout strong {
    display: block;
    margin-top: 2px;
    color: var(--amber);
    font-size: 0.86rem;
    font-weight: 500;
}

.application-body {
    min-height: 0;
    display: grid;
    grid-template-columns: 70px minmax(440px, 1fr) minmax(240px, 18vw);
}

.view-rail {
    min-height: 0;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-right: 1px solid var(--line);
    background: #030b09;
}

.view-button {
    min-height: 50px;
    display: grid;
    place-items: center;
    gap: 2px;
    padding: 5px 3px;
    border: 1px solid transparent;
    color: #527765;
    background: transparent;
}

.view-button span {
    font-size: 1rem;
}

.view-button small {
    font-size: 0.58rem;
    letter-spacing: 0.1em;
}

.view-button:hover,
.view-button:focus-visible {
    color: var(--green-bright);
    border-color: var(--line);
    outline: none;
}

.view-button.active {
    color: var(--green);
    border-color: var(--line-strong);
    background: rgba(98, 255, 173, 0.08);
    box-shadow: inset 3px 0 var(--green);
}

.primary-column {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.context-bar {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    color: var(--green-muted);
    background: rgba(5, 15, 13, 0.78);
    font-size: 0.78rem;
    white-space: nowrap;
}

.context-bar i {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 11px var(--green);
}

.context-bar strong {
    color: var(--green-bright);
    font-weight: 500;
}

.view-stack {
    min-height: 0;
    position: relative;
}

.app-view {
    position: absolute;
    inset: 0;
    display: none;
}

.app-view.active {
    display: block;
}

.terminal-output {
    height: 100%;
    overflow-y: auto;
    padding: 24px;
    color: #acd8c6;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(74, 230, 180, 0.012) 0,
        rgba(74, 230, 180, 0.012) 1px,
        transparent 1px,
        transparent 4px
    );
    font-size: 0.88rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

.terminal-output p {
    margin: 0 0 14px;
}

.terminal-output .submitted {
    color: var(--green-bright);
}

.terminal-output .error {
    color: var(--red);
}

.terminal-output .system-event {
    color: var(--green);
}

.command-activity {
    --depth-progress: 0%;
    margin: 2px 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    color: var(--green);
    background: rgba(98, 255, 173, 0.035);
}

.command-activity.pivot {
    border-color: rgba(255, 195, 104, 0.35);
    color: var(--amber);
    background: rgba(255, 195, 104, 0.035);
}

.command-activity-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
}

.command-activity-detail {
    margin-top: 6px;
    color: var(--green-muted);
    font-size: 0.72rem;
}

.command-activity-metrics {
    margin-top: 7px;
    color: currentColor;
    font-size: 0.68rem;
    letter-spacing: 0.055em;
}

.command-activity-depth {
    display: grid;
    grid-template-rows: auto 30px auto;
    justify-items: start;
    margin: 11px 0 9px 4px;
}

.command-activity-depth > div {
    min-width: 150px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 4px 7px;
    border: 1px solid rgba(255, 195, 104, 0.28);
    background: rgba(255, 195, 104, 0.035);
}

.command-activity-depth span {
    color: #8e7654;
    font-size: 0.56rem;
    letter-spacing: 0.08em;
}

.command-activity-depth strong {
    color: var(--amber);
    font-size: 0.7rem;
    font-weight: 500;
}

.command-activity-depth > i {
    position: relative;
    width: 1px;
    height: 30px;
    margin-left: 16px;
    overflow: hidden;
    background: rgba(255, 195, 104, 0.2);
}

.command-activity-depth > i b {
    position: absolute;
    inset: 0 0 auto;
    height: var(--depth-progress);
    background: var(--amber);
    box-shadow: 0 0 8px var(--amber);
    transition: height 220ms linear;
}

.command-activity-track {
    height: 3px;
    margin-top: 9px;
    overflow: hidden;
    background: #17251f;
    border: 0;
}

.command-activity-track i {
    width: 0;
    height: 100%;
    display: block;
    background: currentColor;
    transition: width 220ms linear;
}

.command-activity.complete {
    border-color: rgba(98, 255, 173, 0.62);
}

.command-activity.interrupted {
    border-color: rgba(255, 79, 101, 0.62);
    color: var(--red);
}

.command-line {
    min-height: 58px;
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    border-top: 1px solid var(--line-strong);
    background: #05100d;
}

.command-line label {
    color: var(--green);
    font-size: 0.85rem;
    white-space: nowrap;
}

.command-line input {
    width: 100%;
    padding: 10px 8px;
    border: 0;
    outline: 0;
    color: var(--green-bright);
    background: transparent;
    caret-color: var(--red);
}

.command-line > span {
    color: #436653;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
}

.operations-sidebar {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    border-left: 1px solid var(--line);
    background: rgba(5, 15, 13, 0.95);
}

.terminal-output,
.network-view,
.map-view,
.help-navigation,
.help-content,
.operations-sidebar,
.management-dialog-body {
    scrollbar-width: none;
}

.terminal-output::-webkit-scrollbar,
.network-view::-webkit-scrollbar,
.map-view::-webkit-scrollbar,
.help-navigation::-webkit-scrollbar,
.help-content::-webkit-scrollbar,
.operations-sidebar::-webkit-scrollbar,
.management-dialog-body::-webkit-scrollbar {
    display: none;
}

.operations-sidebar section {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.sidebar-heading {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}

.sidebar-heading span,
.intrusion-section > span {
    color: var(--green-muted);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
}

.sidebar-heading strong {
    overflow: hidden;
    color: #8fc9b2;
    font-size: 0.72rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-topology {
    width: 100%;
    margin-top: 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 0;
    color: inherit;
    background: transparent;
    text-align: left;
}

.compact-topology:hover .topology-layer,
.compact-topology:focus-visible .topology-layer {
    border-color: var(--line-strong);
}

.compact-topology:focus-visible {
    outline: 1px solid var(--green);
    outline-offset: 5px;
}

.topology-layer {
    min-height: 34px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: stretch;
    border: 1px solid var(--line);
    background: rgba(98, 255, 173, 0.025);
    transition: border-color 120ms ease, background 120ms ease;
}

.topology-layer.current {
    border-color: rgba(255, 195, 104, 0.75);
    background: rgba(255, 195, 104, 0.08);
    box-shadow: inset 3px 0 var(--amber);
}

.topology-layer.unknown {
    border-style: dashed;
    opacity: 0.48;
}

.topology-layer-number {
    display: grid;
    place-items: center;
    border-right: 1px solid var(--line);
    color: var(--green-muted);
    font-size: 0.72rem;
}

.topology-layer.current .topology-layer-number {
    color: var(--amber);
}

.topology-node-list {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    align-items: center;
    padding: 3px;
}

.topology-node-list.full-layer {
    grid-template-columns: 1fr;
}

.topology-node,
.topology-empty {
    min-width: 0;
    padding: 4px;
    overflow: hidden;
    color: #b4e5d1;
    background: var(--panel-soft);
    font-size: 0.68rem;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topology-node strong {
    color: var(--green);
    font-weight: 500;
}

.topology-empty {
    color: #416353;
    background: transparent;
    border: 1px dashed rgba(98, 255, 173, 0.13);
}

.topology-unknown {
    grid-column: 1 / -1;
    color: #4e7564;
    font-size: 0.68rem;
    text-align: center;
    letter-spacing: 0.13em;
}

.large-timer {
    margin-top: 8px;
    color: var(--amber);
    font-size: 1.55rem;
    font-variant-numeric: tabular-nums;
}

.progress-track {
    height: 5px;
    margin-top: 10px;
    overflow: hidden;
    background: #17251f;
}

.progress-track i {
    width: 0;
    height: 100%;
    display: block;
    background: var(--green);
    transition: width 240ms linear;
}

#trace-progress {
    background: var(--amber);
}

.status-value {
    margin-top: 10px;
    color: var(--green-bright);
    font-size: 0.82rem;
}

.status-detail {
    margin-top: 5px;
    color: var(--green-muted);
    font-size: 0.74rem;
}

.crafting-jobs {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.crafting-job {
    min-width: 0;
}

.crafting-job-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--green-bright);
    font-size: 0.72rem;
}

.crafting-job-header strong {
    overflow: hidden;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crafting-job-header span {
    flex: none;
    color: var(--amber);
    font-variant-numeric: tabular-nums;
}

#crafting-panel .progress-track i {
    background: var(--amber);
}

.intrusion-section {
    color: var(--red);
    background: rgba(255, 83, 105, 0.08);
    animation: alert-pulse 1s steps(2, end) infinite;
}

.intrusion-section > span {
    color: #b75c69;
}

.intrusion-section strong {
    display: block;
    margin-top: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.06em;
}

.network-view {
    overflow-y: auto;
    padding: 16px 20px;
    background:
        linear-gradient(rgba(98, 255, 173, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(98, 255, 173, 0.025) 1px, transparent 1px);
    background-size: 28px 28px;
}

.network-view-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.network-view-heading > div > span,
.network-view-meta span {
    color: var(--green-muted);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
}

.network-view h2 {
    margin: 5px 0 0;
    color: var(--green-bright);
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.network-view-meta {
    text-align: right;
}

.network-view-meta strong,
.network-view-meta span {
    display: block;
}

.network-view-meta strong {
    color: var(--green);
    font-size: 0.88rem;
    font-weight: 500;
}

.network-view-meta span {
    margin-top: 5px;
}

#upgrade-network {
    align-self: center;
    padding: 7px 9px;
    border: 1px solid var(--green-dark);
    color: var(--green);
    background: rgba(98, 255, 173, 0.05);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

#upgrade-network:hover,
#upgrade-network:focus-visible {
    border-color: var(--green);
    outline: none;
}

.map-view {
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    background:
        radial-gradient(circle at 45% 35%, rgba(17, 78, 57, 0.16), transparent 38%),
        linear-gradient(rgba(98, 255, 173, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(98, 255, 173, 0.018) 1px, transparent 1px),
        #020806;
    background-size: auto, 24px 24px, 24px 24px, auto;
}

.map-view.active {
    display: grid;
}

.map-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(480px, 1fr) minmax(210px, 25%);
}

.world-regions {
    min-height: 0;
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(230px, 1fr));
    grid-template-rows: repeat(2, minmax(230px, 1fr));
    gap: 8px;
    padding: 10px;
    overflow-y: auto;
    isolation: isolate;
    scrollbar-width: none;
}

.world-regions::-webkit-scrollbar {
    display: none;
}

.map-region {
    min-width: 0;
    min-height: 0;
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--line);
    background: rgba(3, 14, 11, 0.78);
    box-shadow: inset 0 0 28px rgba(42, 167, 111, 0.035);
}

.map-region > header {
    position: relative;
    z-index: 40;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 7px 9px;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 28, 22, 0.72);
}

.map-region > header span,
.map-region > header > strong {
    color: var(--green-muted);
    font-size: 0.52rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

.map-region > header h3 {
    margin: 2px 0 0;
    color: var(--green-bright);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.map-region-canvas {
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 3px,
        rgba(98, 255, 173, 0.014) 4px
    );
}

.map-region-canvas > svg {
    position: absolute;
    inset: 8% 5%;
    width: 90%;
    height: 84%;
    filter: drop-shadow(0 0 8px rgba(98, 255, 173, 0.09));
}

.map-landmass {
    fill: rgba(36, 113, 83, 0.28);
    stroke: rgba(98, 255, 173, 0.56);
    stroke-width: 0.45;
    vector-effect: non-scaling-stroke;
}

.world-link-layer {
    position: absolute;
    z-index: 20;
    top: 0;
    left: 0;
    display: block;
    pointer-events: none;
    overflow: visible;
}

.map-data-link {
    fill: none;
    stroke: rgba(98, 255, 173, 0.3);
    stroke-width: 1.1;
    stroke-dasharray: 3 7;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 3px rgba(98, 255, 173, 0.28));
    animation: map-wire-flow 10s linear infinite;
    animation-delay: var(--wire-delay, 0s);
    transition:
        opacity 140ms ease,
        stroke 140ms ease,
        stroke-width 140ms ease,
        filter 140ms ease;
}

.map-data-link-interregion {
    stroke: rgba(98, 255, 173, 0.48);
    stroke-width: 1.35;
    stroke-dasharray: 2 6;
}

.map-data-link.active {
    stroke: var(--amber);
    stroke-width: 2.1;
    stroke-dasharray: 4 5;
    filter: drop-shadow(0 0 7px rgba(255, 195, 104, 0.68));
    animation-duration: 2.2s;
}

.map-country {
    position: absolute;
    z-index: 30;
    max-width: 34%;
    padding: 3px 5px 3px 14px;
    transform: translate(-7px, -50%);
    border: 1px solid rgba(98, 255, 173, 0.24);
    color: #9bcab6;
    background: rgba(2, 10, 8, 0.88);
    font: inherit;
    font-size: 0.53rem;
    line-height: 1.18;
    text-align: left;
    text-transform: uppercase;
    transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.map-country i {
    position: absolute;
    top: 50%;
    left: 5px;
    width: 5px;
    height: 5px;
    transform: translateY(-50%);
    border: 1px solid var(--green-muted);
    border-radius: 50%;
    background: #03100c;
}

.map-country:hover,
.map-country:focus-visible,
.map-country.selected {
    z-index: 35;
    border-color: var(--green);
    outline: none;
    color: var(--green-bright);
    background: rgba(9, 34, 26, 0.96);
}

.map-country.connected {
    border-color: rgba(255, 195, 104, 0.62);
    color: #f1d3a1;
    box-shadow: 0 0 11px rgba(255, 195, 104, 0.1);
}

.map-country.connected i {
    border-color: var(--amber);
    box-shadow: 0 0 7px rgba(255, 195, 104, 0.52);
}

.map-country.known i {
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

.map-country.owned {
    border-color: rgba(255, 195, 104, 0.62);
    color: #ffe2ae;
}

.map-country.owned i {
    border-color: var(--amber);
    background: var(--amber);
    box-shadow: 0 0 9px var(--amber);
}

.map-country.gateway {
    border-color: var(--red);
    color: #ffc0c8;
    box-shadow: inset 2px 0 var(--red);
}

.map-country.gateway i {
    border-color: var(--red);
    background: var(--red);
    box-shadow: 0 0 10px var(--red);
}

.map-country-intel {
    min-width: 0;
    min-height: 0;
    padding: 14px;
    overflow-y: auto;
    border-left: 1px solid var(--line);
    background: rgba(4, 16, 13, 0.94);
    scrollbar-width: none;
}

.map-country-intel::-webkit-scrollbar {
    display: none;
}

.map-intel-kicker {
    color: var(--green-muted);
    font-size: 0.58rem;
    letter-spacing: 0.11em;
}

.map-country-intel h3 {
    margin: 6px 0 10px;
    color: var(--green-bright);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.25;
    text-transform: uppercase;
}

.map-intel-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 18px;
}

.map-intel-flags span {
    padding: 3px 5px;
    border: 1px solid rgba(255, 195, 104, 0.4);
    color: var(--amber);
    font-size: 0.5rem;
    letter-spacing: 0.07em;
}

.map-intel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 13px 0;
    background: var(--line);
}

.map-intel-grid > div {
    min-width: 0;
    padding: 8px;
    background: #06120f;
}

.map-intel-grid dt,
.map-intel-section h4 {
    color: var(--green-muted);
    font-size: 0.52rem;
    letter-spacing: 0.1em;
}

.map-intel-grid dd {
    margin: 5px 0 0;
    overflow: hidden;
    color: #a9dbc6;
    font-size: 0.66rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-intel-section {
    margin-top: 13px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.map-intel-section h4 {
    margin: 0 0 7px;
    font-weight: 500;
}

.map-intel-section ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.map-intel-section li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0;
    color: #8dbca9;
    font-size: 0.62rem;
}

.map-intel-section li strong {
    color: var(--green-bright);
    font-weight: 500;
}

.map-intel-section li span {
    color: var(--amber);
    text-align: right;
}

.map-intel-section .map-intel-empty {
    color: #456858;
    letter-spacing: 0.06em;
}

.map-survey-hint {
    margin-top: 14px;
    padding: 8px;
    border: 1px solid var(--line);
    color: var(--green-muted);
    background: rgba(98, 255, 173, 0.025);
    font-size: 0.57rem;
    line-height: 1.4;
}

.full-topology {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 13px;
}

.help-view {
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    background:
        linear-gradient(rgba(98, 255, 173, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(98, 255, 173, 0.018) 1px, transparent 1px),
        #030a08;
    background-size: 28px 28px;
}

.help-view.active {
    display: grid;
}

.help-view-heading {
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(210px, 1fr) minmax(260px, 420px) minmax(120px, auto);
    gap: 22px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line-strong);
    background: rgba(5, 17, 14, 0.96);
}

.help-view-heading > div > span,
.help-search > span {
    display: block;
    color: var(--green-muted);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
}

.help-view-heading h2 {
    margin: 5px 0 0;
    color: var(--green-bright);
    font-size: 1.08rem;
    font-weight: 500;
    letter-spacing: 0.06em;
}

.help-view-heading > strong {
    color: var(--green-muted);
    font-size: 0.68rem;
    font-weight: 500;
    text-align: right;
    letter-spacing: 0.08em;
}

.help-search input {
    width: 100%;
    margin-top: 5px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 0;
    outline: 0;
    color: var(--green-bright);
    background: #020705;
    font: inherit;
    font-size: 0.76rem;
    caret-color: var(--red);
}

.help-search input:focus {
    border-color: var(--green);
    box-shadow: inset 3px 0 var(--green);
}

.help-search input::placeholder {
    color: #416353;
}

.help-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
}

.help-navigation {
    min-height: 0;
    padding: 10px;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    background: rgba(3, 11, 9, 0.94);
}

.help-nav-button {
    width: 100%;
    display: block;
    padding: 10px 11px;
    border: 1px solid transparent;
    color: var(--green-muted);
    background: transparent;
    text-align: left;
}

.help-nav-button + .help-nav-button {
    margin-top: 4px;
}

.help-nav-button span,
.help-nav-button strong {
    display: block;
}

.help-nav-button span {
    font-size: 0.58rem;
    letter-spacing: 0.14em;
}

.help-nav-button strong {
    margin-top: 4px;
    color: #8dbba8;
    font-size: 0.72rem;
    font-weight: 500;
}

.help-nav-button:hover,
.help-nav-button:focus-visible {
    border-color: var(--line);
    outline: 0;
    color: var(--green);
}

.help-nav-button.active {
    border-color: var(--line-strong);
    color: var(--green);
    background: rgba(98, 255, 173, 0.07);
    box-shadow: inset 3px 0 var(--green);
}

.help-nav-button.active strong {
    color: var(--green-bright);
}

.help-content {
    min-height: 0;
    padding: 24px clamp(20px, 3vw, 42px) 44px;
    overflow-y: auto;
}

.help-page-header {
    max-width: 880px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.help-page-header > span {
    color: var(--green);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
}

.help-page-header h2 {
    margin: 7px 0 8px;
    color: var(--green-bright);
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 400;
    letter-spacing: 0.025em;
}

.help-page-header p {
    max-width: 780px;
    margin: 0;
    color: #8eb6a6;
    font-size: 0.83rem;
    line-height: 1.65;
}

.help-topic-sections {
    max-width: 920px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.help-topic-section {
    padding: 16px 17px;
    border: 1px solid var(--line);
    background: rgba(5, 17, 14, 0.88);
}

.help-topic-section h3,
.help-result-heading {
    margin: 0 0 11px;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.help-topic-section p,
.help-list {
    color: #9bc4b3;
    font-size: 0.76rem;
    line-height: 1.62;
}

.help-topic-section p {
    margin: 0 0 10px;
}

.help-list {
    margin: 0;
    padding-left: 18px;
}

.help-list li + li {
    margin-top: 8px;
}

.help-list li::marker {
    color: var(--green);
}

.help-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 15px 0;
    padding-bottom: 4px;
}

.help-filter-button {
    flex: 1 1 auto;
    min-width: max-content;
    padding: 7px 9px;
    border: 1px solid var(--line);
    color: var(--green-muted);
    background: rgba(5, 17, 14, 0.86);
    font-size: 0.62rem;
    letter-spacing: 0.07em;
}

.help-filter-button:hover,
.help-filter-button:focus-visible,
.help-filter-button.active {
    border-color: var(--green-dark);
    outline: 0;
    color: var(--green-bright);
}

.help-filter-button.active {
    background: rgba(98, 255, 173, 0.09);
}

.help-card-list {
    max-width: 960px;
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.help-card {
    border: 1px solid var(--line);
    background: rgba(5, 17, 14, 0.9);
}

.help-card[open] {
    border-color: var(--line-strong);
}

.help-card summary {
    min-height: 64px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 18px;
    gap: 18px;
    align-items: center;
    padding: 11px 14px;
    cursor: pointer;
    list-style: none;
}

.help-card summary::-webkit-details-marker {
    display: none;
}

.help-card summary::before {
    content: "+";
    width: 18px;
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    color: var(--green-muted);
    text-align: center;
}

.help-card[open] summary::before {
    content: "−";
    color: var(--green);
}

.help-card-identity {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
}

.help-card-identity > code,
.help-card-identity > strong,
.help-card-identity > span {
    display: block;
}

.help-command-path,
.help-node-name {
    color: var(--green-bright);
    font-size: 0.82rem;
    font-weight: 500;
}

.help-command-path {
    width: fit-content;
    padding: 2px 5px;
    color: var(--green);
    background: rgba(98, 255, 173, 0.07);
}

.help-card-summary {
    margin-top: 5px;
    overflow: hidden;
    color: #7ea492;
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.help-card-badges {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    gap: 5px;
    align-items: center;
}

.help-badge {
    padding: 4px 6px;
    border: 1px solid #29473a;
    color: #719482;
    font-size: 0.56rem;
    white-space: nowrap;
    letter-spacing: 0.07em;
}

.help-badge.ready {
    border-color: var(--green-dark);
    color: var(--green);
}

.help-badge.pending {
    border-color: rgba(255, 195, 104, 0.35);
    color: var(--amber);
}

.help-badge.development {
    border-color: rgba(255, 83, 105, 0.35);
    color: var(--red);
}

.help-badge.unlock {
    color: #a8d4c1;
}

.help-card-body {
    padding: 0 15px 16px;
    border-top: 1px solid var(--line);
    color: #9bc4b3;
    font-size: 0.74rem;
    line-height: 1.58;
}

.help-card-body > p {
    margin: 14px 0;
}

.help-card-body h4 {
    margin: 15px 0 7px;
    color: var(--green-muted);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.12em;
}

.help-code-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.help-code-list code {
    padding: 5px 7px;
    border: 1px solid var(--line);
    color: var(--green-bright);
    background: #020705;
    font-size: 0.7rem;
}

.help-node-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.help-node-facts > div {
    padding: 9px;
    border: 1px solid var(--line);
}

.help-node-facts span,
.help-node-facts strong {
    display: block;
}

.help-node-facts span {
    color: var(--green-muted);
    font-size: 0.58rem;
    letter-spacing: 0.12em;
}

.help-node-facts strong {
    margin-top: 4px;
    color: #acd8c6;
    font-size: 0.7rem;
    font-weight: 500;
}

.help-muted {
    color: var(--green-muted);
}

.help-result-heading {
    max-width: 960px;
    margin-top: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.help-search-topic {
    width: 100%;
    max-width: 960px;
    display: block;
    padding: 13px 15px;
    border: 1px solid var(--line);
    color: inherit;
    background: rgba(5, 17, 14, 0.9);
    text-align: left;
}

.help-search-topic + .help-search-topic {
    margin-top: 7px;
}

.help-search-topic:hover,
.help-search-topic:focus-visible {
    border-color: var(--line-strong);
    outline: 0;
}

.help-search-topic span,
.help-search-topic strong {
    display: block;
}

.help-search-topic span {
    color: var(--green-muted);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
}

.help-search-topic strong {
    margin-top: 5px;
    color: var(--green-bright);
    font-size: 0.82rem;
    font-weight: 500;
}

.help-search-topic p {
    margin: 6px 0 0;
    color: #7ea492;
    font-size: 0.7rem;
    line-height: 1.5;
}

.help-empty {
    padding: 24px;
    border: 1px dashed var(--line);
    color: var(--green-muted);
    font-size: 0.75rem;
    text-align: center;
    letter-spacing: 0.08em;
}

.architecture-layer {
    min-height: 108px;
    display: grid;
    grid-template-rows: auto 1fr;
    border: 1px solid var(--line);
    background: rgba(5, 17, 14, 0.92);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.architecture-layer.core {
    border-color: rgba(255, 195, 104, 0.55);
}

.architecture-layer-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 9px;
    border-bottom: 1px solid var(--line);
    color: var(--green-muted);
    font-size: 0.72rem;
}

.architecture-layer.core .architecture-layer-header {
    color: var(--amber);
}

.architecture-slots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
}

.architecture-slots.full-layer {
    grid-template-columns: 1fr;
}

.architecture-node,
.architecture-empty {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
    padding: 8px;
    border: 1px solid transparent;
    background: var(--panel-soft);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.architecture-node:hover,
.architecture-node:focus-visible,
.architecture-empty:hover,
.architecture-empty:focus-visible {
    border-color: var(--green);
    outline: none;
    box-shadow: 0 0 18px rgba(98, 255, 173, 0.08);
}

.architecture-node.placement-target,
.architecture-empty.placement-target {
    border-color: var(--amber);
    background: rgba(255, 195, 104, 0.09);
    box-shadow: inset 0 0 0 1px rgba(255, 195, 104, 0.24);
    animation: placement-pulse 1.2s ease-in-out infinite;
}

.architecture-node.placement-disabled,
.architecture-empty.placement-disabled {
    cursor: default;
    opacity: 0.34;
}

.architecture-node strong {
    color: var(--green-bright);
    font-size: 0.78rem;
    font-weight: 500;
}

.architecture-node span {
    color: var(--green-muted);
    font-size: 0.68rem;
}

.architecture-empty {
    justify-content: center;
    align-items: center;
    border-color: rgba(98, 255, 173, 0.13);
    border-style: dashed;
    color: #426554;
    font-size: 0.7rem;
}

.management-dialog {
    width: min(620px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 32px));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    color: var(--green-bright);
    background: #06110f;
    box-shadow: 0 25px 90px rgba(0, 0, 0, 0.68);
}

.management-dialog::backdrop {
    background: rgba(0, 5, 4, 0.78);
    backdrop-filter: blur(3px);
}

.management-dialog-header,
.management-dialog-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    background: #081713;
}

.management-dialog-header span {
    color: var(--green-muted);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
}

.management-dialog-header h2 {
    margin: 5px 0 0;
    color: var(--green-bright);
    font-size: 1rem;
    font-weight: 500;
}

.management-dialog-header button {
    width: 36px;
    height: 36px;
    border: 1px solid transparent;
    color: var(--green-muted);
    background: transparent;
    font-size: 1.4rem;
}

.management-dialog-header button:hover,
.management-dialog-header button:focus-visible {
    border-color: var(--line);
    color: var(--green-bright);
    outline: none;
}

.management-dialog-body {
    max-height: 540px;
    padding: 18px;
    overflow-y: auto;
}

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

.management-options button,
.management-name-group button,
.management-dialog-actions button {
    padding: 10px 12px;
    border: 1px solid var(--green-dark);
    color: var(--green);
    background: rgba(98, 255, 173, 0.05);
    font-size: 0.76rem;
    letter-spacing: 0.06em;
}

.management-options button:hover,
.management-options button:focus-visible,
.management-name-group button:hover,
.management-name-group button:focus-visible,
.management-dialog-actions button:hover,
.management-dialog-actions button:focus-visible {
    border-color: var(--green);
    outline: none;
}

.management-name-group {
    display: grid;
    gap: 10px;
}

.management-name-group label {
    color: var(--green-muted);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

.management-name-group input {
    width: 100%;
    padding: 11px;
    border: 1px solid var(--green-dark);
    outline: none;
    color: var(--green-bright);
    background: #030b09;
}

.management-name-group input:focus {
    border-color: var(--green);
}

.management-preview h3 {
    margin: 0 0 12px;
    color: var(--green);
    font-size: 0.92rem;
    font-weight: 500;
}

.management-preview p {
    margin: 6px 0;
    color: #a7d7c3;
    font-size: 0.78rem;
    line-height: 1.45;
}

.management-preview .preview-cost {
    margin: 15px 0 4px;
    padding: 10px;
    color: var(--amber);
    background: rgba(255, 195, 104, 0.07);
}

.management-preview .preview-check {
    color: var(--green-muted);
}

.management-preview .preview-check.failed {
    color: var(--red);
}

.management-error {
    min-height: 1.2em;
    margin: 12px 0 0;
    color: var(--red);
    font-size: 0.78rem;
}

.management-dialog-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    border-bottom: 0;
}

#management-confirm {
    border-color: var(--green);
    color: #031009;
    background: var(--green);
}

.ice-dialog {
    width: min(860px, calc(100vw - 32px));
    max-height: min(820px, calc(100vh - 32px));
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 83, 105, 0.72);
    color: #ffe7eb;
    background: #0b070b;
    box-shadow:
        0 28px 110px rgba(0, 0, 0, 0.82),
        0 0 48px rgba(255, 45, 94, 0.16),
        inset 0 0 0 1px rgba(255, 184, 199, 0.04);
}

.ice-dialog::backdrop {
    background: rgba(3, 0, 3, 0.86);
    backdrop-filter: blur(5px) saturate(0.7);
}

.ice-dialog-frame {
    position: relative;
    max-height: min(760px, calc(100vh - 32px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    background:
        linear-gradient(115deg, rgba(255, 42, 88, 0.055), transparent 34%),
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 48px,
            rgba(255, 83, 105, 0.018) 49px
        );
}

.ice-dialog-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 5px 0 #ff355f;
    animation: ice-frame-pulse 1.6s ease-in-out infinite;
}

.ice-dialog-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 13px 18px;
    border-bottom: 1px solid rgba(255, 83, 105, 0.32);
    background: rgba(32, 8, 16, 0.92);
}

.ice-alert-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid #ff5369;
    color: #120006;
    background: #ff5369;
    font-size: 1.5rem;
    font-weight: 900;
    box-shadow: 0 0 22px rgba(255, 83, 105, 0.3);
}

.ice-dialog-identity span,
.ice-dialog-clock span,
.ice-dialog-status span,
.ice-response-form label {
    color: #b96f80;
    font-size: 0.7rem;
    letter-spacing: 0.13em;
}

.ice-dialog-identity h2 {
    margin: 4px 0 0;
    color: #fff2f5;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.12em;
}

.ice-dialog-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.ice-dialog-clock strong {
    color: #ff5369;
    font-size: 1.65rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-shadow: 0 0 18px rgba(255, 83, 105, 0.35);
}

.ice-dialog-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid rgba(255, 83, 105, 0.2);
    background: rgba(20, 7, 12, 0.82);
}

.ice-dialog-status > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 18px;
}

.ice-dialog-status > div + div {
    border-left: 1px solid rgba(255, 83, 105, 0.2);
}

.ice-dialog-status strong {
    color: #ff9aae;
    font-size: 0.75rem;
    font-weight: 500;
}

.ice-dialog-body {
    min-height: 0;
    max-height: none;
    padding: 18px 22px;
    overflow: auto;
    scrollbar-width: none;
}

.ice-dialog-body::-webkit-scrollbar {
    display: none;
}

.ice-protocol-copy {
    margin: 0 0 18px;
    color: #d28b9a;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    line-height: 1.5;
}

.ice-packet-table {
    display: grid;
    gap: 7px;
}

.ice-packet {
    width: 100%;
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 14px;
    align-items: center;
    padding: 10px 13px;
    border: 1px solid rgba(255, 83, 105, 0.2);
    color: #f2c8d1;
    background: rgba(255, 83, 105, 0.025);
    text-align: left;
}

.ice-packet:hover,
.ice-packet:focus-visible {
    border-color: #ff5369;
    outline: none;
    background: rgba(255, 83, 105, 0.09);
    transform: translateX(3px);
}

.ice-packet strong {
    color: #ff6f89;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

.ice-packet code {
    overflow: hidden;
    color: #ffe8ed;
    font: inherit;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ice-cipher-card {
    display: grid;
    gap: 18px;
}

.ice-ciphertext {
    padding: 20px;
    border: 1px solid rgba(255, 83, 105, 0.34);
    color: #fff1f4;
    background: rgba(255, 83, 105, 0.065);
    font-size: clamp(1.6rem, 4vw, 2.7rem);
    letter-spacing: 0.22em;
    text-align: center;
    text-shadow: 0 0 18px rgba(255, 83, 105, 0.32);
}

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

.ice-credential-option {
    padding: 13px 10px;
    border: 1px solid rgba(255, 83, 105, 0.2);
    color: #f7cbd4;
    background: rgba(255, 83, 105, 0.025);
    text-align: center;
    letter-spacing: 0.12em;
}

.ice-route-layout {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 180px;
    gap: 18px;
    align-items: center;
}

.ice-route-grid {
    display: grid;
    gap: 2px;
    width: min(100%, 42vh, 340px);
    aspect-ratio: 1;
    margin: 0 auto;
    padding: 6px;
    border: 1px solid rgba(255, 83, 105, 0.35);
    background: #080407;
}

.ice-route-cell {
    min-width: 0;
    position: relative;
    display: grid;
    place-items: center;
    border: 2px solid #39141e;
    color: #8d4e5d;
    background: #12070c;
    font-size: 0.68rem;
}

.ice-route-cell.open-north { border-top-color: transparent; }
.ice-route-cell.open-east { border-right-color: transparent; }
.ice-route-cell.open-south { border-bottom-color: transparent; }
.ice-route-cell.open-west { border-left-color: transparent; }

.ice-route-cell.start,
.ice-route-cell.target {
    color: #ff9caf;
}

.ice-route-cell.current {
    color: #150007;
    background: #ff5369;
    box-shadow: 0 0 18px rgba(255, 83, 105, 0.55);
    animation: ice-agent-pulse 0.9s ease-in-out infinite;
}

.ice-route-controls {
    display: grid;
    grid-template-columns: repeat(3, clamp(42px, 6vh, 52px));
    grid-template-rows: repeat(3, clamp(42px, 6vh, 52px));
    gap: 6px;
    justify-content: center;
}

.ice-route-command {
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 83, 105, 0.38);
    color: #ffdce4;
    background: rgba(255, 83, 105, 0.06);
    cursor: default;
    font-size: 1rem;
    user-select: none;
}

.ice-route-command.north { grid-column: 2; grid-row: 1; }
.ice-route-command.west { grid-column: 1; grid-row: 2; }
.ice-route-command.east { grid-column: 3; grid-row: 2; }
.ice-route-command.south { grid-column: 2; grid-row: 3; }

.ice-signal-stage {
    min-height: 280px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 16px;
    border: 1px solid rgba(255, 83, 105, 0.28);
    background:
        radial-gradient(circle, rgba(255, 83, 105, 0.1), transparent 50%),
        #080407;
}

.ice-signal-token {
    min-width: 180px;
    padding: 24px 30px;
    border: 1px solid rgba(255, 83, 105, 0.55);
    color: #fff4f6;
    background: rgba(255, 83, 105, 0.09);
    font-size: 2.5rem;
    letter-spacing: 0.2em;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 83, 105, 0.12);
}

.ice-signal-token.flash {
    animation: ice-token-flash 0.24s ease-out;
}

.ice-response-form {
    padding: 0 22px 14px;
}

.ice-response-form label {
    display: block;
    margin-bottom: 7px;
}

.ice-response-row {
    display: grid;
    grid-template-columns: 1fr auto;
}

.ice-response-row input,
.ice-response-row button {
    min-height: 44px;
    border: 1px solid rgba(255, 83, 105, 0.45);
}

.ice-response-row input {
    min-width: 0;
    padding: 10px 12px;
    outline: none;
    color: #fff1f4;
    background: #070306;
}

.ice-response-row input:focus {
    border-color: #ff5369;
    box-shadow: inset 0 0 18px rgba(255, 83, 105, 0.08);
}

.ice-response-row button {
    padding: 0 18px;
    color: #160007;
    background: #ff5369;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.ice-response-row input:disabled,
.ice-response-row button:disabled,
.ice-packet:disabled {
    cursor: wait;
    opacity: 0.46;
}

.ice-dialog-footer {
    min-height: 44px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 9px 18px;
    border-top: 1px solid rgba(255, 83, 105, 0.25);
    background: rgba(30, 7, 14, 0.9);
    font-size: 0.72rem;
}

.ice-lock-state {
    color: #c48390;
    letter-spacing: 0.09em;
}

.ice-lock-state i {
    width: 7px;
    height: 7px;
    display: inline-block;
    margin-right: 7px;
    border-radius: 50%;
    background: #ff5369;
    box-shadow: 0 0 10px rgba(255, 83, 105, 0.85);
}

#ice-dialog-feedback {
    color: #ff9aae;
    font-weight: 500;
    text-align: right;
}

.ice-dialog.success {
    border-color: var(--green);
}

.ice-dialog.success #ice-dialog-feedback {
    color: var(--green);
}

.router-dialog {
    width: min(820px, calc(100vw - 32px));
    height: min(760px, calc(100vh - 32px));
    height: min(760px, calc(100dvh - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    box-sizing: border-box;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 195, 104, 0.72);
    color: #ffe8c2;
    background: #0c0904;
    box-shadow:
        0 28px 110px rgba(0, 0, 0, 0.82),
        0 0 50px rgba(255, 174, 61, 0.14),
        inset 0 0 0 1px rgba(255, 232, 194, 0.04);
}

.router-dialog::backdrop {
    background: rgba(4, 3, 0, 0.88);
    backdrop-filter: blur(5px) saturate(0.65);
}

.router-dialog-frame {
    position: relative;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    background:
        linear-gradient(115deg, rgba(255, 174, 61, 0.06), transparent 38%),
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 48px,
            rgba(255, 195, 104, 0.018) 49px
        );
}

.router-dialog-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 5px 0 var(--amber);
}

.router-dialog-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 13px 18px;
    border-bottom: 1px solid rgba(255, 195, 104, 0.3);
    background: rgba(34, 22, 7, 0.94);
}

.router-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--amber);
    color: #1a0f02;
    background: var(--amber);
    font-size: 1.35rem;
    font-weight: 900;
    box-shadow: 0 0 22px rgba(255, 195, 104, 0.28);
}

.router-dialog-identity span,
.router-dialog-clock span,
.router-route-status span,
.router-expected span {
    color: #ae8650;
    font-size: 0.7rem;
    letter-spacing: 0.13em;
}

.router-dialog-identity h2 {
    margin: 4px 0 0;
    color: #fff2d9;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.router-dialog-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.router-dialog-clock strong {
    color: var(--amber);
    font-size: 1.65rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-shadow: 0 0 18px rgba(255, 195, 104, 0.32);
}

.router-dialog-clock strong.urgent {
    color: var(--red);
    text-shadow: 0 0 18px rgba(255, 83, 105, 0.4);
}

.router-route-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid rgba(255, 195, 104, 0.18);
    background: rgba(22, 15, 5, 0.84);
}

.router-route-status > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 18px;
}

.router-route-status > div + div {
    border-left: 1px solid rgba(255, 195, 104, 0.18);
}

.router-route-status strong {
    color: #ffd899;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: right;
}

.router-dialog-body {
    min-height: 0;
    padding: 20px 22px 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
}

.router-dialog-body::-webkit-scrollbar {
    display: none;
}

.router-expected {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 195, 104, 0.42);
    background: rgba(255, 195, 104, 0.07);
}

.router-expected code {
    color: #fff0d3;
    font: inherit;
    font-size: 1rem;
    letter-spacing: 0.055em;
    white-space: pre-wrap;
}

.router-dialog-body > p {
    margin: 16px 0 11px;
    color: #c5a97c;
    font-size: 0.82rem;
    line-height: 1.45;
}

.router-options {
    display: grid;
    gap: 8px;
}

.router-option {
    width: 100%;
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(255, 195, 104, 0.22);
    color: #e4c99d;
    background: rgba(255, 195, 104, 0.025);
    text-align: left;
}

.router-option:hover,
.router-option:focus-visible {
    border-color: var(--amber);
    outline: none;
    color: #fff1d7;
    background: rgba(255, 195, 104, 0.09);
    transform: translateX(3px);
}

.router-option strong {
    color: var(--amber);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

.router-option code {
    overflow: hidden;
    color: inherit;
    font: inherit;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.router-dialog-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 11px 18px;
    border-top: 1px solid rgba(255, 195, 104, 0.22);
    background: rgba(28, 18, 5, 0.94);
}

.router-dialog-footer button {
    padding: 8px 12px;
    border: 1px solid rgba(255, 83, 105, 0.55);
    color: #ff9eac;
    background: rgba(255, 83, 105, 0.045);
}

.router-dialog-footer button:hover,
.router-dialog-footer button:focus-visible {
    border-color: var(--red);
    outline: none;
    color: #ffe4e8;
}

.router-dialog-footer strong {
    color: #d8b87f;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-align: right;
}

.router-dialog.retry .router-dialog-frame::after {
    box-shadow: inset 5px 0 var(--red);
}

.router-dialog.cleared {
    border-color: rgba(98, 255, 173, 0.65);
}

.router-dialog.cleared .router-dialog-frame::after {
    box-shadow: inset 5px 0 var(--green);
}

@keyframes ice-frame-pulse {
    0%, 100% { opacity: 0.42; }
    50% { opacity: 1; }
}

@keyframes map-wire-flow {
    to { stroke-dashoffset: -40; }
}

@keyframes ice-agent-pulse {
    0%, 100% { transform: scale(0.92); }
    50% { transform: scale(1); }
}

@keyframes ice-token-flash {
    from { transform: scale(0.92); opacity: 0.35; }
    to { transform: scale(1); opacity: 1; }
}

.mail-view-button {
    position: relative;
}

.mail-view-button > b {
    position: absolute;
    top: 5px;
    right: 6px;
    min-width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border: 1px solid #ffb45f;
    border-radius: 9px;
    color: #1a0d03;
    background: #ffb45f;
    font-size: 0.55rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 10px rgba(255, 180, 95, 0.36);
}

.mail-view {
    min-height: 0;
    background:
        linear-gradient(rgba(98, 255, 173, 0.012) 1px, transparent 1px),
        #020806;
    background-size: 100% 24px;
}

.mail-frame {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid var(--line-strong);
    box-shadow: inset 4px 0 rgba(98, 255, 173, 0.45);
}

.mail-heading {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--line-strong);
    background: rgba(5, 17, 14, 0.97);
}

.mail-heading span,
.mail-folders > span,
.mail-index > header,
.mail-reader > header,
.mail-compose > header {
    color: var(--green-muted);
    font-size: 0.61rem;
    letter-spacing: 0.14em;
}

.mail-heading h2 {
    margin: 4px 0 0;
    color: var(--green);
    font-size: 1.08rem;
    font-weight: 500;
    letter-spacing: 0.09em;
}

.mail-heading p {
    margin: 4px 0 0;
    color: #86aa9a;
    font-size: 0.67rem;
}

.mail-heading > strong {
    color: var(--green);
    font-size: 0.67rem;
    font-weight: 500;
    letter-spacing: 0.11em;
}

.mail-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: 142px minmax(210px, 28%) minmax(0, 1fr);
}

.mail-folders {
    min-height: 0;
    padding: 16px 11px;
    border-right: 1px solid var(--line);
    background: rgba(4, 14, 11, 0.96);
}

.mail-folders > span {
    display: block;
    margin: 0 7px 10px;
}

.mail-folders button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 8px;
    border: 1px solid transparent;
    color: #709886;
    background: transparent;
    text-align: left;
}

.mail-folders button:hover,
.mail-folders button:focus-visible,
.mail-folders button.active {
    border-color: var(--line-strong);
    color: var(--green);
    outline: none;
}

.mail-folders button.active {
    background: rgba(98, 255, 173, 0.07);
    box-shadow: inset 3px 0 var(--green);
}

.mail-folders button strong {
    font-size: 0.67rem;
    font-weight: 500;
}

.mail-folders button small {
    color: var(--green-muted);
    font-size: 0.61rem;
}

.mail-folders .mail-compose-open {
    margin-top: 13px;
    border-top-color: var(--line);
}

.mail-index {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border-right: 1px solid var(--line);
    background: rgba(3, 11, 9, 0.94);
}

.mail-index > header {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
}

.mail-index > header strong {
    color: #719584;
    font-size: 0.56rem;
    font-weight: 400;
}

#mail-list {
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
}

#mail-list::-webkit-scrollbar,
.mail-content::-webkit-scrollbar {
    display: none;
}

.mail-list-item {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    padding: 11px 12px;
    border: 0;
    border-bottom: 1px solid rgba(52, 141, 103, 0.22);
    color: #8ab39f;
    background: transparent;
    text-align: left;
}

.mail-list-item:hover,
.mail-list-item:focus-visible,
.mail-list-item.active {
    color: var(--green-bright);
    background: rgba(98, 255, 173, 0.05);
    outline: none;
}

.mail-list-item.active {
    box-shadow: inset 3px 0 var(--green);
}

.mail-list-item strong,
.mail-list-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-list-item strong {
    font-size: 0.65rem;
    font-weight: 400;
}

.mail-list-item.unread strong {
    color: var(--green);
    font-weight: 600;
}

.mail-list-item span {
    grid-column: 1 / -1;
    color: #b1d4c4;
    font-size: 0.7rem;
}

.mail-list-item time {
    color: #527765;
    font-size: 0.57rem;
}

.mail-list-empty {
    margin: 22px 14px;
    color: #426555;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
}

.mail-content {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    background: rgba(2, 9, 7, 0.82);
    scrollbar-width: none;
}

.mail-empty {
    height: 100%;
    display: grid;
    place-items: center;
    padding: 20px;
    color: #365749;
    font-size: 0.65rem;
    letter-spacing: 0.13em;
    text-align: center;
}

.mail-reader,
.mail-compose {
    width: min(760px, 100%);
    min-height: 100%;
    margin: 0 auto;
    padding: 23px 25px;
}

.mail-reader > header,
.mail-compose > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.mail-reader h2 {
    margin: 19px 0 16px;
    color: var(--green-bright);
    font-size: 1rem;
    font-weight: 500;
}

.mail-reader dl {
    display: grid;
    gap: 5px;
    margin: 0 0 20px;
}

.mail-reader dl > div {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 9px;
}

.mail-reader dt {
    color: #527765;
    font-size: 0.59rem;
    letter-spacing: 0.08em;
}

.mail-reader dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: #91baa7;
    font-size: 0.65rem;
}

.mail-reader > p {
    min-height: 160px;
    margin: 0;
    color: #c0dfd1;
    font-size: 0.74rem;
    line-height: 1.65;
    white-space: pre-wrap;
}

.mail-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 13px 14px;
    border: 1px solid rgba(255, 195, 104, 0.48);
    background: rgba(255, 195, 104, 0.045);
    box-shadow: inset 3px 0 var(--amber);
}

.mail-action > div:first-child {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.mail-action span,
.mail-action small {
    color: #a18154;
    font-size: 0.56rem;
    letter-spacing: 0.1em;
}

.mail-action strong {
    overflow: hidden;
    color: var(--amber);
    font-size: 0.75rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-action-controls {
    display: flex;
    gap: 7px;
}

.mail-action-controls button {
    border-color: rgba(255, 195, 104, 0.55);
    color: var(--amber);
}

.mail-action-controls button:disabled {
    opacity: 0.45;
}

.mail-reader > footer,
.mail-compose > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: #527765;
    font-size: 0.6rem;
}

.mail-reader button,
.mail-compose button {
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    color: var(--green);
    background: rgba(98, 255, 173, 0.03);
    font: inherit;
}

.mail-reader button:hover,
.mail-reader button:focus-visible,
.mail-compose button:hover,
.mail-compose button:focus-visible {
    background: rgba(98, 255, 173, 0.09);
    outline: none;
}

.mail-compose {
    display: grid;
    align-content: start;
    gap: 13px;
}

.mail-compose label {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    color: var(--green-muted);
    font-size: 0.61rem;
    letter-spacing: 0.1em;
}

.mail-compose label.mail-compose-body {
    align-items: start;
}

.mail-compose input,
.mail-compose textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    color: #c0dfd1;
    background: rgba(1, 7, 5, 0.9);
    font: inherit;
    outline: none;
}

.mail-compose input {
    min-height: 37px;
    padding: 7px 9px;
}

.mail-compose textarea {
    min-height: 230px;
    padding: 10px;
    resize: vertical;
    line-height: 1.5;
}

.mail-compose input:focus,
.mail-compose textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 12px rgba(98, 255, 173, 0.08);
}

.mail-compose input:disabled,
.mail-compose textarea:disabled,
.mail-compose button:disabled {
    opacity: 0.48;
}

#mail-status {
    margin: 0;
    color: var(--green-muted);
}

#mail-status.error {
    color: var(--red);
}

.chat-view {
    --chat-accent: var(--green);
    min-height: 0;
    background:
        linear-gradient(rgba(98, 255, 173, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(98, 255, 173, 0.015) 1px, transparent 1px),
        #020806;
    background-size: 28px 28px;
}

.chat-view.active {
    display: block;
}

.chat-frame {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid color-mix(in srgb, var(--chat-accent) 38%, transparent);
    box-shadow: inset 4px 0 var(--chat-accent);
}

.chat-heading {
    min-height: 64px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    padding: 7px 14px;
    border-bottom: 1px solid color-mix(in srgb, var(--chat-accent) 34%, transparent);
    background: rgba(5, 17, 14, 0.97);
}

.chat-emblem {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--chat-accent);
    color: var(--chat-accent);
    background: color-mix(in srgb, var(--chat-accent) 8%, transparent);
    font-size: 1rem;
    box-shadow: 0 0 18px color-mix(in srgb, var(--chat-accent) 12%, transparent);
}

.chat-identity {
    min-width: 0;
}

.chat-identity > span {
    color: var(--green-muted);
    font-size: 0.56rem;
    letter-spacing: 0.15em;
}

.chat-identity h2 {
    margin: 2px 0 0;
    overflow: hidden;
    color: var(--chat-accent);
    font-size: 0.94rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-identity p {
    margin: 2px 0 0;
    overflow: hidden;
    color: #7fa895;
    font-size: 0.59rem;
    letter-spacing: 0.06em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-heading > strong {
    color: var(--chat-accent);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

.chat-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(150px, 18%) minmax(0, 1fr);
}

.chat-sidebar {
    min-width: 0;
    min-height: 0;
    padding: 11px 9px;
    overflow-y: auto;
    border-right: 1px solid color-mix(in srgb, var(--chat-accent) 25%, transparent);
    background: rgba(4, 14, 11, 0.96);
    scrollbar-width: none;
}

.chat-sidebar::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    display: none;
}

.chat-sidebar > span {
    display: block;
    margin-bottom: 9px;
    color: var(--green-muted);
    font-size: 0.6rem;
    letter-spacing: 0.14em;
}

.chat-channel {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
    padding: 9px 8px;
    border: 1px solid transparent;
    color: #709886;
    background: transparent;
    text-align: left;
}

.chat-channel:hover,
.chat-channel:focus-visible,
.chat-channel.active {
    border-color: color-mix(in srgb, var(--chat-accent) 35%, transparent);
    color: var(--chat-accent);
    outline: none;
}

.chat-channel.active {
    background: color-mix(in srgb, var(--chat-accent) 7%, transparent);
    box-shadow: inset 3px 0 var(--chat-accent);
}

.chat-channel strong {
    overflow: hidden;
    font-size: 0.7rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-collective-summary {
    display: grid;
    gap: 6px;
    margin-top: 18px;
    padding: 10px 8px;
    border-top: 1px solid var(--line);
    color: #527765;
    font-size: 0.61rem;
    line-height: 1.45;
}

.chat-collective-summary strong {
    color: var(--green-bright);
    font-size: 0.68rem;
    font-weight: 500;
}

.chat-collective-summary span {
    color: var(--chat-accent);
}

.chat-collective-summary small {
    color: var(--green-muted);
    font-size: 0.56rem;
}

.collective-control-open {
    width: 100%;
    margin-top: 3px;
    padding: 7px 8px;
    border: 1px solid var(--chat-accent);
    color: var(--chat-accent);
    background: color-mix(in srgb, var(--chat-accent) 6%, transparent);
    font: inherit;
    font-size: 0.57rem;
    letter-spacing: 0.08em;
}

.collective-control-open:hover,
.collective-control-open:focus-visible {
    background: color-mix(in srgb, var(--chat-accent) 13%, transparent);
    outline: none;
}

.collective-dialog {
    width: min(920px, calc(100vw - 34px));
    height: min(680px, calc(100vh - 34px));
    padding: 0;
    border: 0;
    color: #b7ddcc;
    background: transparent;
}

.collective-dialog::backdrop {
    background: rgba(0, 5, 3, 0.84);
    backdrop-filter: blur(2px);
}

.collective-dialog-frame {
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border: 1px solid var(--chat-accent);
    background:
        linear-gradient(rgba(98, 255, 173, 0.018) 1px, transparent 1px),
        #030b08;
    background-size: 100% 24px;
    box-shadow:
        inset 4px 0 var(--chat-accent),
        0 0 34px rgba(0, 0, 0, 0.7);
}

.collective-dialog-header {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) auto 34px;
    gap: 13px;
    align-items: center;
    padding: 13px 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--chat-accent) 38%, transparent);
    background: rgba(5, 17, 14, 0.98);
}

.collective-dialog-emblem {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--chat-accent);
    color: var(--chat-accent);
    background: color-mix(in srgb, var(--chat-accent) 8%, transparent);
    font-size: 1rem;
}

.collective-dialog-header span,
.collective-panel header span,
.collective-dialog-footer {
    color: var(--green-muted);
    font-size: 0.59rem;
    letter-spacing: 0.13em;
}

.collective-dialog-header h2 {
    margin: 3px 0;
    color: var(--chat-accent);
    font-size: 1.08rem;
    font-weight: 500;
    letter-spacing: 0.06em;
}

.collective-dialog-header p {
    margin: 0;
    color: #719584;
    font-size: 0.62rem;
}

.collective-dialog-state {
    display: grid;
    gap: 4px;
    text-align: right;
}

.collective-dialog-state strong {
    color: var(--chat-accent);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

#collective-dialog-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--line);
    color: var(--green-muted);
    background: transparent;
    font: inherit;
    font-size: 1rem;
}

.collective-dialog-body {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(230px, 0.8fr) minmax(300px, 1.2fr);
    gap: 1px;
    overflow: auto;
    background: var(--line);
}

.collective-panel {
    min-width: 0;
    padding: 16px;
    background: rgba(3, 11, 9, 0.98);
}

.collective-panel > header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.collective-panel > header strong {
    color: #799e8d;
    font-size: 0.56rem;
    font-weight: 400;
}

.collective-members-panel {
    grid-row: 1 / span 2;
}

.collective-member-list {
    display: grid;
    align-content: start;
    gap: 1px;
    margin-top: 10px;
    background: rgba(52, 141, 103, 0.2);
}

.collective-member-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    background: #06120f;
}

.collective-member-list strong {
    color: var(--chat-accent);
    font-size: 0.7rem;
    font-weight: 500;
}

.collective-member-list small {
    color: var(--green-muted);
    font-size: 0.57rem;
}

.collective-rank-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.collective-rank-grid article {
    display: grid;
    gap: 5px;
    padding: 10px;
    border: 1px solid rgba(52, 141, 103, 0.28);
    background: #06120f;
}

.collective-rank-grid strong {
    color: var(--chat-accent);
    font-size: 0.67rem;
    font-weight: 500;
}

.collective-rank-grid span,
.collective-access-panel > small,
.collective-invite-panel > p {
    color: #6f9583;
    font-size: 0.56rem;
    line-height: 1.5;
}

.collective-access-panel > small {
    display: block;
    margin-top: 9px;
}

.collective-invite-panel > p {
    margin: 10px 0;
}

#collective-invite-form {
    display: grid;
    gap: 6px;
}

#collective-invite-form label {
    color: var(--green-muted);
    font-size: 0.56rem;
    letter-spacing: 0.1em;
}

#collective-invite-form > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

#collective-invite-form input,
#collective-invite-form button,
.collective-dialog-footer button {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--chat-accent);
    color: var(--chat-accent);
    background: #020806;
    font: inherit;
    font-size: 0.63rem;
    outline: none;
}

#collective-invite-form input:focus {
    box-shadow: inset 3px 0 var(--chat-accent);
}

#collective-invite-submit:disabled {
    opacity: 0.45;
}

#collective-dialog-feedback {
    min-height: 18px;
    margin-bottom: 0;
    color: var(--green-muted);
}

#collective-dialog-feedback.success {
    color: var(--chat-accent);
}

#collective-dialog-feedback.error {
    color: var(--red);
}

.collective-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid color-mix(in srgb, var(--chat-accent) 32%, transparent);
    background: rgba(5, 17, 14, 0.98);
}

.chat-member-controls {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 8px;
    border-top: 1px solid var(--line);
}

.chat-member-controls:empty {
    display: none;
}

.chat-member-controls > span {
    color: var(--green-muted);
    font-size: 0.58rem;
    letter-spacing: 0.12em;
}

.chat-member-list {
    display: grid;
    gap: 4px;
}

.chat-member-list > div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.61rem;
}

.chat-member-list strong,
.chat-invitation strong {
    overflow: hidden;
    color: var(--chat-accent);
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-member-list small,
.chat-invitation small {
    color: var(--green-muted);
    font-size: 0.52rem;
}

.chat-invite-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
}

.chat-invite-form input {
    min-width: 0;
    padding: 6px;
    border: 1px solid var(--line);
    color: var(--green-bright);
    background: #020806;
    font: inherit;
    font-size: 0.58rem;
    outline: none;
}

.chat-invite-form button,
.chat-invitation-actions button {
    padding: 6px;
    border: 1px solid var(--chat-accent);
    color: var(--chat-accent);
    background: transparent;
    font: inherit;
    font-size: 0.52rem;
}

.chat-invitation {
    display: grid;
    gap: 4px;
}

.chat-invitation-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.chat-error.success {
    color: var(--green-bright);
}

.chat-room {
    min-width: 0;
    min-height: 0;
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    background: rgba(2, 9, 7, 0.9);
}

.chat-messages {
    min-height: 0;
    padding: 13px 16px;
    overflow-y: auto;
    scrollbar-width: none;
}

.chat-empty {
    margin: 30px 0;
    color: #466757;
    font-size: 0.7rem;
    text-align: center;
    letter-spacing: 0.12em;
}

.chat-message {
    min-width: 0;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 0.55em;
    align-items: baseline;
    padding: 1px 0;
    font-size: 0.76rem;
    line-height: 1.35;
}

.chat-message strong {
    color: var(--chat-accent);
    font-weight: 500;
    white-space: nowrap;
}

.chat-message time {
    color: #456858;
    font-size: 0.68rem;
    white-space: nowrap;
}

.chat-message > span {
    min-width: 0;
    color: #b5ddcc;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.chat-message.system strong,
.chat-message.system > span {
    color: var(--amber);
}

.chat-message.system time {
    color: #8f7650;
}

.chat-compose {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 6px 10px;
    border-top: 1px solid color-mix(in srgb, var(--chat-accent) 35%, transparent);
    background: #05100d;
}

.chat-compose label {
    color: var(--chat-accent);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
}

.chat-compose input {
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid rgba(98, 255, 173, 0.18);
    outline: none;
    color: var(--green-bright);
    background: #020705;
    caret-color: var(--chat-accent);
}

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

.chat-compose button {
    padding: 7px 10px;
    border: 1px solid var(--chat-accent);
    color: var(--chat-accent);
    background: color-mix(in srgb, var(--chat-accent) 7%, transparent);
    font-size: 0.66rem;
}

.chat-error {
    min-height: 18px;
    margin: 0;
    padding: 2px 10px 4px;
    color: var(--red);
    background: #05100d;
    font-size: 0.62rem;
}

.chat-error:empty {
    display: none;
}

@media (max-width: 700px) {
    .chat-heading {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 9px 11px;
    }

    .chat-emblem {
        width: 38px;
        height: 38px;
    }

    .chat-heading > strong {
        display: none;
    }

    .chat-layout {
        grid-template-columns: 112px minmax(0, 1fr);
    }

    .collective-dialog {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
    }

    .collective-dialog-header {
        grid-template-columns: 40px minmax(0, 1fr) 32px;
        padding: 10px;
    }

    .collective-dialog-emblem {
        width: 38px;
        height: 38px;
    }

    .collective-dialog-state {
        display: none;
    }

    .collective-dialog-body {
        grid-template-columns: 1fr;
    }

    .collective-members-panel {
        grid-row: auto;
    }

    .mail-action {
        align-items: stretch;
        flex-direction: column;
    }

    .mail-action-controls button {
        flex: 1;
    }

    .chat-compose {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .chat-compose label {
        display: none;
    }
}

.hidden {
    display: none !important;
}

@keyframes alert-pulse {
    0%,
    49% {
        box-shadow: inset 4px 0 var(--red);
    }

    50%,
    100% {
        box-shadow: inset 4px 0 transparent;
    }
}

@keyframes placement-pulse {
    0%,
    100% {
        box-shadow: inset 0 0 0 1px rgba(255, 195, 104, 0.18);
    }

    50% {
        box-shadow: inset 0 0 0 1px rgba(255, 195, 104, 0.62), 0 0 18px rgba(255, 195, 104, 0.12);
    }
}

@keyframes command-sweep {
    0% {
        transform: translateX(-110%);
    }

    100% {
        transform: translateX(330%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .intrusion-section {
        animation: none;
        box-shadow: inset 4px 0 var(--red);
    }

    .architecture-node.placement-target,
    .architecture-empty.placement-target {
        animation: none;
    }

    .command-activity-track i {
        animation: none;
        transform: none;
    }

    .ice-dialog-frame::after,
    .ice-route-cell.current,
    .ice-signal-token.flash,
    .map-data-link {
        animation: none;
    }

    .login-as0-mark,
    .login-kicker,
    .login-title,
    .login-subtitle,
    .login-form {
        opacity: 1;
        animation: none;
    }

    .login-title::before,
    .login-title::after,
    .login-flicker {
        display: none;
    }
}

@media (max-width: 700px) {
    .router-dialog {
        width: calc(100vw - 18px);
        height: calc(100vh - 18px);
        height: calc(100dvh - 18px);
        max-height: calc(100vh - 18px);
        max-height: calc(100dvh - 18px);
    }

    .router-dialog-header {
        grid-template-columns: 1fr auto;
        gap: 10px;
    }

    .router-mark {
        display: none;
    }

    .router-route-status {
        grid-template-columns: 1fr;
    }

    .router-route-status > div + div {
        border-top: 1px solid rgba(255, 195, 104, 0.18);
        border-left: 0;
    }

    .router-dialog-body {
        padding: 15px;
    }

    .router-option {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .router-option code {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .router-dialog-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .router-dialog-footer strong {
        text-align: left;
    }

    .ice-dialog {
        width: calc(100vw - 18px);
        max-height: calc(100vh - 18px);
    }

    .ice-dialog-header {
        grid-template-columns: auto 1fr;
    }

    .ice-dialog-clock {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
    }

    .ice-dialog-status,
    .ice-route-layout {
        grid-template-columns: 1fr;
    }

    .ice-dialog-status > div + div {
        border-top: 1px solid rgba(255, 83, 105, 0.2);
        border-left: 0;
    }

    .ice-dialog-body {
        min-height: 260px;
        padding: 16px;
    }

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

    .ice-route-grid {
        width: min(100%, 38vh, 290px);
    }
}

@media (max-width: 980px) {
    body {
        overflow: auto;
    }

    .shell {
        min-height: 100vh;
        height: auto;
    }

    .terminal-panel {
        min-height: 100vh;
    }

    .app-topbar {
        grid-template-areas:
            "brand state"
            "resources resources";
        grid-template-columns: 1fr auto;
    }

    .resource-strip {
        grid-column: auto;
        grid-row: auto;
    }

    .application-body {
        grid-template-columns: 64px minmax(0, 1fr);
        grid-template-rows: minmax(620px, 1fr) auto;
    }

    .operations-sidebar {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .topology-section {
        grid-row: span 3;
    }

    .help-layout {
        grid-template-columns: 176px minmax(0, 1fr);
    }

    .help-view-heading {
        grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr);
    }

    .help-view-heading > strong {
        display: none;
    }

    .mail-layout {
        grid-template-columns: 120px minmax(190px, 31%) minmax(0, 1fr);
    }

    .mail-reader,
    .mail-compose {
        padding: 18px;
    }
}

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

    .protocol {
        right: 28px;
        left: 28px;
    }

    .login-stage {
        padding: 52px 14px 84px;
    }

    .login-title {
        font-size: clamp(2.5rem, 13vw, 3.25rem);
    }

    .login-subtitle {
        font-size: 0.66rem;
    }

    .login-form {
        margin-top: 38px;
    }

    .login-prompt {
        gap: 6px;
        font-size: 0.9rem;
    }

    .login-corner {
        font-size: 0.5rem;
    }

    .app-topbar {
        grid-template-areas:
            "brand"
            "resources"
            "state";
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .phase-readout {
        text-align: left;
    }

    .resource-strip {
        grid-column: auto;
        grid-row: auto;
        grid-template-columns: repeat(2, minmax(100px, 1fr));
    }

    .application-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(600px, 1fr) auto;
    }

    .view-rail {
        flex-direction: row;
        padding: 7px 10px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .view-button {
        width: 58px;
        min-height: 44px;
    }

    .context-bar {
        overflow-x: auto;
    }

    .command-line {
        grid-template-columns: 1fr;
    }

    .command-line > span {
        display: none;
    }

    .operations-sidebar {
        display: block;
    }

    .network-view-heading {
        align-items: start;
        grid-template-columns: 1fr;
    }

    .network-view-meta {
        text-align: left;
    }

    .full-topology {
        grid-template-columns: 1fr;
    }

    .map-view {
        overflow-y: auto;
    }

    .map-layout {
        display: block;
    }

    .world-regions {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 260px);
    }

    .map-country-intel {
        min-height: 360px;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .mail-view {
        overflow-y: auto;
    }

    .mail-frame {
        height: auto;
        min-height: 100%;
    }

    .mail-heading {
        min-height: 72px;
        padding: 10px 14px;
    }

    .mail-heading > strong {
        display: none;
    }

    .mail-layout {
        grid-template-columns: 96px minmax(0, 1fr);
        grid-template-rows: 260px minmax(360px, auto);
    }

    .mail-folders,
    .mail-index {
        border-bottom: 1px solid var(--line);
    }

    .mail-content {
        grid-column: 1 / -1;
    }

    .mail-folders button {
        padding: 9px 6px;
    }

    .mail-folders button small {
        display: none;
    }

    .mail-reader,
    .mail-compose {
        padding: 16px 13px;
    }

    .mail-compose label {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .help-view-heading {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .help-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .help-navigation {
        display: flex;
        gap: 5px;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .help-nav-button {
        width: 154px;
        flex: 0 0 auto;
    }

    .help-nav-button + .help-nav-button {
        margin-top: 0;
    }

    .help-content {
        padding: 18px 14px 32px;
    }

    .help-card summary {
        grid-template-columns: minmax(0, 1fr) 18px;
    }

    .help-card summary::before {
        grid-column: 2;
    }

    .help-card-badges {
        grid-column: 1 / -1;
        grid-row: 2;
        flex-wrap: wrap;
    }

    .help-card-summary {
        white-space: normal;
    }

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