:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --panel: #11141b;
  --panel-2: #171b24;
  --panel-3: #1d222d;
  --line: #2a303d;
  --line-soft: #202632;
  --text: #f2f4fa;
  --muted: #929bad;
  --accent: #6e7dff;
  --accent-2: #9e72ff;
  --green: #42d692;
  --amber: #f4b860;
  --red: #ff6f7d;
  --shadow: 0 20px 55px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, "Segoe UI", system-ui, sans-serif; overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }

.login-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 35%, #1b2232 0, #0b0d12 55%); }
.auth-pending .workspace { visibility: hidden; }
.auth-pending .google-button { visibility: hidden; }
.login-card { width: min(430px, 100%); padding: 28px 34px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; border: 1px solid #343d50; border-radius: 16px; background: rgba(17,20,27,.96); box-shadow: var(--shadow); }
.login-card h1 { margin: 14px 0 8px; }
.login-card p { margin-bottom: 22px; color: var(--muted); }
.login-mark { width: max-content; min-width: 180px; height: 52px; margin: auto; padding: 0 18px; display: grid; place-items: center; border: 1px solid #58699a; border-radius: 14px; color: #aab5ff; background: rgba(110,125,255,.13); font-size: 18px; font-weight: 900; }
.button.google-button { min-width: 244px; min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 11px; text-decoration: none; color: #3c4043; background: #fff; border-color: #dadce0; box-shadow: 0 1px 2px rgba(0,0,0,.22); }
.button.google-button:hover { color: #202124; background: #f8faff; border-color: #d2e3fc; box-shadow: 0 1px 3px rgba(60,64,67,.3); }
.button.google-button:focus-visible { outline: 2px solid #8ab4f8; outline-offset: 2px; }
.google-icon { width: 18px; height: 18px; flex: 0 0 18px; }

textarea, .modal input, .mask-controls input[type="text"], .mask-controls input:not([type]) {
  border: 1px solid var(--line); background: #0b0e14; color: var(--text); border-radius: 8px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(110, 125, 255, .12); }
.button-row, .toolbar-row, .view-controls, .result-actions { display: flex; gap: 8px; align-items: center; }

.workspace { width: 100vw; height: 100vh; display: grid; grid-template-columns: clamp(270px, 18vw, 350px) minmax(0, 1fr) clamp(330px, 21vw, 390px); min-width: 0; overflow: hidden; }
.panel { background: var(--panel); overflow: hidden; }
.input-panel { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.control-panel { min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-left: 1px solid var(--line); }
.panel-title-row, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-title-row { padding: 20px 18px 14px; }
h1, h2, p { margin: 0; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
.eyebrow { color: #7f8aa0; font-size: 10px; font-weight: 800; letter-spacing: .16em; margin-bottom: 3px; }
.counter { min-width: 28px; padding: 4px 7px; text-align: center; color: #cdd2dd; border-radius: 999px; background: var(--panel-3); }

.layout-card { margin: 16px 18px 12px; min-height: 76px; display: grid; grid-template-columns: 64px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 7px; border: 1px solid #455078; border-radius: 9px; background: linear-gradient(135deg,rgba(110,125,255,.13),rgba(110,125,255,.035)); }
.layout-thumb-shell { width: 64px; height: 60px; display: grid; place-items: center; overflow: hidden; border: 1px solid #3b4561; border-radius: 6px; background: #0b0e14; color: #8996c7; font-size: 9px; font-weight: 900; letter-spacing: .1em; cursor: pointer; }
.layout-thumb-shell img { width: 100%; height: 100%; object-fit: cover; }
.layout-copy { min-width: 0; display: flex; flex-direction: column; }
.layout-copy strong, .layout-copy span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layout-copy strong { font-size: 12px; }
.layout-copy > span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.compact-upload { padding: 6px 8px; font-size: 11px; }

.refs-heading { margin: 0 18px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #0d1016; }
.refs-actions { display: flex; align-items: center; gap: 7px; }
.refs-counter { min-height: 0; padding: 4px 8px; border-color: #455078; background: rgba(110,125,255,.1); color: #cbd1ff; font-weight: 800; }

.asset-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 8px; }
.sidebar-footer { flex: 0 0 auto; padding: 10px 14px 13px; border-top: 1px solid var(--line); background: #0d1016; }
.sidebar-account-row, .sidebar-settings-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-account-row { margin-bottom: 8px; }
.sidebar-account-row .status-pill { min-width: 0; max-width: 205px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-settings-row .status-pill { flex: 1; }
.sidebar-settings-row .button, .sidebar-account-row .button { flex: 0 0 auto; }
.asset-card { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 10px; padding: 9px; margin-bottom: 6px; border: 1px solid transparent; border-radius: 9px; background: #151922; cursor: pointer; }
.asset-card:hover { border-color: #333b4b; background: #191e28; }
.asset-card.active { border-color: var(--accent); background: rgba(110,125,255,.1); }
.asset-thumb { width: 58px; height: 58px; background: #0b0e14; border: 1px solid var(--line); border-radius: 6px; object-fit: cover; display: grid; place-items: center; color: #697386; font-weight: 800; font-size: 11px; overflow: hidden; }
.asset-body { min-width: 0; }
.asset-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 650; margin-bottom: 4px; }
.asset-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.role-row { display: flex; align-items: center; gap: 6px; }
.role-select { width: 100%; min-width: 0; border: 1px solid #343b49; border-radius: 5px; background: #0e1219; color: #dce1ed; padding: 4px 5px; font-size: 11px; }
.ref-checkbox { accent-color: var(--accent); }
.confidence-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.confidence-dot.low { background: var(--amber); }
.confidence-dot.very-low { background: var(--red); }
.asset-reason { margin-top: 4px; font-size: 10px; color: #768196; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selection-summary { color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.wide { flex: 1; }

.stage-column { min-width: 0; min-height: 0; height: 100%; max-height: 100vh; display: flex; flex-direction: column; gap: 10px; padding: 0 10px 10px; overflow: hidden; background: #0a0c11; }
.stage-workarea { flex: 1 1 0; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 10px; overflow: hidden; }
.layer-dock { min-width: 0; min-height: 0; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.layer-dock .layer-section { height: 100%; display: flex; flex-direction: column; padding: 14px; border: 0; }
.layer-actions-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.layer-actions-row .button { min-width: 0; min-height: 58px; padding: 6px 4px; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; font-size: 9px; }
.segment-map-panel { min-height: 0; margin-top: 9px; padding: 9px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: #0b0e14; }
.segment-map-heading { position: sticky; top: -9px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -9px -9px 7px; padding: 8px 9px; background: #0b0e14; border-bottom: 1px solid var(--line); font-size: 11px; }
.segment-map-heading span { color: var(--muted); }
.segment-map-list { display: flex; flex-direction: column; gap: 6px; }
.segment-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px; align-items: start; padding: 7px; border: 1px solid #2e3543; border-radius: 6px; background: #111620; font-size: 10px; }
.segment-item input { margin: 1px 0 0; accent-color: var(--accent); }
.segment-item span { min-width: 0; overflow-wrap: anywhere; }
.segment-map-raw { margin: 0; color: #b7c0d2; white-space: pre-wrap; overflow-wrap: anywhere; font: 10px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }
.stage { position: relative; flex: 1 1 0; min-height: 0; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.checker { background-color: #171a21; background-image: linear-gradient(45deg,#222631 25%,transparent 25%),linear-gradient(-45deg,#222631 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#222631 75%),linear-gradient(-45deg,transparent 75%,#222631 75%); background-size: 24px 24px; background-position: 0 0,0 12px,12px -12px,-12px 0; }
.stage:not(.checker) { background: #0c0f15; background-image: radial-gradient(circle at center, #171d27, #0b0e13 68%); }
.stage > img { position: absolute; inset: 12px; display: block; width: calc(100% - 24px); height: calc(100% - 24px); min-width: 0; min-height: 0; object-fit: contain; object-position: center; box-shadow: var(--shadow); }
.compare-view { --compare-split: 50%; position: absolute; inset: 0; z-index: 2; overflow: hidden; }
.compare-image { position: absolute; inset: 12px; display: block; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain; object-position: center; }
.compare-after-clip { position: absolute; inset: 0; overflow: hidden; clip-path: inset(0 0 0 var(--compare-split)); }
.compare-divider { position: absolute; z-index: 3; top: 0; bottom: 0; left: var(--compare-split); width: 2px; transform: translateX(-1px); background: rgba(255,255,255,.92); pointer-events: none; }
.compare-divider span { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; display: grid; place-items: center; transform: translate(-50%,-50%); border: 2px solid white; border-radius: 50%; background: var(--accent); color: white; font-weight: 900; box-shadow: 0 4px 18px rgba(0,0,0,.45); }
.compare-label { position: absolute; z-index: 3; top: 10px; padding: 3px 7px; border-radius: 999px; background: rgba(8,10,14,.72); color: white; font-size: 9px; font-weight: 900; letter-spacing: .08em; pointer-events: none; }
.compare-label.before { left: 10px; }
.compare-label.after { right: 10px; }
.compare-slider { position: absolute; z-index: 4; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.stage-empty { text-align: center; color: var(--muted); padding: 35px; }
.stage-empty-mark { width: max-content; min-width: 180px; height: 52px; margin: 0 auto 16px; padding: 0 18px; border-radius: 14px; display: grid; place-items: center; border: 1px solid #35405a; background: rgba(110,125,255,.07); color: #8d9aff; font-size: 18px; font-weight: 900; }
.stage-empty h2 { color: #cfd5e1; margin-bottom: 6px; }
.stage-loading { position: absolute; inset: 0; background: rgba(7,9,13,.72); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; z-index: 3; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #343b4a; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-strip { flex: 0 0 126px; padding: 10px 14px; display: grid; grid-template-columns: 115px minmax(0,1fr) auto; gap: 12px; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #0f1218; }
.result-meta { display: flex; flex-direction: column; gap: 4px; }
.result-meta span { color: var(--muted); font-size: 11px; }
.result-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.result-thumb { width: 104px; height: 92px; object-fit: cover; border-radius: 7px; border: 2px solid transparent; cursor: pointer; background: #090b0f; }
.result-thumb.active { border-color: var(--accent); }
.result-actions { width: 270px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.result-actions .button { padding: 7px 8px; font-size: 11px; }

.history-panel { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 14px 16px 16px; overflow: hidden; border-top: 1px solid var(--line); background: #0d1016; }
.history-heading { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 10px; }
.history-refresh { flex: 0 0 auto; width: 27px; height: 27px; padding: 0; color: #cbd1dc; font-size: 16px; }
.history-list { flex: 1 1 0; min-width: 0; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 8px; overflow-x: hidden; overflow-y: auto; padding-right: 3px; }
.history-card { position: relative; width: 100%; aspect-ratio: 4 / 3; padding: 0; overflow: hidden; border: 1px solid #303746; border-radius: 7px; background: #090b0f; cursor: pointer; }
.history-card:hover, .history-card:focus-visible { border-color: var(--accent); outline: none; }
.history-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.history-kind { position: absolute; left: 5px; bottom: 5px; max-width: calc(100% - 10px); padding: 2px 5px; border-radius: 4px; background: rgba(5,7,10,.82); color: #dce2f0; font-size: 9px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-empty { grid-column: 1 / -1; width: 100%; color: var(--muted); font-size: 11px; }

.control-section { padding: 17px; border-bottom: 1px solid var(--line); }
.section-heading { margin-bottom: 10px; }
.section-heading.compact { align-items: flex-start; }
.anime-badge, .free-badge { font-size: 9px; font-weight: 900; letter-spacing: .12em; padding: 4px 6px; border-radius: 5px; color: #e8e4ff; background: rgba(137,101,255,.24); border: 1px solid rgba(158,114,255,.36); }
.free-badge { color: #c8f9e1; background: rgba(66,214,146,.1); border-color: rgba(66,214,146,.28); }
textarea { width: 100%; resize: none; padding: 10px; color: var(--text); }
.prompt-preset-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px 34px; gap: 6px; margin-bottom: 9px; }
.prompt-preset-select { width: 100%; min-width: 0; padding: 8px 10px; border-color: #3a4254; color: #dbe0ec; background: #0d1118; }
.preset-icon-button { width: 34px; min-width: 34px; padding: 0; font-size: 18px; }
#presetPromptInput { min-height: 150px; }
.additional-negative { margin-top: 9px; }
.field-label { display: block; color: var(--muted); font-size: 11px; margin: 9px 0 5px; }
.prompt-preview { margin: 0; max-height: 230px; overflow: auto; white-space: pre-wrap; border: 1px solid var(--line); background: #0b0e14; border-radius: 8px; padding: 10px; color: #bfc7d8; font: 11px/1.45 "Cascadia Code", Consolas, monospace; }
.field-grid { display: grid; gap: 9px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.field-grid.four { grid-template-columns: minmax(0, 1.45fr) minmax(0, .82fr) minmax(0, .92fr) minmax(0, .7fr); gap: 6px; }
.field-grid.four label { min-width: 0; }
.field-grid.four select, .field-grid.four output { width: 100%; min-width: 0; padding: 7px 6px; font-size: 10px; }
.field-grid.four output { white-space: nowrap; }
.field-grid label, .mask-controls label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; }
select, .mask-controls input { border: 1px solid var(--line); background: #0b0e14; color: var(--text); border-radius: 7px; padding: 8px; }
output { display: flex; align-items: center; min-height: 35px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: #0b0e14; color: #cbd1dc; }
.generate { width: 100%; margin-top: 12px; min-height: 43px; border: 0 !important; background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important; color: white !important; box-shadow: 0 8px 25px rgba(104,87,240,.23); }
.notice { margin-top: 9px; padding: 8px 9px; border-radius: 7px; background: rgba(244,184,96,.08); border: 1px solid rgba(244,184,96,.22); color: #c8b791; font-size: 11px; }
.notice.subtle { background: #0d1016; border-color: var(--line); color: var(--muted); }
.section-copy { color: var(--muted); font-size: 12px; margin-bottom: 10px; }

.button, .icon-button, .chip, .mini-button, .close-button, .mask-tool { border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); cursor: pointer; transition: .14s ease; }
.button { padding: 8px 12px; font-weight: 650; }
.button:hover:not(:disabled), .icon-button:hover, .chip:hover, .mini-button:hover { filter: brightness(1.16); transform: translateY(-1px); }
.button:disabled { opacity: .4; cursor: not-allowed; }
.button.primary { background: var(--accent); border-color: #8590ff; color: white; }
.button.secondary { background: #262c38; }
.button.ghost { background: transparent; }
.icon-button { width: 39px; background: #202632; font-size: 20px; }
.chip { padding: 5px 8px; font-size: 11px; color: var(--muted); }
.chip.active { color: white; border-color: #4b5677; background: #272e3d; }
.mini-button { padding: 4px 7px; color: #b6bfd1; font-size: 10px; }
.status-pill { padding: 6px 9px; border-radius: 999px; border: 1px solid rgba(66,214,146,.25); background: rgba(66,214,146,.08); color: #a9eccd; font-size: 11px; }
.status-pill.muted { border-color: var(--line); background: #161a22; color: var(--muted); }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 5px; color: var(--muted); padding: 25px; }
.empty-state strong { color: #c8ceda; }
.empty-icon { font-size: 30px; color: #596276; }
.hidden { display: none !important; }

.modal { padding: 0; border: 1px solid #3b4353; border-radius: 12px; background: #11151d; color: var(--text); box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.modal::backdrop { background: rgba(3,4,7,.76); backdrop-filter: blur(5px); }
.small-modal { width: min(470px, calc(100vw - 30px)); }
.modal-card { padding: 20px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.modal-card p { color: var(--muted); margin-bottom: 12px; }
.modal-card input { width: 100%; padding: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.close-button { width: 31px; height: 31px; font-size: 21px; background: transparent; color: var(--muted); }

.ref-preview-modal { width: min(1180px, calc(100vw - 36px)); height: min(820px, calc(100vh - 36px)); overflow: hidden; }
.ref-preview-card { height: 100%; display: flex; flex-direction: column; padding: 16px; }
.ref-preview-card > .modal-header { flex: 0 0 auto; margin-bottom: 10px; }
.ref-preview-card > .modal-header > div { min-width: 0; }
#refPreviewTitle { max-width: min(1010px, calc(100vw - 130px)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ref-preview-card .close-button { flex: 0 0 auto; }
.ref-preview-meta { max-width: min(900px, 76vw); margin-top: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ref-preview-stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.ref-preview-stage img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }

.layer-modal { width: min(1460px, calc(100vw - 24px)); height: min(920px, calc(100vh - 24px)); }
.layer-editor { height: 100%; display: flex; flex-direction: column; padding: 16px; }
.layer-editor > .modal-header { flex: 0 0 auto; }
.layer-editor-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; }
.canvas-shell { position: relative; min-width: 0; min-height: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
#maskCanvas { display: block; flex: 0 0 auto; max-width: none; max-height: none; cursor: crosshair; touch-action: none; }
#canvasHint { position: absolute; left: 12px; bottom: 12px; padding: 6px 9px; border-radius: 6px; background: rgba(7,9,13,.76); color: #bac1d0; font-size: 11px; pointer-events: none; }
.mask-controls { overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #0e1117; }
.mask-controls > * { margin-bottom: 12px; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.mask-tool { padding: 7px 5px; color: var(--muted); }
.mask-tool.active { color: white; border-color: var(--accent); background: rgba(110,125,255,.15); }
.wrap { flex-wrap: wrap; }
.captured-layers { min-height: 90px; max-height: 210px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 8px; }
.compact-empty { min-height: 70px; font-size: 11px; }
.captured-layer { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 8px; padding: 6px; border-bottom: 1px solid var(--line-soft); }
.captured-layer img { width: 46px; height: 38px; object-fit: contain; background-color: #222631; background-image: linear-gradient(45deg,#303541 25%,transparent 25%),linear-gradient(-45deg,#303541 25%,transparent 25%); background-size: 10px 10px; }
.captured-layer button { border: 0; background: transparent; color: var(--red); cursor: pointer; }
.mask-note { color: var(--muted); font-size: 10px; }
.fill-box { padding: 11px; border: 1px solid rgba(110,125,255,.3); border-radius: 9px; background: rgba(110,125,255,.06); }
.fill-box > * { margin-bottom: 8px; }
.fill-box > *:last-child { margin-bottom: 0; }
.fill-box-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fill-box-heading span { color: #aeb7ff; font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.fill-box p { color: #a8b0c1; font-size: 10px; }
.fill-button { width: 100%; border-color: #7887ff; background: linear-gradient(135deg, #4f5ed7, #8358ca); color: white; }
.psd-button { width: 100%; border-color: rgba(66,214,146,.45); background: rgba(66,214,146,.12); color: #c8f9e1; }

.toast-region { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { max-width: 410px; padding: 10px 13px; border: 1px solid #3b4353; border-radius: 8px; background: #171c25; box-shadow: var(--shadow); animation: toast-in .2s ease; }
.toast.error { border-color: rgba(255,111,125,.55); color: #ffc5cb; }
.toast.success { border-color: rgba(66,214,146,.45); color: #c6f7df; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

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