:root {
    color-scheme: light;
    --ink: #212121;
    --muted: #6f6f6f;
    --line: #d9d9d9;
    --soft-line: #ededed;
    --bg: #f5f5f5;
    --panel: #ffffff;
    --panel-strong: #fafafa;
    --brand: #ff6c37;
    --brand-dark: #e05320;
    --brand-soft: #fff1eb;
    --teal: #087b75;
    --amber: #b85c00;
    --green: #00875a;
    --danger: #d92d20;
    --service-bg: transparent;
    --service-ink: #333333;
    --folder-bg: transparent;
    --folder-ink: #4f4f4f;
    --shadow: none;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background: #f6f6f6;
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.is-resizing {
    cursor: col-resize;
    user-select: none;
}

.login-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(255, 108, 55, 0.08), rgba(255, 255, 255, 0) 38%),
        #f6f6f6;
}

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

button {
    cursor: pointer;
}

.app-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    display: flex;
    position: sticky;
    top: 0;
    flex-direction: column;
    gap: 24px;
    height: 100vh;
    padding: 18px 14px;
    border-right: 1px solid var(--line);
    background: #ffffff;
}

.brand,
.main-nav a {
    color: inherit;
    text-decoration: none;
}

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

.brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 6px;
    background: #2f2f2f;
    color: #fff;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.main-nav {
    display: grid;
    gap: 6px;
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 6px;
    color: #3d3d3d;
    font-weight: 600;
}

.main-nav a.active {
    background: var(--brand-soft);
    color: #c7471b;
}

.nav-icon {
    width: 22px;
    color: var(--muted);
    text-align: center;
}

.identity-card {
    margin-top: auto;
    padding: 14px;
    border: 1px solid var(--soft-line);
    border-radius: 8px;
    background: var(--panel-strong);
}

