:root {
    --bg: #111111;
    --surface: #171717;
    --surface-2: #1f1f1f;
    --surface-3: #252526;
    --panel: #1b1b1b;
    --border: #2c2c2c;
    --muted: #8d8d8d;
    --text: #f3f3f3;
    --text-soft: #cccccc;
    --accent: #0e639c;
    --accent-strong: #1177bb;
    --success: #2aa198;
    --danger: #c94f4f;
    --sidebar-width: 290px;
    --agent-width: 380px;
    --terminal-height: 240px;
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
    --radius: 14px;
    font-family: "Segoe UI", "SF Pro Display", sans-serif;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #3a3a3a #141414;
}

*::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

*::-webkit-scrollbar-track {
    background: #141414;
}

*::-webkit-scrollbar-thumb {
    border-radius: 999px;
    border: 2px solid #141414;
    background: linear-gradient(180deg, #4a4a4a, #2d2d2d);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5a5a5a, #363636);
}

*::-webkit-scrollbar-corner {
    background: #141414;
}

.monaco-editor .monaco-scrollable-element > .scrollbar {
    background: #111111 !important;
}

.monaco-editor .monaco-scrollable-element > .scrollbar.horizontal,
.monaco-editor .monaco-scrollable-element > .scrollbar.vertical {
    background: rgba(17, 17, 17, 0.96) !important;
}

.monaco-editor .monaco-scrollable-element > .scrollbar > .slider {
    border-radius: 999px !important;
    border: 2px solid #111111 !important;
    background: linear-gradient(180deg, #505050, #2f2f2f) !important;
}

.monaco-editor .monaco-scrollable-element > .scrollbar > .slider:hover,
.monaco-editor .monaco-scrollable-element > .scrollbar > .slider.active {
    background: linear-gradient(180deg, #646464, #3b3b3b) !important;
}

.monaco-editor .monaco-scrollable-element > .scrollbar > .slider.active {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25) inset;
}

.monaco-editor .monaco-scrollable-element .shadow {
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.45) !important;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

body {
    overflow: hidden;
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.notice-bar {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(9, 9, 9, 0.94);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: var(--text);
    max-width: min(80vw, 760px);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notice-bar.notice-error {
    border-color: rgba(201, 79, 79, 0.5);
    color: #ffd7d7;
}

.notice-bar.notice-success {
    border-color: rgba(42, 161, 152, 0.5);
    color: #ccfff9;
}

.pwa-install-gate {
    position: fixed;
    inset: 0;
    z-index: 1900;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(14, 99, 156, 0.22), transparent 24%),
        radial-gradient(circle at 80% 18%, rgba(255, 191, 0, 0.14), transparent 20%),
        rgba(7, 7, 7, 0.8);
    backdrop-filter: blur(18px);
}

.pwa-install-card {
    width: min(560px, 100%);
    padding: 28px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(135deg, rgba(17, 17, 17, 0.98), rgba(14, 99, 156, 0.16)),
        linear-gradient(180deg, rgba(37, 37, 38, 0.92), rgba(14, 14, 14, 0.96));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

.pwa-install-card h2 {
    margin: 18px 0 12px;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.pwa-install-card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 16px;
}

.pwa-install-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.pwa-install-hint {
    margin-top: 16px !important;
    font-size: 14px !important;
    color: var(--muted) !important;
}

#app,
.screen {
    width: 100%;
    height: 100%;
}

.screen-start {
    overflow: auto;
    padding: 18px;
    background:
        radial-gradient(circle at top left, rgba(14, 99, 156, 0.22), transparent 28%),
        radial-gradient(circle at top right, rgba(255, 191, 0, 0.12), transparent 22%),
        linear-gradient(180deg, #0d0d0d, #141414 58%, #111111);
}

.screen-auth {
    display: grid;
    place-items: center;
    padding: 24px;
    overflow: auto;
    background:
        radial-gradient(circle at 15% 20%, rgba(14, 99, 156, 0.34), transparent 24%),
        radial-gradient(circle at 85% 18%, rgba(255, 191, 0, 0.14), transparent 18%),
        radial-gradient(circle at 50% 80%, rgba(42, 161, 152, 0.14), transparent 22%),
        linear-gradient(180deg, #090909, #121212 52%, #0f0f0f);
}

.auth-shell {
    width: min(860px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}

.auth-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.auth-card-feature {
    background:
        linear-gradient(135deg, rgba(17, 17, 17, 0.98), rgba(14, 99, 156, 0.14)),
        linear-gradient(180deg, rgba(37, 37, 38, 0.9), rgba(17, 17, 17, 0.98));
}

.auth-card-feature h1 {
    margin: 18px 0 14px;
    max-width: 12ch;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.auth-card-feature p {
    max-width: 58ch;
    margin: 0;
    color: var(--text-soft);
    font-size: 17px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(141, 213, 255, 0.18);
    background: rgba(14, 99, 156, 0.12);
    color: #8dd5ff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 12px;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.auth-login-button {
    min-width: 240px;
}

.auth-actions-note {
    color: var(--text-soft);
    font-size: 14px;
}

.auth-points {
    display: grid;
    gap: 14px;
    margin-top: 0;
}

.auth-point {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-point strong {
    font-size: 15px;
}

.auth-point span {
    color: var(--text-soft);
    font-size: 14px;
}

.auth-signature {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.auth-signature span {
    color: var(--text-soft);
    font-size: 14px;
}

.auth-signature a {
    color: #8dd5ff;
    text-decoration: none;
    font-weight: 600;
}

.auth-signature a:hover {
    text-decoration: underline;
}

.start-shell {
    width: min(1440px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 18px;
}

.start-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 15, 15, 0.72);
    box-shadow: var(--shadow);
}

.start-header strong {
    display: block;
    margin-top: 4px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
}

.user-chip-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.user-chip strong,
.user-chip span,
.user-menu-copy strong,
.user-menu-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chip span {
    color: var(--text-soft);
    font-size: 12px;
}

.user-chip-compact {
    min-width: 0;
    max-width: 240px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(120, 195, 255, 0.24);
    background:
        radial-gradient(circle at 30% 30%, rgba(113, 205, 255, 0.34), rgba(14, 99, 156, 0.18) 55%, rgba(8, 24, 34, 0.94)),
        #0f1418;
    color: #e8f6ff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.user-avatar-small {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 11px;
}

.panel-card {
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(37, 37, 38, 0.92), rgba(23, 23, 23, 0.97));
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.toolbar-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.toolbar-label-agent {
    text-transform: none;
    letter-spacing: 0.02em;
}

.start-grid {
    display: grid;
    grid-template-columns: minmax(340px, 420px) 1fr;
    gap: 24px;
    align-items: start;
}

.panel-card {
    padding: 20px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.panel-head h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.panel-head p {
    margin: 0;
    color: var(--text-soft);
}

.connect-form {
    display: grid;
    gap: 14px;
}

.connect-editing-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(86, 162, 214, 0.18);
    background: rgba(14, 99, 156, 0.08);
    color: #d9efff;
}

.connect-editing-label {
    font-size: 13px;
    font-weight: 600;
}

.connect-form label {
    display: grid;
    gap: 6px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

.field-small {
    width: 110px;
}

.checkbox-row {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding-top: 28px;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    background: #101010;
    color: var(--text);
    border-radius: 10px;
    padding: 11px 12px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(17, 119, 187, 0.72);
    box-shadow: 0 0 0 3px rgba(17, 119, 187, 0.16);
}

textarea {
    resize: vertical;
    min-height: 140px;
}

.auth-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1;
    transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease, color 0.18s ease;
    text-decoration: none;
}

.button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.button-primary {
    background: rgba(14, 99, 156, 0.14);
    border-color: rgba(14, 99, 156, 0.26);
    color: #d7efff;
}

.button-primary:hover {
    background: rgba(14, 99, 156, 0.22);
    border-color: rgba(68, 150, 204, 0.32);
    color: #eef9ff;
}

.button-danger {
    background: rgba(144, 42, 42, 0.16);
    border-color: rgba(180, 63, 63, 0.28);
    color: #ffd6d6;
}

.button-danger:hover {
    background: rgba(144, 42, 42, 0.24);
    border-color: rgba(204, 92, 92, 0.34);
    color: #fff0f0;
}

.button-secondary {
    background: rgba(255, 255, 255, 0.015);
    color: var(--text-soft);
    border-color: rgba(255, 255, 255, 0.08);
}

.button-secondary:hover,
.icon-button:hover {
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
}

.button-small {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
}

.button-block {
    width: 100%;
}

.saved-projects {
    display: grid;
    gap: 14px;
}

.saved-project-card {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    display: grid;
    gap: 10px;
}

.saved-project-card h3,
.saved-project-card p {
    margin: 0;
}

.saved-project-meta {
    color: var(--text-soft);
    font-size: 13px;
    display: grid;
    gap: 4px;
}

.saved-project-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.saved-project-actions-leading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.empty-state {
    padding: 18px;
    border-radius: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    color: var(--muted);
}

.screen-workspace {
    display: grid;
    grid-template-rows: 42px 1fr;
    min-height: 0;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 14px;
    background: #181818;
    border-bottom: 1px solid var(--border);
}

.workspace-connection {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.workspace-connection-label {
    min-width: 0;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.workspace-fullscreen-button.is-active {
    border-color: rgba(14, 99, 156, 0.28);
    color: #d7efff;
    background: rgba(14, 99, 156, 0.12);
}

.user-menu {
    position: relative;
    min-width: 0;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 240px;
    padding: 5px 10px 5px 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.user-menu-toggle:hover {
    border-color: rgba(120, 195, 255, 0.18);
    background: rgba(255, 255, 255, 0.045);
}

.user-menu-copy {
    min-width: 0;
    display: block;
    text-align: left;
}

.user-menu-copy span {
    color: var(--text-soft);
    font-size: 12px;
}

.user-menu-caret {
    color: var(--muted);
    font-size: 12px;
    flex: 0 0 auto;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    display: grid;
    gap: 4px;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(20, 20, 20, 0.98);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
    z-index: 40;
}

.user-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    text-decoration: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.workspace-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: var(--sidebar-width) 6px minmax(0, 1fr) 6px var(--agent-width);
    overflow: hidden;
    isolation: isolate;
}

.sidebar,
.main-panel,
.agent-panel {
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.sidebar {
    display: grid;
    grid-template-rows: auto 1fr;
    border-right: 1px solid var(--border);
    background: var(--surface);
    transition: box-shadow 0.18s ease, background 0.18s ease;
}

.sidebar.is-drop-target {
    background:
        linear-gradient(180deg, rgba(18, 34, 47, 0.96), rgba(15, 23, 31, 0.98)),
        var(--surface);
    box-shadow: inset 0 0 0 1px rgba(68, 150, 204, 0.28);
}

.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.panel-toolbar-heading {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.panel-toolbar-title {
    min-width: 0;
    font-size: 18px;
    line-height: 1.1;
    color: var(--text);
}

.panel-toolbar-meta {
    min-width: 0;
    color: var(--text-soft);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel-toolbar-explorer {
    align-items: stretch;
    flex-direction: column;
}

.panel-toolbar-explorer .toolbar-actions {
    justify-content: flex-start;
    padding-top: 2px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-button {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
    color: var(--muted);
}

.explorer-pane {
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.explorer-tree {
    height: 100%;
    overflow: auto;
    padding: 8px 6px 18px;
    transition: background 0.18s ease;
}

.explorer-tree.is-drop-target {
    background: linear-gradient(180deg, rgba(14, 99, 156, 0.08), rgba(14, 99, 156, 0.02));
}

.tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.tree-list > li {
    min-width: 0;
}

.tree-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 6px 8px;
    padding-left: calc(8px + var(--depth, 0) * 16px);
    text-align: left;
    border-radius: 8px;
    min-width: 0;
    overflow: hidden;
}

.tree-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tree-row.is-drop-target {
    background: rgba(14, 99, 156, 0.22);
    box-shadow: inset 0 0 0 1px rgba(112, 196, 255, 0.26);
}

.tree-row.is-selected {
    background: rgba(14, 99, 156, 0.24);
}

.tree-row.is-active {
    background: rgba(14, 99, 156, 0.38);
}

.tree-caret,
.tree-icon {
    width: 14px;
    flex: 0 0 14px;
    text-align: center;
    color: var(--muted);
}

.tree-label {
    display: block;
    min-width: 0;
    flex: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-meta {
    color: var(--muted);
    font-size: 12px;
}

.panel-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 10, 12, 0.12);
    backdrop-filter: blur(1px);
    cursor: progress;
}

.panel-loading-overlay-editor {
    z-index: 12;
}

.panel-loading-card {
    width: min(100%, 260px);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 12, 15, 0.86);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
}

.panel-loading-card-editor {
    width: min(100%, 270px);
}

.panel-loading-visual {
    position: relative;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.14);
    border-top-color: rgba(118, 198, 255, 0.9);
    animation: panel-loading-spin 0.75s linear infinite;
}

.panel-loading-visual::before {
    content: none;
}

.panel-loading-orb,
.panel-loading-ring,
.panel-loading-bar {
    display: none;
}

.panel-loading-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.panel-loading-copy strong {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
}

.panel-loading-copy span {
    font-size: 12px;
    line-height: 1.35;
    color: rgba(218, 232, 242, 0.66);
}

@keyframes panel-loading-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.explorer-context-menu {
    position: fixed;
    z-index: 1600;
    min-width: 168px;
    display: grid;
    gap: 4px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(30, 30, 30, 0.98), rgba(22, 22, 22, 0.98)),
        #171717;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.42);
}

.explorer-context-action {
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    text-align: left;
    transition: background 0.16s ease, color 0.16s ease;
}

.explorer-context-action:hover {
    background: rgba(255, 255, 255, 0.06);
}

.explorer-context-action-danger {
    color: #ffd3d3;
}

.explorer-context-action-danger:hover {
    background: rgba(201, 79, 79, 0.16);
    color: #ffe3e3;
}

.resizer {
    background: transparent;
    position: relative;
    z-index: 10;
}

.resizer::after {
    content: "";
    position: absolute;
    inset: 0;
    transition: background 0.18s ease;
}

.resizer:hover::after,
.resizer.is-dragging::after {
    background: rgba(14, 99, 156, 0.42);
}

.resizer-vertical {
    cursor: col-resize;
}

.resizer-horizontal {
    cursor: row-resize;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.main-panel {
    display: grid;
    grid-template-rows: minmax(0, 1fr) 6px var(--terminal-height);
    background: var(--surface-2);
    position: relative;
    z-index: 0;
}

.agent-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    background:
        linear-gradient(180deg, rgba(20, 20, 20, 0.98), rgba(16, 16, 16, 0.98)),
        radial-gradient(circle at top, rgba(14, 99, 156, 0.08), transparent 38%);
    border-left: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.agent-meta {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.agent-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.agent-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    font-size: 12px;
    font-weight: 600;
}

.agent-status-running,
.agent-status-starting {
    color: #8dd5ff;
    border-color: rgba(141, 213, 255, 0.24);
    background: rgba(14, 99, 156, 0.18);
}

.agent-status-succeeded {
    color: #b7fff5;
    border-color: rgba(42, 161, 152, 0.24);
    background: rgba(42, 161, 152, 0.16);
}

.agent-status-failed,
.agent-status-cancelled {
    color: #ffd0d0;
    border-color: rgba(201, 79, 79, 0.28);
    background: rgba(201, 79, 79, 0.14);
}

.agent-project-path {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-soft);
    font-size: 12px;
}

.agent-helper-text {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.agent-messages {
    overflow: auto;
    padding: 12px;
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 0;
    background:
        linear-gradient(180deg, rgba(15, 15, 15, 0.85), rgba(20, 20, 20, 0.94)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent);
}

.agent-messages .empty-state {
    font-size: 13px;
    line-height: 1.45;
}

.agent-message {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    min-width: 0;
}

.agent-message-user {
    background: rgba(14, 99, 156, 0.12);
    border-color: rgba(14, 99, 156, 0.24);
}

.agent-message-assistant {
    background: rgba(255, 255, 255, 0.03);
}

.agent-message-progress {
    background:
        linear-gradient(180deg, rgba(10, 26, 36, 0.94), rgba(13, 19, 24, 0.96)),
        rgba(255, 255, 255, 0.02);
    border-color: rgba(14, 99, 156, 0.24);
}

.agent-message-system {
    background: rgba(201, 79, 79, 0.1);
    border-color: rgba(201, 79, 79, 0.18);
}

.agent-message-live {
    border-style: dashed;
}

.agent-message-head {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.agent-message-content {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.55;
    font-size: 14px;
    min-width: 0;
    max-width: 100%;
}

.agent-message-content.is-markdown {
    white-space: normal;
    display: grid;
    gap: 10px;
    min-width: 0;
}

.agent-message-content.is-markdown > :first-child {
    margin-top: 0;
}

.agent-message-content.is-markdown > :last-child {
    margin-bottom: 0;
}

.agent-message-content.is-markdown p,
.agent-message-content.is-markdown ul,
.agent-message-content.is-markdown ol,
.agent-message-content.is-markdown pre,
.agent-message-content.is-markdown h1,
.agent-message-content.is-markdown h2,
.agent-message-content.is-markdown h3 {
    margin: 0;
    min-width: 0;
    max-width: 100%;
}

.agent-message-content.is-markdown ul,
.agent-message-content.is-markdown ol {
    padding-left: 20px;
}

.agent-message-content.is-markdown li + li {
    margin-top: 6px;
}

.agent-message-actions {
    display: flex;
    justify-content: flex-start;
}

.agent-message-summary-button {
    padding-inline: 12px;
    min-height: 30px;
    font-size: 12px;
    border-color: rgba(14, 99, 156, 0.22);
    background: rgba(14, 99, 156, 0.08);
}

.agent-message-summary-button:hover {
    border-color: rgba(14, 99, 156, 0.34);
    background: rgba(14, 99, 156, 0.14);
}

.agent-message-content.is-markdown h1,
.agent-message-content.is-markdown h2,
.agent-message-content.is-markdown h3 {
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.agent-message-content.is-markdown h1 {
    font-size: 20px;
}

.agent-message-content.is-markdown h2 {
    font-size: 17px;
}

.agent-message-content.is-markdown h3 {
    font-size: 15px;
}

.agent-message-content.is-markdown strong {
    color: #ffffff;
    font-weight: 700;
}

.agent-message-content.is-markdown em {
    color: #d9edf9;
    font-style: italic;
}

.agent-message-content.is-markdown code {
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-family: "Cascadia Code", "Fira Code", monospace;
    font-size: 12px;
}

.agent-message-content.is-markdown pre {
    overflow: auto;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(8, 11, 16, 0.94);
    border: 1px solid rgba(14, 99, 156, 0.16);
}

.agent-message-content.is-markdown pre code {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 12px;
    line-height: 1.65;
}

.agent-form {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.16);
}

.agent-input-wrap {
    display: grid;
    gap: 6px;
}

.agent-loading {
    display: grid;
    gap: 14px;
    min-height: 212px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(14, 99, 156, 0.26);
    background:
        radial-gradient(circle at top, rgba(14, 99, 156, 0.16), transparent 44%),
        linear-gradient(180deg, rgba(8, 14, 22, 0.96), rgba(9, 9, 11, 0.96));
    overflow: hidden;
    position: relative;
}

.agent-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, transparent 14%, rgba(255, 255, 255, 0.07) 34%, transparent 56%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 46%);
    transform: translateX(-65%);
    animation: agent-loading-sheen 2.8s linear infinite;
    pointer-events: none;
}

.agent-loading-stage {
    position: relative;
    min-height: 124px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
        radial-gradient(circle at center, rgba(14, 99, 156, 0.1), transparent 64%);
    overflow: hidden;
}

.agent-loading-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 18px 18px;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1), transparent 78%);
    opacity: 0.55;
}

.agent-loading-core {
    position: absolute;
    left: 26px;
    top: 50%;
    width: 92px;
    height: 92px;
    transform: translateY(-50%);
}

.agent-loading-ring,
.agent-loading-pulse,
.agent-loading-brain,
.agent-loading-orb {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.agent-loading-ring {
    border: 1px solid rgba(111, 196, 255, 0.22);
}

.agent-loading-ring-1 {
    animation: agent-loading-spin 5.8s linear infinite;
}

.agent-loading-ring-2 {
    inset: 10px;
    border-color: rgba(42, 161, 152, 0.26);
    animation: agent-loading-spin-reverse 4.8s linear infinite;
}

.agent-loading-ring-3 {
    inset: 22px;
    border-color: rgba(255, 255, 255, 0.18);
    animation: agent-loading-spin 3.6s linear infinite;
}

.agent-loading-pulse {
    inset: 18px;
    background: radial-gradient(circle, rgba(17, 119, 187, 0.36), rgba(17, 119, 187, 0.04) 62%, transparent 74%);
    animation: agent-loading-pulse 1.9s ease-in-out infinite;
}

.agent-loading-brain {
    inset: 29px;
    background:
        radial-gradient(circle at 34% 38%, rgba(255, 255, 255, 0.95), transparent 18%),
        radial-gradient(circle at 66% 38%, rgba(255, 255, 255, 0.85), transparent 18%),
        radial-gradient(circle at 50% 64%, rgba(42, 161, 152, 0.84), transparent 28%),
        linear-gradient(135deg, rgba(111, 196, 255, 0.7), rgba(17, 119, 187, 0.18));
    box-shadow: 0 0 26px rgba(17, 119, 187, 0.4);
}

.agent-loading-orb {
    width: 10px;
    height: 10px;
    inset: auto;
    background: #b9ebff;
    box-shadow: 0 0 12px rgba(111, 196, 255, 0.8);
}

.agent-loading-orb-1 {
    top: 4px;
    left: 50%;
    margin-left: -5px;
    animation: agent-loading-orbit-1 3.2s linear infinite;
}

.agent-loading-orb-2 {
    top: 50%;
    right: 2px;
    margin-top: -5px;
    animation: agent-loading-orbit-2 4.6s linear infinite;
}

.agent-loading-orb-3 {
    bottom: 8px;
    left: 12px;
    animation: agent-loading-orbit-3 4s linear infinite;
}

.agent-loading-code {
    position: absolute;
    top: 18px;
    right: 18px;
    left: 150px;
    display: grid;
    gap: 10px;
}

.agent-loading-code-line {
    position: relative;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.agent-loading-code-line::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(17, 119, 187, 0.18), rgba(111, 196, 255, 0.84), rgba(42, 161, 152, 0.46));
    transform-origin: left center;
    animation: agent-loading-code-scan 2.4s ease-in-out infinite;
}

.agent-loading-code-line-1 {
    width: 76%;
}

.agent-loading-code-line-2 {
    width: 92%;
}

.agent-loading-code-line-2::before {
    animation-delay: 0.2s;
}

.agent-loading-code-line-3 {
    width: 64%;
}

.agent-loading-code-line-3::before {
    animation-delay: 0.45s;
}

.agent-loading-code-line-4 {
    width: 88%;
}

.agent-loading-code-line-4::before {
    animation-delay: 0.7s;
}

.agent-loading-code-line-5 {
    width: 58%;
}

.agent-loading-code-line-5::before {
    animation-delay: 0.95s;
}

.agent-loading-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 7px;
}

.agent-loading-copy strong {
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
}

.agent-loading-copy p {
    margin: 0;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.55;
}

#agent-prompt {
    min-height: 132px;
    resize: vertical;
    font-family: "Cascadia Code", "Fira Code", monospace;
    font-size: 13px;
    line-height: 1.5;
}

#agent-prompt::placeholder {
    font-size: 13px;
}

.agent-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes agent-loading-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes agent-loading-spin-reverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

@keyframes agent-loading-pulse {
    0%,
    100% {
        transform: scale(0.92);
        opacity: 0.54;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes agent-loading-code-scan {
    0%,
    100% {
        transform: scaleX(0.28);
        opacity: 0.38;
    }

    50% {
        transform: scaleX(1);
        opacity: 1;
    }
}

@keyframes agent-loading-sheen {
    from {
        transform: translateX(-65%);
    }

    to {
        transform: translateX(135%);
    }
}

@keyframes agent-loading-orbit-1 {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(22px, 16px);
    }

    50% {
        transform: translate(0, 34px);
    }

    75% {
        transform: translate(-22px, 16px);
    }

    100% {
        transform: translate(0, 0);
    }
}

@keyframes agent-loading-orbit-2 {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-22px, -20px);
    }

    50% {
        transform: translate(-44px, 0);
    }

    75% {
        transform: translate(-22px, 20px);
    }

    100% {
        transform: translate(0, 0);
    }
}

@keyframes agent-loading-orbit-3 {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(26px, -12px);
    }

    50% {
        transform: translate(46px, -30px);
    }

    75% {
        transform: translate(18px, -20px);
    }

    100% {
        transform: translate(0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .agent-loading::before,
    .agent-loading-ring-1,
    .agent-loading-ring-2,
    .agent-loading-ring-3,
    .agent-loading-pulse,
    .agent-loading-orb-1,
    .agent-loading-orb-2,
    .agent-loading-orb-3,
    .agent-loading-code-line::before {
        animation: none !important;
    }
}

.system-dialog-modal {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(5, 6, 8, 0.74);
    backdrop-filter: blur(16px);
}

.system-dialog-card {
    width: min(520px, 100%);
    display: grid;
    gap: 18px;
    padding: 22px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(145deg, rgba(25, 25, 26, 0.98), rgba(16, 16, 17, 0.98)),
        radial-gradient(circle at top left, rgba(73, 140, 188, 0.1), transparent 54%);
    box-shadow: 0 30px 72px rgba(0, 0, 0, 0.42);
}

.system-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.system-dialog-heading {
    display: grid;
    gap: 8px;
}

.system-dialog-heading h2 {
    margin: 0;
    font-size: 25px;
    line-height: 1.04;
    letter-spacing: -0.03em;
}

.system-dialog-message {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.65;
    white-space: pre-wrap;
}

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

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

.system-dialog-field span {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.system-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.agent-report-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: grid;
    place-items: center;
    padding: 26px;
    background: rgba(6, 6, 6, 0.72);
    backdrop-filter: blur(16px);
}

.agent-report-dialog {
    width: min(820px, 100%);
    max-height: min(86vh, 920px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #151515;
    box-shadow: 0 34px 80px rgba(0, 0, 0, 0.42);
}

.agent-report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.agent-report-heading h2 {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.agent-report-meta {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
}

.agent-report-content {
    overflow: auto;
    padding: 18px 22px 22px;
    display: grid;
    gap: 14px;
}

.agent-report-card {
    display: grid;
    gap: 10px;
    padding: 15px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
}

.agent-report-card h3 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.01em;
}

.agent-report-summary {
    color: var(--text-soft);
    line-height: 1.6;
    white-space: pre-wrap;
}

.agent-report-stats-inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
    gap: 10px;
}

.agent-report-chip {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.agent-report-chip strong {
    font-size: 18px;
    line-height: 1.15;
}

.agent-report-chip span {
    color: var(--muted);
    font-size: 12px;
}

.agent-report-list,
.agent-report-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.agent-report-list li,
.agent-report-file {
    border-radius: 12px;
}

.agent-report-list li {
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-soft);
    line-height: 1.55;
}

.agent-report-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    color: inherit;
    text-align: left;
    font: inherit;
    appearance: none;
}

.agent-report-file.is-clickable {
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.agent-report-file.is-clickable:hover {
    border-color: rgba(14, 99, 156, 0.4);
    background: rgba(14, 99, 156, 0.08);
    transform: translateY(-1px);
}

.agent-report-file code {
    font-family: "Cascadia Code", "Fira Code", monospace;
    font-size: 13px;
    word-break: break-word;
}

.agent-report-hint {
    margin: -2px 0 2px;
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.5;
}

.agent-report-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.agent-report-badge-created {
    color: #b7fff5;
    background: rgba(42, 161, 152, 0.16);
    border: 1px solid rgba(42, 161, 152, 0.26);
}

.agent-report-badge-updated {
    color: #d9f2ff;
    background: rgba(14, 99, 156, 0.18);
    border: 1px solid rgba(14, 99, 156, 0.26);
}

.agent-report-badge-deleted {
    color: #ffd6d6;
    background: rgba(201, 79, 79, 0.16);
    border: 1px solid rgba(201, 79, 79, 0.26);
}

.agent-report-note {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 191, 0, 0.18);
    background: rgba(255, 191, 0, 0.08);
    color: #f9e4a8;
    line-height: 1.5;
}

.editor-panel {
    min-height: 0;
    display: grid;
    grid-template-rows: 38px minmax(0, 1fr);
}

.tabs-bar {
    display: flex;
    overflow: auto hidden;
    border-bottom: 1px solid var(--border);
    background: #181818;
}

.tab {
    max-width: 240px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid var(--border);
    background: transparent;
    color: var(--text-soft);
    white-space: nowrap;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tab.is-active {
    background: var(--surface-3);
    color: var(--text);
}

.tab-activate {
    min-width: 0;
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: transparent;
    border: 0;
    color: inherit;
}

.tab-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-close {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 0;
    background: transparent;
    color: inherit;
}

.tab-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tab-dirty {
    color: #ffd65c;
}

.editor-frame {
    min-height: 0;
    position: relative;
}

#editor {
    width: 100%;
    height: 100%;
}

.editor-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    background:
        radial-gradient(circle at center, rgba(14, 99, 156, 0.18), transparent 26%),
        linear-gradient(180deg, rgba(31, 31, 31, 0.6), rgba(22, 22, 22, 0.92));
    z-index: 5;
}

.terminal-panel {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #161616;
}

.terminal-output {
    padding: 10px 12px;
    overflow: auto;
    background:
        linear-gradient(180deg, rgba(12, 12, 12, 0.86), rgba(22, 22, 22, 0.94)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent);
    font-family: "Cascadia Code", "Fira Code", monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.terminal-line {
    margin: 0 0 8px;
}

.terminal-line.command {
    color: #8dd5ff;
}

.terminal-line.meta {
    color: var(--muted);
}

.terminal-line.error {
    color: #ffb0b0;
}

.terminal-form {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 6px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: rgba(17, 17, 17, 0.96);
}

.terminal-prompt {
    color: #8dd5ff;
    font-family: "Cascadia Code", "Fira Code", monospace;
    white-space: nowrap;
}

#terminal-input {
    background: #0f0f0f;
    border-radius: 8px;
    border-color: #252525;
    font-family: "Cascadia Code", "Fira Code", monospace;
    min-height: 34px;
}

@media (max-width: 1100px) {
    .start-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .screen-auth,
    .screen-start {
        padding: 14px;
    }

    .auth-card,
    .panel-card {
        padding: 18px;
    }

    .auth-actions {
        align-items: stretch;
    }

    .auth-login-button {
        width: 100%;
        min-width: 0;
    }

    .system-dialog-modal,
    .agent-report-modal {
        padding: 14px;
    }

    .system-dialog-card {
        padding: 18px;
    }

    .system-dialog-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .agent-report-stats-inline {
        grid-template-columns: 1fr;
    }

    .agent-report-file {
        align-items: flex-start;
        flex-direction: column;
    }

    .start-header {
        flex-direction: column;
        align-items: stretch;
    }

    .user-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .workspace-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .resizer-vertical,
    #agent-resizer,
    .agent-panel {
        display: none;
    }

    .main-panel {
        grid-template-rows: minmax(0, 1fr) 6px 220px;
    }

    .workspace-header {
        flex-wrap: wrap;
        padding: 10px 12px;
    }

    .workspace-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .pwa-install-card {
        padding: 22px 18px;
    }

    .pwa-install-actions {
        flex-direction: column;
    }
}
