:root {
    --jsmd-bg: #061225;
    --jsmd-bg-deep: #020715;
    --jsmd-panel: rgba(8, 26, 52, 0.76);
    --jsmd-panel-strong: rgba(10, 35, 71, 0.92);
    --jsmd-line: rgba(72, 221, 255, 0.42);
    --jsmd-line-soft: rgba(72, 221, 255, 0.18);
    --jsmd-cyan: #48ddff;
    --jsmd-cyan-bright: #89f6ff;
    --jsmd-blue: #2078ff;
    --jsmd-text: #dff9ff;
    --jsmd-muted: #7da9bd;
    --jsmd-danger: #ff6b8a;
    --jsmd-success: #73ffd3;
    --jsmd-radius: 8px;
    --jsmd-shadow: 0 0 32px rgba(32, 120, 255, 0.25);
    --jsmd-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.jsmd-ai-shell {
    margin: 0;
    color: var(--jsmd-text);
    font-family: var(--jsmd-font);
    background:
        radial-gradient(circle at 50% 28%, rgba(72, 221, 255, 0.18), transparent 26rem),
        radial-gradient(circle at 84% 82%, rgba(32, 120, 255, 0.22), transparent 22rem),
        linear-gradient(135deg, var(--jsmd-bg-deep), var(--jsmd-bg) 54%, #030a19);
}

html.jsmd-ready {
    margin-top: 0 !important;
}

body.jsmd-ai-shell::before,
body.jsmd-ai-shell::after {
    position: fixed;
    inset: 0;
    pointer-events: none;
    content: "";
}

body.jsmd-ai-shell::before {
    background-image:
        linear-gradient(rgba(72, 221, 255, 0.075) 1px, transparent 1px),
        linear-gradient(90deg, rgba(72, 221, 255, 0.06) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 82%);
}

body.jsmd-ai-shell::after {
    border: 1px solid rgba(72, 221, 255, 0.2);
    box-shadow: inset 0 0 54px rgba(32, 120, 255, 0.14);
}

a {
    color: var(--jsmd-cyan-bright);
}

.jsmd-scanline {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 5px);
    opacity: 0.24;
}

.jsmd-app-frame {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.jsmd-page {
    width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    padding: 0;
}

.jsmd-login-page {
    display: grid;
    place-items: center;
    padding: 28px 16px;
}

.jsmd-login-shell {
    position: relative;
    display: grid;
    width: min(960px, 100%);
    min-height: 590px;
    grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.72fr);
    overflow: hidden;
    border: 1px solid var(--jsmd-line);
    border-radius: var(--jsmd-radius);
    background: linear-gradient(135deg, rgba(7, 18, 38, 0.86), rgba(8, 26, 52, 0.72));
    box-shadow: var(--jsmd-shadow), inset 0 0 44px rgba(72, 221, 255, 0.07);
}

.jsmd-login-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 420px;
    border-right: 1px solid var(--jsmd-line-soft);
    background:
        linear-gradient(90deg, rgba(72, 221, 255, 0.1) 1px, transparent 1px),
        linear-gradient(rgba(72, 221, 255, 0.08) 1px, transparent 1px);
    background-size: 32px 32px;
}

.jsmd-orb {
    position: relative;
    width: min(360px, 72vw);
    aspect-ratio: 1;
    border: 1px solid rgba(137, 246, 255, 0.5);
    border-radius: 999px;
    background:
        radial-gradient(circle, rgba(137, 246, 255, 0.2) 0 3%, transparent 4%),
        conic-gradient(from 20deg, transparent 0 7%, rgba(72, 221, 255, 0.8) 7% 12%, transparent 12% 22%, rgba(32, 120, 255, 0.72) 22% 30%, transparent 30% 45%, rgba(72, 221, 255, 0.74) 45% 52%, transparent 52% 100%);
    box-shadow: 0 0 42px rgba(72, 221, 255, 0.28), inset 0 0 44px rgba(32, 120, 255, 0.2);
    animation: jsmd-spin 18s linear infinite;
}

.jsmd-orb::before,
.jsmd-orb::after {
    position: absolute;
    border-radius: inherit;
    content: "";
}

.jsmd-orb::before {
    inset: 14%;
    border: 1px dashed rgba(137, 246, 255, 0.48);
}

.jsmd-orb::after {
    inset: 30%;
    border: 1px solid rgba(72, 221, 255, 0.38);
    box-shadow: inset 0 0 32px rgba(72, 221, 255, 0.16);
}

