:root {
    --bg: #eef1f5;
    --surface: #ffffff;
    --surface-soft: #f7f8fa;
    --sidebar: #151b26;
    --sidebar-surface: #1c2533;
    --sidebar-border: rgba(255, 255, 255, 0.09);
    --sidebar-text: #e7edf5;
    --sidebar-muted: #93a0b4;
    --sidebar-hover: rgba(255, 255, 255, 0.07);
    --sidebar-active: rgba(74, 144, 226, 0.2);
    --sidebar-accent: #68b2ff;
    --border: #d8dde5;
    --border-strong: #c6ccd6;
    --text: #18212f;
    --text-muted: #667085;
    --text-soft: #8b95a5;
    --accent: #0969da;
    --accent-strong: #0757b8;
    --accent-soft: #dcecff;
    --success: #16803c;
    --warning: #b25e09;
    --danger: #c4314b;
    --danger-soft: #fdecef;
    --shadow: 0 12px 30px rgba(23, 34, 52, 0.16);
    --radius: 6px;
    font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
}

.remote-view {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #081018;
    color: #e8eef5;
}

.remote-view[hidden],
.remote-overlay[hidden] {
    display: none !important;
}

.remote-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 58px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #101923;
}

.remote-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
}

.remote-title div {
    display: grid;
    gap: 2px;
}

.remote-title strong {
    font-size: 14px;
}

.remote-title small,
.remote-statusbar {
    color: #91a1b2;
    font-size: 12px;
}

.remote-live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #8b98a7;
    box-shadow: 0 0 0 4px rgba(139, 152, 167, 0.12);
}

.remote-live-dot.online {
    background: #26c281;
    box-shadow: 0 0 0 4px rgba(38, 194, 129, 0.14);
}

.remote-toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.remote-toolbar-actions {
    margin-left: auto;
}

.remote-field {
    display: grid;
    gap: 3px;
    color: #91a1b2;
    font-size: 11px;
}

.remote-field select,
.remote-field input {
    height: 30px;
    min-width: 104px;
    padding: 0 8px;
    border: 1px solid #2c3b4b;
    border-radius: 6px;
    background: #162331;
    color: #e8eef5;
}

.remote-custom-size {
    display: flex;
    align-items: end;
    gap: 5px;
    padding-top: 15px;
}

.remote-custom-size[hidden] {
    display: none !important;
}

.remote-custom-size input {
    width: 72px;
    min-width: 72px;
}

.remote-switch {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid #2c3b4b;
    border-radius: 6px;
    background: #162331;
    cursor: pointer;
    user-select: none;
}

.remote-switch input {
    accent-color: #2f81f7;
}

.remote-switch span {
    font-size: 13px;
}

.remote-icon-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid #2c3b4b;
    border-radius: 6px;
    background: #162331;
    color: #dce6f0;
    cursor: pointer;
}

.remote-icon-button:hover {
    border-color: #46617c;
    background: #1d2d3e;
}

.remote-icon-button.active {
    border-color: #4a88ce;
    background: #1b4f82;
    color: #ffffff;
}

.remote-icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.remote-icon-button.danger {
    color: #ff8b8b;
}

.remote-icon-button svg {
    width: 17px;
    height: 17px;
}

.remote-stage {
    position: relative;
    display: grid;
    min-height: 0;
    overflow: hidden;
    background:
        linear-gradient(45deg, #0c141c 25%, transparent 25%),
        linear-gradient(-45deg, #0c141c 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #0c141c 75%),
        linear-gradient(-45deg, transparent 75%, #0c141c 75%);
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
    outline: none;
}

.remote-stage video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
}

.remote-view[data-pointer-locked="true"] .remote-stage video {
    cursor: none;
}

.remote-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 10px;
    background: rgba(5, 10, 15, 0.78);
    color: #dce6f0;
    text-align: center;
}

.remote-overlay span {
    color: #91a1b2;
    font-size: 13px;
}

.remote-drop-zone {
    position: absolute;
    inset: 18px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 8px;
    border: 2px dashed #4a88ce;
    border-radius: 10px;
    background: rgba(15, 55, 92, 0.86);
    color: #f2f7fb;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
}

.remote-stage.dragging .remote-drop-zone {
    opacity: 1;
}

.remote-statusbar {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 34px;
    padding: 0 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #101923;
}

.remote-statusbar span:last-child {
    margin-left: auto;
    color: #7fb7ff;
}

@media (max-width: 1100px) {
    .remote-toolbar {
        flex-wrap: wrap;
    }

    .remote-title {
        min-width: 150px;
    }

    .remote-toolbar-actions {
        margin-left: 0;
    }
}

@media (max-width: 720px) {
    .remote-toolbar {
        gap: 8px;
        padding: 7px;
    }

    .remote-title {
        width: 100%;
    }

    .remote-field select {
        min-width: 92px;
    }

    .remote-switch span {
        display: none;
    }

    .remote-statusbar {
        gap: 8px;
        overflow: auto;
        white-space: nowrap;
    }
}

.terminal-view {
    position: fixed;
    inset: 0;
    z-index: 1210;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #0b1018;
    color: #e5edf7;
}

.terminal-view[hidden],
.terminal-overlay[hidden] {
    display: none !important;
}

.terminal-toolbar {
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 16px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #111923;
}

.terminal-title {
    display: flex;
    min-width: 210px;
    align-items: center;
    gap: 10px;
}

.terminal-title div {
    display: grid;
    gap: 2px;
}

.terminal-title strong {
    font-size: 14px;
}

.terminal-title small {
    color: #91a1b2;
    font-size: 12px;
}

.terminal-live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #8b98a7;
    box-shadow: 0 0 0 4px rgba(139, 152, 167, 0.12);
}