.identity-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.identity-card strong {
    display: block;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-button {
    width: 100%;
    margin-top: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.workspace {
    min-width: 0;
    padding: 12px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 54px;
    margin: -12px -12px 12px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.topbar p,
.detail-title p {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.topbar h1,
.panel h2,
.detail-title h2 {
    margin: 0;
}

.topbar h1 {
    font-size: 20px;
    letter-spacing: 0;
}

.key-actions,
.response-stats,
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-view {
    min-width: 0;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(360px, 520px);
    width: min(980px, 100%);
    min-height: 560px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 20px 60px rgba(33, 33, 33, 0.08);
}

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 34px;
    padding: 44px;
    border-right: 1px solid var(--line);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-brand strong,
.login-brand small {
    display: block;
}

.login-brand small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.login-copy {
    display: grid;
    gap: 10px;
}

.login-copy p,
.login-copy h1,
.login-copy span,
.login-footnote {
    margin: 0;
}

.login-copy p {
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.login-copy h1 {
    max-width: 340px;
    font-size: 34px;
    line-height: 1.08;
    letter-spacing: 0;
}

.login-copy span,
.login-footnote {
    color: var(--muted);
    line-height: 1.6;
}

.google-login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    background: #fff;
    color: #2f2f2f;
    font-weight: 800;
    text-decoration: none;
}

.google-login-button:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.google-icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid #dadce0;
    border-radius: 50%;
    color: #4285f4;
    font-weight: 800;
}

.login-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    padding: 44px;
    background: #222222;
    color: #fff;
}

.login-side-header {
    display: grid;
    gap: 10px;
}

.login-side-header span {
    color: #ffb199;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.login-side-header strong {
    max-width: 360px;
    font-size: 30px;
    line-height: 1.15;
}

.login-preview {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.preview-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.preview-row span {
    color: #73e0bf;
    font-size: 12px;
    font-weight: 800;
}

.preview-row strong {
    overflow: hidden;
    color: #f8f8f8;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-row.muted span {
    color: #ffb199;
}

.preview-code {
    display: grid;
    gap: 5px;
    margin-top: 4px;
    padding: 14px;
    border-radius: 6px;
    background: #171717;
    color: #e7e7e7;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.5;
}

.empty-state {
    margin: 8px;
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    background: #fafafa;
}

.collections-layout {
    display: grid;
    grid-template-columns:
        var(--collections-left, 300px)
        6px
        minmax(420px, 1fr)
        6px
        var(--collections-env, 280px);
    gap: 0;
    min-height: calc(100vh - 82px);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.collections-layout.env-collapsed {
    --collections-env: 44px;
}

.keys-layout,
.admin-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.admin-layout {
    grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
}

.panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.collections-layout .panel {
    border: 0;
    border-radius: 0;
}

.collection-tree,
.env-panel {
    border-right: 1px solid var(--line) !important;
}

.collection-tree {
    overflow: hidden;
}

.env-panel {
    position: relative;
    border-right: 0 !important;
    border-left: 1px solid var(--line) !important;
    overflow: hidden;
}

.resize-handle {
    position: relative;
    z-index: 3;
    width: 6px;
    min-width: 6px;
    cursor: col-resize;
    background: #f7f7f7;
    border-right: 1px solid var(--soft-line);
    border-left: 1px solid var(--soft-line);
}

.resize-handle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 2px;
    width: 2px;
    height: 36px;
    border-radius: 999px;
    background: #d0d0d0;
    transform: translateY(-50%);
    opacity: 0;
}

.resize-handle:hover,
.resize-handle.dragging {
    background: #fff1eb;
}

.resize-handle:hover::after,
.resize-handle.dragging::after {
    opacity: 1;
    background: var(--brand);
}

.collections-layout.env-collapsed .env-resize-handle {
    display: none;
}

.env-rail-toggle {
    display: none;
}

.collections-layout.env-collapsed .env-panel {
    border-left: 1px solid var(--line) !important;
    background: #fbfbfb;
}

.collections-layout.env-collapsed .env-panel .panel-header,
.collections-layout.env-collapsed .env-panel .env-manager,
.collections-layout.env-collapsed .env-panel .env-list,
.collections-layout.env-collapsed .env-panel .curl-panel {
    display: none;
}

.collections-layout.env-collapsed .env-rail-toggle {
    display: grid;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    place-items: center;
    border: 0;
    background: transparent;
    color: #666;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.collections-layout.env-collapsed .env-rail-toggle:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 12px;
    border-bottom: 1px solid var(--soft-line);
}

.panel h2 {
    font-size: 15px;
}

.primary-button,
.secondary-button,
.icon-button {
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 700;
}

.primary-button {
    padding: 0 12px;
    background: var(--brand);
    color: #fff;
}

.primary-button:hover {
    background: var(--brand-dark);
}

.secondary-button:hover,
.icon-button:hover {
    border-color: #bdbdbd;
    background: #f8f8f8;
}

.secondary-button {
    padding: 0 12px;
    border-color: #cfcfcf;
    background: #fff;
    color: #333;
}

.icon-button {
    display: grid;
    width: 34px;
    place-items: center;
    border-color: #cfcfcf;
    background: #fff;
    color: #333;
}

.compact,
.small {
    min-height: 32px;
}

.compact {
    width: 32px;
}

.small {
    padding: 0 10px;
    font-size: 12px;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.search-field input {
    width: 100%;
    min-width: 0;
    height: 36px;
    border: 0;
    outline: 0;
}

.tree-list,
.key-list,
.env-list,
.event-rows {
    display: grid;
    gap: 2px;
    padding: 0 8px 12px;
}

.tree-list {
    overflow-x: hidden;
    overflow-y: auto;
    align-content: start;
    max-height: calc(100vh - 190px);
}

.tree-item,
.tree-folder,
.tree-collection,
.key-item {
    display: grid;
    align-items: center;
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    text-align: left;
}

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

.tree-collection {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    width: 100%;
    margin-top: 8px;
    border-color: transparent;
    background: var(--service-bg);
    color: var(--service-ink);
    font-weight: 700;
}

.tree-folder {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    width: calc(100% - 16px);
    margin-left: 16px;
    border-color: transparent;
    background: var(--folder-bg);
    color: var(--folder-ink);
    font-weight: 600;
}

.tree-item {
    grid-template-columns: 52px minmax(0, 1fr);
    width: calc(100% - 34px);
    margin-left: 34px;
    color: #333;
}

.tree-item:hover,
.tree-folder:hover,
.tree-collection:hover,
.key-item:hover,
.key-item:hover {
    border-color: #e3e3e3;
    background: #f8f8f8;
}

.tree-collection.active {
    border-color: #ffc7b0;
    background: #fff4ee;
    box-shadow: inset 3px 0 0 var(--brand);
    color: #2d2d2d;
}

.tree-folder.active {
    border-color: #d8d8d8;
    background: #eeeeee;
    box-shadow: inset 3px 0 0 #8f8f8f;
    color: #2f2f2f;
}

.tree-item.active {
    border-color: #ffd8c8;
    background: #fff9f5;
    box-shadow: inset 3px 0 0 #ff8a5b;
    color: #1f1f1f;
}

.key-item.active {
    border-color: #ffc7b0;
    background: var(--brand-soft);
    color: #2d2d2d;
}

.tree-folder.drop-target {
    border-color: var(--brand);
    background: #fff6f1;
}

.tree-item.dragging {
    opacity: 0.45;
}

.tree-item strong,
.tree-folder strong,
.tree-collection strong,
.key-item strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-item span,
.tree-folder span,
.tree-collection span,
.key-item span,
.env-item span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.tree-icon {
    display: grid !important;
    width: 22px;
    height: 22px;
    place-items: center;
    margin: 0 !important;
    border-radius: 5px;
    font-size: 10px !important;
    font-weight: 900;
}

.service-icon {
    border: 1px solid #d0d0d0;
    background: #f7f7f7;
    color: #555 !important;
}

.folder-icon {
    border: 1px solid #d7d7d7;
    background: #f2f2f2;
    color: #666 !important;
}

.tree-collection.active .service-icon {
    border-color: #ffb899;
    background: #ffe5d8;
    color: #c7471b !important;
}

.tree-folder.active .folder-icon {
    border-color: #c8c8c8;
    background: #dedede;
    color: #3f3f3f !important;
}

.tree-folder small,
.tree-collection small {
    color: var(--muted);
    font-size: 11px;
}

.method {
    display: inline-grid !important;
    width: 42px;
    height: 20px;
    place-items: center;
    margin: 0 !important;
    border-radius: 5px;
    background: #e9f8f1;
    color: var(--green) !important;
    font-size: 10px !important;
    font-weight: 800;
}

.method.post {
    background: #fff1e8;
    color: var(--amber) !important;
}

.context-menu {
    position: fixed;
    z-index: 50;
    min-width: 160px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

.context-menu button {
    display: block;
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #334155;
    text-align: left;
    font-weight: 700;
}

.context-menu button:hover {
    background: #f1f5f9;
}

.context-menu button[data-action="delete"] {
    color: var(--danger);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(33, 33, 33, 0.28);
}

.modal-card {
    width: min(420px, 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 52px rgba(33, 33, 33, 0.18);
}

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

.modal-header p {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-field {
    display: grid;
    gap: 6px;
    padding: 16px;
}

.modal-field-stack {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.modal-field.compact-field {
    padding: 0;
}

.modal-field input,
.modal-field textarea {
    width: 100%;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: none;
}

.modal-field input {
    height: 38px;
}

.modal-field textarea {
    min-height: 110px;
    padding: 10px;
    resize: vertical;
}

.modal-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #444;
    font-size: 12px;
    font-weight: 700;
}

.modal-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}

.modal-field input:focus,
.modal-field textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(255, 108, 55, 0.12);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid var(--soft-line);
}

.secret-view-value {
    min-height: 120px;
    max-height: 320px;
    margin: 16px;
    padding: 14px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #171b26;
    color: #f8fafc;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

.toast-region {
    position: fixed;
    z-index: 90;
    left: 16px;
    bottom: 16px;
    display: grid;
    gap: 8px;
    width: min(360px, calc(100vw - 32px));
}

.toast {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(33, 33, 33, 0.14);
}

.toast::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--brand);
}

.toast.success::before {
    background: var(--green);
}

.toast.error::before {
    background: var(--danger);
}

.toast strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
}

.toast span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.toast button {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
}

.toast button:hover {
    background: #f5f5f5;
    color: #333;
}

.method.put,
.method.patch {
    background: #edf4ff;
    color: #1f62b2 !important;
}

.method.delete {
    background: #fef2f2;
    color: var(--danger) !important;
}

.request-studio {
    display: grid;
    grid-template-rows: auto minmax(260px, 1fr);
    gap: 0;
    min-height: 100%;
}

.request-panel,
.response-panel,
.key-detail,
.admin-users,
.event-log {
    padding: 16px;
}

.request-panel {
    border-bottom: 1px solid var(--line) !important;
}

.request-line {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) 84px 74px;
    gap: 8px;
}

.request-line input,
.request-line select,
.meta-row select,
.form-grid input,
.secret-field input,
.form-grid textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

.request-line input:focus,
.request-line select:focus,
.meta-row select:focus,
.form-grid input:focus,
.secret-field input:focus,
.form-grid textarea:focus,
.kv-row input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(255, 108, 55, 0.12);
}

.request-line input,
.request-line select,
.meta-row select,
.form-grid input,
.secret-field input {
    height: 36px;
    padding: 0 10px;
}

.meta-row,
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.meta-row {
    grid-template-columns: minmax(240px, 360px);
}

label {
    color: #344054;
    font-size: 12px;
    font-weight: 700;
}

label input,
label select,
label textarea {
    margin-top: 6px;
}

.tabs {
    display: flex;
    gap: 6px;
    margin: 16px 0 12px;
    border-bottom: 1px solid var(--soft-line);
}

.tab {
    min-height: 34px;
    padding: 0 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
}

.tab:hover {
    color: #333;
}

.tab.active {
    border-color: var(--brand);
    color: var(--brand-dark);
}

.editor-grid {
    display: grid;
    gap: 8px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 34px;
    color: #444;
    font-size: 12px;
    font-weight: 800;
}

.kv-list {
    display: grid;
    gap: 8px;
}

.kv-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 36px;
    gap: 8px;
}