.jsmd-hud-caption {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 28px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    color: var(--jsmd-muted);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.jsmd-login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    padding: 42px;
    background: rgba(3, 9, 22, 0.52);
}

.jsmd-eyebrow {
    color: var(--jsmd-cyan);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.jsmd-title {
    margin: 0;
    color: #f4fdff;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.05;
}

.jsmd-subtitle {
    margin: 0;
    color: var(--jsmd-muted);
    line-height: 1.7;
}

.jsmd-form {
    display: grid;
    gap: 16px;
}

.jsmd-field {
    display: grid;
    gap: 7px;
}

.jsmd-field label {
    color: var(--jsmd-cyan-bright);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.jsmd-input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--jsmd-line);
    border-radius: var(--jsmd-radius);
    color: var(--jsmd-text);
    background: rgba(2, 8, 20, 0.82);
    box-shadow: inset 0 0 18px rgba(72, 221, 255, 0.08);
    font: inherit;
    outline: none;
    padding: 12px 14px;
}

.jsmd-input:focus {
    border-color: var(--jsmd-cyan-bright);
    box-shadow: 0 0 0 3px rgba(72, 221, 255, 0.14), inset 0 0 18px rgba(72, 221, 255, 0.1);
}

.jsmd-color-input {
    min-height: 52px;
    padding: 6px;
}

.jsmd-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(137, 246, 255, 0.74);
    border-radius: var(--jsmd-radius);
    color: #03101c;
    background: linear-gradient(135deg, var(--jsmd-cyan-bright), var(--jsmd-blue));
    box-shadow: 0 0 22px rgba(72, 221, 255, 0.24);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0 18px;
    text-decoration: none;
    text-transform: uppercase;
}

.jsmd-alert {
    border: 1px solid rgba(255, 107, 138, 0.56);
    border-radius: var(--jsmd-radius);
    color: #ffd8df;
    background: rgba(255, 107, 138, 0.12);
    padding: 12px 14px;
}

.jsmd-dashboard {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 260px minmax(0, 1fr);
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: rgba(5, 16, 35, 0.78);
    box-shadow: var(--jsmd-shadow);
}

.jsmd-dashboard.jsmd-user-dashboard {
    grid-template-columns: 1fr;
}

.jsmd-dashboard.jsmd-user-dashboard .jsmd-content {
    min-height: 100vh;
}

.jsmd-user-orbit {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 48%, rgba(72, 221, 255, 0.18), transparent 23rem),
        radial-gradient(circle at 20% 72%, rgba(32, 120, 255, 0.22), transparent 18rem),
        radial-gradient(circle at 82% 70%, rgba(115, 255, 211, 0.16), transparent 17rem),
        linear-gradient(135deg, #111c22, #243135 52%, #11171c);
}

.jsmd-user-orbit::before,
.jsmd-user-orbit::after {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
}

.jsmd-user-orbit::before {
    background:
        linear-gradient(rgba(137, 246, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(137, 246, 255, 0.04) 1px, transparent 1px),
        radial-gradient(ellipse at center, transparent 0 18%, rgba(4, 11, 16, 0.26) 63%, rgba(2, 7, 12, 0.64) 100%);
    background-size: 58px 58px, 58px 58px, auto;
}

.jsmd-user-orbit::after {
    opacity: 0.44;
    background:
        repeating-linear-gradient(88deg, transparent 0 54px, rgba(72, 221, 255, 0.12) 55px, transparent 56px),
        repeating-linear-gradient(172deg, transparent 0 72px, rgba(115, 255, 211, 0.08) 73px, transparent 74px);
    filter: blur(0.2px);
}

.jsmd-user-orbit-bg {
    position: absolute;
    inset: -10%;
    opacity: 0.42;
    background:
        radial-gradient(circle at 11% 30%, rgba(115, 255, 211, 0.35) 0 0.42rem, transparent 0.52rem),
        radial-gradient(circle at 28% 74%, rgba(32, 120, 255, 0.45) 0 0.38rem, transparent 0.48rem),
        radial-gradient(circle at 70% 75%, rgba(115, 255, 211, 0.42) 0 0.48rem, transparent 0.58rem),
        radial-gradient(circle at 88% 34%, rgba(72, 221, 255, 0.28) 0 0.38rem, transparent 0.5rem);
    animation: jsmd-drift 18s ease-in-out infinite alternate;
}

.jsmd-orbit-map {
    position: relative;
    z-index: 1;
    width: 100vw;
    min-height: 100vh;
}

.jsmd-orbit-node {
    --node-color: #48ddff;
    --node-rgb: 72, 221, 255;
    position: absolute;
    display: grid;
    width: clamp(148px, 14vw, 260px);
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(var(--node-rgb), 0.58);
    border-radius: 24% 18% 28% 18% / 22% 28% 18% 24%;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 25%),
        radial-gradient(circle at 50% 52%, rgba(0, 0, 0, 0.98) 0 50%, rgba(0, 0, 0, 0.94) 58%, rgba(var(--node-rgb), 0.22) 62%, transparent 68%),
        linear-gradient(135deg, rgba(0, 0, 0, 0.98), rgba(var(--node-rgb), 0.18));
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.94),
        0 0 34px rgba(0, 0, 0, 0.78),
        0 0 42px rgba(var(--node-rgb), 0.2);
    text-align: center;
    text-decoration: none;
    transform: translate(-50%, -50%);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
    animation: jsmd-node-float 5.8s ease-in-out infinite;
    isolation: isolate;
}

