:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #171717;
  background: #f4f4f2;
  font-synthesis: none;
  --ink: #171717;
  --muted: #696966;
  --line: #d9d9d5;
  --paper: #fff;
  --canvas: #ececea;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .upload-card:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.hidden { display: none !important; }
.app-shell { min-height: 100vh; }

.site-header {
  height: 72px;
  padding: 0 clamp(20px, 3.5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.065em;
}
.brand-light { font-weight: 400; }
.brand-mark {
  width: 25px;
  height: 25px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  transform: rotate(-18deg);
}
.brand-mark span {
  border: 1.6px solid var(--ink);
  border-radius: 65% 15% 65% 15%;
  transform: rotate(45deg);
}
.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #62625f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-left: auto;
}
.status-dot { width: 6px; height: 6px; background: var(--ink); }
.header-divider { width: 1px; height: 17px; margin: 0 6px; background: var(--line); }
.header-help {
  width: 29px;
  height: 29px;
  border: 1px solid #a8a8a4;
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.header-help:hover { background: var(--ink); color: #fff; }

.main-content {
  max-width: 1700px;
  margin: auto;
  padding: 42px clamp(20px, 3.5vw, 64px) 0;
}
.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 45px;
  margin-bottom: 37px;
}
.eyebrow, .section-kicker, .model-setting-label, .summary-visual-label, .estimate-title, .stage-label {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; color: #5f5f5c; }
.eyebrow-line { display: block; width: 21px; height: 1px; background: var(--ink); }
.intro h1 {
  margin: 0;
  font-size: clamp(40px, 4.2vw, 66px);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -.067em;
}
.intro h1 em { font-style: normal; font-weight: 400; color: #757571; }
.intro p { max-width: 330px; margin: 0 0 4px; color: #676764; font-size: 13px; line-height: 1.65; }

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 305px) minmax(420px, 1fr) minmax(265px, 305px);
  gap: 12px;
  align-items: stretch;
}
.panel, .body-panel { min-height: 710px; }
.panel {
  padding: 26px 24px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.panel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 23px;
  border-bottom: 1px solid var(--line);
}
.step-number {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: none;
  border: 1px solid var(--ink);
  color: var(--ink);
  font: 700 11px Consolas, 'Courier New', monospace;
}
.section-kicker { color: #777773; }
.panel h2, .body-panel h2 { margin: 3px 0 0; font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -.035em; }
.form-section { padding-top: 23px; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.field-heading label, .field-label { color: #272727; font-size: 11px; font-weight: 700; }
.field-optional { color: #888884; font-size: 10px; }
.field-value { color: #171717; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.upload-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 73px;
  padding: 10px 11px;
  border: 1px dashed #949490;
  background: #f7f7f6;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.upload-card:hover { background: #eeeeec; border-color: var(--ink); }
.upload-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid #c5c5c1; color: var(--ink); }
.upload-icon svg { width: 18px; height: 18px; }
.upload-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.upload-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.upload-copy small { overflow: hidden; white-space: nowrap; color: #858581; font-size: 9px; }
.upload-arrow { margin-left: auto; font-size: 17px; color: var(--ink); }
.text-button {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.range-row {
  display: grid;
  grid-template-columns: 43px 1fr 42px;
  align-items: center;
  gap: 7px;
  margin: 13px 0;
  color: #777773;
  font-size: 11px;
}
.range-row span:last-child { text-align: right; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
input[type=range] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 2px;
  background: #bdbdb9;
  accent-color: var(--ink);
}
input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 0;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
  cursor: pointer;
}
input[type=range]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 1px solid #fff;
  border-radius: 0;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
  cursor: pointer;
}
.size-presets { display: flex; gap: 6px; margin-top: 16px; }
.size-presets button {
  flex: 1;
  padding: 8px 7px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: #666663;
  font-size: 10px;
  font-weight: 700;
}
.size-presets button:hover { border-color: var(--ink); }
.size-presets button.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.fit-design-button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid #bcbcb8;
  border-radius: 0;
  background: #f6f6f4;
  color: var(--ink);
  text-align: left;
  font-size: 10px;
  font-weight: 700;
}
.fit-design-button:hover { background: #e9e9e6; border-color: var(--ink); }
.fit-design-button:disabled { opacity: .5; cursor: wait; }
.fit-design-button span { font-size: 17px; line-height: 10px; }
.field-hint { margin: 7px 1px 0; color: #858581; font-size: 9px; line-height: 1.45; }
.select-wrap { position: relative; margin-top: 12px; }
.select-wrap:after { content: '⌄'; position: absolute; top: 7px; right: 12px; color: #666; font-size: 19px; pointer-events: none; }
.select-wrap select, .notes-section textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: #222;
  font-size: 11px;
}
.select-wrap select { appearance: none; padding: 12px 30px 12px 11px; }
.notes-section textarea { min-height: 82px; padding: 11px; resize: vertical; line-height: 1.5; }
.notes-section textarea::placeholder { color: #969692; }

.body-panel {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: #f0f0ee;
  border: 1px solid var(--line);
}
.body-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 25px 27px 17px;
  background: #f0f0ee;
  position: relative;
  z-index: 2;
}
.body-panel h2 { font-size: 22px; }
.view-toggle, .gender-toggle { display: flex; flex: none; }
.view-toggle { border: 1px solid #a7a7a3; }
.view-toggle button, .gender-toggle button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #646461;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.view-toggle button { padding: 9px 12px; }
.view-toggle button + button { border-left: 1px solid #a7a7a3; }
.view-toggle button.active, .gender-toggle button.active { background: var(--ink); color: #fff; }
.view-toggle button:hover:not(.active), .gender-toggle button:hover:not(.active) { background: #e2e2df; color: var(--ink); }
.model-settings {
  display: grid;
  grid-template-columns: auto minmax(125px, 1fr);
  align-items: end;
  gap: 22px;
  padding: 0 27px 18px;
  border-bottom: 1px solid #d1d1ce;
  background: #f0f0ee;
  position: relative;
  z-index: 2;
}
.model-setting-label { display: block; margin-bottom: 9px; color: #72726e; font-size: 9px; }
.gender-toggle { border: 1px solid #b1b1ad; }
.gender-toggle button { padding: 8px 9px; }
.gender-toggle button + button { border-left: 1px solid #b1b1ad; }
.model-height-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.model-height-heading output { color: var(--ink); font-size: 11px; font-weight: 700; white-space: nowrap; }
.model-height-setting input { display: block; margin: 10px 0 7px; }

.body-stage {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 525px;
  overflow: hidden;
  background-color: var(--canvas);
  background-image: linear-gradient(#dcdcd9 1px, transparent 1px), linear-gradient(90deg, #dcdcd9 1px, transparent 1px);
  background-size: 32px 32px;
}
.body-stage:before {
  content: '';
  position: absolute;
  top: 27px;
  bottom: 52px;
  left: 50%;
  border-left: 1px dashed #bcbcb8;
}
.body-stage.is-zoomed:before { display: none; }
.body-svg {
  width: min(100%, 430px);
  height: min(555px, 100%);
  max-height: 555px;
  overflow: hidden;
  z-index: 1;
  touch-action: none;
}
.body-part {
  fill: url(#skin);
  stroke: #9c9c99;
  stroke-width: 1.25;
  cursor: crosshair;
  transition: filter .15s;
}
.body-part.arm { fill: url(#skinArm); }
.body-part:hover { filter: brightness(1.07); }
.body-detail { fill: none; stroke: #aaa9a6; stroke-width: 1.25; stroke-linecap: round; pointer-events: none; }
.body-detail.dark { stroke: #888884; }
.body-shade { fill: #888884; opacity: .15; pointer-events: none; }
.tattoo-group { cursor: grab; touch-action: none; }
.tattoo-group:active { cursor: grabbing; }
.tattoo-group:focus { outline: none; }
.stage-label { position: absolute; top: 43%; z-index: 1; color: #777774; writing-mode: vertical-rl; font-size: 9px; }
.stage-label-left { left: 27px; transform: rotate(180deg); }
.stage-label-right { right: 27px; }
.body-stage.is-zoomed .stage-label { opacity: .35; }
.zoom-tools {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid #bcbcb9;
  background: #fafaf9;
}
.zoom-tools span { min-width: 29px; text-align: center; color: var(--ink); font: 700 10px Consolas, 'Courier New', monospace; }
.zoom-tools button {
  min-width: 26px;
  height: 26px;
  border: 1px solid #d4d4d0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
.zoom-tools button:last-child { padding: 0 8px; font-size: 9px; white-space: nowrap; }
.zoom-tools button:hover:not(:disabled) { background: var(--ink); color: #fff; border-color: var(--ink); }
.zoom-tools button:disabled { opacity: .35; cursor: default; }
.stage-tip {
  position: absolute;
  bottom: 17px;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 9px 12px;
  transform: translateX(-50%);
  border: 1px solid #cacac6;
  background: #fff;
  color: #565653;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  white-space: normal;
}
.tip-cursor { color: var(--ink); font-size: 16px; line-height: 0; }
.body-panel-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 55px;
  padding: 0 24px;
  border-top: 1px solid #d0d0cc;
  background: #f8f8f7;
  font-size: 11px;
  font-weight: 700;
}
.location-dot { width: 6px; height: 6px; flex: none; background: var(--ink); }
.body-panel-bottom button {
  margin-left: auto;
  border: 0;
  background: none;
  color: #545451;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.body-panel-bottom button:hover { color: var(--ink); text-decoration: underline; }

.summary-panel { display: flex; flex-direction: column; }
.summary-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 219px;
  margin-top: 23px;
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: #f1f1ef;
  background-image: linear-gradient(#e5e5e2 1px, transparent 1px), linear-gradient(90deg, #e5e5e2 1px, transparent 1px);
  background-size: 18px 18px;
}
.summary-visual-label { position: absolute; top: 12px; left: 12px; color: #6e6e6a; font-size: 9px; }
.summary-visual-caption {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
#miniPreview { width: 125px; height: 190px; overflow: hidden; }
#miniPreview svg { display: block; width: 100%; height: 100%; }
.summary-list { margin: 20px 0 0; }
.summary-list div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e5e5e2; font-size: 11px; }
.summary-list dt { color: #777773; }
.summary-list dd { max-width: 155px; margin: 0; color: var(--ink); font-weight: 700; text-align: right; }
.estimate-card { margin-top: 22px; padding: 17px; background: #1d1d1d; color: #fff; }
.estimate-title { display: flex; justify-content: space-between; color: #bcbcbc; font-size: 9px; }
.estimate-icon { color: #fff; font-size: 16px; line-height: 10px; }
.estimate-row { display: flex; gap: 20px; margin: 22px 0 17px; }
.estimate-row > div { flex: 1; }
.estimate-row > div + div { padding-left: 16px; border-left: 1px solid #555; }
.estimate-row small { display: block; margin-bottom: 5px; color: #acacac; font-size: 10px; }
.estimate-row strong { font-size: 21px; font-weight: 700; letter-spacing: -.045em; white-space: nowrap; }
.estimate-card p { margin: 0; padding-top: 12px; border-top: 1px solid #4b4b4b; color: #bcbcbc; font-size: 9px; line-height: 1.5; }
.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  transition: background .15s;
}
.primary-button:hover { background: #444; }
.primary-button span { font-size: 18px; line-height: 12px; }
.summary-panel > .primary-button { margin-top: auto; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 0; color: #888884; font-size: 9px; }
.privacy-note svg { width: 14px; height: 14px; }
.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 0;
  color: #777773;
  font: 700 9px Consolas, 'Courier New', monospace;
  letter-spacing: .1em;
}
.site-footer > span:first-child { color: var(--ink); }
.footer-muted { color: #888884; font-weight: 400; }

.result-dialog {
  width: calc(100% - 32px);
  max-width: 450px;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 0;
  box-shadow: 0 20px 70px #0004;
}
.result-dialog::backdrop { background: #0009; }
.dialog-content { position: relative; padding: 31px; background: #fff; }
.dialog-close { position: absolute; top: 14px; right: 19px; border: 0; background: none; color: var(--ink); font-size: 26px; }
.dialog-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 19px; background: var(--ink); color: #fff; font-weight: 700; }
.dialog-content h2 { margin: 8px 0 10px; font-size: 30px; font-weight: 700; letter-spacing: -.05em; }
.dialog-content > p { margin: 0; color: #666; font-size: 12px; line-height: 1.6; }
.dialog-summary { max-height: 230px; overflow: auto; margin: 23px 0; padding: 15px; border: 1px solid var(--line); background: #f6f6f4; font-size: 11px; line-height: 1.7; white-space: pre-wrap; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dialog-actions .primary-button { padding: 12px; font-size: 10px; }
.secondary-button { border: 1px solid var(--ink); border-radius: 0; background: #fff; color: var(--ink); font-size: 10px; font-weight: 700; }
.secondary-button:hover { background: #ededeb; }
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 10;
  padding: 11px 17px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1160px) {
  .workspace { grid-template-columns: minmax(255px, 300px) 1fr; }
  .summary-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 25px; min-height: 0; }
  .summary-panel .panel-heading { grid-column: 1 / -1; }
  .summary-visual { grid-row: 2 / 5; }
  .summary-list { margin-top: 23px; }
  .summary-panel > .primary-button { margin-top: 18px; }
  .privacy-note { justify-content: flex-start; }
  .body-panel { min-height: 690px; }
  .panel { min-height: 0; }
}
@media (max-width: 760px) {
  .site-header { height: 64px; padding: 0 19px; }
  .header-meta { display: none; }
  .main-content { padding: 29px 15px 0; }
  .intro { display: block; margin-bottom: 27px; }
  .intro h1 { font-size: clamp(39px, 10vw, 52px); }
  .intro p { max-width: 460px; margin-top: 17px; }
  .workspace { display: flex; flex-direction: column; gap: 12px; }
  .panel { padding: 21px; }
  .control-panel { order: 2; }
  .body-panel { order: 1; min-height: 620px; }
  .summary-panel { order: 3; display: flex; }
  .summary-visual { height: 195px; }
  .summary-panel > .primary-button { margin-top: 18px; }
  .privacy-note { justify-content: center; }
  .body-panel-top { padding: 20px 17px 15px; }
  .body-panel h2 { font-size: 19px; }
  .model-settings { padding: 0 17px 16px; gap: 15px; }
  .body-svg { height: 495px; max-height: 495px; }
  .body-stage { min-height: 495px; }
  .stage-label-left { left: 17px; }
  .stage-label-right { right: 17px; }
  .site-footer { gap: 10px; line-height: 1.5; }
  .footer-muted { display: none; }
}
@media (max-width: 520px) {
  .model-settings { grid-template-columns: 1fr; gap: 15px; }
  .gender-toggle button { flex: 1; }
  .model-height-setting input { margin-bottom: 4px; }
}
@media (max-width: 420px) {
  .view-toggle button { padding: 7px; font-size: 9px; }
  .body-panel h2 { font-size: 18px; }
  .body-panel-top { align-items: end; }
  .stage-tip { padding: 8px; font-size: 9px; }
  .body-panel-bottom { padding: 0 12px; font-size: 10px; }
  .body-panel-bottom button { font-size: 9px; }
  .zoom-tools { top: 9px; right: 9px; }
  .zoom-tools button:last-child { padding: 0 5px; font-size: 8px; }
  .dialog-actions { grid-template-columns: 1fr; }
  .dialog-content { padding: 25px; }
}

/* Navigation back to the module overview. */
.hive-demo-nav { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px clamp(20px, 3.5vw, 50px); background: #171717; color: #e9e7df; font-size: 12px; line-height: 1.5; }
.hive-demo-nav a { color: inherit; text-decoration: none; flex-shrink: 0; }
.hive-demo-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.hive-demo-nav a:focus-visible { outline: 2px solid #f59e0b; outline-offset: 4px; }
.hive-demo-label { color: #f9c15c; margin-left: 12px; }
@media (max-width: 480px) { .hive-demo-nav { gap: 12px; font-size: 11px; } .hive-demo-label { margin-left: 6px; } }