.terminal-live-dot.online {
    background: #26c281;
    box-shadow: 0 0 0 4px rgba(38, 194, 129, 0.14);
}

.terminal-shell-switch {
    display: inline-flex;
    padding: 3px;
    border: 1px solid #2c3b4b;
    border-radius: 6px;
    background: #0e1620;
}

.terminal-shell {
    min-width: 92px;
    height: 28px;
    padding: 0 12px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #91a1b2;
    cursor: pointer;
    font-size: 12px;
}

.terminal-shell:hover {
    color: #dce6f0;
}

.terminal-shell.active {
    background: #1f5f9d;
    color: #ffffff;
}

.terminal-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.terminal-icon-button {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #2c3b4b;
    border-radius: 6px;
    background: #162331;
    color: #dce6f0;
    cursor: pointer;
}

.terminal-icon-button:hover {
    border-color: #46617c;
    background: #1d2d3e;
}

.terminal-icon-button.danger {
    color: #ff8b8b;
}

.terminal-icon-button svg {
    width: 17px;
    height: 17px;
}

.terminal-stage {
    position: relative;
    min-height: 0;
    padding: 10px 12px;
    overflow: hidden;
    background: #0b1018;
}

.terminal-container {
    width: 100%;
    height: 100%;
}

.terminal-container .xterm {
    height: 100%;
}

.terminal-container .xterm-viewport {
    scrollbar-color: #34465a #0b1018;
}

.terminal-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 10px;
    background: rgba(7, 11, 17, 0.88);
    color: #dce6f0;
    text-align: center;
}

.terminal-overlay span {
    color: #91a1b2;
    font-size: 13px;
}

.terminal-statusbar {
    display: flex;
    min-height: 34px;
    align-items: center;
    gap: 22px;
    padding: 0 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #111923;
    color: #91a1b2;
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 12px;
}

.terminal-statusbar span:last-child {
    margin-left: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 800px) {
    .terminal-toolbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 7px;
    }

    .terminal-title {
        width: 100%;
        min-width: 0;
    }

    .terminal-shell {
        min-width: 78px;
    }

    .terminal-toolbar-actions {
        margin-left: 0;
    }

    .terminal-statusbar {
        gap: 10px;
        overflow: auto;
        white-space: nowrap;
    }
}

.admin-view {
    overflow: auto;
    padding: 18px;
}

.admin-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.admin-page-head h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

.admin-page-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.update-version-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.update-version-strip > div {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-right: 1px solid var(--border);
}

.update-version-strip > div:last-child {
    border-right: 0;
}

.update-version-strip span {
    color: var(--text-muted);
    font-size: 11px;
}

.update-version-strip strong {
    overflow-wrap: anywhere;
    font-size: 13px;
}

.admin-tabs {
    margin-bottom: 14px;
}

.admin-content,
.settings-content {
    display: grid;
    min-width: 0;
    gap: 16px;
}

.admin-section {
    min-width: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.admin-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
}

.admin-section-head h3 {
    margin: 0;
    font-size: 15px;
}

.admin-section-head p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.update-upload-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(160px, 1fr) auto;
    align-items: end;
    gap: 10px;
    padding: 0 0 14px;
}

.update-upload-form.agent-upload {
    grid-template-columns: 130px minmax(220px, 1fr) minmax(180px, 1fr) auto;
}