.kv-row input {
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.response-panel {
    padding-top: 0;
}

.response-header {
    margin: 0 -16px;
}

.response-stats span {
    padding: 5px 8px;
    border-radius: 6px;
    background: #e9f8f1;
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
}

.response-stats span:nth-child(2) {
    background: #fff1e8;
    color: var(--amber);
}

.response-stats span:nth-child(3) {
    background: #edf4ff;
    color: #1f62b2;
}

.code-block {
    overflow: auto;
    min-height: 300px;
    max-height: 50vh;
    margin: 16px 0 0;
    padding: 16px;
    border-radius: 6px;
    background: #1e1e1e;
    color: #f5f5f5;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.request-panel .code-block {
    min-height: 210px;
    max-height: 320px;
    margin-top: 0;
}

.request-body-editor {
    width: 100%;
    border: 0;
    outline: 0;
    resize: vertical;
}

.env-item {
    padding: 11px 12px;
    border: 1px solid var(--soft-line);
    border-radius: 6px;
    background: var(--panel-strong);
}

.env-item strong {
    display: block;
    overflow-wrap: anywhere;
}

.env-manager {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--soft-line);
}

.env-manager select {
    width: 100%;
    height: 36px;
    margin-top: 6px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    outline: none;
}

.env-manager-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.env-row {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.1fr) auto 32px;
    gap: 6px;
    align-items: center;
}