.jsmd-orbit-node::before,
.jsmd-orbit-node::after {
    position: absolute;
    inset: -9%;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    content: "";
}

.jsmd-orbit-node::before {
    border: 1px solid rgba(var(--node-rgb), 0.45);
    clip-path: polygon(0 0, 38% 0, 38% 8%, 62% 8%, 62% 0, 100% 0, 100% 34%, 92% 34%, 92% 66%, 100% 66%, 100% 100%, 62% 100%, 62% 92%, 38% 92%, 38% 100%, 0 100%, 0 66%, 8% 66%, 8% 34%, 0 34%);
    opacity: 0.8;
    animation: jsmd-node-scan 4.8s linear infinite;
}

.jsmd-orbit-node::after {
    background:
        linear-gradient(90deg, transparent, rgba(var(--node-rgb), 0.38), transparent),
        radial-gradient(circle, rgba(var(--node-rgb), 0.16), transparent 64%);
    opacity: 0.55;
    filter: blur(10px);
    animation: jsmd-node-pulse 2.8s ease-in-out infinite;
}

.jsmd-orbit-node:hover {
    border-color: rgba(var(--node-rgb), 0.84);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.94),
        0 0 42px rgba(var(--node-rgb), 0.36),
        0 0 70px rgba(var(--node-rgb), 0.24);
    transform: translate(-50%, -50%) scale(1.045);
}

