:root {
  color-scheme: dark;
  --ink: #0f0e0d;
  --panel: #181715;
  --line: #39332f;
  --paper: #ece7de;
  --muted: #aaa095;
  --accent: #c0687a;
  --wine: #743749;
  font-family: Jost, sans-serif;
  color: var(--paper);
  background: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
:root.studio-document {
  color-scheme: light;
  --ink: #edf0f4;
  --panel: #ffffff;
  --line: #e1e4ea;
  --paper: #242938;
  --muted: #5d6678;
  --accent: #285699;
  --accent-hover: #22477e;
  --accent-soft: #eaf1fc;
  --control-hover: #eef0f5;
  --canvas-surface: #edf0f4;
  --wine: var(--accent);
  font-family: system-ui, sans-serif;
}
.workspace {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--paper);
}
.studio-bar { min-height: 48px; padding: 7px 14px; display: flex; align-items: center; gap: 6px 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); background: var(--panel); }
.studio-id { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.bureau-wordmark { display: block; width: 100%; height: auto; }
.studio-brand { width: 145px; }
.wordmark { font: 400 30px/.95 "Bodoni Moda", Georgia, serif; letter-spacing: -.045em; }
.mode { color: var(--muted); }
.studio-id h1 { margin: 0; color: var(--muted); font-size: 13px; font-weight: 500; }
.studio-brand:not([hidden]) + h1::before { content: "/"; margin-right: 12px; color: var(--muted); opacity: .65; }
.studio-tools, .studio-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.studio-actions { margin-left: auto; }
.studio-bar .button { min-height: 32px; padding: 4px 10px; border-radius: 7px; font-size: 12px; font-weight: 550; }
.studio-bar .studio-preview { gap: 5px; border-color: transparent; }
.studio-preview svg { width: 16px; height: 16px; fill: #c9f0dd; stroke: #06794d; stroke-linejoin: round; }
.studio-actions form { margin: 0; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 7px 14px; color: var(--paper); background: transparent; border: 1px solid var(--line); text-decoration: none; cursor: pointer; font-size: 14px; }
.button:hover { background: #272320; }
.button.primary { background: var(--wine); border-color: var(--wine); }
.button.primary:hover { background: #834256; }
.button.quiet { padding-inline: 2px; border-color: transparent; color: var(--muted); }
.button.quiet:hover { color: var(--paper); background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.workspace .button:hover { background: var(--control-hover); }
.workspace .button.primary { color: var(--panel); }
.workspace .button.primary:hover { background: var(--accent-hover); }
.workspace .button.quiet:hover { background: transparent; }
.button:disabled { opacity: .45; cursor: default; }
.workspace .button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.studio-status { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 16px; min-height: 25px; padding: 3px 16px; border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 12px; }
.studio-shell { flex: 1; min-height: 0; display: flex; }
.studio-rail { flex: none; width: 50px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-block: 7px; border-right: 1px solid var(--line); background: var(--panel); }
.studio-rail button { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.studio-rail button:not(:disabled):hover { background: var(--control-hover); color: var(--paper); }
.studio-rail button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.studio-rail button:disabled { opacity: .5; cursor: default; }
.studio-rail svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.studio-rail span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#studio { flex: 1; min-height: 0; overflow: hidden; }
#studio, #studio button, #studio input { font-family: system-ui, sans-serif; }
#studio .studio-workbench { height: 100%; }
#studio .studio-outline, #studio .studio-inspector { min-width: 0 !important; background: var(--panel); }
#studio .studio-outline { flex: 0 0 clamp(172px, 18vw, 264px); }
#studio .studio-inspector { flex: 0 0 clamp(204px, 22vw, 306px); }
#studio .studio-navigation-tabs { display: none; }
#studio .studio-insert-panel .gs-block-manager__blocks { gap: 1px; padding: 5px 8px; }
#studio .studio-insert-panel .gs-block-item-compact { min-height: 34px; border-color: transparent; border-radius: 5px; font-size: 13px; }
#studio .studio-insert-panel .gs-block-item-compact:hover { color: var(--accent); background: var(--accent-soft); }
#studio .studio-artboard { --canvas-gutter: clamp(10px, 1.4vw, 22px); min-width: 0; background: var(--canvas-surface); }
#studio .gs-cmp-editor-topbar { background: var(--panel); }
#studio .gs-cmp-editor-topbar button { border-radius: 7px; }
#studio .studio-canvas-insert, #studio .studio-grid-toggle[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
#studio .studio-canvas-insert:hover, #studio .studio-grid-toggle:hover { color: var(--accent-hover); }
#studio .studio-artboard > .gs-canvas {
  align-self: center;
  width: calc(100% - 2 * var(--canvas-gutter)) !important;
  height: auto !important;
  min-height: 0;
  margin-block: var(--canvas-gutter);
  outline: 1px solid rgb(36 41 56 / .12);
  box-shadow: 0 4px 16px rgb(36 41 56 / .06);
}
#studio .studio-artboard-desktop > .gs-canvas {
  flex: none;
  width: var(--desktop-canvas-width) !important;
  height: calc(var(--desktop-canvas-width) * 9 / 16) !important;
}
/* Keep the selection outline while showing the original canvas colors. */
#studio .gjs-padding-v-el, #studio .gjs-margin-v-el {
  background-color: transparent !important;
}
#studio .studio-selection, #studio .studio-properties { padding: 8px 12px; }
.sign-in { min-height: 100dvh; display: grid; grid-template-columns: minmax(340px, 1fr) minmax(360px, 1.1fr); }
.sign-in-panel { display: flex; flex-direction: column; padding: clamp(32px, 7vw, 110px); }
.sign-in-panel > header { display: flex; gap: 16px; align-items: baseline; }
.sign-in-panel > header .mode { font-size: 14px; }
.sign-in-main { width: min(100%, 370px); margin-block: auto; padding-block: 54px; }
.sign-in-main h1 { font: 400 clamp(42px, 5vw, 74px)/1.02 "Bodoni Moda", Georgia, serif; letter-spacing: -.035em; margin: 0 0 18px; }
.sign-in-main p { color: var(--muted); line-height: 1.55; margin: 0 0 34px; }
.sign-in-main form { display: grid; gap: 15px; }
.sign-in-main label { display: grid; gap: 6px; font-size: 14px; }
.sign-in-main input { min-height: 46px; width: 100%; padding: 8px 12px; background: var(--panel); color: var(--paper); border: 1px solid var(--line); border-radius: 0; }
.sign-in-main form button { justify-self: start; min-width: 120px; margin-top: 4px; }
.sign-in-main #login-status { min-height: 1.6em; color: #e5a5b2; margin: 4px 0 0; }
.cover-study { display: grid; grid-template-rows: 1fr auto; margin: 22px 22px 22px 0; padding: clamp(20px, 4vw, 68px); background: #fdfcf9; color: #141414; }
.cover-study img { width: min(100%, 460px); align-self: center; justify-self: center; }
.cover-study figcaption { display: flex; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid #e4decf; font-size: 13px; color: #6e6862; }
@media (max-width: 750px) {
  .sign-in { grid-template-columns: 1fr; }
  .sign-in-main { padding-block: 64px 22px; }
  .cover-study { margin: 0 20px 20px; min-height: 250px; }
  .cover-study img { width: min(100%, 290px); }
  .studio-bar { gap: 8px; }
  .studio-actions { margin-left: 0; }
  .studio-shell { flex-direction: column; }
  .studio-rail { width: auto; flex-direction: row; padding: 3px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .studio-rail button { width: auto; padding-inline: 8px; font-size: 12px; }
  .studio-rail span { position: static; width: auto; height: auto; clip-path: none; }
  #studio .studio-workbench { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 3fr) minmax(0, 2fr); }
  #studio .studio-artboard { grid-area: 1 / 1 / 2 / -1; min-height: 0; --canvas-gutter: 8px; }
  #studio .studio-artboard .gs-cmp-editor-topbar { overflow-x: auto; }
  #studio .studio-artboard .gs-cmp-editor-topbar__wrp { width: max-content; min-width: 100%; }
  #studio .studio-outline, #studio .studio-inspector { width: 100% !important; min-height: 0; border-top: 1px solid var(--line); }
  #studio .gs-cmp-tabs__tab { padding-inline: 4px; }
}
#studio [role="tab"][aria-selected="true"] { color: var(--accent); }

.release-dialog { width: min(460px, calc(100% - 36px)); border: 1px solid var(--line); padding: 28px; background: var(--panel); color: var(--paper); }
.release-dialog::backdrop { background: rgb(20 16 14 / .45); }
.release-dialog h2 { margin: 0 0 10px; font: 400 34px/1.1 "Bodoni Moda", Georgia, serif; }
.release-dialog p { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
.release-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.release-actions + button { margin-top: 8px; }

.studio-id a { text-decoration: none; }
#studio .studio-inspector {
  flex-basis: clamp(216px, 23vw, 324px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
#studio .studio-inspector-content { flex: none; min-height: 100%; }
#studio .studio-inspector-content > .gs-cmp-tabs__panels {
  flex: 1 0 auto;
  overflow: visible;
}
#studio .studio-inspector-content > .gs-cmp-tabs__panels > .gs-cmp-tabs__panel { height: auto; }
#studio .studio-inspector-tabs { min-height: 38px; flex-shrink: 0; }
.studio-phone, .studio-quick-edit { padding: 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.studio-phone {
  background: var(--panel);
}
.studio-phone summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 650;
  border-radius: 4px;
}
.studio-phone summary::-webkit-details-marker { display: none; }
.studio-phone summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.studio-phone summary svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.studio-phone summary span { margin-left: auto; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.studio-phone summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 3px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.studio-phone[open] summary::after { transform: rotate(225deg); }
.studio-phone-stage {
  width: 132.6px;
  height: 221px;
  overflow: hidden;
  margin: 12px auto 1px;
  border-radius: 9px;
  outline: 1px solid var(--line);
  background: var(--canvas-surface);
  box-shadow: 0 4px 14px rgb(36 41 56 / .09);
}
.studio-phone iframe {
  display: block;
  width: 390px;
  height: 650px;
  border: 0;
  transform: scale(.34);
  transform-origin: top left;
  pointer-events: none;
}
@media (max-height: 780px), (max-width: 750px) {
  .studio-phone-stage { width: 109.2px; height: 182px; }
  .studio-phone iframe { transform: scale(.28); }
}
.studio-quick-edit { display: grid; gap: 8px; }
.studio-quick-edit label { display: grid; gap: 4px; color: var(--muted); }
.studio-quick-edit input, .studio-quick-edit textarea { width: 100%; padding: 5px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--paper); background: var(--panel); font: inherit; }
.studio-quick-edit textarea { min-height: 46px; resize: vertical; }
.studio-quick-edit .button { justify-self: start; min-height: 30px; padding: 4px 9px; font-size: 12px; border-radius: 4px; }

.studio-phone-error { display: none; color: var(--muted); }
.studio-phone[data-preview-error] .studio-phone-error { display: block; }

#page-map {
  width: min(1200px, calc(100vw - 24px));
  height: min(840px, calc(100dvh - 24px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--paper);
}
#page-map[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
#page-map::backdrop { background: rgb(36 41 56 / .45); }
.page-map-bar, .page-map-link {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.page-map-bar h2 { margin: 0 auto 0 0; font-size: 16px; }
.page-map-zoom { display: flex; gap: 4px; }
#page-map .button { min-height: 32px; padding: 4px 10px; border-radius: 6px; font-size: 12px; }
.page-map-link { font-size: 12px; color: var(--muted); }
#map-connect { touch-action: none; user-select: none; }
#map-feedback { color: var(--accent); }
.page-map-viewport { overflow: auto; background: var(--canvas-surface); cursor: grab; }
.page-map-viewport.is-panning, .page-map-viewport.is-panning * { cursor: grabbing; }
.page-map-sheet {
  position: relative;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  padding: 44px;
  background-image: radial-gradient(#a7afbd 1px, transparent 1px);
  background-size: 14px 14px;
}
.page-map-cards {
  display: grid;
  grid-template-columns: repeat(3, 224px);
  gap: 52px 70px;
}
.page-map-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.page-map-lines marker { fill: var(--accent); }
.page-map-edge, .page-map-drag { fill: none; stroke: var(--accent); stroke-width: 2; }
.page-map-drag { stroke-dasharray: 5 4; }
.page-map-card {
  display: grid;
  gap: 8px;
  position: relative;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--paper);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}
.page-map-card:hover, .page-map-card[aria-current] { border-color: var(--accent); }
.is-linking .page-map-card { cursor: crosshair; }
.page-map-thumbnail { display: block; width: 206px; height: 134px; overflow: hidden; background: #fbfaf7; }
.page-map-thumbnail iframe { display: block; width: 920px; height: 598px; border: 0; transform: scale(.224); transform-origin: top left; pointer-events: none; }
@media (max-width: 750px) {
  .page-map-cards { grid-template-columns: repeat(2, 224px); }
  .page-map-sheet { padding: 24px; }
}
