:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e0e8;
  --panel: #f8fafc;
  --paper: #ffffff;
  --accent: #1f6feb;
  --focus: #ffbf47;
  --stage: #eef3f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #e8edf2;
  font: 14px/1.4 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(520px, 1fr) 300px;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.app-shell:has(.inspector-details:not([open])) {
  grid-template-columns: 290px minmax(520px, 1fr) 68px;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  min-height: 74px;
  padding: 12px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 260px;
  min-width: 220px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  aspect-ratio: 1;
  background: #05070a;
  border: 1px solid #303741;
  border-radius: 11px;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  letter-spacing: 0;
}

.brand p,
#statusText,
#selectedKind {
  color: var(--muted);
}

.toolbar,
.view-tools,
.paper-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar {
  flex: 1 1 540px;
  flex-wrap: wrap;
  justify-content: center;
  min-width: 0;
}

.brand-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 1 370px;
  min-width: 260px;
}

.company-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.company-field input {
  width: 145px;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.logo-button,
.watermark-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.logo-button input {
  display: none;
}

.watermark-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.tool-button,
.text-button,
.view-tools button,
.paper-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  min-width: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #ffffff;
  white-space: nowrap;
}

.toolbar-menu {
  position: relative;
}

.toolbar-menu summary {
  list-style: none;
  touch-action: manipulation;
}

.toolbar-menu summary::-webkit-details-marker {
  display: none;
}

.toolbar-menu[open] summary {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.menu-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(18, 31, 53, .16);
}

.menu-options button {
  height: 36px;
  padding: 0 12px;
  text-align: left;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
}

.export-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.export-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.menu-options button:hover {
  color: #ffffff;
  background: var(--accent);
}

.text-button {
  padding: 0 14px;
}

.icon-only {
  width: 38px;
  padding: 0;
}

.button-icon {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  font-size: 16px;
  line-height: 1;
}

.button-label {
  font-size: 13px;
  font-weight: 700;
}

.tool-button.active,
.paper-button.active,
.grid-toggle.active,
.text-button:hover,
.view-tools button:hover,
.paper-button:hover {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.tool-button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.grid-toggle:not(.active) {
  border-color: #c6d0dc;
  background: #f8fafc;
  color: #475569;
}

.library,
.inspector {
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--panel);
}

.library {
  border-right: 1px solid var(--line);
}

.inspector {
  border-left: 1px solid var(--line);
  padding-bottom: 18px;
}

.inspector-details {
  min-height: 100%;
}

.inspector-details > summary {
  cursor: pointer;
  list-style: none;
}

.inspector-details > summary::-webkit-details-marker {
  display: none;
}

.inspector-body {
  display: block;
}

.inspector-details:not([open]) .inspector-body {
  display: none;
}

.panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
  position: sticky;
  top: 0;
  z-index: 4;
  backdrop-filter: blur(10px);
}

.panel-head h2 {
  font-size: 15px;
}

.inspector-title {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.inspector-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #c6d0dc;
  border-radius: 8px;
  color: #172033;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(18, 31, 53, .08);
  font-size: 12px;
  font-weight: 800;
}

.toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #ffffff;
  background: var(--accent);
  border-radius: 50%;
  font-size: 19px;
  line-height: 1;
  transform: rotate(0deg);
}

.inspector-details[open] .toggle-icon {
  transform: rotate(180deg);
}

.inspector-details:not([open]) > .panel-head {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: center;
  height: 100%;
  min-height: calc(100vh - 74px);
  padding: 10px;
}

.inspector-details:not([open]) .inspector-title {
  display: none;
}

.inspector-details:not([open]) .inspector-toggle {
  flex-direction: column;
  justify-content: center;
  width: 48px;
  min-height: 150px;
  padding: 10px 6px;
}

.inspector-details:not([open]) .toggle-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

#librarySearch,
.inspector input,
.inspector select,
.inspector textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
}

#librarySearch {
  height: 38px;
  padding: 0 11px;
}

.library-list {
  padding: 12px;
}