.jsmd-orbit-node .jsmd-node-title {
    max-width: 78%;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(15px, 1.45vw, 26px);
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.jsmd-project-node {
    --node-color: #48ddff;
}

.jsmd-agent-node {
    width: clamp(126px, 11vw, 214px);
    border-radius: 999px;
    align-content: center;
    gap: 7px;
}

.jsmd-agent-node::before,
.jsmd-agent-node::after {
    border-radius: 999px;
}

.jsmd-agent-node .jsmd-node-title {
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: clamp(11px, 0.88vw, 16px);
    letter-spacing: 0.06em;
}

.jsmd-agent-node small {
    max-width: 76%;
    color: rgba(223, 249, 255, 0.66);
    font-size: clamp(9px, 0.64vw, 12px);
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.jsmd-orbit-pos-1 {
    left: 50%;
    top: 29%;
}

.jsmd-orbit-pos-2 {
    left: 29%;
    top: 52%;
}

.jsmd-orbit-pos-3 {
    left: 71%;
    top: 52%;
}

.jsmd-orbit-pos-4 {
    left: 50%;
    top: 75%;
}

.jsmd-orbit-pos-5 {
    left: 18%;
    top: 76%;
}

.jsmd-orbit-pos-6 {
    left: 82%;
    top: 76%;
}

.jsmd-orbit-map.is-agent-map .jsmd-orbit-node {
    width: clamp(132px, 12vw, 228px);
}

.jsmd-user-back {
    position: fixed;
    top: 22px;
    left: 24px;
    z-index: 4;
    border: 1px solid rgba(137, 246, 255, 0.2);
    border-radius: 999px;
    color: rgba(223, 249, 255, 0.72);
    background: rgba(2, 8, 20, 0.24);
    backdrop-filter: blur(8px);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    padding: 9px 14px;
    text-decoration: none;
    text-transform: uppercase;
}

.jsmd-user-back:hover {
    border-color: rgba(137, 246, 255, 0.42);
    color: #fff;
    background: rgba(72, 221, 255, 0.08);
}

.jsmd-user-logout {
    position: fixed;
    top: 22px;
    right: 24px;
    z-index: 4;
    border: 1px solid rgba(137, 246, 255, 0.16);
    border-radius: 999px;
    color: rgba(223, 249, 255, 0.58);
    background: rgba(2, 8, 20, 0.18);
    backdrop-filter: blur(8px);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    padding: 8px 12px;
    text-decoration: none;
    text-transform: uppercase;
}

.jsmd-user-logout:hover {
    border-color: rgba(137, 246, 255, 0.34);
    color: #fff;
    background: rgba(72, 221, 255, 0.07);
}

.jsmd-chat-dialog {
    width: min(820px, calc(100vw - 44px));
}

.jsmd-user-chat {
    display: grid;
    gap: 14px;
}

.jsmd-chat-log {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 320px;
    max-height: min(52vh, 520px);
    overflow: auto;
    border: 1px solid var(--jsmd-line-soft);
    border-radius: var(--jsmd-radius);
    background: rgba(2, 8, 20, 0.42);
    padding: 14px;
}

.jsmd-chat-message {
    width: fit-content;
    max-width: min(76%, 620px);
    border: 1px solid var(--jsmd-line-soft);
    border-radius: var(--jsmd-radius);
    background: rgba(72, 221, 255, 0.08);
    padding: 11px 13px;
}

.jsmd-chat-message.is-user {
    justify-self: end;
    border-color: rgba(137, 246, 255, 0.42);
    background: rgba(32, 120, 255, 0.18);
}

.jsmd-chat-message.is-assistant {
    justify-self: start;
}

.jsmd-chat-message p {
    margin: 0;
    color: var(--jsmd-text);
    line-height: 1.65;
    white-space: pre-wrap;
}

.jsmd-chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.jsmd-chat-input {
    min-height: 74px;
}

.jsmd-user-chat-page {
    position: relative;
    z-index: 2;
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 68px 18px 18px;
}

.jsmd-user-chat-card {
    width: min(900px, 100%);
    border: 1px solid var(--jsmd-line);
    border-radius: var(--jsmd-radius);
    background: rgba(3, 9, 22, 0.78);
    box-shadow: var(--jsmd-shadow);
    padding: 18px;
}

.jsmd-sidebar {
    display: flex;
    flex-direction: column;
    gap: 26px;
    border-right: 1px solid var(--jsmd-line-soft);
    background: rgba(2, 8, 20, 0.56);
    padding: 24px;
}

.jsmd-brand {
    display: grid;
    gap: 5px;
}

.jsmd-brand strong {
    color: #fff;
    font-size: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.jsmd-brand span {
    color: var(--jsmd-muted);
    font-size: 12px;
}

.jsmd-nav {
    display: grid;
    gap: 10px;
}

.jsmd-nav a {
    border: 1px solid transparent;
    border-radius: var(--jsmd-radius);
    color: var(--jsmd-muted);
    padding: 12px 13px;
    text-decoration: none;
}

.jsmd-nav a:hover,
.jsmd-nav a.is-active {
    border-color: var(--jsmd-line);
    color: var(--jsmd-text);
    background: rgba(72, 221, 255, 0.08);
}

.jsmd-sidebar-footer {
    margin-top: auto;
}

.jsmd-content {
    display: grid;
    align-content: start;
    gap: 20px;
    min-width: 0;
    max-height: 100vh;
    overflow: auto;
    padding: 28px;
}

.jsmd-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--jsmd-line-soft);
    padding-bottom: 20px;
}

.jsmd-page-title {
    margin: 0;
    font-size: 30px;
}

.jsmd-topbar-description {
    max-width: 780px;
    margin: 8px 0 0;
    color: var(--jsmd-muted);
    line-height: 1.65;
}

.jsmd-empty-state {
    min-height: 300px;
    border: 1px dashed rgba(72, 221, 255, 0.36);
    border-radius: var(--jsmd-radius);
    background:
        linear-gradient(135deg, rgba(72, 221, 255, 0.08), transparent),
        rgba(3, 9, 22, 0.42);
    display: grid;
    place-items: center;
    padding: 28px;
    text-align: center;
}

.jsmd-empty-state h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.jsmd-empty-state p {
    max-width: 560px;
    margin: 0;
    color: var(--jsmd-muted);
    line-height: 1.7;
}

.jsmd-grid {
    display: grid;
    gap: 20px;
}

.jsmd-grid-two {
    grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1fr);
}