.env-row input {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: none;
}

.env-row.restricted input {
    background: #f5f5f5;
    color: #777;
}

.env-permission {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.env-row input:focus,
.env-manager select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(255, 108, 55, 0.12);
}

.curl-panel {
    border-top: 1px solid var(--soft-line);
}

.compact-header {
    min-height: 48px;
}

.curl-output {
    overflow: auto;
    min-height: 180px;
    max-height: 320px;
    margin: 0;
    padding: 12px;
    background: #1e1e1e;
    color: #f5f5f5;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.detail-title {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.permission-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-top: 10px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f3f3f3;
    color: #666;
    font-size: 12px;
    font-weight: 800;
}

.permission-pill.editable {
    background: #e9f8f1;
    color: var(--green);
}

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

.secret-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 8px;
    margin-top: 6px;
}

.secret-field input {
    margin-top: 0;
}

button:disabled,
input:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

input:disabled,
textarea:disabled {
    background: #f3f4f6;
    color: #667085;
}

.form-grid textarea {
    min-height: 220px;
    padding: 10px;
    resize: vertical;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--soft-line);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

td {
    font-size: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #edf4ff;
    color: #1f62b2;
    font-size: 12px;
    font-weight: 800;
}

.badge.admin {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.event-item {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--soft-line);
    border-radius: 6px;
    background: var(--panel-strong);
}

.event-item time {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.event-item strong {
    display: block;
    margin-bottom: 4px;
}

.event-item span {
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 1180px) {
    .login-shell {
        grid-template-columns: minmax(320px, 440px) minmax(300px, 1fr);
    }

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

    .sidebar {
        padding: 18px 12px;
    }

    .brand span:not(.brand-mark),
    .main-nav a:not(.active) {
        font-size: 0;
    }

    .main-nav a {
        justify-content: center;
        padding: 0;
    }

    .nav-icon {
        width: auto;
        font-size: 18px;
    }

    .identity-card {
        display: none;
    }

    .collections-layout,
    .keys-layout,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .collections-layout {
        display: grid;
    }

    .collection-tree,
    .env-panel,
    .request-panel {
        border-right: 0 !important;
        border-left: 0 !important;
        border-bottom: 1px solid var(--line) !important;
    }

    .resize-handle {
        display: none;
    }

    .collections-layout.env-collapsed .env-panel {
        min-height: 44px;
    }

    .collections-layout.env-collapsed .env-rail-toggle {
        writing-mode: horizontal-tb;
    }
}

@media (max-width: 720px) {
    .login-body {
        display: block;
        padding: 14px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .login-panel,
    .login-side {
        padding: 28px;
    }

    .login-side {
        min-height: 320px;
    }

    .login-copy h1,
    .login-side-header strong {
        font-size: 26px;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

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

    .workspace {
        padding: 14px;
    }

    .topbar,
    .detail-title {
        align-items: stretch;
        flex-direction: column;
    }

    .key-actions {
        justify-content: stretch;
    }

    .key-actions button {
        flex: 1;
    }

    .request-line,
    .meta-row,
    .form-grid,
    .kv-row,
    .secret-field {
        grid-template-columns: 1fr;
    }

    .response-stats {
        flex-wrap: wrap;
    }
}
