/* iolinki station studio: one light app frame around the 3D stage. */
:root {
  --bg: #fafaf6; --panel: #ffffff; --fg: #183638; --muted: #56696a; --line: #dce3de; --soft: #eef3ed;
  --accent: #176e69; --accent-soft: #e4efeb; --warn: #8a5a00; --warnbg: #fff4d6; --ok: #1d7a3a;
  --sensor: #ff7a1a; --master: #176e69;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 Inter, "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--fg); display: flex; flex-direction: column; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: 12.5px; }

.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; font-weight: 750; font-size: 22px; color: var(--fg); text-decoration: none; letter-spacing: -1.1px; }
.brand span { color: var(--accent); }
.brand .brand-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin: 8px 0 0 5px; }
.divider { width: 1px; height: 26px; background: var(--line); }
.title { flex: 1; min-width: 0; }
.title h1 { font-size: 15px; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.chips span { font-size: 12px; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.chips span.warn { color: var(--warn); background: var(--warnbg); border-color: #f5d68a; }
.top-actions { display: flex; gap: 8px; align-items: center; }
button.primary, button.ghost { border-radius: 6px; padding: 7px 14px; cursor: pointer; font-size: 13.5px; }
button.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); font-weight: 600; }
button.primary:hover { background: #114d4b; border-color: #114d4b; }
button.ghost { background: var(--panel); border: 1px solid #bccbc4; }
button.ghost:hover { background: var(--soft); }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(20,23,28,.12); padding: 4px; min-width: 240px; }
.menu-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.menu-list button:hover { background: var(--soft); }

.app { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr) 320px; gap: 12px; padding: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; min-height: 0; overflow: auto; }

.library { display: flex; flex-direction: column; }
.search { padding: 12px 12px 8px; position: sticky; top: 0; background: var(--panel); z-index: 2; }
.search input { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); outline: none; }
.search input:focus { border-color: var(--accent); background: var(--panel); }
.segmented { display: flex; margin: 0 12px 8px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.segmented button { flex: 1; border: 0; background: none; padding: 5px 0; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 13px; }
.segmented button.on { background: var(--panel); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.parts { padding: 0 8px 8px; display: grid; gap: 4px; }
.part { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 10px; background: none; cursor: grab; }
.part:hover { background: var(--soft); border-color: var(--line); }
.part .glyph { width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; background: #fff1e6; color: var(--sensor); }
.part.master .glyph { background: var(--accent-soft); color: var(--master); }
.part.equipment .glyph { background: var(--soft); color: var(--muted); }
.part b { display: block; font-size: 13.5px; }
.part small { color: var(--muted); font-size: 12px; }
.part .add { opacity: 0; color: var(--accent); font-size: 18px; line-height: 1; }
.part:hover .add { opacity: 1; }
.catalog { padding: 0 12px 12px; }
.catalog h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 6px; }
.catalog ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.catalog li button { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 6px; padding: 6px 8px; cursor: grab; }
.catalog li button:hover { background: var(--soft); border-color: var(--line); }
.catalog li b { display: block; font-size: 13px; }
.catalog li small { color: var(--muted); font-size: 12px; }
.catalog li .add { color: var(--accent); font-size: 18px; opacity: 0; }
.catalog li button:hover .add { opacity: 1; }
.catalog li button.busy { opacity: .6; cursor: progress; }
.part .tag { font-size: 10.5px; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 4px; margin-left: 4px; font-weight: 600; }

.stage-wrap { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.stage-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.tabs, .view-tools { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tabs button, .view-tools button { border: 0; background: none; padding: 5px 14px; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 13px; }
.tabs button.on { background: var(--fg); color: #fff; }
.view-tools button:hover { background: var(--soft); color: var(--fg); }
.run { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; border: 1px solid #b7e1c3; background: #ecf8f0; color: var(--ok); font-weight: 600; border-radius: 10px; padding: 6px 16px; cursor: pointer; font-size: 13.5px; }
.run:hover { background: #def3e5; }
.run-icon { width: 0; height: 0; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.run.on { background: var(--fg); border-color: var(--fg); color: #fff; }
.run.on .run-icon { width: 9px; height: 10px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.run.on .run-time { font-variant-numeric: tabular-nums; }
.stage { position: relative; flex: 1; min-height: 420px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #eef1f5; }
.pane { position: absolute; inset: 0; }
.pane.doc { background: var(--panel); overflow: auto; padding: 14px; }
.stage-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; min-height: 28px; }
.notes-pill { border: 1px solid #f5d68a; background: var(--warnbg); color: var(--warn); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; cursor: pointer; }
.notes-list { background: var(--warnbg); color: var(--warn); border-radius: 12px; padding: 8px 14px; margin-top: 8px; font-size: 13px; max-height: 160px; overflow: auto; }
.notes-list ul { margin: 0; padding-left: 18px; }

.empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; background: linear-gradient(180deg, rgba(244,246,249,.85), rgba(244,246,249,.97)); }
.empty h2 { margin: 0 0 6px; font-size: 20px; }
.empty p { max-width: 460px; margin: 0 auto 12px; color: var(--muted); }
.ask { display: flex; gap: 8px; max-width: 520px; margin: 0 auto; width: 100%; }
.ask input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px auto 6px; max-width: 560px; }
.examples button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; }
.examples button:hover { border-color: var(--accent); color: var(--accent); }

.inspector { padding: 16px; }
.inspector h2 { font-size: 16px; margin: 0; }
.inspector h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; }
.ihead { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; }
.ihead .glyph { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #fff1e6; color: var(--sensor); }
.ihead.master .glyph { background: var(--accent-soft); color: var(--master); }
.ihead.equipment .glyph { background: var(--soft); color: var(--muted); }
.back { border: 0; background: none; color: var(--accent); padding: 0; margin-bottom: 10px; cursor: pointer; font-size: 13px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.badges span { font-size: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--muted); }
.field { margin-bottom: 12px; }
.field label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.field label span { color: var(--muted); font-size: 12px; }
.field .row { display: grid; grid-template-columns: 1fr 86px; gap: 8px; align-items: center; }
.field input[type=number], .field select { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.field input[type=range] { width: 100%; accent-color: var(--accent); }
.field .unit { color: var(--muted); font-size: 12px; }
.field.warn input[type=number] { border-color: #f0b429; background: var(--warnbg); }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.seg button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.written { background: var(--soft); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; }
.written div { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.written div span { color: var(--muted); }
.inote { color: var(--warn); background: var(--warnbg); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; margin: 10px 0; }
.inote ul { margin: 0; padding-left: 16px; }
.danger { border: 1px solid var(--line); background: var(--panel); color: #b42318; border-radius: 6px; padding: 6px 12px; cursor: pointer; margin-top: 12px; }
.order { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.order li { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.order li span { color: var(--muted); min-width: 26px; }
.stat { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.stat span { color: var(--muted); }
.meter { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; margin: 2px 0 8px; }
.meter i { display: block; height: 100%; background: var(--ok); }
.buy input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; background: var(--panel); }
.buy button.primary { width: 100%; padding: 10px; }
.buy .linkish { border: 0; background: none; color: var(--accent); padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
.buy .result { font-size: 13px; margin-top: 8px; }
.no { color: #b42318; }
.buy .ok { color: #1a7f37; }

.scroll { overflow-x: auto; }
.ports-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.ports-table th, .ports-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ports-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.small { color: var(--muted); font-size: 12px; }
.s3d { position: relative; }
.s3d canvas { display: block; cursor: grab; }
.s3d-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.s3d-tag { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font-size: 11.5px; line-height: 1.25; padding: 3px 8px; border-radius: 8px; background: rgba(255,255,255,.92); color: #14171c; border: 1px solid #d8dde4; box-shadow: 0 1px 3px rgba(20,23,28,.12); text-align: center; }
.s3d-tag b { font-weight: 650; }
.s3d-tag i { display: block; font-style: normal; color: #66707d; font-size: 10.5px; }
.s3d-tag.sensor { border-color: #ffb27a; }
.s3d-tag.master { border-color: #8fbfb7; }
.s3d-tag.equipment { background: rgba(255,255,255,.7); color: #4b5560; border-color: transparent; box-shadow: none; font-size: 11px; }
.s3d-tag.warn { border-color: #ffb020; background: #fff6e0; }
.s3d-tag.selected { outline: 2px solid #ff7a1a; }
.s3d-tag em { display: block; font-style: normal; font-variant-numeric: tabular-nums; font-size: 11px; color: #2b3138; background: #eef1f5; border-radius: 5px; margin: 2px -4px 0; padding: 0 4px; }
.s3d-tag em.on { background: #ffd23a; color: #3d2c00; }
svg.wiring { font-family: inherit; }
.w-master { fill: #e4efeb; stroke: #8fbfb7; }
.w-sensor { fill: #fff3ea; stroke: #ffb27a; }
.w-sensor.warn { fill: #fff6e0; stroke: #ffb020; }
.w-title { font-size: 13px; font-weight: 650; fill: #14171c; }
.w-sub { font-size: 11px; font-weight: 400; fill: #66707d; }
.w-portname { font-size: 12px; font-weight: 600; fill: #3b4450; }
.w-port { fill: #fff; stroke: #9aa3b2; stroke-width: 1.5; }
.w-port.used { fill: #23262b; stroke: #23262b; }
.w-free { font-size: 11px; fill: #9aa3b2; }
.w-cable { fill: none; stroke: #23262b; stroke-width: 3; }
.w-wires { font-size: 10px; fill: #66707d; }

@media (max-width: 1100px) {
  .app { grid-template-columns: 240px minmax(0, 1fr); }
  .inspector { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  body { display: block; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  .divider { display: none; }
  .top-actions { width: 100%; }
  .top-actions .primary { flex: 1; }
  .app { display: flex; flex-direction: column; padding: 10px 16px; }
  .stage { min-height: 360px; }
  .stage-wrap { order: -1; }
  .panel { max-height: none; }
  .view-tools { display: none; }
}

[hidden] { display: none !important; }
.pane.s3d { position: absolute; }

/* Run mode */
.live { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 12px; background: #fcfcfa; }
.live.idle { color: var(--muted); font-size: 12.5px; background: var(--soft); border-style: dashed; }
.live.idle button { margin-top: 8px; }
.lv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lv-value { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.lv-out { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.lv-out.on { background: #ffd23a; border-color: #e8b800; color: #3d2c00; }
.lv-trace { display: block; width: 100%; height: 96px; margin: 8px 0 6px; }
.lv-meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12px; color: var(--muted); }
.lv-meta b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.lv-meta code { font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--fg); text-align: right; }
.lv-drive { margin-top: 10px; }
.lv-drive .row { grid-template-columns: 1fr auto; }
.lv-drive button { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.lv-drive button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.live-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.live-list li { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.live-list li i { width: 9px; height: 9px; border-radius: 50%; background: #2f7d45; opacity: .45; }
.live-list li i.on { background: #ffc400; opacity: 1; box-shadow: 0 0 6px #ffc400; }
.live-list li b { font-variant-numeric: tabular-nums; font-weight: 600; }
.ports-table td.pd code { font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.ports-table td.pd .on { background: #ffd23a; border-radius: 4px; padding: 0 4px; }

.menu-list button { white-space: nowrap; }

/* ?embed=1: one station inside another page. */
body.embed { display: flex; flex-direction: column; height: 100%; background: var(--panel); }
body.embed .topbar, body.embed .library, body.embed .inspector, body.embed .notes-list, body.embed #empty { display: none !important; }
body.embed .app { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 8px; min-height: 0; }
body.embed .stage-wrap { order: 0; }
body.embed .stage { min-height: 0; }
body.embed .stage-foot { gap: 10px; }
body.embed .open-full { margin-left: auto; font-size: 12.5px; font-weight: 600; white-space: nowrap; text-decoration: none; }
body.embed .open-full::after { content: " ↗"; }
@media (max-width: 760px) {
  body.embed .stage-bar { flex-wrap: wrap; }
  body.embed .tabs, body.embed .run, body.embed .view-tools { flex-shrink: 0; }
  body.embed .view-tools { display: flex; margin-left: auto; }
  body.embed #stage-hint { display: none; }
}
body.embed .ai, body.embed .ai-open { display: none !important; }

/* Design with AI */
.ai-open { display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; padding: 7px 14px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid #b9d5ce; }
.ai-open:hover, .ai-open.on { background: #d5e8e2; }
.ai { position: absolute; left: 12px; bottom: 12px; z-index: 6; width: min(420px, calc(100% - 24px)); max-height: min(560px, calc(100% - 24px)); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 36px rgba(20,23,28,.18); overflow: hidden; }
.ai-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ai-x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 8px; width: 32px; height: 32px; }
.ai-x:hover { background: var(--soft); color: var(--fg); }
.ai-body { flex: 1; min-height: 120px; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ai-gate h3 { margin: 0 0 6px; font-size: 16px; }
.ai-gate p { margin: 0 0 10px; }
.ai-gate p.muted { margin-top: 10px; }
.ai-gsi { min-height: 44px; display: flex; align-items: center; }
.ai-hello p { margin: 0 0 10px; color: var(--muted); }
.ai-samples { display: grid; gap: 6px; }
.ai-samples button { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 12px; cursor: pointer; font-size: 13px; line-height: 1.35; }
.ai-samples button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ai-msg { max-width: 92%; padding: 8px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.ai-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.bot { align-self: flex-start; background: var(--soft); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-msg.err { background: #fdecea; border-color: #f4c2bd; color: #8c1d14; }
.ai-steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ai-steps span { font-size: 11.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.ai-steps span.bad { color: var(--warn); border-color: #f5d68a; background: var(--warnbg); }
.ai-applied { margin-top: 6px; font-size: 11.5px; color: var(--ok); }
.ai-msg.working { color: var(--muted); }
.dots { display: inline-flex; gap: 3px; margin-right: 4px; vertical-align: middle; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: ai-blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes ai-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); }
.ai-form textarea { flex: 1; resize: none; min-height: 38px; max-height: 120px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); outline: none; font: inherit; line-height: 1.35; overflow: hidden; }
.ai-form textarea:focus { border-color: var(--accent); background: var(--panel); }
.ai-form button:disabled { opacity: .55; cursor: progress; }
.ai-foot { display: flex; justify-content: space-between; gap: 8px; padding: 6px 14px 10px; font-size: 11.5px; color: var(--muted); }
.ai-foot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-foot button { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 11.5px; }
@media (max-width: 760px) {
  .top-actions { flex-wrap: wrap; }
  .ai-open { flex: 1 1 100%; justify-content: center; }
  .ai { position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-height: 54vh; border-radius: 16px 16px 0 0; z-index: 30; }
  .ai-form textarea { font-size: 16px; }
}
.stage.ai-on .empty { display: none; }

/* Saved virtual factory projects */
.project-banner { margin: 8px 0; padding: 8px 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; overflow-wrap: anywhere; }
.project-indicator { color: var(--muted); font-size: 12px; white-space: nowrap; }
.project-indicator[data-status="conflict"], .project-indicator[data-status="error"] { color: var(--warn); }
.projects-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--fg); padding: 20px; box-shadow: 0 16px 60px #14211f44; }
.projects-dialog::backdrop { background: #14211f66; }
.projects-head, .project-actions, .project-account { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.projects-head { justify-content: space-between; }
.projects-head h2 { margin: 0; }
.project-label { display: block; margin-bottom: 5px; }
#project-title { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--fg); background: var(--soft); font: inherit; }
.project-actions { margin: 12px 0; }
#project-status { overflow-wrap: anywhere; }
.projects-dialog h3 { margin: 22px 0 8px; }
.project-list { display: grid; gap: 7px; margin-top: 8px; }
.project-row { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; text-align: left; font: inherit; background: var(--soft); color: var(--fg); overflow-wrap: anywhere; }
button.project-row, .project-row button { cursor: pointer; }
.project-row button { border: 0; background: none; font: inherit; color: var(--accent); text-align: left; padding: 4px 0; }
.project-row label { display: inline-flex; gap: 6px; align-items: center; margin: 0 12px; font-size: 12px; }
.project-row input { width: 54px; padding: 4px; font: inherit; }
.project-row button:first-child { display: block; }
.projects-dialog button:disabled { opacity: .6; cursor: progress; }
body.embed .projects-dialog, body.embed .project-banner { display: none !important; }
.cell-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.cell-controls[hidden], .deployment-status[hidden] { display: none; }
.cell-controls select { max-width: 100%; min-width: 0; }
#cell-status { flex: 1 1 280px; line-height: 1.5; }
.deployment-status { max-height: 160px; overflow: auto; padding: 10px 12px; white-space: pre-line; font-size: 12px; }
.factory-results { max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 12px; padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.publication-disclosure { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0; font-size: 13px; }
.published-link { display: block; margin-top: 12px; overflow-wrap: anywhere; }
.published-link[hidden] { display: none; }
@media (max-width: 760px) {
  .projects-dialog { padding: 14px; }
  #project-title { font-size: 16px; }
  .project-indicator { margin-right: auto; }
  .project-actions button { flex: 1 1 40%; }
}