.jsmd-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.jsmd-span-full {
    grid-column: 1 / -1;
}

.jsmd-panel {
    border: 1px solid var(--jsmd-line-soft);
    border-radius: var(--jsmd-radius);
    background: var(--jsmd-panel);
    box-shadow: inset 0 0 28px rgba(72, 221, 255, 0.05);
    padding: 20px;
}

.jsmd-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.jsmd-section-heading h2 {
    margin: 0;
    color: #f4fdff;
    font-size: 20px;
}

.jsmd-section-heading p {
    margin: 6px 0 0;
    color: var(--jsmd-muted);
    line-height: 1.55;
}

.jsmd-textarea {
    min-height: 114px;
    resize: vertical;
}

select.jsmd-input {
    appearance: none;
}

.jsmd-card-list {
    display: grid;
    gap: 12px;
}

.jsmd-card-link {
    display: grid;
    gap: 7px;
    border: 1px solid var(--jsmd-line-soft);
    border-radius: var(--jsmd-radius);
    color: var(--jsmd-text);
    background: rgba(2, 8, 20, 0.46);
    padding: 15px;
    text-decoration: none;
}

.jsmd-card-link:hover {
    border-color: var(--jsmd-cyan);
    background: rgba(72, 221, 255, 0.08);
}

.jsmd-card-link strong {
    font-size: 16px;
}

.jsmd-card-link em {
    color: var(--jsmd-cyan-bright);
    font-size: 13px;
    font-style: normal;
}

.jsmd-card-link span {
    color: var(--jsmd-muted);
    line-height: 1.55;
}

.jsmd-mini-empty {
    border: 1px dashed rgba(72, 221, 255, 0.28);
    border-radius: var(--jsmd-radius);
    color: var(--jsmd-muted);
    padding: 18px;
}

.jsmd-button-ghost {
    color: var(--jsmd-cyan-bright);
    background: rgba(72, 221, 255, 0.08);
}

.jsmd-agent-settings {
    gap: 20px;
}

.jsmd-competency-list {
    display: grid;
    gap: 14px;
}

.jsmd-competency-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
    gap: 14px;
    border: 1px solid var(--jsmd-line-soft);
    border-radius: var(--jsmd-radius);
    background: rgba(2, 8, 20, 0.34);
    padding: 14px;
}

.jsmd-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.jsmd-file-list a {
    border: 1px solid var(--jsmd-line-soft);
    border-radius: var(--jsmd-radius);
    color: var(--jsmd-cyan-bright);
    background: rgba(72, 221, 255, 0.08);
    padding: 9px 11px;
    text-decoration: none;
}

.jsmd-sticky-actions {
    position: sticky;
    bottom: 18px;
    display: flex;
    justify-content: flex-end;
    border: 1px solid var(--jsmd-line-soft);
    border-radius: var(--jsmd-radius);
    background: rgba(2, 8, 20, 0.84);
    padding: 14px;
    backdrop-filter: blur(10px);
}

.jsmd-tabs {
    display: grid;
    gap: 20px;
}

.jsmd-tab-list {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    gap: 8px;
    border: 1px solid var(--jsmd-line-soft);
    border-radius: var(--jsmd-radius);
    background: rgba(2, 8, 20, 0.46);
    padding: 6px;
}

.jsmd-tab-button {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: var(--jsmd-radius);
    color: var(--jsmd-muted);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0 14px;
    text-transform: uppercase;
}

.jsmd-tab-button.is-active {
    border-color: var(--jsmd-line);
    color: var(--jsmd-text);
    background: rgba(72, 221, 255, 0.1);
}

.jsmd-tab-panel {
    display: none;
}

.jsmd-tab-panel.is-active {
    display: block;
}

.jsmd-ai-result {
    display: grid;
    gap: 10px;
    border: 1px solid var(--jsmd-line-soft);
    border-radius: var(--jsmd-radius);
    margin-top: 18px;
    padding: 16px;
}

.jsmd-ai-result strong {
    color: var(--jsmd-cyan-bright);
}