.category {
  margin-bottom: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.category[open] {
  border-color: #dfe6ee;
  background: rgba(255, 255, 255, .54);
}

.category summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 9px 8px;
  color: #465063;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.category summary::-webkit-details-marker {
  display: none;
}

.category summary::before {
  content: "▸";
  color: #7b8797;
}

.category[open] summary::before {
  content: "▾";
}

.category summary span:first-child {
  margin-right: auto;
}

.category summary span:last-child {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 20px;
  border-radius: 999px;
  color: #64748b;
  background: #e8eef5;
  font-size: 11px;
  letter-spacing: 0;
}

.category-items {
  padding: 0 4px 8px;
}

.palette-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  margin: 6px 0;
  padding: 7px 9px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  touch-action: none;
}

.palette-item:hover {
  border-color: #c6d0dc;
  background: #ffffff;
}

.touch-drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  max-width: 220px;
  padding: 10px 12px;
  border: 1px solid #c6d0dc;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 14px 32px rgba(18, 31, 53, .22);
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
  transform: translate(-9999px, -9999px);
}

.palette-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 34px;
  color: var(--accent);
  border: 1px solid #d8e1ea;
  border-radius: 6px;
  background: #ffffff;
}

.palette-item strong {
  display: block;
  font-size: 13px;
}

.palette-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stage-wrap {
  display: grid;
  grid-template-rows: 50px minmax(0, 1fr);
  min-width: 0;
  background: var(--stage);
}

.stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #f9fbfd;
  gap: 12px;
}

.diagram-name-input {
  width: min(260px, 34vw);
  height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
}

.diagram-name-input:hover,
.diagram-name-input:focus {
  border-color: #c6d0dc;
  background: #ffffff;
  outline: none;
}

.view-tools span {
  min-width: 48px;
  text-align: center;
  color: var(--muted);
}

.view-tools button {
  min-width: 92px;
}

.paper-tools {
  margin-left: auto;
}

.paper-button {
  height: 34px;
  min-width: 86px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
}

.canvas-host {
  min-height: 0;
  overflow: auto;
  padding: 22px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
}

#diagram {
  display: block;
  width: 1100px;
  height: 850px;
  background: #ffffff;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(18, 31, 53, .12);
  transform-origin: top left;
  user-select: none;
}

#diagram.grid-off .grid {
  display: none;
}

