.sheet-create {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 14px;
  align-items: end;
  padding: 16px 18px 18px;
  margin-bottom: 14px;
}
.sheet-create > div { grid-column: 1 / -1; }
.sheet-create h3 { margin: 0 0 4px; font-size: 18px; }
.sheet-create p { margin: 0; color: var(--muted); font-size: 14px; }
.sheet-create label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.album-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.album-bar h3 { margin: 0 0 4px; font-size: 22px; }
.album-bar p { margin: 0; color: var(--muted); font-size: 14px; }
.album-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.album-folder {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 0;
  text-align: left;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.album-folder img, .album-folder .album-ph { height: 92px; width: 100%; object-fit: cover; display: grid; place-items: center; background: #ececee; color: var(--muted); font-size: 13px; }
.album-folder b { display: block; padding: 10px 12px 0; font-size: 14px; }
.album-folder > span:last-child { display: block; padding: 2px 12px 12px; color: var(--muted); font-size: 12px; }
.modal.album-pop { width: min(1440px, calc(100vw - 32px)); max-height: 92vh; }
.album-pop h3 .muted { font-weight: 500; font-size: 14px; margin-left: 6px; }
.album-pop-grid { display: grid; grid-template-columns: repeat(auto-fill, 92px); gap: 8px; justify-content: start; min-width: 0; }
.album-pop-shot { position: relative; width: 92px; height: 92px; margin: 0; }
.album-pop-shot > button { display: block; width: 92px; height: 92px; padding: 0; border: 0; background: #ececee; border-radius: 8px; overflow: hidden; cursor: zoom-in; }
.album-pop-shot img { width: 92px; height: 92px; max-width: none; object-fit: cover; display: block; }
.album-pop-tools { position: absolute; left: 4px; right: 4px; bottom: 4px; display: none; gap: 4px; }
.album-pop-shot:hover .album-pop-tools { display: flex; }
.album-pop-tools .btn { padding: 2px 6px; background: #fff; }
.album-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.album-card.hidden { display: none; }
.album-shot { display: block; width: 100%; padding: 0; border: 0; background: #ececee; cursor: zoom-in; }
.album-shot img { width: 100%; height: 168px; object-fit: cover; display: block; }
.album-card figcaption { display: grid; gap: 4px; padding: 12px 14px 14px; }
.album-card b { font-size: 14px; }
.album-card figcaption > span { color: var(--muted); font-size: 12px; }
.album-card figcaption em { font-style: normal; color: var(--ink-2); }
.album-actions { display: flex; gap: 6px; margin-top: 6px; }
.sheet-create input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; background: #fff;
}
.album-light {
  position: fixed; inset: 0; z-index: 80; background: rgba(10, 12, 16, .82);
  display: grid; place-items: center; padding: 28px;
}
.album-light figure { margin: 0; max-width: min(1100px, 100%); }
.album-light img { max-width: 100%; max-height: calc(100vh - 120px); display: block; border-radius: 12px; }
.album-light figcaption { color: #fff; margin-top: 10px; font-size: 14px; }
.album-light > button {
  position: absolute; top: 16px; right: 16px; background: #fff; border: 0; border-radius: 999px; padding: 8px 14px;
}

.sheet-modal { width: min(420px, 100%); }
.sheet-head { display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin: 0 0 12px; }
.sheet-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-head h3 { margin: 0; font-size: 16px; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sheet-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  min-width: 0; padding: 12px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow);
}
.sheet-pages { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.sheet-pages li {
  margin: 0; padding-left: 10px; border-left: 2px solid #e4e4e7;
  color: var(--muted); font-size: 12px; line-height: 1.3;
}
.sheet-row .btn { flex: none; }
.sheet-copy { min-width: 0; display: grid; gap: 2px; }
.sheet-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.2; }
.sheet-link {
  font-weight: 600; font-size: 14px; line-height: 1.25;
  color: inherit; text-decoration: none;
}
.sheet-link:hover { color: #0071e3; }
@media (max-width: 720px) { .sheet-grid { grid-template-columns: 1fr; } }
.shapes-page .sheet-head { justify-content: space-between; max-width: none; align-items: center; margin-bottom: 14px; }
.shapes-page .sheet-head p { margin: 0; color: var(--muted); font-size: 14px; max-width: 560px; }
.shape-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.shape-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.shape-pic {
  width: 56px; height: 56px; border-radius: 12px; background: #f2f2f7;
  display: grid; place-items: center; overflow: hidden;
}
.shape-pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.shape-blank { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid #d0d5dd; }
.shape-copy { min-width: 0; display: grid; gap: 2px; }
.shape-copy strong { font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shape-copy span { color: var(--muted); font-size: 12px; line-height: 1.2; }
.shape-modal { width: min(920px, calc(100% - 32px)); }
.shape-modal .body.shape-form {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 8px 28px;
  align-items: start;
  padding: 16px 20px 18px;
}
.shape-modal .foot .btn-ghost:first-child { margin-right: auto; }
.shape-side, .shape-ports { display: grid; gap: 10px; align-content: start; min-width: 0; }
.shape-ports { border-left: 1px solid var(--line); padding-left: 22px; }
.shape-form .sld-draft-lead { margin: 0; font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.shape-form .sld-image-pick { display: grid; gap: 8px; }
.shape-form .sld-draft-thumb {
  width: 100%; height: 72px; object-fit: contain; border-radius: 10px; background: #f2f2f7;
}
.shape-form .sld-quick { display: grid; gap: 4px; margin: 0; max-height: none; overflow: visible; }
.shape-form .sld-quick span {
  display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 13px; white-space: nowrap;
}
.shape-form .sld-quick em { flex: 1; font-style: normal; }
.shape-form .sld-quick button { flex: none; min-width: 40px; padding: 4px 10px; }
.shape-form .sld-draft-ports { display: grid; gap: 3px; }
.shape-form .sld-ports-empty { margin: 0; color: var(--muted); font-size: 12px; }
.shape-form .sld-dport {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 58px 108px 20px;
  gap: 6px;
  align-items: center;
  margin: 0;
  font-size: 12px;
}
.shape-form .sld-dport input,
.shape-form .sld-dport select { width: 100%; min-width: 0; padding: 2px 6px; font-size: 12px; line-height: 1.2; }
.shape-form .sld-dport button { justify-self: center; }
@media (max-width: 800px) {
  .shape-modal .body.shape-form { grid-template-columns: 1fr; }
  .shape-ports { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
}
.sheet-devices { margin-top: 14px; }
.sheet-devices > p { margin: 0 16px 10px; }
.sheet-devices .sld-draft { margin: 0 16px 10px; }
.sheet-devices #sld-lib { padding: 0 16px 16px; }
.sheet-devices .sld-dev > span { flex: 1; min-width: 0; }

body.is-sld { background: #e6e8ee; overflow: hidden; }
body.is-sld .view.sld-root { max-width: none; width: 100%; height: 100vh; padding: 0; }
.sld-wait { padding: 28px; color: var(--muted); }
.sld-app { height: 100vh; display: flex; flex-direction: column; background: #e6e8ee; color: #1c1c1e; }
.sld-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: rgba(255,255,255,.92); border-bottom: 1px solid rgba(0,0,0,.08); flex: none;
}
.sld-bar > a { font-weight: 650; color: #1c1c1e; }
#sld-name {
  font: inherit; font-weight: 650; font-size: 16px; border: 0; background: transparent; min-width: 180px; padding: 6px 8px; border-radius: 8px;
}
#sld-name:focus { outline: 2px solid rgba(0,113,227,.35); background: #fff; }
#sld-save { color: #6e6e73; font-size: 12px; min-width: 64px; }
#sld-hint { color: #0071e3; font-size: 13px; flex: 1; }
.sld-zooms { display: flex; border: 1px solid rgba(0,0,0,.12); border-radius: 999px; overflow: hidden; }
.sld-zooms button { border: 0; background: #fff; padding: 6px 10px; }
.sld-zooms button + button { border-left: 1px solid rgba(0,0,0,.08); }
.sld-work { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr) 270px; }
.sld-lib, .sld-insp {
  background: #f7f7f8; border-right: 1px solid rgba(0,0,0,.06); overflow: auto; padding: 14px; min-height: 0;
}
.sld-insp { border-right: 0; border-left: 1px solid rgba(0,0,0,.06); }
.sld-lib-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sld-lib h2, .sld-insp h2 { margin: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #6e6e73; }
#sld-find, .sld-lib input, .sld-lib select, .sld-insp input, .sld-insp select, .sld-draft input, .sld-draft select {
  width: 100%; border: 1px solid rgba(0,0,0,.12); border-radius: 8px; padding: 7px 8px; background: #fff; font: inherit; font-size: 13px;
}
.sld-lib-note, .sld-insp p, .sld-lib-empty { color: #6e6e73; font-size: 12px; line-height: 1.45; }
.sld-dev { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.sld-dev > button:first-child {
  flex: 1; display: flex; gap: 8px; align-items: center; text-align: left;
  border: 1px solid rgba(0,0,0,.08); background: #fff; border-radius: 12px; padding: 8px;
}
.sld-dev img, .sld-swatches { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: #eef0f3; flex: none; }
.sld-swatches { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 3px; }
.sld-swatches b { display: block; border-radius: 2px; }
.sld-dev strong { display: block; font-size: 13px; }
.sld-dev small { color: #6e6e73; }
.sld-draft { background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 14px; padding: 10px; margin: 8px 0; }
.sld-draft-h, .sld-draft-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sld-draft-h button, .sld-iport button, .sld-dport button { border: 0; background: transparent; color: #6e6e73; }
.sld-draft label, .sld-insp label { display: grid; gap: 4px; margin: 8px 0; font-size: 12px; color: #6e6e73; }
.sld-draft-lead { margin: 8px 0 4px; }
.sld-quick { display: grid; gap: 4px; max-height: 180px; overflow: auto; margin-bottom: 8px; }
.sld-quick span { display: grid; grid-template-columns: 10px 1fr 42px auto auto; gap: 6px; align-items: center; font-size: 11px; }
.sld-quick input { width: 42px; padding: 2px 4px; }
.sld-quick i, .sld-key i, .sld-legend i, .sld-dport i, .sld-iport i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.sld-quick button { border: 1px solid rgba(0,0,0,.1); background: #fff; border-radius: 999px; padding: 2px 7px; font-size: 11px; }
.sld-dport, .sld-iport { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 4px; align-items: center; margin-top: 4px; }
.sld-iport { grid-template-columns: 10px 1fr 92px auto; }
.sld-key, .sld-addport { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sld-key span, .sld-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: #3a3a3c; }
.sld-addport select { width: auto; flex: 1; }
.sld-work.is-draw { grid-template-columns: 300px minmax(0, 1fr); }
.sld-stage.is-draw { display: flex; padding: 0; overflow: hidden; min-height: 0; }
.sld-frame { flex: 1; width: 100%; height: 100%; min-height: 0; border: 0; background: #fff; display: block; }
.sld-holder { position: relative; }
.sld-fit { position: absolute; top: 0; left: 0; transform-origin: top left; }
.sld-sheet {
  width: 420mm; height: 297mm; position: relative; background: #fff;
  box-shadow: 0 16px 50px rgba(20, 24, 33, .16);
  border: 0.35mm solid #1c1c1e;
  background-image: linear-gradient(rgba(28,28,30,.045) 0.15mm, transparent 0.15mm), linear-gradient(90deg, rgba(28,28,30,.045) 0.15mm, transparent 0.15mm);
  background-size: 10mm 10mm;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.sld-wires { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; overflow: visible; }
.sld-hit { cursor: pointer; }
#sld-nodes { position: absolute; inset: 0; z-index: 3; }
.sld-node {
  position: absolute; background: #fff; border: 0.32mm solid #1c1c1e; border-radius: 1.5mm;
  box-shadow: 0 0.6mm 1.8mm rgba(0,0,0,.06);
}
.sld-node.is-on { border-color: #0071e3; box-shadow: 0 0 0 0.45mm rgba(0,113,227,.25); }
.sld-node-h {
  font-size: 3.3mm; font-weight: 680; letter-spacing: .06em; text-transform: uppercase;
  text-align: center; padding: 1.7mm 2.2mm 1.5mm; border-bottom: 0.2mm solid #e4e6ea; cursor: grab;
}
.sld-figure { padding: 1.6mm; border-bottom: 0.2mm solid #e4e6ea; }
.sld-figure img { display: block; width: 100%; max-height: 28mm; object-fit: contain; }
.sld-cols { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
.sld-port {
  width: 100%; display: flex; align-items: center; gap: 1.3mm; min-height: 6.2mm;
  padding: 0.4mm 1.5mm; border: 0; background: transparent; font-size: 2.75mm; color: #1c1c1e; text-align: left; cursor: crosshair;
}
.sld-port span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sld-cols > div:last-child .sld-port { flex-direction: row-reverse; text-align: right; }
.sld-nub { width: 2.5mm; height: 2.5mm; border-radius: 50%; flex: none; box-shadow: 0 0 0 0.35mm #fff, 0 0 0 0.65mm currentColor; }
.sld-port.in .sld-nub { margin-left: -3.2mm; }
.sld-port.out .sld-nub { margin-right: -3.2mm; }
.sld-port.is-hot .sld-nub { box-shadow: 0 0 0 0.35mm #fff, 0 0 0 1.15mm currentColor; }
.sld-legend, .sld-stamp { position: absolute; z-index: 4; pointer-events: none; background: #fff; }
.sld-legend { left: 5mm; bottom: 5mm; display: flex; flex-wrap: wrap; gap: 1.4mm 3mm; max-width: 200mm; padding: 1.4mm 2mm; border: 0.2mm solid #d0d3d8; border-radius: 1mm; }
.sld-legend span { font-size: 2.5mm; }
.sld-legend i { width: 2.2mm; height: 2.2mm; }
.sld-stamp { right: 5mm; bottom: 5mm; width: 88mm; border: 0.35mm solid #1c1c1e; padding: 2mm 2.6mm 1.8mm; }
.sld-stamp-k { font-size: 2.3mm; letter-spacing: .14em; text-transform: uppercase; color: #6e6e73; }
.sld-stamp strong { display: block; font-size: 4mm; letter-spacing: -0.02em; margin: 0.4mm 0; }
.sld-stamp div { font-size: 2.7mm; }
.sld-stamp-m { color: #6e6e73; }
.sld-stamp-f { display: flex; justify-content: space-between; gap: 2mm; margin-top: 1.4mm; padding-top: 1.2mm; border-top: 0.2mm solid #1c1c1e; font-size: 2.4mm; }

@media print {
  @page { size: A3 landscape; margin: 0; }
  body.is-sld-printing { background: #fff !important; }
  body.is-sld-printing .sld-bar,
  body.is-sld-printing .sld-lib,
  body.is-sld-printing .sld-insp { display: none !important; }
  body.is-sld-printing .sld-app,
  body.is-sld-printing .sld-work,
  body.is-sld-printing .sld-stage,
  body.is-sld-printing .view.sld-root { display: block; height: auto; overflow: visible; background: #fff; padding: 0; }
  body.is-sld-printing .sld-holder { width: auto !important; height: auto !important; }
  body.is-sld-printing .sld-fit { position: static !important; transform: none !important; }
  body.is-sld-printing .sld-sheet { box-shadow: none; background-image: none; }
}
@media (max-width: 980px) {
  .album-bar { align-items: flex-start; flex-direction: column; }
  .sld-work { grid-template-columns: 1fr; }
  .sld-lib, .sld-insp { max-height: 240px; }
}
.modal.meta-modal { width: min(820px, 100%); }
.meta-fields { display: grid; gap: 14px; }
.meta-brand { display: flex; align-items: center; gap: 12px; }
.meta-brand img, .meta-party img { width: 88px; height: 56px; object-fit: contain; background: #111; border-radius: 8px; }
.meta-brand strong { display: block; }
.meta-brand span { color: var(--muted); font-size: 13px; }
.meta-party { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line, #e6e6e8); }
.meta-logo-empty { width: 88px; height: 56px; display: grid; place-items: center; border-radius: 8px; background: #f2f2f4; color: var(--muted); font-size: 12px; }
.meta-file { margin-top: 8px; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.meta-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) {
  .meta-grid, .meta-party { grid-template-columns: 1fr; }
}