.jsmd-ai-result p {
    margin: 0;
    color: var(--jsmd-text);
    line-height: 1.75;
    white-space: normal;
}

.jsmd-ai-result.is-success {
    background: rgba(72, 221, 255, 0.08);
}

.jsmd-ai-result.is-error {
    border-color: rgba(255, 107, 138, 0.5);
    background: rgba(255, 107, 138, 0.1);
}

.jsmd-openai-options {
    display: none;
    border-top: 1px solid var(--jsmd-line-soft);
    margin-top: 20px;
    padding-top: 20px;
}

.jsmd-openai-options.is-visible {
    display: block;
}

.jsmd-openai-image-options {
    display: none;
}

.jsmd-openai-image-options.is-visible {
    display: block;
}

.jsmd-openai-deep-model {
    display: none;
}

.jsmd-openai-deep-model.is-visible {
    display: grid;
}

.jsmd-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    border: 1px solid var(--jsmd-line);
    border-radius: var(--jsmd-radius);
    color: var(--jsmd-text);
    background: rgba(2, 8, 20, 0.52);
    padding: 12px 14px;
}

.jsmd-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--jsmd-cyan);
}

.jsmd-generated-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.jsmd-generated-images img {
    width: 100%;
    border: 1px solid var(--jsmd-line-soft);
    border-radius: var(--jsmd-radius);
    background: rgba(2, 8, 20, 0.42);
}

.jsmd-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.jsmd-modal.is-open {
    display: flex;
}

.jsmd-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 6, 16, 0.78);
    backdrop-filter: blur(8px);
}

.jsmd-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: calc(100vh - 44px);
    overflow: auto;
    border: 1px solid var(--jsmd-line);
    border-radius: var(--jsmd-radius);
    background: linear-gradient(135deg, rgba(7, 18, 38, 0.98), rgba(8, 26, 52, 0.96));
    box-shadow: 0 0 54px rgba(72, 221, 255, 0.22);
    padding: 22px;
}

.jsmd-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--jsmd-line-soft);
    margin-bottom: 18px;
    padding-bottom: 16px;
}

.jsmd-modal-header h2 {
    margin: 4px 0 0;
    color: #f4fdff;
    font-size: 22px;
}

.jsmd-icon-button {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--jsmd-line-soft);
    border-radius: var(--jsmd-radius);
    color: var(--jsmd-cyan-bright);
    background: rgba(72, 221, 255, 0.08);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    line-height: 1;
}

@keyframes jsmd-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes jsmd-drift {
    to {
        transform: translate3d(2.4%, -1.8%, 0) scale(1.04);
    }
}

@keyframes jsmd-node-float {
    0%,
    100% {
        margin-top: 0;
    }

    50% {
        margin-top: -14px;
    }
}

@keyframes jsmd-node-pulse {
    0%,
    100% {
        opacity: 0.38;
        transform: scale(0.96);
    }

    50% {
        opacity: 0.72;
        transform: scale(1.04);
    }
}

@keyframes jsmd-node-scan {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 820px) {
    .jsmd-login-shell,
    .jsmd-dashboard {
        grid-template-columns: 1fr;
    }

    .jsmd-login-visual {
        min-height: 280px;
        border-right: 0;
        border-bottom: 1px solid var(--jsmd-line-soft);
    }

    .jsmd-login-panel {
        padding: 28px;
    }

    .jsmd-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--jsmd-line-soft);
    }

    .jsmd-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .jsmd-grid-two,
    .jsmd-grid-three,
    .jsmd-competency-row {
        grid-template-columns: 1fr;
    }

    .jsmd-orbit-map {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: center;
        gap: 22px;
        min-height: 100vh;
        padding: 28px;
    }

    .jsmd-orbit-node,
    .jsmd-orbit-map.is-agent-map .jsmd-orbit-node {
        position: relative;
        left: auto;
        top: auto;
        width: min(38vw, 180px);
        justify-self: center;
        transform: none;
    }

    .jsmd-orbit-node:hover {
        transform: scale(1.035);
    }

    .jsmd-user-back {
        top: 14px;
        left: 14px;
    }

    .jsmd-user-logout {
        top: 14px;
        right: 14px;
    }

    .jsmd-chat-form {
        grid-template-columns: 1fr;
    }

    .jsmd-chat-message {
        max-width: 92%;
    }

    .jsmd-chat-log {
        max-height: 56vh;
    }
}