.link {
  fill: none;
  stroke: #334155;
  stroke-width: 4;
  marker-end: url(#arrow);
  cursor: pointer;
  pointer-events: stroke;
  touch-action: none;
}

.link.audio {
  stroke: #0f766e;
}

.link.video {
  stroke: #1f6feb;
}

.link.network {
  stroke: #7c3aed;
  stroke-dasharray: 10 8;
}

.link.power {
  stroke: #be123c;
  stroke-dasharray: 4 7;
}

.link.selected {
  stroke: var(--focus);
  stroke-width: 7;
}

.cable-link-icon,
.cable-link-label {
  cursor: grab;
  pointer-events: all;
  touch-action: none;
}

.cable-free {
  cursor: grab;
}

.cable-link-badge {
  fill: #ffffff;
  stroke: #d9e0e8;
  stroke-width: 1.5;
}

.cable-link-label {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 800;
  text-anchor: middle;
}

.brand-watermark-text {
  fill: #172033;
  opacity: .3;
  font-family: Inter, Arial, sans-serif;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.node {
  filter: url(#nodeShadow);
  cursor: grab;
  touch-action: none;
}

.node.selected .node-body {
  stroke: var(--focus);
  stroke-width: 5;
}

.node.connect-source .node-body {
  stroke: #0f766e;
  stroke-width: 5;
}

.node-body {
  fill: #ffffff;
  stroke: #8fa1b5;
  stroke-width: 2;
}

.text-box-body {
  fill: rgba(255, 255, 255, .88);
  stroke: var(--node-color);
  stroke-dasharray: 8 6;
}

.text-box-label {
  fill: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.text-box-copy {
  fill: #263242;
  font-size: 15px;
  font-weight: 600;
}

.text-box-copy.bold {
  font-weight: 900;
}

.text-box-copy.italic {
  font-style: italic;
}

.text-box-placeholder {
  fill: #94a3b8;
  font-size: 14px;
  font-style: italic;
}

.text-box-divider {
  fill: none;
  stroke: #d9e0e8;
  stroke-width: 1.5;
  stroke-dasharray: none;
}

.text-resize-handle {
  cursor: nwse-resize;
  pointer-events: all;
}

.text-resize-handle rect {
  fill: color-mix(in srgb, var(--node-color) 14%, white);
  stroke: var(--node-color);
  stroke-width: 1.5;
}

.text-resize-handle path {
  fill: none;
  stroke: var(--node-color);
  stroke-width: 2;
  stroke-linecap: round;
}

.equipment-body {
  fill: #ffffff;
  stroke: currentColor;
  stroke-width: 3;
}

.equipment-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.equipment-line.soft {
  stroke-width: 2.5;
  opacity: .72;
}

.equipment-line.cable-thick {
  stroke-width: 9;
}

.detail-fill {
  fill: currentColor;
  stroke: none;
}

.screen-glow {
  fill: color-mix(in srgb, var(--node-color) 12%, white);
  stroke: color-mix(in srgb, var(--node-color) 50%, white);
  stroke-width: 2;
}

.node-accent {
  fill: var(--node-color);
}

.node text {
  fill: var(--ink);
  pointer-events: none;
}

.node-label {
  font-size: 18px;
  font-weight: 800;
}

.equipment-label,
.equipment-sub {
  text-anchor: middle;
}

.node-sub {
  fill: #667085;
  font-size: 12px;
  text-transform: uppercase;
}

.node-icon {
  stroke: var(--node-color, currentColor);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.node-icon-fill {
  fill: var(--node-color, currentColor);
  stroke: none;
}

.flow-diamond {
  transform-box: fill-box;
  transform-origin: center;
}

.inspector label {
  display: grid;
  gap: 7px;
  padding: 16px 16px 0;
  color: #465063;
  font-weight: 700;
}

.inspector input,
.inspector select,
.inspector textarea {
  padding: 10px;
  color: var(--ink);
  font-weight: 500;
  resize: vertical;
}

.text-format-controls {
  display: grid;
  grid-template-columns: repeat(5, 38px);
  gap: 8px;
  padding: 10px 16px 0;
}

.format-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.format-button.italic {
  font-style: italic;
}

.format-button.active {
  border-color: var(--focus);
  background: #eaf3ff;
  color: var(--focus);
}

.format-button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.io-capacity-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 14px 16px 0;
}

.io-capacity-controls label {
  padding: 0;
}

.io-capacity-controls input {
  min-width: 0;
}

.size-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  align-items: center;
  gap: 10px;
}

.size-control input {
  padding: 0;
}

.size-control output {
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #465063;
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.swatches {
  display: flex;
  gap: 9px;
  padding: 16px;
}

.swatch {
  width: 31px;
  height: 31px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px #bdc8d6;
}

.swatch.active {
  box-shadow: 0 0 0 3px var(--focus);
}

.legend {
  margin: 8px 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.legend h3 {
  margin-bottom: 12px;
  font-size: 13px;
}

.legend p {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px 0;
  color: #465063;
}

.build-label {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 40;
  padding: 4px 8px;
  border: 1px solid rgba(148, 163, 184, .5);
  border-radius: 7px;
  color: rgba(71, 85, 105, .8);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.build-label:hover {
  color: var(--ink);
  background: #ffffff;
}

.about-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
}

.about-dialog::backdrop {
  background: rgba(15, 23, 42, .38);
  backdrop-filter: blur(2px);
}

.about-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.about-card h2 {
  font-size: 24px;
}

.about-eyebrow,
.about-version,
.about-legal {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.about-eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
}

.about-card dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.about-card dl div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
}

.about-card dt {
  color: var(--muted);
  font-weight: 800;
}

.about-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.about-card a {
  color: var(--accent);
  font-weight: 800;
}

.about-close {
  justify-self: end;
}

.line {
  width: 34px;
  height: 0;
  border-top: 4px solid #0f766e;
}

.line.video {
  border-color: #1f6feb;
}

.line.network {
  border-color: #7c3aed;
  border-top-style: dashed;
}

.line.power {
  border-color: #be123c;
  border-top-style: dotted;
}

@media (max-width: 1240px) {
  .app-shell,
  .app-shell:has(.inspector-details:not([open])) {
    grid-template-columns: minmax(240px, 28vw) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) minmax(210px, auto);
  }

  .topbar {
    align-items: flex-start;
    gap: 12px;
  }

  .brand {
    flex-basis: 230px;
  }

  .toolbar {
    justify-content: flex-start;
    order: 3;
    flex-basis: 100%;
  }

  .brand-tools {
    flex: 1 1 320px;
  }

  .inspector {
    grid-column: 1 / -1;
    max-height: 34vh;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .inspector-details:not([open]) > .panel-head {
    height: auto;
    min-height: 0;
    justify-content: flex-start;
  }

  .inspector-details:not([open]) .inspector-toggle {
    flex-direction: row;
    width: auto;
    min-height: 44px;
    padding: 0 12px;
  }

  .inspector-details:not([open]) .toggle-text {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .stage-top {
    min-height: 50px;
    height: auto;
    flex-wrap: wrap;
    padding: 8px 12px;
  }
}

@media (max-width: 840px) {
  .app-shell,
  .app-shell:has(.inspector-details:not([open])) {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(185px, auto) minmax(420px, 1fr) minmax(220px, auto);
  }

  .topbar {
    padding: 10px max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
  }

  .brand {
    flex: 1 1 100%;
  }

  .brand-tools {
    justify-content: flex-start;
    flex-basis: 100%;
    min-width: 0;
  }

  .company-field {
    flex: 1 1 220px;
  }

  .company-field input {
    width: 100%;
  }

  .library {
    max-height: 34vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stage-wrap {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .stage-top {
    align-items: flex-start;
  }

  .diagram-name-input {
    width: min(100%, 360px);
  }

  .paper-tools,
  .view-tools {
    flex-wrap: wrap;
    margin-left: 0;
  }

  .canvas-host {
    padding: 14px;
  }

  .inspector {
    max-height: 38vh;
  }

  .build-label {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    font-size: 10px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 13px;
  }

  .app-shell,
  .app-shell:has(.inspector-details:not([open])) {
    grid-template-rows: auto minmax(170px, auto) minmax(390px, 1fr) minmax(210px, auto);
  }

  .brand p {
    display: none;
  }

  .toolbar,
  .brand-tools,
  .paper-tools,
  .view-tools {
    gap: 6px;
  }

  .tool-button,
  .text-button,
  .view-tools button,
  .paper-button,
  .logo-button,
  .watermark-toggle {
    min-height: 42px;
    padding: 0 10px;
  }

  .button-label {
    font-size: 12px;
  }

  .view-tools button,
  .paper-button {
    min-width: 0;
  }

  .library-list {
    padding: 8px;
  }

  .palette-item {
    min-height: 56px;
  }

  .panel-head,
  .inspector label,
  .swatches {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (orientation: landscape) and (max-height: 720px) and (max-width: 1180px) {
  .app-shell,
  .app-shell:has(.inspector-details:not([open])) {
    grid-template-columns: minmax(220px, 25vw) minmax(0, 1fr) minmax(240px, 28vw);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .library,
  .inspector {
    max-height: none;
  }

  .inspector {
    grid-column: auto;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

@media (pointer: coarse) {
  button,
  summary,
  .logo-button,
  .watermark-toggle,
  .palette-item,
  #librarySearch,
  .inspector input,
  .inspector select,
  .inspector textarea {
    min-height: 44px;
  }

  .category summary {
    padding-block: 12px;
  }

  .palette-icon {
    width: 44px;
    height: 38px;
  }

  .swatch {
    width: 42px;
    height: 42px;
  }

  .link {
    stroke-width: 6;
  }

  .link.selected {
    stroke-width: 9;
  }
}
