:root {
  --bg: #090a12;
  --panel: #11131e;
  --panel-2: #171a29;
  --panel-3: #1e2132;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f7f7fb;
  --muted: #9296aa;
  --purple: #9a7cff;
  --blue: #72b7ff;
  --mint: #73e2c2;
  --danger: #ff7a91;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 80% 0%, rgba(91, 74, 186, .24), transparent 30rem),
    radial-gradient(circle at 15% 18%, rgba(34, 110, 154, .14), transparent 28rem),
    var(--bg);
}
button, input, textarea { font: inherit; }
button { color: inherit; }

.studio-brand, .glimnavi-brand { align-items: center; gap: 12px; }
.studio-brand { display: flex; }
.glimnavi-brand { display: none; }
.glimnavi-brand img { width: 123px; height: 24px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.ui-switcher {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.025);
}
.ui-switcher button {
  min-width: 88px;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.ui-switcher button span, .ui-switcher button small { display: block; }
.ui-switcher button span { font-size: 10px; font-weight: 800; }
.ui-switcher button small { margin-top: 2px; font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
.ui-switcher button.active {
  color: var(--text);
  background: var(--panel-3);
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.metadata-tool-button {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: .18s ease;
}
.metadata-tool-button:hover { color: var(--text); border-color: rgba(154,124,255,.5); background: rgba(154,124,255,.06); }
.metadata-tool-button b { padding: 3px 4px; color: #b8a5ff; background: rgba(154,124,255,.12); border-radius: 4px; font-size: 8px; letter-spacing: .04em; }
.metadata-tool-button span { font-size: 9px; font-weight: 750; }
.glim-context-bar { display: none; }

.topbar {
  height: 76px;
  padding: 0 max(24px, calc((100vw - 1380px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 10, 18, .76);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border-radius: 11px;
  box-shadow: 0 8px 26px rgba(124, 99, 255, .3);
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: .16em; }
.server-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 12px;
}
.server-status i { width: 7px; height: 7px; border-radius: 50%; background: #73778a; }
.server-status.online i { background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.server-status.offline i { background: var(--danger); }

.metadata-dialog {
  width: min(900px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  overflow: visible;
}
.metadata-dialog::backdrop { background: rgba(4,5,10,.76); backdrop-filter: blur(5px); }
.metadata-dialog-shell { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: 0 30px 90px rgba(0,0,0,.5); overflow: hidden; }
.metadata-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 24px 26px 20px; border-bottom: 1px solid var(--line); }
.metadata-dialog-head h2 { margin: 5px 0 7px; font-size: 21px; letter-spacing: -.03em; }
.metadata-dialog-head > div > p:last-child { margin: 0; color: var(--muted); font-size: 10px; }
.metadata-dialog-close { width: 34px; height: 34px; flex: 0 0 auto; color: var(--muted); background: var(--panel-3); border: 1px solid var(--line); border-radius: 9px; font-size: 21px; line-height: 1; cursor: pointer; }
.metadata-dialog-close:hover { color: var(--text); border-color: var(--line-strong); }
.metadata-dialog-body { min-height: 430px; display: grid; grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr); gap: 16px; padding: 18px; }
.metadata-upload-panel { min-width: 0; }
.metadata-upload-panel > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.metadata-upload-zone { height: 100%; min-height: 390px; display: grid; place-content: center; justify-items: center; gap: 9px; padding: 28px; text-align: center; background: #0b0d16; border: 1px dashed var(--line-strong); border-radius: 14px; cursor: pointer; transition: .18s ease; }
.metadata-upload-zone:hover,
.metadata-upload-zone.is-dragging { background: rgba(154,124,255,.06); border-color: var(--purple); }
.metadata-upload-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 4px; color: #c7b9ff; background: rgba(154,124,255,.1); border: 1px solid rgba(154,124,255,.24); border-radius: 14px; font-size: 11px; font-weight: 850; letter-spacing: .05em; }
.metadata-upload-zone strong { font-size: 12px; }
.metadata-upload-zone small { color: var(--muted); font-size: 9px; }
.metadata-preview-wrap { height: 100%; min-height: 390px; display: none; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; padding: 12px; background: #0b0d16; border: 1px solid var(--line); border-radius: 14px; }
.metadata-upload-panel.has-file .metadata-upload-zone { display: none; }
.metadata-upload-panel.has-file .metadata-preview-wrap { display: grid; }
.metadata-preview-wrap img { width: 100%; height: 100%; min-height: 0; object-fit: contain; border-radius: 9px; }
.metadata-preview-wrap label { padding: 10px; color: var(--muted); text-align: center; background: var(--panel-3); border: 1px solid var(--line); border-radius: 8px; font-size: 9px; font-weight: 750; cursor: pointer; }
.metadata-preview-wrap label:hover { color: var(--text); border-color: var(--line-strong); }
.metadata-results { min-width: 0; height: 100%; max-height: 430px; display: flex; flex-direction: column; overflow: hidden; background: #0b0d16; border: 1px solid var(--line); border-radius: 14px; }
.metadata-results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px 13px; border-bottom: 1px solid var(--line); }
.metadata-results-head > div { display: grid; gap: 3px; }
.metadata-results-head b { font-size: 11px; }
.metadata-results-head small { color: var(--muted); font-size: 8px; }
.metadata-results-head > span { min-width: 24px; padding: 4px 6px; color: #b8a5ff; text-align: center; background: rgba(154,124,255,.1); border-radius: 6px; font-size: 8px; font-weight: 800; }
.metadata-body { min-height: 0; display: grid; align-content: start; gap: 11px; padding: 13px 14px 18px; overflow: auto; }
.metadata-row { min-width: 0; display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 11px; align-items: start; }
.metadata-row b { color: #9a91b7; font-size: 8px; font-weight: 750; line-height: 1.45; letter-spacing: .04em; overflow-wrap: anywhere; }
.metadata-row code { display: block; max-height: 190px; overflow: auto; color: #d7d9e4; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 8px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.metadata-empty { color: var(--muted); font-size: 9px; line-height: 1.6; }
.metadata-error { color: var(--danger); }

main { width: min(1380px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 90px; }
.hero { min-height: 430px; display: flex; align-items: center; justify-content: space-between; gap: 64px; }
.hero-copy { position: relative; }
.hero-copy::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  left: -35px;
  top: 5px;
  border: 1px solid rgba(154, 124, 255, .18);
  border-radius: 36px;
  transform: rotate(18deg);
  pointer-events: none;
}
.eyebrow { margin: 0 0 11px; color: var(--purple); font-size: 10px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { position: relative; margin: 0; font-size: clamp(42px, 5vw, 70px); line-height: 1.05; letter-spacing: -.06em; }
.hero h1 em {
  color: transparent;
  background: linear-gradient(90deg, #b49dff, #6fc9ff);
  background-clip: text;
  -webkit-background-clip: text;
  font-style: normal;
}
.hero-copy > p:nth-of-type(2) { max-width: 650px; margin: 22px 0 0; color: var(--muted); line-height: 1.75; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.hero-tags span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: #b9bdd0; background: rgba(255,255,255,.025); font-size: 10px; }
.compute-card {
  flex: 0 0 340px;
  min-height: 190px;
  padding: 26px;
  background: linear-gradient(145deg, rgba(31, 34, 53, .96), rgba(15, 17, 28, .98));
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  box-shadow: 0 32px 90px rgba(0,0,0,.35);
}
.compute-card > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.compute-card small { color: var(--muted); font-size: 9px; letter-spacing: .14em; }
.compute-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px rgba(115, 226, 194, .7); }
.compute-card strong { display: block; margin: 29px 0 23px; font-size: 20px; }
.compute-card p { display: flex; justify-content: space-between; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.compute-card p b { color: var(--text); }

.studio-intro { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin: 4px 4px 24px; }
.studio-intro h2 { margin: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.04em; }
.studio-intro > p { max-width: 430px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; text-align: right; }
.workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  background: rgba(17, 19, 30, .9);
  box-shadow: 0 30px 100px rgba(0,0,0,.22);
}
.catalog-panel { padding: 28px 18px; border-right: 1px solid var(--line); background: rgba(12,14,23,.55); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 8px 22px; }
.section-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.count-badge, .version {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 10px;
}
.workflow-list { display: grid; gap: 8px; }
.catalog-filters { display: flex; gap: 6px; margin: 0 0 14px; }
.catalog-filters button { flex: 1; padding: 9px 7px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 11px; }
.catalog-filters button[aria-pressed="true"] { color: var(--text); background: var(--panel-3); border-color: var(--purple); }
.catalog-filters span { margin-left: 4px; font-variant-numeric: tabular-nums; }
.catalog-empty, .catalog-notice { color: var(--muted); font-size: 12px; line-height: 1.7; }
.workflow-item { position: relative; min-width: 0; }
.favorite-button { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 32px; height: 36px; padding: 0; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; font-size: 23px; cursor: pointer; }
.favorite-button:hover { background: var(--panel-3); }
.favorite-button[aria-pressed="true"] { color: #efbd4f; }
.favorite-button:focus-visible, .catalog-filters button:focus-visible, .workflow-card:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; }
.card-meta small { margin-top: 0; }
.workflow-card {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr);
  align-items: center;
  gap: 12px;
  padding: 13px 48px 13px 13px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: .18s ease;
}
.workflow-card:hover { background: var(--panel-2); transform: translateX(2px); }
.workflow-card.active { background: linear-gradient(110deg, rgba(154,124,255,.16), rgba(114,183,255,.06)); border-color: rgba(154,124,255,.35); }
.card-icon { display: grid; place-items: center; width: 44px; height: 44px; background: var(--panel-3); border-radius: 12px; color: #b8a5ff; font-size: 18px; }
.workflow-card.active .card-icon { color: white; background: linear-gradient(135deg, #8c6cf2, #538fcf); }
.card-copy { min-width: 0; }
.card-copy strong, .card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-copy strong { font-size: 13px; }
.card-copy small { color: var(--muted); font-size: 9px; }
.card-state { padding: 4px 7px; color: #d7a86d; background: rgba(215,168,109,.11); border-radius: 6px; font-size: 8px; font-weight: 900; letter-spacing: .06em; }
.card-state.ready { color: var(--mint); background: rgba(115,226,194,.1); }

.playground-panel { min-width: 0; padding: 38px; background: linear-gradient(145deg, rgba(23,25,39,.94), rgba(13,15,24,.94)); }
.empty-state { height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty-state h2 { margin: 18px 0 8px; color: var(--text); font-size: 20px; }
.empty-state p { margin: 0; font-size: 12px; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid rgba(154,124,255,.28); border-radius: 19px; color: #b49dff; background: rgba(154,124,255,.07); font-size: 24px; }
.playground-head { display: flex; justify-content: space-between; gap: 30px; padding-bottom: 27px; border-bottom: 1px solid var(--line); }
.playground-head h2 { margin: 0; font-size: 31px; letter-spacing: -.045em; }
.playground-head > div > p:last-child { max-width: 650px; margin: 10px 0 0; color: var(--muted); line-height: 1.65; font-size: 12px; }
.setup-notice { margin: 22px 0; padding: 16px 18px; background: rgba(215,168,109,.08); border: 1px solid rgba(215,168,109,.25); border-radius: 12px; }
.setup-notice strong { color: #f0bd7d; font-size: 12px; }
.setup-notice p { margin: 7px 0 0; color: #b9a98f; font-size: 11px; }
.run-form { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 16px; align-items: end; margin: 29px 0; }
.form-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.field { display: grid; gap: 8px; }
.field-tall { grid-row: span 2; }
.field > span:first-child { color: #c9ccda; font-size: 11px; font-weight: 700; }
.field textarea, .field > input:not([type=file]), .field select { width: 100%; padding: 13px 14px; color: var(--text); background: #0b0d16; border: 1px solid var(--line); border-radius: 10px; outline: none; resize: vertical; }
.field textarea:focus, .field > input:focus, .field select:focus { border-color: rgba(154,124,255,.65); box-shadow: 0 0 0 3px rgba(154,124,255,.08); }
.field select { min-height: 44px; color-scheme: dark; cursor: pointer; }
.field:has(textarea) { grid-column: 1 / -1; }
.prompt-details { grid-column: 1 / -1; justify-self: end; width: 100%; padding: 0; border: 0; background: transparent; }
.prompt-details summary { min-height: 18px; display: flex; align-items: center; justify-content: flex-end; gap: 5px; padding: 0 3px; color: var(--muted); cursor: pointer; list-style: none; opacity: .38; transition: opacity .18s ease; }
.prompt-details summary:hover, .prompt-details[open] summary { opacity: .72; }
.prompt-details summary::-webkit-details-marker { display: none; }
.prompt-details summary::after { content: "···"; color: inherit; font-size: 10px; letter-spacing: .08em; }
.prompt-details[open] summary::after { content: "×"; }
.prompt-details summary span { color: inherit; font-size: 8px; font-weight: 500; letter-spacing: .04em; }
.prompt-editor { margin-top: 7px; padding: 12px; background: #0d0f18; border: 1px solid var(--line); border-radius: 10px; }
.prompt-editor label { display: grid; gap: 8px; }
.prompt-editor label > span { color: var(--muted); font-size: 9px; }
.image-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone { min-height: 122px; display: grid; place-content: center; gap: 7px; text-align: center; background: #0b0d16; border: 1px dashed var(--line-strong); border-radius: 12px; cursor: pointer; transition: .18s ease; }
.dropzone:hover { border-color: rgba(154,124,255,.5); background: rgba(154,124,255,.035); }
.dropzone b { font-size: 11px; }
.dropzone small { color: var(--muted); font-size: 9px; }
.image-field.is-dragging .dropzone { background: rgba(154,124,255,.08); border-color: var(--purple); box-shadow: inset 0 0 0 1px rgba(154,124,255,.15); }
.image-field.is-dragging .dropzone b { color: #b8a5ff; }
.image-field.has-error .dropzone { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 10px; }
.image-field.has-image .dropzone { display: none; }
.image-preview { display: none; width: 100%; height: 170px; object-fit: contain; background: #090b12; border: 1px solid var(--line); border-radius: 12px; }
.image-field.has-image .image-preview { display: block; }
.image-field.has-image { position: relative; }
.image-field.has-image.is-dragging .image-preview { border-color: var(--purple); opacity: .38; }
.image-field.has-image.is-dragging::after { content: "새 이미지로 교체"; position: absolute; inset: 27px 0 0; display: grid; place-items: center; color: #d8ceff; background: rgba(31,25,53,.48); border: 1px dashed var(--purple); border-radius: 12px; font-size: 11px; font-weight: 800; pointer-events: none; }
.run-button { height: 49px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; color: white; background: linear-gradient(100deg, #8d6df0, #4f94d3); border: 0; border-radius: 11px; font-size: 11px; font-weight: 850; cursor: pointer; box-shadow: 0 12px 28px rgba(98,82,190,.22); }
.run-button:hover:not(:disabled) { filter: brightness(1.08); }
.run-button:disabled { background: #303343; color: #777b8e; cursor: not-allowed; box-shadow: none; }
.run-button b { font-size: 18px; }
.result-panel { min-height: 330px; display: grid; place-items: center; background: #090b12; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; }
.result-empty, .progress-state, .error-state { display: grid; justify-items: center; gap: 10px; padding: 35px; text-align: center; color: var(--muted); }
.result-empty span { color: #676b7d; font-size: 9px; letter-spacing: .2em; }
.result-empty p { margin: 0; font-size: 11px; }
.progress-state strong { color: var(--text); font-size: 12px; }
.progress-state small { color: var(--muted); font-family: monospace; font-size: 9px; }
.spinner { width: 35px; height: 35px; border: 2px solid #292c3f; border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state span { color: var(--danger); font-size: 10px; font-weight: 800; }
.error-state strong { max-width: 650px; color: var(--text); font-size: 12px; line-height: 1.6; }
.output-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--line); }
.output-collection { width: 100%; align-self: stretch; }
.output-actions { display: flex; justify-content: flex-end; padding: 10px 12px; background: #10121c; border-bottom: 1px solid var(--line); }
.download-all-button { min-height: 34px; padding: 0 12px; color: #d8ceff; background: rgba(154,124,255,.1); border: 1px solid rgba(154,124,255,.3); border-radius: 8px; font-size: 9px; font-weight: 800; cursor: pointer; }
.download-all-button:hover:not(:disabled) { color: white; background: rgba(154,124,255,.18); border-color: rgba(154,124,255,.55); }
.download-all-button:disabled { opacity: .55; cursor: wait; }
.output-grid a { display: grid; color: inherit; background: #090b12; text-decoration: none; }
.output-grid img { width: 100%; height: 440px; object-fit: contain; }
.output-grid span { padding: 10px; color: var(--muted); font-size: 10px; }
.comparison { width: 100%; align-self: stretch; display: flex; flex-direction: column; }
.comparison-toolbar { min-height: 58px; display: flex; align-items: center; gap: 18px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #10121c; }
.comparison-modes { display: flex; gap: 3px; padding: 3px; background: #080a11; border: 1px solid var(--line); border-radius: 9px; }
.comparison-modes button { padding: 7px 12px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; font-size: 10px; font-weight: 800; cursor: pointer; }
.comparison-modes button.active { color: white; background: linear-gradient(100deg, #8d6df0, #4f94d3); }
.opacity-control { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; }
.opacity-control[hidden] { display: none; }
.opacity-control input { width: 110px; accent-color: var(--purple); }
.opacity-control b { min-width: 28px; color: var(--text); }
.open-output { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 9px; }
.open-output:hover { color: #b8a5ff; }
.comparison-stage {
  position: relative;
  flex: 1;
  min-height: 520px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: #090b12;
  background-image: linear-gradient(45deg, #11131d 25%, transparent 25%), linear-gradient(-45deg, #11131d 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #11131d 75%), linear-gradient(-45deg, transparent 75%, #11131d 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.comparison-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.comparison-stage[data-mode="input"] .comparison-output { opacity: 0 !important; }
.comparison-stage[data-mode="output"] .comparison-input { opacity: 0; }
.comparison-stage[data-mode="output"] .comparison-output { opacity: 1 !important; }
.comparison-label { position: absolute; top: 14px; left: 14px; z-index: 2; padding: 6px 9px; color: white; background: #8062dc; border-radius: 6px; font-size: 9px; font-weight: 900; }
.additional-outputs { margin-top: 1px; }

.runs-section { padding: 64px 0 0; }
.history-heading-tools { display: flex; align-items: center; gap: 14px; }
.history-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; font-weight: 750; }
.history-filter select {
  min-width: 190px;
  height: 36px;
  padding: 0 32px 0 11px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  color-scheme: dark;
  cursor: pointer;
  font-size: 10px;
}
.history-filter select:hover, .history-filter select:focus { border-color: rgba(154,124,255,.55); }
.history-filter select:focus { box-shadow: 0 0 0 3px rgba(154,124,255,.08); }
.history-filter select:disabled { opacity: .5; cursor: default; }
.history-note { color: var(--muted); font-size: 10px; }
.run-list { display: grid; gap: 22px; }
.run-entry { min-width: 0; }
.run-item { width: 100%; display: grid; grid-template-columns: 10px minmax(180px, 1fr) minmax(200px, .7fr) 80px; align-items: center; gap: 15px; min-height: 68px; padding: 0 12px; color: inherit; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .18s ease, opacity .18s ease; }
.run-item:hover { background: rgba(255,255,255,.025); }
.run-entry.expanded .run-item { background: rgba(154,124,255,.055); border-bottom-color: transparent; }
.run-item.loading { opacity: .5; pointer-events: none; }
.run-item div strong, .run-item div small { display: block; }
.run-item div strong { font-size: 12px; }
.run-item div small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.run-item > b { color: var(--muted); font-size: 9px; text-align: right; }
.run-item code { color: #a5a9bb; font-family: "Cascadia Code", monospace; font-size: 9px; }
.run-status { width: 7px; height: 7px; border-radius: 50%; background: #c19765; }
.run-status.completed { background: var(--mint); }
.run-status.failed { background: var(--danger); }
.run-status.running { background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.run-detail { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.run-detail[hidden] { display: none; }
.history-detail-loading { min-height: 160px; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); font-size: 10px; }
.history-detail-error { margin: 0; padding: 32px; color: var(--danger); text-align: center; font-size: 10px; line-height: 1.6; }
.history-result { width: 100%; align-self: stretch; }
.history-result-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 18px;
  background: #10121c;
  border-bottom: 1px solid var(--line);
}
.history-result-head div > span,
.history-result-head div > strong { display: block; }
.history-result-head div > span { margin-bottom: 5px; color: var(--purple); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.history-result-head div > strong { font-size: 13px; }
.history-result-head time { color: var(--muted); font-size: 9px; }
.history-result-actions { display: flex; align-items: center; gap: 15px; }
.history-workspace-button {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  color: white;
  background: linear-gradient(100deg, #8d6df0, #4f94d3);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}
.history-workspace-button:hover { filter: brightness(1.08); }
.history-workspace-button b { font-size: 14px; }
.history-image-section { padding: 20px; border-bottom: 1px solid var(--line); }
.history-image-section:last-child { border-bottom: 0; }
.history-image-section > div:first-child { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.history-image-section > div:first-child strong { font-size: 12px; }
.history-image-section > div:first-child span { color: var(--muted); font-size: 9px; }
.history-image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.history-image-card { position: relative; min-width: 0; color: inherit; background: #090b12; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; text-decoration: none; }
.history-image-card img { width: 100%; height: 300px; display: block; object-fit: contain; }
.history-image-card > span { display: block; padding: 11px 12px; border-top: 1px solid var(--line); }
.history-image-card > .history-image-badge { position: absolute; top: 10px; left: 10px; z-index: 1; padding: 6px 8px; color: white; background: rgba(8,10,17,.82); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; backdrop-filter: blur(8px); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.history-image-card.input { border-color: rgba(154,124,255,.55); }
.history-image-card.input > .history-image-badge { background: rgba(128,98,220,.9); }
.history-image-card strong, .history-image-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-image-card strong { font-size: 10px; }
.history-image-card small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.history-empty-note { margin: 0; padding: 24px; color: var(--muted); background: rgba(255,255,255,.02); border: 1px dashed var(--line-strong); border-radius: 10px; text-align: center; font-size: 10px; }
.history-gallery-entry { min-width: 0; background: rgba(255,255,255,.015); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.history-gallery-head { width: 100%; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; color: inherit; text-align: left; background: transparent; border: 0; cursor: pointer; transition: background .18s ease; }
.history-gallery-head:hover { background: rgba(255,255,255,.025); }
.history-gallery-entry.expanded .history-gallery-head { background: rgba(154,124,255,.055); }
.history-gallery-title { min-width: 0; display: flex; align-items: center; gap: 11px; }
.history-gallery-title div { min-width: 0; }
.history-gallery-title strong, .history-gallery-title time { display: block; }
.history-gallery-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.history-gallery-title time { margin-top: 5px; color: var(--muted); font-size: 9px; }
.history-gallery-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 9px; }
.history-gallery-meta > span { padding: 5px 8px; background: rgba(255,255,255,.04); border-radius: 999px; white-space: nowrap; }
.history-gallery-meta > b { min-width: 66px; font-size: 8px; text-align: center; }
.history-gallery-chevron { width: 9px; height: 9px; margin: 0 5px 4px 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .2s ease, margin .2s ease; }
.history-gallery-entry.expanded .history-gallery-chevron { margin-top: 7px; margin-bottom: 0; transform: rotate(225deg); }
.history-gallery-detail { padding: 15px 18px 18px; border-top: 1px solid var(--line); }
.history-gallery-detail[hidden] { display: none; }
.history-gallery-detail-toolbar { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; color: var(--muted); font-size: 9px; }
.history-gallery-strip { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(190px, 22vw, 270px); gap: 12px; padding: 1px 2px 10px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: inline proximity; scrollbar-color: var(--line-strong) transparent; }
.history-gallery-strip .history-image-card { scroll-snap-align: start; }
.history-gallery-strip .history-image-card img { height: 210px; }
.history-image-placeholder { height: 210px; display: grid; place-content: center; gap: 6px; padding: 24px; color: var(--muted); text-align: center; }
.history-image-placeholder b { color: var(--text); font-size: 10px; }
.history-image-placeholder small { font-size: 8px; line-height: 1.5; }
.history-pagination { display: flex; align-items: center; justify-content: center; gap: 8px; padding-top: 4px; }
.history-page-tabs { display: flex; align-items: center; gap: 6px; }
.history-pagination button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 10px; font-weight: 800; }
.history-pagination button:hover:not(:disabled), .history-pagination button.active { color: white; background: var(--purple); border-color: var(--purple); }
.history-pagination button:disabled { opacity: .3; cursor: default; }
.history-pagination-gap { width: 20px; color: var(--muted); text-align: center; }
.muted { color: var(--muted); font-size: 11px; }
.skeleton { color: var(--muted); animation: pulse 1.2s ease infinite alternate; }
@keyframes pulse { to { opacity: .5; } }

@media (max-width: 900px) {
  main { width: min(100% - 28px, 700px); }
  .hero { min-height: 560px; align-items: flex-start; justify-content: center; flex-direction: column; gap: 40px; padding: 58px 0; }
  .compute-card { width: 100%; flex-basis: auto; }
  .studio-intro { align-items: flex-start; flex-direction: column; gap: 12px; }
  .studio-intro > p { text-align: left; }
  .workspace { grid-template-columns: 1fr; }
  .catalog-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .run-form { grid-template-columns: 1fr; }
  .comparison-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .open-output { margin-left: 0; }
  .run-item { grid-template-columns: 10px 1fr 70px; }
  .run-item code { display: none; }
  .history-result-head { align-items: flex-start; flex-direction: column; }
  .history-result-actions { width: 100%; justify-content: space-between; }
  .history-gallery-detail-toolbar { align-items: flex-start; }
}

@media (max-width: 560px) {
  .topbar { padding: 0 16px; }
  .ui-switcher button { min-width: 68px; padding-inline: 7px; }
  .ui-switcher button small { display: none; }
  .server-status span { display: none; }
  .hero h1 { font-size: 42px; }
  .hero-copy::before { display: none; }
  .playground-panel { padding: 26px 16px; }
  .form-fields { grid-template-columns: 1fr; }
  .field-tall { grid-row: auto; }
  .workspace { border-radius: 19px; }
  .runs-section > .section-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .history-heading-tools { width: 100%; align-items: flex-start; flex-direction: column; gap: 8px; }
  .history-filter { width: 100%; }
  .history-filter select { min-width: 0; flex: 1; }
  .history-gallery-head { min-height: 66px; padding: 12px 14px; }
  .history-gallery-detail { padding: 14px; }
  .history-gallery-meta > span, .history-gallery-meta > b { display: none; }
  .history-gallery-strip { grid-auto-columns: min(78vw, 250px); }
  .history-gallery-detail-toolbar > span { display: none; }
  .history-gallery-detail-toolbar .history-workspace-button { margin-left: auto; }
  .history-pagination { gap: 5px; }
  .history-page-tabs { gap: 4px; }
  .history-pagination button { width: 31px; height: 31px; }
}

/* GlimNavi preview UI
   Visual tokens follow the production GlimNavi workspace: white canvas,
   #212121 actions, #DBF7FA highlights and restrained 8–16px radii. */
html[data-ui="glimnavi"] {
  --bg: #f6f7f8;
  --panel: #ffffff;
  --panel-2: #fafafa;
  --panel-3: #eff9fb;
  --line: #eeeeee;
  --line-strong: #e0e0e0;
  --text: #0a0a0a;
  --muted: #757575;
  --purple: #0ea7c3;
  --blue: #3b82f6;
  --mint: #0ea7c3;
  --danger: #e5484d;
  color-scheme: light;
  background: #f6f7f8;
}
html[data-ui="glimnavi"] body {
  color: var(--text);
  background: #f6f7f8;
}
html[data-ui="glimnavi"] .topbar {
  height: 64px;
  padding-inline: max(24px, calc((100vw - 1540px) / 2));
  border-color: #eeeeee;
  background: rgba(255,255,255,.96);
  box-shadow: 0 1px 0 rgba(10,10,10,.02);
}
html[data-ui="glimnavi"] .studio-brand { display: none; }
html[data-ui="glimnavi"] .glimnavi-brand { display: flex; }
html[data-ui="glimnavi"] .glimnavi-brand > span {
  padding-left: 12px;
  border-left: 1px solid #e0e0e0;
}
html[data-ui="glimnavi"] .glimnavi-brand strong {
  color: #0a0a0a;
  font-size: 11px;
}
html[data-ui="glimnavi"] .glimnavi-brand small {
  color: #9e9e9e;
  font-size: 7px;
}
html[data-ui="glimnavi"] .ui-switcher {
  border-color: #e0e0e0;
  background: #fafafa;
}
html[data-ui="glimnavi"] .ui-switcher button { color: #757575; }
html[data-ui="glimnavi"] .ui-switcher button.active {
  color: #0a0a0a;
  background: #dbf7fa;
  box-shadow: 0 2px 7px rgba(14,167,195,.12);
}
html[data-ui="glimnavi"] .metadata-tool-button {
  color: #616161;
  background: #fff;
  border-color: #e0e0e0;
}
html[data-ui="glimnavi"] .metadata-tool-button:hover { color: #0a0a0a; background: #eff9fb; border-color: #0ea7c3; }
html[data-ui="glimnavi"] .metadata-tool-button b { color: #07839a; background: #dbf7fa; }
html[data-ui="glimnavi"] .server-status {
  color: #616161;
  border-color: #e0e0e0;
  background: white;
}
html[data-ui="glimnavi"] .server-status.online i {
  background: #0ea7c3;
  box-shadow: 0 0 0 3px rgba(14,167,195,.13);
}
html[data-ui="glimnavi"] .metadata-dialog { color: #0a0a0a; }
html[data-ui="glimnavi"] .metadata-dialog::backdrop { background: rgba(28,38,42,.55); }
html[data-ui="glimnavi"] .metadata-dialog-shell { background: #fff; border-color: #e0e0e0; box-shadow: 0 24px 80px rgba(29,55,62,.22); }
html[data-ui="glimnavi"] .metadata-dialog-head,
html[data-ui="glimnavi"] .metadata-results-head { border-color: #eeeeee; }
html[data-ui="glimnavi"] .metadata-dialog-head > div > p:last-child,
html[data-ui="glimnavi"] .metadata-upload-zone small,
html[data-ui="glimnavi"] .metadata-results-head small,
html[data-ui="glimnavi"] .metadata-empty { color: #757575; }
html[data-ui="glimnavi"] .metadata-dialog-close,
html[data-ui="glimnavi"] .metadata-preview-wrap label { color: #616161; background: #fafafa; border-color: #e0e0e0; }
html[data-ui="glimnavi"] .metadata-upload-zone,
html[data-ui="glimnavi"] .metadata-preview-wrap,
html[data-ui="glimnavi"] .metadata-results { background: #fafafa; border-color: #e0e0e0; }
html[data-ui="glimnavi"] .metadata-upload-zone:hover,
html[data-ui="glimnavi"] .metadata-upload-zone.is-dragging { background: #eff9fb; border-color: #0ea7c3; }
html[data-ui="glimnavi"] .metadata-upload-icon,
html[data-ui="glimnavi"] .metadata-results-head > span { color: #07839a; background: #dbf7fa; border-color: #b8eaef; }
html[data-ui="glimnavi"] .metadata-row b { color: #07839a; }
html[data-ui="glimnavi"] .metadata-row code { color: #212121; }
html[data-ui="glimnavi"] .glim-context-bar {
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 10px max(24px, calc((100vw - 1540px) / 2));
  color: #616161;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.glim-breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.glim-breadcrumb b { color: #bdbdbd; font-weight: 400; }
.glim-breadcrumb strong { color: #0a0a0a; font-size: 13px; }
.glim-steps { display: flex; align-items: center; gap: 0; margin: 0; padding: 0; list-style: none; }
.glim-steps li { display: flex; align-items: center; color: #9e9e9e; font-size: 11px; }
.glim-steps li:not(:last-child)::after {
  content: "";
  width: 34px;
  height: 1px;
  margin: 0 9px;
  background: #e0e0e0;
}
.glim-steps i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin-right: 7px;
  color: #757575;
  background: #eeeeee;
  border-radius: 50%;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}
.glim-steps .active { color: #0a0a0a; font-weight: 700; }
.glim-steps .active i { color: #0a0a0a; background: #dbf7fa; }

html[data-ui="glimnavi"] main {
  width: min(1540px, calc(100% - 48px));
  padding-bottom: 70px;
}
html[data-ui="glimnavi"] .hero {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  padding: 28px 0 20px;
}
html[data-ui="glimnavi"] .hero-copy {
  min-height: 156px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 30px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
}
html[data-ui="glimnavi"] .hero-copy::before { display: none; }
html[data-ui="glimnavi"] .hero .eyebrow { margin-bottom: 8px; }
html[data-ui="glimnavi"] .eyebrow {
  color: #0ea7c3;
  font-size: 9px;
  letter-spacing: .12em;
}
html[data-ui="glimnavi"] .hero h1 {
  color: #0a0a0a;
  font-size: clamp(25px, 2.4vw, 34px);
  line-height: 1.22;
  letter-spacing: -.045em;
}
html[data-ui="glimnavi"] .hero h1 br { display: none; }
html[data-ui="glimnavi"] .hero h1 em {
  margin-left: .22em;
  color: #0ea7c3;
  background: none;
  -webkit-text-fill-color: currentColor;
}
html[data-ui="glimnavi"] .hero-copy > p:nth-of-type(2) {
  margin-top: 10px;
  color: #616161;
  line-height: 1.55;
  font-size: 11px;
}
html[data-ui="glimnavi"] .hero-tags { display: none; }
html[data-ui="glimnavi"] .compute-card {
  min-height: 156px;
  padding: 24px;
  color: #0a0a0a;
  background: #dbf7fa;
  border-color: #c6edf1;
  border-radius: 16px;
  box-shadow: none;
}
html[data-ui="glimnavi"] .compute-card small { color: #37747d; }
html[data-ui="glimnavi"] .compute-card strong { margin: 23px 0 18px; font-size: 18px; }
html[data-ui="glimnavi"] .compute-card p { color: #4a7379; border-color: rgba(14,167,195,.18); }
html[data-ui="glimnavi"] .compute-card p b { color: #0a0a0a; }
html[data-ui="glimnavi"] .compute-dot {
  background: #0ea7c3;
  box-shadow: 0 0 0 4px rgba(14,167,195,.14);
}
html[data-ui="glimnavi"] .studio-intro {
  align-items: center;
  margin: 14px 2px 18px;
}
html[data-ui="glimnavi"] .studio-intro h2 {
  color: #0a0a0a;
  font-size: 22px;
}
html[data-ui="glimnavi"] .studio-intro > p { color: #757575; }

html[data-ui="glimnavi"] .workspace {
  grid-template-columns: 290px minmax(0,1fr);
  min-height: 720px;
  border-color: #e0e0e0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(10,10,10,.045);
}
html[data-ui="glimnavi"] .catalog-panel {
  padding: 24px 16px;
  border-color: #eeeeee;
  background: #fafafa;
}
html[data-ui="glimnavi"] .section-heading h2 { color: #0a0a0a; font-size: 18px; }
html[data-ui="glimnavi"] .count-badge,
html[data-ui="glimnavi"] .version {
  color: #616161;
  border-color: #e0e0e0;
  background: white;
}
html[data-ui="glimnavi"] .workflow-card {
  min-height: 64px;
  grid-template-columns: 40px minmax(0,1fr);
  gap: 10px;
  padding: 11px 46px 11px 11px;
  color: #0a0a0a;
  border-radius: 8px;
}
html[data-ui="glimnavi"] .workflow-card:hover {
  background: #f3f5f5;
  transform: none;
}
html[data-ui="glimnavi"] .workflow-card.active {
  background: #e8f5ff;
  border-color: #cce8f6;
}
html[data-ui="glimnavi"] .card-icon {
  width: 40px;
  height: 40px;
  color: #0ea7c3;
  background: #eff9fb;
  border-radius: 8px;
}
html[data-ui="glimnavi"] .workflow-card.active .card-icon {
  color: white;
  background: #0ea7c3;
}
html[data-ui="glimnavi"] .card-copy small { color: #757575; }
html[data-ui="glimnavi"] .catalog-filters button[aria-pressed="true"] { color: #087f94; background: #eff9fb; border-color: #0ea7c3; }
html[data-ui="glimnavi"] .favorite-button:hover { background: #eff9fb; }
html[data-ui="glimnavi"] .favorite-button[aria-pressed="true"] { color: #986900; }
html[data-ui="glimnavi"] .card-state {
  color: #9a651f;
  background: #fff5df;
}
html[data-ui="glimnavi"] .card-state.ready {
  color: #087f94;
  background: #dbf7fa;
}

html[data-ui="glimnavi"] .playground-panel {
  padding: 30px;
  color: #0a0a0a;
  background: #fff;
}
html[data-ui="glimnavi"] .empty-state { color: #757575; }
html[data-ui="glimnavi"] .empty-state h2 { color: #0a0a0a; }
html[data-ui="glimnavi"] .empty-icon {
  color: #0ea7c3;
  background: #eff9fb;
  border-color: #c6edf1;
  border-radius: 12px;
}
html[data-ui="glimnavi"] .playground-head { border-color: #eeeeee; }
html[data-ui="glimnavi"] .playground-head h2 { color: #0a0a0a; font-size: 26px; }
html[data-ui="glimnavi"] .playground-head > div > p:last-child { color: #616161; }
html[data-ui="glimnavi"] .setup-notice {
  background: #fff8e8;
  border-color: #f0dfbd;
}
html[data-ui="glimnavi"] .setup-notice strong { color: #8a5d19; }
html[data-ui="glimnavi"] .setup-notice p { color: #806f58; }
html[data-ui="glimnavi"] .field > span:first-child { color: #0a0a0a; }
html[data-ui="glimnavi"] .field textarea,
html[data-ui="glimnavi"] .field > input:not([type=file]),
html[data-ui="glimnavi"] .field select {
  color: #0a0a0a;
  background: #fafafa;
  border-color: #eeeeee;
  border-radius: 8px;
}
html[data-ui="glimnavi"] .field textarea:focus,
html[data-ui="glimnavi"] .field > input:focus,
html[data-ui="glimnavi"] .field select:focus {
  border-color: #0ea7c3;
  box-shadow: 0 0 0 3px rgba(14,167,195,.1);
}
html[data-ui="glimnavi"] .field select { color-scheme: light; }
html[data-ui="glimnavi"] .prompt-details summary { color: #757575; }
html[data-ui="glimnavi"] .prompt-editor {
  background: #fafafa;
  border-color: #eeeeee;
  border-radius: 8px;
}
html[data-ui="glimnavi"] .prompt-editor label > span { color: #616161; }
html[data-ui="glimnavi"] .dropzone {
  color: #0a0a0a;
  background: #fafafa;
  border-color: #e0e0e0;
  border-radius: 8px;
}
html[data-ui="glimnavi"] .dropzone:hover,
html[data-ui="glimnavi"] .image-field.is-dragging .dropzone {
  background: #eff9fb;
  border-color: #0ea7c3;
}
html[data-ui="glimnavi"] .image-preview {
  background: #fafafa;
  border-color: #eeeeee;
  border-radius: 8px;
}
html[data-ui="glimnavi"] .run-button {
  color: white;
  background: #212121;
  border-radius: 8px;
  box-shadow: none;
}
html[data-ui="glimnavi"] .run-button:hover:not(:disabled) {
  background: #0ea7c3;
  filter: none;
}
html[data-ui="glimnavi"] .run-button:disabled {
  color: #bdbdbd;
  background: #eeeeee;
}
html[data-ui="glimnavi"] .result-panel {
  background: #fafafa;
  border-color: #eeeeee;
  border-radius: 12px;
}
html[data-ui="glimnavi"] .result-empty,
html[data-ui="glimnavi"] .progress-state,
html[data-ui="glimnavi"] .error-state { color: #757575; }
html[data-ui="glimnavi"] .result-empty span { color: #0ea7c3; }
html[data-ui="glimnavi"] .progress-state strong,
html[data-ui="glimnavi"] .error-state strong { color: #0a0a0a; }
html[data-ui="glimnavi"] .spinner {
  border-color: #d7eff2;
  border-top-color: #0ea7c3;
}
html[data-ui="glimnavi"] .output-grid { background: #eeeeee; }
html[data-ui="glimnavi"] .output-grid a { color: #0a0a0a; background: #fff; }
html[data-ui="glimnavi"] .output-grid span { color: #616161; }
html[data-ui="glimnavi"] .comparison-toolbar {
  border-color: #eeeeee;
  background: #fff;
}
html[data-ui="glimnavi"] .comparison-modes {
  background: #fafafa;
  border-color: #e0e0e0;
}
html[data-ui="glimnavi"] .comparison-modes button { color: #757575; }
html[data-ui="glimnavi"] .comparison-modes button.active {
  color: #0a0a0a;
  background: #dbf7fa;
}
html[data-ui="glimnavi"] .opacity-control,
html[data-ui="glimnavi"] .open-output { color: #616161; }
html[data-ui="glimnavi"] .opacity-control b { color: #0a0a0a; }
html[data-ui="glimnavi"] .comparison-label { background: #0ea7c3; }
html[data-ui="glimnavi"] .runs-section {
  margin-top: 24px;
  padding: 28px 24px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
}
html[data-ui="glimnavi"] .history-filter { color: #757575; }
html[data-ui="glimnavi"] .history-filter select {
  color: #0a0a0a;
  background: #fff;
  border-color: #e0e0e0;
  color-scheme: light;
}
html[data-ui="glimnavi"] .history-filter select:hover,
html[data-ui="glimnavi"] .history-filter select:focus { border-color: #87dbe5; }
html[data-ui="glimnavi"] .history-filter select:focus { box-shadow: 0 0 0 3px rgba(14,167,195,.08); }
html[data-ui="glimnavi"] .run-list { border-color: #eeeeee; }
html[data-ui="glimnavi"] .run-item { color: #0a0a0a; border-color: #eeeeee; }
html[data-ui="glimnavi"] .run-item:hover { background: #f7fbfc; }
html[data-ui="glimnavi"] .run-entry.expanded .run-item { background: #e8f5ff; }
html[data-ui="glimnavi"] .run-detail { border-color: #e0e0e0; border-radius: 12px; }
html[data-ui="glimnavi"] .run-item div small,
html[data-ui="glimnavi"] .run-item > b,
html[data-ui="glimnavi"] .run-item code,
html[data-ui="glimnavi"] .history-note { color: #757575; }
html[data-ui="glimnavi"] .history-result-head {
  color: #0a0a0a;
  background: #fff;
  border-color: #eeeeee;
}
html[data-ui="glimnavi"] .history-workspace-button {
  color: white;
  background: #212121;
}
html[data-ui="glimnavi"] .history-workspace-button:hover {
  background: #0ea7c3;
  filter: none;
}
html[data-ui="glimnavi"] .history-image-section { border-color: #eeeeee; }
html[data-ui="glimnavi"] .history-image-card {
  color: #0a0a0a;
  background: #fff;
  border-color: #e0e0e0;
  border-radius: 8px;
}
html[data-ui="glimnavi"] .history-image-card img { background: #fafafa; }
html[data-ui="glimnavi"] .history-image-card > span { border-color: #eeeeee; }
html[data-ui="glimnavi"] .history-image-card.input { border-color: #87dbe5; }
html[data-ui="glimnavi"] .history-image-card.input > .history-image-badge { color: #0a0a0a; background: #dbf7fa; border-color: #87dbe5; }
html[data-ui="glimnavi"] .history-gallery-entry { background: #fff; border-color: #e0e0e0; }
html[data-ui="glimnavi"] .history-gallery-head:hover { background: #f7fbfc; }
html[data-ui="glimnavi"] .history-gallery-entry.expanded .history-gallery-head { background: #e8f5ff; }
html[data-ui="glimnavi"] .history-gallery-detail { border-color: #eeeeee; }
html[data-ui="glimnavi"] .history-gallery-title { color: #0a0a0a; }
html[data-ui="glimnavi"] .history-gallery-title time,
html[data-ui="glimnavi"] .history-gallery-meta { color: #757575; }
html[data-ui="glimnavi"] .history-gallery-meta > span { background: #f5f5f5; }
html[data-ui="glimnavi"] .history-image-placeholder b { color: #0a0a0a; }
html[data-ui="glimnavi"] .history-pagination button { border-color: #e0e0e0; }
html[data-ui="glimnavi"] .history-pagination button:hover:not(:disabled),
html[data-ui="glimnavi"] .history-pagination button.active { color: #0a0a0a; background: #dbf7fa; border-color: #87dbe5; }
html[data-ui="glimnavi"] .history-empty-note {
  color: #757575;
  background: #fafafa;
  border-color: #e0e0e0;
}

@media (max-width: 900px) {
  html[data-ui="glimnavi"] .glim-context-bar { align-items: flex-start; flex-direction: column; gap: 12px; }
  html[data-ui="glimnavi"] .hero { grid-template-columns: 1fr; }
  html[data-ui="glimnavi"] .hero-copy { min-height: 150px; }
  html[data-ui="glimnavi"] .compute-card { width: 100%; }
  html[data-ui="glimnavi"] .workspace { grid-template-columns: 1fr; }
  html[data-ui="glimnavi"] .catalog-panel { border-right: 0; border-bottom: 1px solid #eee; }
}

@media (max-width: 680px) {
  html[data-ui="glimnavi"] .topbar { padding-inline: 14px; }
  html[data-ui="glimnavi"] .glimnavi-brand img { width: 100px; }
  html[data-ui="glimnavi"] .glimnavi-brand > span { display: none; }
  html[data-ui="glimnavi"] .server-status { display: none; }
  html[data-ui="glimnavi"] .glim-context-bar { padding-inline: 16px; }
  html[data-ui="glimnavi"] .glim-steps { width: 100%; justify-content: space-between; }
  html[data-ui="glimnavi"] .glim-steps li:not(:last-child)::after { width: 12px; margin-inline: 5px; }
  html[data-ui="glimnavi"] main { width: calc(100% - 28px); }
  html[data-ui="glimnavi"] .hero h1 em { display: block; margin-left: 0; }
  html[data-ui="glimnavi"] .playground-panel { padding: 24px 16px; }
  html[data-ui="glimnavi"] .runs-section { padding-inline: 16px; }
}

@media (max-width: 560px) {
  .metadata-tool-button span { display: none; }
  .metadata-dialog { width: calc(100vw - 20px); }
  .metadata-dialog-head { padding: 18px; }
  .metadata-dialog-head > div > p:last-child { display: none; }
  .metadata-dialog-body { min-height: 0; grid-template-columns: 1fr; padding: 10px; }
  .metadata-upload-zone,
  .metadata-preview-wrap { min-height: 220px; }
  .metadata-results { max-height: 300px; }
  .metadata-row { grid-template-columns: 78px minmax(0, 1fr); }
}
.result-image-viewer { width: 96vw; max-width: none; height: 94vh; max-height: 94vh; padding: 0; border: 1px solid #46505e; border-radius: 12px; color: #e7edf3; background: #11141a; }
.result-image-viewer::backdrop { background: #05070aeb; }
.result-image-viewer[open] { display: flex; flex-direction: column; }
.result-image-viewer header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; }
.result-image-viewer header > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.result-image-viewer button, .result-image-viewer a { padding: 8px 12px; border: 1px solid #46505e; border-radius: 6px; color: #e7edf3; background: #252c35; cursor: pointer; text-decoration: none; }
.result-image-viewer output { min-width: 45px; text-align: center; }
.result-image-scroll { flex: 1; min-height: 0; overflow: auto; padding: 12px; }
.result-image-scroll img { display: block; max-width: none; height: auto; margin: auto; }
.result-image-viewer-open { overflow: hidden; }
.comparison-output, .history-image-card, .output-grid a { cursor: zoom-in; }
