:root {
  color-scheme: light;
  --ink: #183027;
  --muted: #6d776f;
  --moss: #264c3d;
  --moss-dark: #17372c;
  --gold: #b89457;
  --cream: #f5f0e6;
  --paper: #fffdf8;
  --line: #ded8ca;
  --shadow: 0 18px 55px rgba(32, 55, 43, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--cream); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.login-screen { min-height: 100vh; padding: 24px; display: grid; place-items: center; background: radial-gradient(circle at top, #fffdf8 0, var(--cream) 58%, #e7decc 100%); }
.login-card { width: min(560px, 100%); padding: clamp(28px, 6vw, 52px); border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 28px; }
.login-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.login-row input, .login-row button { min-height: 48px; }
.login-error { margin: 14px 0 0; color: #8d332d; font-size: 13px; font-weight: 700; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; display: flex; flex-direction: column; color: #f8f4ea; background: linear-gradient(165deg, var(--moss-dark), #10261f); }
.brand { display: flex; align-items: center; color: inherit; text-decoration: none; padding: 0 8px 30px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 13px; font-family: Georgia, serif; font-size: 24px; color: #f4dcae; background: rgba(255,255,255,.06); }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 20px; letter-spacing: .01em; }
.brand small { margin-top: 3px; color: #b8c7c0; font-size: 11px; }
nav { display: grid; gap: 8px; }
.nav-item { width: 100%; border: 0; border-radius: 12px; padding: 13px 14px; display: flex; gap: 12px; color: #c9d5cf; background: transparent; text-align: left; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.1); }
.nav-item.active { box-shadow: inset 3px 0 var(--gold); }
.sidebar-note { margin-top: auto; display: flex; gap: 10px; align-items: flex-start; padding: 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.05); }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note small { margin-top: 3px; color: #aebdb6; line-height: 1.4; }
.status-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 4px; border-radius: 99px; background: #8fca9a; box-shadow: 0 0 0 4px rgba(143,202,154,.12); }
main { min-width: 0; }
.topbar { min-height: 104px; padding: 24px 4vw; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: rgba(255,253,248,.78); backdrop-filter: blur(14px); }
.topbar.application-topbar { min-height: 78px; padding-block: 18px; }
.topbar-description { min-width: 0; }
.topbar-actions { margin-left: 18px; display: flex; align-items: center; gap: 10px; }
.topbar-application-up { flex: 0 0 50px; width: 50px; height: 50px; font-size: 20px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font: 500 clamp(28px, 4vw, 40px)/1 Georgia, serif; }
h2 { margin-bottom: 12px; font: 500 clamp(25px, 4vw, 39px)/1.14 Georgia, serif; }
h3 { margin-bottom: 0; font: 500 23px/1.2 Georgia, serif; }
.eyebrow { margin-bottom: 8px; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
#app { padding: 34px 4vw 60px; }
#app.database-mode { padding-top: 18px; }
.application-count-row { margin-bottom: 24px; padding: 14px 18px; display: flex; justify-content: center; align-items: center; gap: 10px; color: #f7f3e9; border: 1px solid rgba(255,255,255,.16); border-radius: 15px; background: linear-gradient(145deg, #274c3e, #17342a); box-shadow: 0 8px 24px rgba(32,55,43,.12); }
.application-count-row strong { font: 500 25px/1 Georgia, serif; }
.application-count-row span { color: #e0e6e3; font-size: 16px; font-weight: 650; line-height: 1; }
.atomic-count-bar { width: fit-content; padding: 9px 15px; display: inline-flex; align-items: center; gap: 9px; color: #f7f3e9; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: linear-gradient(145deg, #274c3e, #17342a); box-shadow: 0 8px 24px rgba(32,55,43,.12); }
.atomic-count-bar strong { font: 500 27px/1 Georgia, serif; }
.atomic-count-bar span { color: #d4ddd9; font-size: 11px; font-weight: 750; line-height: 1.25; letter-spacing: .06em; text-align: left; }
.build-status { width: fit-content; max-width: 100%; margin: 14px auto 0; padding: 7px 12px; border: 1px solid #d9cfbb; border-radius: 999px; color: var(--muted); background: rgba(255,253,248,.72); font-size: 10px; font-weight: 700; letter-spacing: .04em; line-height: 1.2; text-align: center; }
.editor-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 10px 35px rgba(41,55,45,.06); }
.pyramid-panel, .detail-panel, .form-panel, .preset-list { padding: 24px; }
.detail-panel { position: sticky; top: 128px; }
.panel-heading { margin-bottom: 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.reader-hint { color: var(--muted); font-size: 12px; }
.pyramid { max-width: 1100px; margin: 0 auto; padding: 8px 0 28px; }
.viewer-stack { display: flex; flex-direction: column; align-items: center; }
.viewer-category-card { position: relative; width: min(300px, 100%); min-height: 104px; margin: 0 auto; padding: 22px; border: 1px solid #d3c39f; border-radius: 19px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); background: linear-gradient(145deg, #fffdf8, #f5eddd); box-shadow: 0 12px 34px rgba(57,64,51,.1); text-align: center; cursor: pointer; transition: .18s ease; }
.viewer-category-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.viewer-category-card.selected { border-color: var(--moss); box-shadow: 0 0 0 3px rgba(38,76,61,.1), 0 12px 34px rgba(57,64,51,.1); }
.viewer-category-card > strong { font: 500 25px Georgia, serif; }
.viewer-template-marker { margin-top: 7px; color: var(--gold); font-size: 9px; font-style: normal; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.viewer-description-list { width: min(620px, 100%); margin-top: 16px; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 9px; }
.viewer-description-chip, .viewer-route-button { min-height: 36px; padding: 8px 15px; border: 1px solid #d9cfbb; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: #f8f4eb; font-size: 12px; font-weight: 750; line-height: 1.2; text-align: center; transition: .18s ease; }
.viewer-description-chip.has-child, .viewer-description-chip.has-value { min-height: 52px; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; justify-items: center; align-content: center; row-gap: 4px; }
.viewer-description-chip.has-child br { display: none; }
.viewer-description-child-category { grid-column: 1; display: block; width: 100%; color: #8d332d; font-size: 10px; font-weight: 850; letter-spacing: .07em; line-height: 1.1; text-transform: uppercase; }
.viewer-description-name { grid-column: 1; display: block; width: 100%; }
.viewer-description-value { grid-column: 1; display: block; width: 100%; color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.viewer-description-chip:hover { border-color: var(--gold); background: #efe4cf; transform: translateY(-1px); }
.viewer-description-chip.selected { border-color: var(--moss); color: #fff; background: var(--moss); box-shadow: 0 5px 14px rgba(38,76,61,.18); }
.viewer-description-chip.selected .viewer-description-child-category { color: #ffc7bd; }
.viewer-description-chip.selected .viewer-description-value { color: #e0e9e5; }
.viewer-collapsed-card { width: min(230px, 100%); padding: 12px 14px; border: 1px solid #d3c39f; border-radius: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink); background: linear-gradient(145deg, #fffdf8, #f5eddd); box-shadow: 0 7px 22px rgba(57,64,51,.08); cursor: pointer; transition: .18s ease; }
.viewer-collapsed-card:hover, .viewer-collapsed-card:focus-visible { border-color: var(--gold); box-shadow: 0 10px 26px rgba(57,64,51,.13); transform: translateY(-1px); outline: none; }
.viewer-route-category { min-width: 130px; flex-direction: column; border-color: #d3c39f; background: #fffdf8; font: 500 17px Georgia, serif; }
.viewer-route-category .viewer-template-marker { margin-top: 3px; font-family: Arial, sans-serif; }
.viewer-route-connector { width: 1px; height: 24px; flex: 0 0 24px; background: linear-gradient(var(--gold), #d9d1bf); }
.viewer-action-card { position: relative; width: min(300px, 100%); min-height: 105px; margin-top: 18px; padding: 14px 17px 17px; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; color: var(--ink); background: #fff; box-shadow: 0 8px 24px rgba(38,76,61,.07); }
.viewer-action-dismiss { width: 28px; height: 28px; padding: 0; border: 1px solid #d9cfbb; border-radius: 999px; display: grid; place-items: center; color: var(--moss); background: #f6f1e7; font-size: 19px; line-height: 1; }
.viewer-action-dismiss:hover { border-color: var(--gold); background: #efe4cf; }
.viewer-action-card .card-command-row { position: static; margin-top: 14px; justify-content: center; }
.viewer-navigation-row { margin-top: 16px; display: flex; justify-content: center; align-items: center; gap: 9px; }
.viewer-navigation-row .card-command-button { width: 42px; height: 42px; }
.viewer-navigation-row .focus-up-icon { width: 42px; height: 42px; margin: 0; font-size: 17px; }
.focus-up-icon, .form-up-icon { width: 29px; height: 29px; padding: 0; display: grid; place-items: center; border: 1px solid #d9cfbb; border-radius: 999px; color: var(--moss); background: #f6f1e7; font-size: 14px; font-weight: 800; line-height: 1; }
.focus-up-icon { margin: 10px auto 0; }
.form-up-icon { flex: 0 0 44px; width: 44px; height: 44px; margin: 0; font-size: 18px; }
.focus-up-icon:hover, .form-up-icon:hover { border-color: var(--gold); background: #efe4cf; }
.focus-connector { height: 70px; margin-bottom: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.focus-connector span { width: 1px; flex: 1; background: linear-gradient(var(--gold), #d9d1bf); }
.focus-connector strong { min-width: 170px; padding: 7px 16px; border: 1px solid #ddd4c1; border-radius: 999px; color: var(--muted); background: #f8f4eb; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.pyramid-row { width: 100%; align-self: stretch; display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap; gap: 12px; }
.pyramid-node { position: relative; width: 190px; max-width: 100%; flex: 0 1 190px; display: flex; flex-direction: column; }
.pyramid-row > .pyramid-node:only-child { width: 300px; max-width: 100%; flex-basis: 300px; }
.pyramid-card { position: relative; min-height: 166px; flex: 1; padding: 14px 14px 58px; border: 1px solid var(--line); border-radius: 15px; display: flex; flex-direction: column; align-items: flex-start; color: var(--ink); background: #fff; text-align: left; transition: .18s ease; }
.pyramid-card:hover { transform: translateY(-2px); border-color: #b9ac90; box-shadow: 0 8px 24px rgba(38,76,61,.08); }
.pyramid-card strong { margin-top: auto; }
.atomic-description-row { width: 100%; margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.atomic-description-row strong { min-width: 0; margin-top: 0; }
.card-command-row { position: absolute; right: 14px; bottom: 13px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.card-command-button { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border: 1px solid #d9cfbb; border-radius: 999px; color: var(--moss); background: #f6f1e7; transition: .18s ease; }
.card-command-button:hover { transform: translateY(-1px); border-color: var(--gold); background: #efe4cf; }
.card-command-button:disabled { cursor: not-allowed; color: #a4aaa5; border-color: #e4e0d7; background: #f1efe9; opacity: .55; transform: none; }
.card-command-button:disabled:hover { border-color: #e4e0d7; background: #f1efe9; transform: none; }
.card-command-button.create-command { border-color: var(--gold); color: #5a4421; background: #f2dfb9; }
.card-command-button.create-command:hover { background: #ead09d; }
.card-command-button.reorder-command { width: 30px; height: 30px; }
.card-command-button.trash-command { color: #8a3d36; border-color: #d9b9b5; background: #fff7f5; }
.card-command-button.trash-command:hover { background: #f5e4e1; }
.card-command-button.trash-command:disabled { color: #aaa5a4; border-color: #e4e0d7; background: #f1efe9; }
.card-command-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pyramid-card small { margin-bottom: 8px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.pyramid-card em { margin-top: 11px; color: var(--gold); font-size: 10px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.edit-atomic { padding: 9px 12px; border: 1px solid var(--moss); border-top: 0; border-radius: 0 0 15px 15px; color: white; background: var(--moss); font-size: 12px; font-weight: 800; }
.edit-atomic:hover { background: var(--moss-dark); }
.terminal-note { width: fit-content; margin: 24px auto 0; padding: 7px 12px; border-radius: 99px; color: var(--muted); background: #f2efe7; font-size: 11px; }
.atomic-workspace-heading { margin-bottom: 22px; display: flex; gap: 20px; align-items: center; }
.atomic-workspace-heading h2 { margin-bottom: 0; }
.atomic-workspace { position: static; max-width: 760px; }
.preset-workspace { max-width: 920px; }
.preset-edit-commands { display: flex; gap: 8px; }
.state { margin-bottom: 16px; padding: 4px 7px; border-radius: 99px; color: #56675e; background: #edf0ec; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.state-approved { color: #23603a; background: #e1f2e5; }
.metadata { display: grid; gap: 0; margin: 0 0 25px; }
.metadata div { padding: 10px 0; display: flex; justify-content: space-between; border-bottom: 1px solid #ece7dc; }
.metadata dt { color: var(--muted); }
.metadata dd { margin: 0; font-weight: 650; text-transform: capitalize; }
.revision { padding: 5px 8px; border-radius: 8px; color: var(--moss); background: #e9efeb; font-size: 11px; font-weight: 800; }
.section-title { margin: 22px 0 10px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stacked-actions { display: grid; gap: 8px; }
.primary, .secondary { border-radius: 10px; padding: 10px 14px; font-weight: 700; }
.primary { border: 1px solid var(--moss); color: white; background: var(--moss); }
.primary:hover { background: var(--moss-dark); }
.secondary { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.secondary:hover { border-color: #a99e87; background: #faf7f0; }
.secondary:disabled { cursor: not-allowed; color: #a4aaa5; border-color: #e4e0d7; background: #f1efe9; box-shadow: none; opacity: .72; }
.secondary:disabled:hover { border-color: #e4e0d7; background: #f1efe9; }
.create-button { border: 1px solid var(--gold); border-radius: 10px; padding: 10px 14px; color: #5a4421; background: #f2dfb9; font-weight: 800; }
.create-button:hover { background: #ead09d; }
.create-button:disabled, .primary:disabled { cursor: not-allowed; color: #a4aaa5; border-color: #e4e0d7; background: #f1efe9; box-shadow: none; opacity: .72; }
.create-button:disabled:hover, .primary:disabled:hover { border-color: #e4e0d7; background: #f1efe9; }
.media-event { padding: 13px; border-radius: 12px; background: #f3f0e8; }
.media-event strong { font-size: 13px; }
.media-event div { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.media-event span { padding: 4px 7px; border-radius: 6px; color: #536159; background: white; font-size: 10px; text-transform: uppercase; }
.application-panel { padding: 24px; }
.user-gateway-panel { padding: 24px; }
.user-gateway-heading { align-items: flex-start; }
.bypass-check { padding: 10px 12px; display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 11px; background: #f8f4eb; white-space: nowrap; }
.bypass-check input { width: auto; }
.user-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.user-list-item { min-height: 54px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fff; font-weight: 750; text-align: center; transition: .18s ease; }
.user-list-item:hover { border-color: var(--gold); transform: translateY(-1px); }
.user-list-item.selected { border-color: var(--moss); color: #fff; background: var(--moss); box-shadow: 0 6px 18px rgba(38,76,61,.16); }
.user-list .empty-state { padding: 34px 20px; }
.user-list .empty-state strong { margin: 0; }
.user-list .empty-state span { margin-top: 7px; color: var(--muted); font-size: 12px; }
.user-gateway-actions { width: min(100%, 360px); margin: 22px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.user-gateway-actions .application-icon-button { width: 52px; height: 52px; padding: 0; display: inline-grid; place-items: center; justify-self: center; border-radius: 999px; }
.user-gateway-actions .application-icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sign-out-panel { margin-top: 18px; padding: 18px; display: flex; justify-content: center; }
.sign-out-button { min-width: 150px; }
.user-mode-panel { width: min(100%, 410px); margin: 18px auto 0; padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mode-choice-button { min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fffdf8; font-weight: 800; box-shadow: 0 4px 10px rgba(38,76,61,.09); transition: .16s ease; }
.mode-choice-button:hover { border-color: var(--gold); background: #faf4e7; }
.mode-choice-button[aria-pressed="true"] { border-color: var(--moss); color: #fff; background: var(--moss); box-shadow: inset 0 3px 7px rgba(0,0,0,.22); transform: translateY(1px); }
.mode-choice-button:disabled { cursor: wait; opacity: .7; }
.application-panel.hidden-view .panel-heading { margin-bottom: 8px; }
.application-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.application-card { position: relative; min-height: 105px; padding: 18px 72px 18px 20px; border: 1px solid var(--line); border-radius: 16px; display: flex; justify-content: space-between; align-items: center; color: var(--ink); background: #fff; text-align: left; transition: .18s ease; cursor: pointer; }
.application-card:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 10px 28px rgba(38,76,61,.1); }
.application-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.application-card.selected { border-color: var(--moss); box-shadow: inset 0 0 0 1px var(--moss), 0 10px 28px rgba(38,76,61,.12); }
.application-card.hidden-application { opacity: .68; background: #f1efe9; }
.application-card-content { min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.application-card strong { margin: 0; font: 500 18px/1.25 Georgia, serif; }
.application-card em { margin-top: 10px; color: var(--gold); font-size: 10px; font-style: normal; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.application-card-icon { position: absolute; top: 50%; right: 20px; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; transform: translateY(-50%); border: 1px solid #d9cfbb; border-radius: 999px; color: var(--moss); background: #f6f1e7; font-size: 18px; font-weight: 800; line-height: 1; }
.application-card-icon:hover { border-color: var(--gold); background: #efe4cf; }
.application-card-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.application-actions { width: min(100%, 360px); margin: 22px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; gap: 10px; }
.application-actions .application-icon-button { width: 52px; height: 52px; padding: 0; justify-self: center; border-radius: 999px; }
.application-icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden-application-actions { width: min(100%, 360px); margin: 18px auto 0; display: flex; justify-content: center; }
.hidden-application-actions button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; }
.hidden-application-actions .hidden-done-icon { display: grid; }
.database-tabs { margin-top: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.database-tabs.generic-only { grid-template-columns: 1fr; }
.database-dashboard.user-reader { padding-top: 6px; }
.database-dashboard.user-reader .pyramid-panel { margin-top: 0; }
.application-actions button, .database-tabs button, .editor-command-grid button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; }
.database-tabs { margin: 0 0 24px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.database-reset-row { margin: -12px 0 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.database-reset-row.reset-generic button { grid-column: 1; }
.database-reset-row.reset-preset button { grid-column: 1; }
.database-reset-row .atomic-count-bar { grid-column: 3; justify-self: end; }
.database-reset-row button { display: inline-flex; align-items: center; gap: 7px; }
.empty-state { grid-column: 1 / -1; padding: 50px 20px; color: var(--muted); text-align: center; }
.empty-state span, .empty-state strong { display: block; }
.empty-state span { color: var(--gold); font-size: 35px; }
.empty-state strong { margin-top: 9px; color: var(--ink); font: 500 22px Georgia, serif; }
.empty-state p { margin: 8px 0 0; }
.hidden-empty-state { padding: 14px 20px 8px; }
.hidden-empty-state strong { margin-top: 0; }
.application-identity { padding: 13px; display: grid; gap: 5px; border-radius: 11px; background: #f3f0e8; }
.application-identity small { color: var(--muted); }
.application-identity code { overflow: hidden; color: var(--ink); text-overflow: ellipsis; }
.application-name-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.application-name-row label { min-width: 0; }
.application-name-row input { height: 44px; }
.application-name-row .application-name-action { width: 44px; height: 44px; padding: 0; border-color: #d9cfbb; border-radius: 999px; color: var(--moss); background: #f6f1e7; }
.application-name-row .application-name-action:hover { border-color: var(--gold); background: #efe4cf; }
.editor-command-grid { display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; gap: 10px; }
.editor-command-grid .application-editor-icon { width: 52px; height: 52px; padding: 0; justify-self: center; border-radius: 999px; }
.editor-command-grid .reset-application-icon svg { width: 24px; height: 24px; stroke-width: 2.2; }
.editor-command-grid .editor-action-full { grid-column: 1 / -1; }
.application-editor-footer { display: flex; align-items: stretch; gap: 10px; }
.application-editor-footer .delete-button { min-width: 0; flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
.application-editor-footer .delete-button svg { width: 21px; height: 21px; flex: 0 0 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.application-editor-footer .secondary { flex: 0 0 auto; }
.danger-outline { color: #7d352f; border-color: #d9b9b5; }
.delete-button { border: 1px solid #a73e35; border-radius: 10px; padding: 10px 14px; color: #fff; background: #a73e35; font-weight: 800; }
.delete-button:hover { background: #842e28; }
.delete-button:disabled { cursor: not-allowed; color: #a4aaa5; border-color: #e4e0d7; background: #f1efe9; opacity: .72; }
.preset-edit-commands .preset-command-icon { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 999px; font-size: 18px; line-height: 1; }
.preset-command-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dialog-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.nav-item:disabled { cursor: not-allowed; opacity: .38; }
.preset-item { width: calc(100% - (var(--depth, 0) * 13px)); margin-left: calc(var(--depth, 0) * 13px); padding: 12px; border: 0; border-radius: 11px; display: flex; gap: 12px; align-items: center; color: var(--ink); background: transparent; text-align: left; }
.preset-item:hover, .preset-item.active { background: #f1eee5; }
.preset-item > span { color: var(--gold); font: 500 16px Georgia, serif; }
.preset-item strong, .preset-item small { display: block; }
.preset-item small { margin-top: 3px; color: var(--muted); }
.form-panel { display: grid; gap: 20px; }
.template-connection { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #b99a52; border-radius: 14px; background: #fff9e9; }
.template-connection strong, .template-connection small { display: block; }
.template-connection small { margin-top: 5px; color: var(--muted); }
.template-status-copy { min-width: 0; }
.template-connection-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.template-connection-button[aria-pressed="true"] { box-shadow: inset 0 2px 5px rgba(0, 0, 0, .2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label { display: grid; gap: 7px; color: #526057; font-size: 12px; font-weight: 750; }
label small { color: var(--muted); font-weight: 400; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--ink); background: white; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--moss); box-shadow: 0 0 0 3px rgba(38,76,61,.1); }
textarea { resize: vertical; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 9px; }
.check input { width: auto; }
fieldset { margin: 0; padding: 14px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 12px; }
fieldset legend { padding: 0 6px; color: var(--ink); font-size: 13px; font-weight: 800; }
fieldset > small { margin: -5px 0 3px 27px; color: var(--muted); line-height: 1.4; }
.template-hierarchy { padding: 14px; border: 1px solid #d8c79f; border-radius: 12px; background: #fff9e9; }
.template-hierarchy ol { margin: 9px 0 0; padding-left: 22px; display: grid; gap: 9px; }
.template-hierarchy li { color: var(--gold); }
.template-hierarchy strong, .template-hierarchy small { display: block; color: var(--ink); }
.template-hierarchy small { margin-top: 2px; color: var(--muted); line-height: 1.4; }
dialog { width: min(500px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 20px; padding: 25px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(16,38,31,.62); backdrop-filter: blur(4px); }
dialog form { display: grid; gap: 18px; }
.creation-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.path-card { min-height: 150px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; align-items: flex-start; color: var(--ink); background: #fff; text-align: left; }
.path-card:hover { border-color: var(--gold); background: #faf5e9; }
.path-card > span { color: var(--gold); font: 500 28px Georgia, serif; }
.path-card > strong { margin-top: auto; }
.path-card > small { margin-top: 6px; color: var(--muted); line-height: 1.4; }
.dialog-heading h2 { margin-bottom: 0; }
.dialog-error { margin: 0; padding: 11px 13px; border: 1px solid #d9b9b5; border-radius: 10px; color: #8d332d; background: #fff4f2; font-size: 13px; font-weight: 700; line-height: 1.45; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
#toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; padding: 12px 16px; border-radius: 10px; color: white; background: var(--moss-dark); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
#toast.visible { opacity: 1; transform: translateY(0); }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { position: static; width: 100%; height: 59px; min-height: 59px; max-height: 59px; padding: 0 12px; flex-direction: row; justify-content: center; align-items: center; overflow: hidden; }
  .brand { width: 100%; height: 59px; min-height: 59px; padding: 0; justify-content: center; align-items: center; text-align: center; }
  .brand small, .sidebar-note { display: none; }
  nav { margin-left: auto; display: flex; }
  .nav-item { width: auto; }
  .editor-layout { grid-template-columns: 1fr; }
  .detail-panel { position: static; }
}
@media (max-width: 620px) {
  .login-screen { padding: 16px; }
  .login-card { padding: 28px 20px; }
  .login-row { grid-template-columns: 1fr auto; }
  .sidebar { justify-content: center; align-items: center; }
  .brand strong { display: block; }
  .topbar, #app { padding-inline: 18px; }
  .topbar { min-height: 90px; }
  .topbar h1 { font-size: 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .template-connection { align-items: stretch; flex-direction: column; }
  .template-connection-actions { justify-content: stretch; }
  .template-connection-actions button { flex: 1; }
  .pyramid-node { width: 260px; max-width: 100%; flex-basis: 260px; }
  .pyramid-row > .pyramid-node:only-child { width: 300px; max-width: 100%; flex-basis: 300px; }
  .creation-paths { grid-template-columns: 1fr; }
  .application-actions { width: 100%; }
  .user-gateway-heading { align-items: stretch; flex-direction: column; }
  .bypass-check { white-space: normal; }
  .database-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-actions { margin-left: 12px; }
  .topbar-application-up { flex-basis: 44px; width: 44px; height: 44px; font-size: 18px; }
  .atomic-workspace-heading { align-items: flex-start; flex-direction: column; }
}