.admin-field {
    display: grid;
    min-width: 0;
    gap: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.admin-field input,
.admin-field select,
.setting-field input,
.setting-field select {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 9px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: #fff;
    color: var(--text);
}

.admin-table-wrap {
    overflow: auto;
    border-top: 1px solid var(--border);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.admin-table th,
.admin-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: var(--text-muted);
    background: var(--surface-soft);
    font-weight: 600;
    white-space: nowrap;
}

.admin-table td.actions {
    text-align: right;
    white-space: nowrap;
}

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

.update-scope-select {
    width: 132px;
    height: 38px;
    appearance: none;
    padding: 0 34px 0 12px;
    border: 1px solid #d2dbe7;
    border-radius: 8px;
    outline: 0;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667588' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 16px;
    color: #18212f;
    box-shadow: 0 1px 2px rgba(32, 44, 60, 0.06);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    text-overflow: ellipsis;
    transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.update-scope-select:hover {
    border-color: #9eacc0;
    background-color: #ffffff;
}

.update-scope-select:focus {
    border-color: #3b82d0;
    background-color: #ffffff;
    box-shadow:
        0 0 0 4px rgba(59, 130, 208, 0.13),
        0 2px 6px rgba(32, 66, 104, 0.08);
}

.admin-actions .button {
    height: 38px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 8px;
}

.admin-actions .icon-button {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 8px;
}

.admin-actions .icon-button.danger {
    border-color: #e7a6b4;
    color: #9f203a;
    background: #fff;
}

.admin-actions .icon-button.danger:hover {
    border-color: #d9788d;
    background: #fff5f7;
}

.settings-group {
    display: grid;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.settings-group h3 {
    margin: 0;
    font-size: 15px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
}

.setting-field {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.setting-field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #344054;
    font-size: 12px;
    font-weight: 600;
}

.setting-field-help {
    color: var(--text-muted);
    font-size: 11px;
}

.setting-checkbox {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 7px;
    color: #344054;
    font-size: 12px;
}

.setting-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.setting-wide {
    grid-column: 1 / -1;
}

.update-progress {
    display: grid;
    width: 120px;
    gap: 4px;
}

.update-progress-track {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7ebf0;
}

.update-progress-value {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

@media (max-width: 760px) {
    .update-version-strip,
    .settings-grid,
    .update-upload-form,
    .update-upload-form.agent-upload {
        grid-template-columns: 1fr;
    }

    .update-version-strip > div {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .update-version-strip > div:last-child {
        border-bottom: 0;
    }
}

.admin-view {
    padding: 22px clamp(16px, 2.2vw, 32px) 36px;
    background: #f4f6f9;
}

.admin-page-head {
    align-items: flex-start;
    margin-bottom: 18px;
}

.admin-page-head h2 {
    margin-bottom: 5px;
    font-size: 21px;
    letter-spacing: 0;
}

.admin-page-head p {
    max-width: 720px;
    line-height: 1.55;
}

.update-version-strip {
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 5px 16px rgba(24, 33, 47, 0.04);
}

.update-version-strip > div {
    gap: 6px;
    padding: 16px 18px;
}

.update-version-strip span {
    color: #7b8798;
    font-size: 11px;
    font-weight: 700;
}

.update-version-strip strong {
    font-size: 14px;
}

.admin-tabs {
    width: fit-content;
    margin-bottom: 16px;
    padding: 4px;
    border: 1px solid #dce2ea;
    border-radius: 8px;
    background: #eef1f5;
}

.admin-content,
.settings-content {
    width: 100%;
    max-width: none;
    gap: 18px;
}

.admin-section {
    overflow: hidden;
    border: 1px solid #dce2ea;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(24, 33, 47, 0.045);
}

.admin-section-head {
    min-height: 68px;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e9ef;
    background: #ffffff;
}

.admin-section-head h3 {
    font-size: 15px;
    letter-spacing: 0;
}

.admin-section-head p {
    max-width: 760px;
    line-height: 1.5;
}

.update-upload-form {
    padding: 18px;
    background: #f9fafc;
}

.update-upload-form .button {
    min-height: 46px;
    height: 46px;
}

.release-upload-form {
    display: grid;
    gap: 13px;
    padding: 18px;
    background: #f9fafc;
}

.release-form-grid {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 16px;
}

.release-form-actions {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 12px;
    border-top: 1px solid #e5e9ef;
}

.release-form-actions .button {
    min-height: 38px;
    height: 38px;
    flex: 0 0 auto;
}

.release-form-grid .admin-field input {
    height: 38px;
    font-size: 13px;
}

.release-form-hint {
    color: #7b8798;
    font-size: 12px;
    line-height: 1.5;
}

.update-upload-form.agent-upload {
    grid-template-columns: 130px minmax(250px, 1.4fr) minmax(180px, 1fr) auto;
}

.admin-field {
    gap: 7px;
}

.admin-field > span {
    color: #526071;
    font-size: 12px;
    font-weight: 700;
}

.admin-field input:not([type="file"]),
.admin-field select,
.setting-field input,
.setting-field select {
    height: 46px;
    padding: 0 14px;
    border: 1px solid #d2dbe7;
    border-radius: 8px;
    outline: 0;
    background: #ffffff;
    color: #18212f;
    box-shadow: 0 1px 2px rgba(32, 44, 60, 0.06);
    font-size: 13.5px;
    font-weight: 500;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.admin-field input:not([type="file"]):hover,
.admin-field select:hover,
.setting-field input:hover,
.setting-field select:hover {
    border-color: #9eacc0;
    background: #ffffff;
}

.admin-field input:not([type="file"]):focus,
.admin-field select:focus,
.setting-field input:focus,
.setting-field select:focus {
    border-color: #3b82d0;
    background: #ffffff;
    box-shadow:
        0 0 0 4px rgba(59, 130, 208, 0.13),
        0 2px 6px rgba(32, 66, 104, 0.08);
}

.admin-field input::placeholder,
.setting-field input::placeholder {
    color: #9aa5b4;
}

.file-field {
    min-width: 0;
}

.file-picker {
    position: relative;
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 11px;
    padding: 7px 12px;
    border: 1px dashed #b8c5d7;
    border-radius: 7px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.file-picker-large {
    min-height: 72px;
}

.file-picker:hover,
.file-picker:focus-within {
    border-color: #3b82d0;
    background: #f7fbff;
    box-shadow: 0 0 0 3px rgba(59, 130, 208, 0.1);
}

.file-picker.has-file {
    border-style: solid;
    border-color: #8dbde8;
    background: #f3f8fe;
}

.file-picker.has-file .file-picker-copy strong {
    color: #155fa8;
}

.file-picker > svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: #4d77a8;
}

.file-picker-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.file-picker-copy strong {
    overflow: hidden;
    color: #263446;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-picker-copy small {
    overflow: hidden;
    color: #7b8798;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-picker input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.admin-table-wrap {
    border-top: 0;
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

.admin-table th,
.admin-table td {
    padding: 11px 14px;
}

.admin-table th {
    border-bottom: 1px solid #dce2ea;
    background: #f5f7fa;
    color: #667085;
    font-size: 11px;
    text-transform: uppercase;
}

.admin-table td {
    color: #344054;
}

.admin-table code {
    padding: 2px 5px;
    border-radius: 4px;
    background: #f2f4f7;
    color: #475467;
    font-size: 11px;
}

.settings-content {
    width: 100%;
    max-width: none;
}

.settings-group {
    display: grid;
    grid-template-columns: minmax(160px, 210px) minmax(0, 1fr);
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #dce2ea;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(24, 33, 47, 0.045);
}

.settings-group h3 {
    align-self: stretch;
    margin: 0;
    padding: 20px 18px;
    border-right: 1px solid #e5e9ef;
    background: #f7f9fc;
    font-size: 15px;
    letter-spacing: 0;
}

.settings-grid {
    padding: 20px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px 20px;
}

.setting-field {
    gap: 7px;
}

.setting-control {
    position: relative;
    display: flex;
    min-height: 46px;
    align-items: stretch;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #d2dbe7;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(32, 44, 60, 0.06);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.setting-control:hover {
    border-color: #aeb9c9;
}

.setting-control:focus-within {
    border-color: #2f7ed8;
    box-shadow:
        0 0 0 4px rgba(47, 126, 216, 0.13),
        0 2px 7px rgba(32, 66, 104, 0.08);
}

.setting-control input,
.setting-control select {
    width: 100%;
    height: 44px;
    min-width: 0;
    padding: 0 14px;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: #18212f;
    font-size: 13.5px;
    font-weight: 500;
}

.setting-control input:hover,
.setting-control input:focus,
.setting-control select:hover,
.setting-control select:focus {
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
}

.setting-unit {
    display: flex;
    min-width: 48px;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border-left: 1px solid #e2e8f0;
    background: #f4f7fa;
    color: #7b8798;
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
    white-space: nowrap;
}

.setting-field input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.setting-field input[type="number"]::-webkit-inner-spin-button,
.setting-field input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.setting-field-label {
    color: #4b596b;
    font-size: 12px;
    font-weight: 700;
}

.setting-field-help {
    line-height: 1.4;
}

.setting-toggle {
    position: relative;
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid #cbd4e0;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.setting-toggle:hover {
    border-color: #9eacc0;
}

.setting-toggle:focus-within {
    border-color: #3b82d0;
    box-shadow: 0 0 0 3px rgba(59, 130, 208, 0.14);
}

.setting-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.setting-toggle-track {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 38px;
    border-radius: 999px;
    background: #c8d0dc;
    transition: background 140ms ease;
}

.setting-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(20, 30, 45, 0.25);
    transition: transform 140ms ease;
}

.setting-toggle input:checked + .setting-toggle-track {
    background: #1976d2;
}

.setting-toggle input:checked + .setting-toggle-track .setting-toggle-thumb {
    transform: translateX(16px);
}

.setting-toggle-text {
    color: #344054;
    font-size: 12px;
    font-weight: 600;
}

.setting-wide {
    grid-column: 1 / -1;
}

.update-progress {
    width: 150px;
}

@media (max-width: 900px) {
    .settings-group {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

@media (max-width: 760px) {
    .admin-page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-page-head .button {
        width: 100%;
    }

    .update-upload-form,
    .update-upload-form.agent-upload,
    .release-form-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

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

    .release-form-actions .button {
        width: 100%;
    }

    .update-version-strip {
        grid-template-columns: 1fr;
    }

    .update-version-strip > div {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .update-version-strip > div:last-child {
        border-bottom: 0;
    }

    .admin-tabs {
        width: 100%;
        overflow: auto;
    }
}

.settings-layout {
    display: grid;
    width: 100%;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.settings-nav {
    position: sticky;
    top: 0;
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid #dce2ea;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(24, 33, 47, 0.045);
}

.settings-nav-item {
    display: grid;
    width: 100%;
    min-height: 52px;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #526071;
    cursor: pointer;
    text-align: left;
}

.settings-nav-item:hover {
    background: #f4f7fa;
    color: #263446;
}

.settings-nav-item.active {
    border-color: #c7ddf6;
    background: #edf5ff;
    color: #175ea8;
}

.settings-nav-item > svg {
    width: 18px;
    height: 18px;
    justify-self: center;
}

.settings-nav-item span {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.settings-nav-item strong,
.settings-nav-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-nav-item strong {
    font-size: 12px;
}

.settings-nav-item small {
    color: #8b95a5;
    font-size: 10px;
}

.settings-nav-item.active small {
    color: #5e8fc5;
}

.settings-panels {
    min-width: 0;
}

.settings-panel {
    display: none;
    overflow: hidden;
    border: 1px solid #dce2ea;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(24, 33, 47, 0.045);
}

.settings-panel.active {
    display: block;
}

.settings-panel-head {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
    border-bottom: 1px solid #e5e9ef;
}

.settings-panel-head h3 {
    margin: 0;
    font-size: 16px;
}

.settings-panel-head p {
    margin: 4px 0 0;
    color: #7b8798;
    font-size: 12px;
}

.settings-count {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}

.settings-service-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr) auto;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e9ef;
    background: #f8fbff;
}

.settings-service-state {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.settings-service-state > div,
.settings-service-meta,
.settings-service-actions {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.settings-service-state strong {
    color: #263446;
    font-size: 13px;
}

.settings-service-state span:not(.settings-service-dot),
.settings-service-actions > span,
.settings-service-meta > span {
    color: #7b8798;
    font-size: 11px;
}

.settings-service-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: #98a2b3;
    box-shadow: 0 0 0 4px rgba(152, 162, 179, 0.13);
}

.settings-service-dot.online {
    background: #22a06b;
    box-shadow: 0 0 0 4px rgba(34, 160, 107, 0.14);
}

.settings-service-meta code {
    overflow: hidden;
    color: #344054;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-service-actions {
    justify-items: end;
}

.settings-service-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-service-actions .button {
    height: 38px;
    min-height: 38px;
}

.settings-rows {
    display: grid;
}

.settings-row {
    display: grid;
    min-height: 88px;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 360px);
    align-items: center;
    gap: 28px;
    padding: 16px 18px;
    border-bottom: 1px solid #edf0f4;
}

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

.settings-row-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.settings-row-copy strong {
    color: #263446;
    font-size: 13px;
}

.settings-row-copy > span {
    max-width: 620px;
    color: #7b8798;
    font-size: 12px;
    line-height: 1.5;
}

.settings-row-control {
    width: 100%;
    max-width: 360px;
    justify-self: end;
}

.settings-row-control .setting-control,
.settings-row-control .setting-toggle {
    width: 100%;
}

.settings-row-control .setting-toggle {
    max-width: 230px;
    margin-left: auto;
}

.settings-restart-badge {
    width: fit-content;
    margin-top: 2px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #fff4e5;
    color: #995400;
    font-size: 10px;
    font-weight: 700;
}

@media (max-width: 900px) {
    .settings-service-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .settings-service-actions {
        justify-items: stretch;
    }

    .settings-service-actions .button {
        width: 100%;
    }

    .settings-service-buttons {
        width: 100%;
    }

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

    .settings-nav {
        position: static;
        display: flex;
        overflow-x: auto;
    }

    .settings-nav-item {
        min-width: 150px;
    }
}

@media (max-width: 640px) {
    .settings-row {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 10px;
    }

    .settings-row-control {
        max-width: none;
        justify-self: stretch;
    }

    .settings-row-control .setting-toggle {
        max-width: none;
        margin-left: 0;
    }
}

.release-form-grid .admin-field input:not([type="file"]) {
    height: 38px;
    font-size: 13px;
}

* {
    box-sizing: border-box;
}

#app {
    width: 100%;
    height: 100%;
    min-height: 100vh;
}

html,
body {
    width: 100%;
    min-width: 320px;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--bg);
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

[hidden] {
    display: none !important;
}

.login-view {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background: #e8edf3;
}

.login-panel {
    width: min(400px, calc(100vw - 32px));
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.login-brand h1 {
    margin: 0;
    font-size: 21px;
    font-weight: 650;
}

.login-brand p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border-radius: 6px;
    color: #fff;
    background: #1f5f99;
}

.brand-mark svg {
    width: 25px;
    height: 25px;
}

.brand-mark.compact {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
}

.brand-mark.compact svg {
    width: 18px;
    height: 18px;
}

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

.login-form label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-size: 13px;
    font-weight: 600;
}

.login-form input {
    height: 40px;
    padding: 0 11px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: #fff;
}

.form-error {
    padding: 9px 11px;
    border: 1px solid #f1b9c5;
    border-radius: 4px;
    color: #9f203a;
    background: #fff5f7;
    font-size: 13px;
}

.workspace {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
    display: flex;
    min-height: 0;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
    background: var(--sidebar);
    color: var(--sidebar-text);
    box-shadow: 8px 0 24px rgba(11, 18, 30, 0.08);
}

.sidebar-brand {
    display: flex;
    height: 58px;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border-bottom: 1px solid var(--sidebar-border);
    color: var(--sidebar-text);
}

.sidebar-brand-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.sidebar-brand-copy strong {
    overflow: hidden;
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-brand-copy span {
    overflow: hidden;
    color: var(--sidebar-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-list {
    display: grid;
    gap: 7px;
    padding: 14px 12px;
}

.nav-item {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 56px;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    color: #c8d1de;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.nav-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 120ms ease, background 120ms ease;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    color: #93a4b9;
    transition: color 120ms ease;
}

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

.nav-copy strong,
.nav-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-copy strong {
    font-size: 13px;
    font-weight: 600;
}

.nav-copy small {
    color: #7f8da1;
    font-size: 11px;
    font-weight: 400;
}

.nav-item::before {
    position: absolute;
    top: 50%;
    left: -12px;
    width: 3px;
    height: 24px;
    border-radius: 0 3px 3px 0;
    background: transparent;
    content: "";
    transform: translateY(-50%);
}

.nav-item:hover:not(:disabled) {
    color: #ffffff;
    background: var(--sidebar-hover);
}

.nav-item:hover:not(:disabled) .nav-icon {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.07);
}

.nav-item:hover:not(:disabled) .nav-icon svg {
    color: #c5d6ea;
}

.nav-item:hover:not(:disabled) .nav-copy small {
    color: #a8b5c6;
}

.nav-item.active {
    color: #ffffff;
    background: var(--sidebar-active);
    box-shadow: inset 0 0 0 1px rgba(104, 178, 255, 0.12);
    font-weight: 600;
}

.nav-item.active::before {
    background: var(--sidebar-accent);
}

.nav-item.active .nav-icon {
    border-color: rgba(104, 178, 255, 0.22);
    background: rgba(104, 178, 255, 0.12);
}

.nav-item.active .nav-icon svg {
    color: var(--sidebar-accent);
}

.nav-item.active .nav-copy small {
    color: #a9c6e7;
}

.nav-item:disabled {
    color: #68768a;
    cursor: default;
}

.nav-item:disabled .nav-icon {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.025);
}

.nav-item:disabled .nav-icon svg {
    color: #5f6d80;
}

.nav-item:disabled .nav-copy small {
    color: #5f6d80;
}

.drive-list {
    min-height: 0;
    overflow: auto;
    margin-top: 8px;
    padding: 10px 12px 14px;
    border-top: 1px solid var(--sidebar-border);
}

.drive-section + .drive-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--sidebar-border);
}

.section-label {
    padding: 10px 8px 7px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.sidebar .section-label {
    color: var(--sidebar-muted);
}

.drive-button {
    display: grid;
    width: 100%;
    min-height: 66px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #c8d1de;
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
    text-align: left;
    transition: color 120ms ease, background 120ms ease;
}

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

.drive-button:hover,
.drive-button.active {
    color: #ffffff;
    background: var(--sidebar-hover);
}

.drive-button.active {
    border-color: rgba(104, 178, 255, 0.16);
    background: rgba(74, 144, 226, 0.14);
}

.shortcut-button {
    min-height: 50px;
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 7px 9px;
}

.shortcut-button .drive-copy {
    gap: 2px;
}

.drive-button svg {
    width: 17px;
    height: 17px;
    color: #7fa5d3;
    justify-self: center;
}

.drive-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drive-button .drive-copy {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.drive-copy strong,
.drive-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drive-copy strong {
    color: #dce5f0;
    font-size: 12px;
    font-weight: 600;
}

.drive-progress {
    display: block;
    width: 100%;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.drive-progress-value {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #68b2ff;
}

.drive-button small {
    display: block;
    margin-top: 0;
    color: #8290a4;
    font-size: 11px;
}

.sidebar-footer {
    display: flex;
    height: 48px;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 0 18px;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(0, 0, 0, 0.08);
    color: var(--sidebar-muted);
    font-size: 12px;
}

.sidebar ::-webkit-scrollbar {
    width: 8px;
}

.sidebar ::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    background-clip: padding-box;
}

.sidebar ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.24);
    background-clip: padding-box;
}

.status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #98a2b3;
}

.status-dot.online {
    background: #18a957;
    box-shadow: 0 0 0 3px rgba(24, 169, 87, 0.12);
}

.status-dot.offline {
    background: #98a2b3;
}

.main {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-rows: 58px minmax(0, 1fr);
    background: var(--bg);
}

.topbar {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.topbar-title {
    display: grid;
}

.topbar-title strong {
    font-size: 15px;
}

.topbar-title span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.user-chip {
    color: #3d4a5c;
    font-size: 13px;
}

.view {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 18px 20px 24px;
}

.summary-strip {
    display: flex;
    min-height: 70px;
    align-items: stretch;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.summary-item {
    display: grid;
    min-width: 150px;
    align-content: center;
    gap: 2px;
    padding: 12px 20px;
    border-right: 1px solid var(--border);
}

.summary-item:last-child {
    border-right: 0;
}

.summary-item span {
    color: var(--text-muted);
    font-size: 12px;
}

.summary-item strong {
    font-size: 24px;
    font-weight: 650;
}

.text-success {
    color: var(--success);
}

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

.content-panel {
    display: grid;
    min-height: 340px;
    grid-template-rows: 54px minmax(0, 1fr);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.panel-toolbar,
.explorer-toolbar {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
}

.toolbar-spacer {
    flex: 1;
}

.segmented {
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: #fff;
}

.segment {
    min-width: 60px;
    height: 28px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
}

.segment.active {
    color: #0757b8;
    background: var(--accent-soft);
    font-weight: 600;
}

.search-box,
.file-search {
    display: flex;
    height: 32px;
    align-items: center;
    gap: 7px;
    padding: 0 9px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: #fff;
}

.search-box {
    width: min(330px, 32vw);
}

.search-box svg,
.file-search svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    color: var(--text-muted);
}

.search-box input,
.file-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13px;
}

.icon-button {
    display: inline-grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}

.icon-button:hover {
    border-color: var(--border);
    background: #fff;
}

.icon-button svg {
    width: 17px;
    height: 17px;
}

.icon-button:disabled,
.command-button:disabled {
    color: #a9b1bd;
    cursor: default;
    opacity: 0.7;
}

.button {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 13px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

.button svg {
    width: 16px;
    height: 16px;
}

.button:hover {
    background: #f5f7fa;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    pointer-events: none;
}

.button.primary {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
}

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

.button.danger {
    border-color: #e7a6b4;
    color: #9f203a;
    background: #fff;
}

.button.wide {
    width: 100%;
    height: 40px;
}

.table-wrap {
    min-width: 0;
    overflow: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    height: 38px;
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    background: #fbfcfd;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    height: 48px;
    padding: 7px 12px;
    border-bottom: 1px solid #edf0f3;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #f7faff;
}

.data-table tbody tr.selected {
    background: var(--accent-soft);
}

.device-name {
    display: grid;
    gap: 2px;
}

.device-name strong {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.device-name small,
.subtle {
    color: var(--text-muted);
    font-size: 11px;
}

.device-name .device-note {
    max-width: 260px;
    overflow: hidden;
    color: #8a6116;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    height: 24px;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border-radius: 999px;
    color: #475467;
    background: #eef1f4;
    font-size: 12px;
}

.status-badge::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #98a2b3;
    content: "";
}

.status-badge.online {
    color: #116b34;
    background: #e7f7ed;
}

.status-badge.online::before {
    background: #18a957;
}

.actions-column {
    width: 240px;
    text-align: right !important;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 3px;
}

.icon-button.favorite.active {
    border-color: transparent;
    color: #b77900;
    background: transparent;
    box-shadow: none;
}

.icon-button.favorite.active:hover {
    border-color: var(--border);
    background: #fff;
}

.icon-button.favorite.active svg {
    fill: currentColor;
}

.empty-state {
    display: grid;
    min-height: 240px;
    place-content: center;
    justify-items: center;
    gap: 7px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 34px;
    height: 34px;
    stroke-width: 1.5;
}

.empty-state strong {
    color: #475467;
    font-size: 14px;
}

.empty-state span {
    font-size: 12px;
}

.file-view {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) 28px;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.explorer-toolbar {
    min-height: 46px;
}

.history-actions {
    display: flex;
    gap: 2px;
}

.breadcrumb {
    display: flex;
    min-width: 0;
    height: 32px;
    flex: 1;
    align-items: center;
    gap: 2px;
    padding: 0 7px;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: #fff;
}

.breadcrumb-path {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 2px;
    overflow: hidden;
}

.breadcrumb-path button {
    max-width: 180px;
    height: 25px;
    overflow: hidden;
    padding: 0 7px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb-path button:hover {
    background: #eef1f4;
}

.breadcrumb svg {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    color: var(--text-soft);
}

.breadcrumb-edit {
    display: grid;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    margin-left: 3px;
    place-items: center;
    border: 0;
    border-radius: 3px;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
}

.breadcrumb-edit:hover {
    color: var(--text);
    background: #eef1f4;
}

.breadcrumb-edit svg {
    width: 14px;
    height: 14px;
}

.breadcrumb-input {
    width: 100%;
    min-width: 0;
    height: 28px;
    padding: 0 7px;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font: inherit;
}

.file-search {
    width: min(280px, 25vw);
}

.file-search-group {
    display: flex;
    min-width: 0;
    flex: 0 1 auto;
    align-items: center;
    gap: 8px;
}

.file-search-group .file-search {
    width: clamp(160px, 24vw, 280px);
}

.search-recursive {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.search-recursive input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--accent);
}

.explorer-commandbar {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 3px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.command-button {
    display: inline-flex;
    height: 32px;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.command-button svg {
    width: 16px;
    height: 16px;
}

.command-button:hover:not(:disabled) {
    border-color: var(--border);
    background: #f5f7fa;
}

.command-button.danger {
    color: var(--danger);
}

.explorer-shell {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 220px;
    background: #fff;
}

.explorer-content {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-rows: 34px minmax(0, 1fr);
    border-right: 1px solid var(--border);
}

.explorer-head {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 170px 120px 100px 144px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: #fbfcfd;
}

.explorer-head button {
    display: flex;
    height: 100%;
    align-items: center;
    gap: 3px;
    padding: 0 10px;
    border: 0;
    border-right: 1px solid #edf0f3;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    text-align: left;
}

.explorer-head button:hover {
    background: #f2f5f8;
}

.explorer-head svg {
    width: 12px;
    height: 12px;
}

.column-size {
    justify-content: flex-end;
}

.column-actions {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: flex-end;
    padding: 0 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.file-list {
    min-height: 0;
    overflow: auto;
    outline: 0;
}

.file-row {
    display: grid;
    min-width: 824px;
    height: 38px;
    grid-template-columns: minmax(260px, 1fr) 170px 120px 100px 144px;
    align-items: center;
    border-bottom: 1px solid #f0f2f5;
    cursor: default;
    font-size: 13px;
}

.file-row:hover {
    background: #f5f9ff;
}

.file-row.selected {
    background: var(--accent-soft);
}

.file-cell {
    min-width: 0;
    overflow: hidden;
    padding: 0 10px;
    color: #475467;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-cell.name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.file-cell.name svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    color: #d49a18;
}

.file-cell.name.file svg {
    color: #4f7ca5;
}

.file-cell.size {
    text-align: right;
}

.file-cell.actions {
    display: flex;
    justify-content: flex-end;
    gap: 2px;
    overflow: visible;
    padding: 0 6px;
}

.file-action {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border: 0;
    border-radius: 4px;
    color: #66758a;
    background: transparent;
    cursor: pointer;
}

.file-action svg {
    width: 15px;
    height: 15px;
}

.file-action:hover:not(:disabled) {
    color: var(--accent);
    background: #e8f1fd;
}

.file-action.danger:hover:not(:disabled) {
    color: var(--danger);
    background: var(--danger-soft);
}

.file-action:disabled {
    opacity: 0.28;
    cursor: default;
}

.details-pane {
    min-width: 0;
    padding: 0 12px 12px;
    background: #fbfcfd;
}

.file-details {
    display: grid;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.detail-line {
    display: grid;
    gap: 2px;
}

.detail-line strong {
    overflow-wrap: anywhere;
    color: #344054;
    font-weight: 600;
}

.statusbar {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    background: #f7f8fa;
    font-size: 12px;
}

.modal-backdrop {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(18, 27, 40, 0.38);
}

.modal {
    display: grid;
    width: min(760px, calc(100vw - 40px));
    max-height: min(760px, calc(100vh - 40px));
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
    display: flex;
    min-height: 52px;
    align-items: center;
    padding: 0 16px;
}

.modal-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    min-width: 0;
    overflow: hidden;
    margin: 0;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-header .icon-button {
    border-color: var(--border);
    color: #344054;
    background: #f4f6f8;
}

.modal-header .icon-button:hover {
    border-color: #aeb8c6;
    background: #e9edf3;
}

.modal-body {
    min-height: 0;
    overflow: auto;
    padding: 16px;
}

.modal-footer {
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--border);
    background: #fbfcfd;
}

.modal-footer:empty {
    display: none;
}

.detail-grid {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--border);
    background: var(--border);
}

.detail-item {
    min-height: 66px;
    padding: 10px 12px;
    background: #fff;
}

.detail-item.wide {
    grid-column: 1 / -1;
}

.detail-item span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 11px;
}

.detail-item strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 600;
}

.prompt-label {
    display: grid;
    gap: 7px;
    color: #475467;
    font-size: 13px;
}

.prompt-label input {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
}

.context-menu {
    position: fixed;
    z-index: 1100;
    width: 248px;
    padding: 7px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: #fff;
    box-shadow:
        0 18px 45px rgba(25, 35, 52, 0.16),
        0 4px 12px rgba(25, 35, 52, 0.08);
    animation: context-menu-in 110ms ease-out;
}

.context-menu-head {
    display: grid;
    min-width: 0;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 7px 8px 8px;
}

.context-menu-item-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #dce5ee;
    border-radius: 6px;
    color: #31557a;
    background: #f2f6fa;
}

.context-menu-item-icon svg {
    width: 17px;
    height: 17px;
}

.context-menu-item-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.context-menu-item-copy strong,
.context-menu-item-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.context-menu-item-copy strong {
    color: #1d2939;
    font-size: 13px;
    font-weight: 650;
}

.context-menu-item-copy small {
    color: var(--text-muted);
    font-size: 11px;
}

.context-menu-group {
    display: grid;
    gap: 1px;
}

.context-menu-divider {
    height: 1px;
    margin: 5px 4px;
    background: #e9edf2;
}

.context-menu button {
    display: flex;
    width: 100%;
    height: 34px;
    align-items: center;
    gap: 10px;
    padding: 0 9px;
    border: 0;
    border-radius: 5px;
    color: #344054;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    transition: color 100ms ease, background-color 100ms ease;
}

.context-menu button:hover {
    color: #174a78;
    background: #edf4fb;
}

.context-menu button:focus-visible {
    outline: 2px solid #86b7e5;
    outline-offset: -2px;
}

.context-menu button svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: #667085;
}

.context-menu button:hover svg {
    color: #256aa6;
}

.context-menu button.danger {
    color: #b42318;
}

.context-menu button.danger svg {
    color: #d92d20;
}

.context-menu button.danger:hover {
    color: #912018;
    background: #fef3f2;
}

@keyframes context-menu-in {
    from {
        opacity: 0;
        transform: translateY(-3px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.transfer-panel {
    position: fixed;
    z-index: 900;
    right: 18px;
    bottom: 18px;
    width: min(360px, calc(100vw - 36px));
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: #fff;
    box-shadow: var(--shadow);
}

.transfer-header {
    display: flex;
    height: 40px;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
    background: #f7f8fa;
    font-size: 13px;
    font-weight: 600;
}

.transfer-item {
    display: grid;
    gap: 7px;
    padding: 11px 12px;
    border-bottom: 1px solid #edf0f3;
    font-size: 12px;
}

.transfer-item:last-child {
    border-bottom: 0;
}

.transfer-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-track {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8ecf1;
}

.progress-value {
    height: 100%;
    background: var(--accent);
    transition: width 120ms linear;
}

.transfer-meta {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-muted);
    font-size: 11px;
}

.transfer-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transfer-cancel {
    height: 24px;
    flex: 0 0 auto;
    padding: 0 8px;
    border: 1px solid #f0b8b2;
    border-radius: 4px;
    color: #b42318;
    background: #fff;
    cursor: pointer;
    font-size: 11px;
}

.transfer-cancel:hover {
    background: #fef3f2;
}

.transfer-detail,
.transfer-error {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transfer-detail {
    color: var(--text-soft);
}

.transfer-error {
    color: var(--danger);
}

.toast-container {
    position: fixed;
    z-index: 1200;
    top: 16px;
    right: 16px;
    display: grid;
    width: min(360px, calc(100vw - 32px));
    gap: 8px;
}

.toast {
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--accent);
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 34, 52, 0.16);
    font-size: 13px;
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.success {
    border-left-color: var(--success);
}

.loading-mask {
    position: absolute;
    z-index: 20;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.72);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #cfd6df;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

@media (max-width: 940px) {
    .workspace {
        grid-template-columns: 216px minmax(0, 1fr);
    }

    .details-pane {
        display: none;
    }

    .explorer-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .file-search {
        width: 210px;
    }

    .command-button span {
        display: none;
    }

    .summary-item {
        min-width: 120px;
    }
}

@media (max-width: 700px) {
    .explorer-toolbar {
        flex-wrap: wrap;
    }

    .breadcrumb {
        flex-basis: 180px;
    }

    .file-search-group {
        flex: 1 1 100%;
        justify-content: flex-end;
    }

    .workspace {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .sidebar-brand-copy,
    .nav-copy,
    .sidebar-footer span:last-child,
    .drive-list,
    .user-chip {
        display: none;
    }

    .sidebar-brand {
        justify-content: center;
        padding: 0;
    }

    .nav-list {
        padding: 10px 8px;
    }

    .nav-item {
        min-height: 48px;
        justify-content: center;
        padding: 0;
    }

    .nav-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .nav-item::before {
        left: -8px;
    }

    .sidebar-footer {
        justify-content: center;
        padding: 0;
    }

    .topbar {
        padding: 0 12px;
    }

    .view {
        padding: 12px;
    }

    .summary-strip {
        overflow: auto;
    }

    .content-panel {
        grid-template-rows: auto minmax(0, 1fr);
    }

    .panel-toolbar {
        flex-wrap: wrap;
    }

    .search-box {
        width: 100%;
        order: 2;
    }

    .file-search {
        width: 150px;
    }

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