/* Replan - design language of i-soa.com: Archivo + Heebo, ink on white, hairlines, 14px corners, pill buttons */
:root {
  --ink: #101010; --paper: #fff; --text: #3a3a3a; --grey: #6b6b6b; --line: #eaeaea; --edge: #cfcfcf; --soft: #fafafa;
  --radius: 14px; --side: 56px; color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Archivo', 'Heebo', sans-serif; background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
html[lang="he"] * { letter-spacing: normal !important; text-transform: none !important; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px var(--side); }
.site-header img { height: 30px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 34px; font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.nav-link:hover { opacity: .55; }
.lang-btn { width: 44px; height: 44px; border: 1.3px solid var(--ink); border-radius: 999px; background: var(--paper); font-size: 12px; font-weight: 700; cursor: pointer; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 12px 28px; border: 1.3px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; }
.btn.solid { background: var(--ink); color: #fff; }
.btn.small { min-height: 44px; padding: 10px 20px; }
.btn:hover { opacity: .75; }

/* hero card */
.hero-wrap { padding: 20px 32px 0; }
.hero { position: relative; min-height: 560px; border-radius: var(--radius); overflow: hidden; background: var(--paper); border: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1.15fr; align-items: end; gap: 24px; padding: 44px 48px; }
.hero-text { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.hero-art { align-self: center; }
.eyebrow { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 28px; height: 1.5px; background: currentColor; }
h1 { font-size: clamp(38px, 5.6vw, 80px); line-height: 1.04; font-weight: 700; letter-spacing: -.03em; text-wrap: balance; }
.hero p { font-size: clamp(16px, 1.4vw, 19px); max-width: 480px; color: var(--text); }
.row { display: flex; flex-wrap: wrap; gap: 12px; }

/* sections */
.step { padding: 72px var(--side) 0; }
.step-head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: 28px; }
.step-head .eyebrow { color: var(--grey); margin-bottom: 14px; }
h2 { font-size: clamp(28px, 3.2vw, 44px); line-height: 1.12; font-weight: 700; letter-spacing: -.025em; text-wrap: balance; }
.step-head p { color: var(--text); max-width: 520px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.pad { padding: 28px; }
.two { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dots { background: var(--soft) radial-gradient(#dadada 1px, transparent 1.2px) 0 0 / 24px 24px; }

/* upload */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 280px; padding: 32px; border: 1.3px dashed var(--ink); border-radius: var(--radius); text-align: center; }
.drop b { font-size: 24px; letter-spacing: -.02em; }
.hint { color: var(--grey); font-size: 14px; }

/* check the detected outline */
.board { padding: 24px; }
.board svg { width: 100%; max-height: 520px; }
.legend { list-style: none; margin: 18px 0 24px; padding: 0; display: grid; }
.legend li { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); font-size: 15px; }
.legend svg { flex: 0 0 34px; width: 34px; height: 18px; }
h3 { font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }

/* requirements */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.field.wide { grid-column: 1 / -1; flex-direction: column; align-items: stretch; gap: 10px; border-bottom: 0; padding-top: 24px; }
.label { font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 44px; height: 44px; border: 1.3px solid var(--ink); border-radius: 999px; background: var(--paper); font-size: 20px; line-height: 1; cursor: pointer; }
.stepper output { min-width: 40px; text-align: center; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.chip { min-height: 44px; padding: 10px 18px; border: 1.3px solid var(--ink); border-radius: 999px; background: var(--paper); font-size: 14px; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.sub { display: block; color: var(--grey); font-size: 14px; font-weight: 400; }
.group { grid-column: 1 / -1; padding-top: 32px; }
textarea, .inp { width: 100%; border: 1px solid #8a8a8a; border-radius: 10px; padding: 12px 14px; background: var(--paper); }
textarea { min-height: 92px; resize: vertical; }
.inp { min-height: 48px; }
.actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 24px; }

/* sign-up */
.signup { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: center; }
.signup .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.signup label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.signup label.full, .signup .full { grid-column: 1 / -1; }
.signup label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }

/* results */
.plan { display: flex; flex-direction: column; }
.plan .sheet { padding: 12px; border-bottom: 1px solid var(--line); }
.plan .sheet svg { width: 100%; }
.plan .pad { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.no { color: var(--grey); font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 16px 0; border-block: 1px solid var(--line); }
.facts div { display: flex; flex-direction: column-reverse; }
.facts dt { color: var(--grey); font-size: 13px; }
.facts dd { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.note { color: var(--grey); font-size: 14px; max-width: 760px; padding-top: 20px; }

footer { margin-top: 96px; padding: 72px var(--side) 40px; background: var(--paper); border-top: 1px solid var(--line); }
.foot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; font-size: 14px; }
.foot-grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.foot-grid img { height: 34px; width: auto; }
.foot-grid .k { color: var(--grey); font-size: 13px; font-weight: 700; }
.foot-grid p { color: var(--text); }
.copy { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--grey); font-size: 13px; }

@media (max-width: 900px) {
  :root { --side: 20px; }
  .site-header { padding-block: 12px; }
  .site-nav { gap: 12px; }
  .site-nav .nav-link { display: none; }
  .hero-wrap { padding: 14px 16px 0; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 28px 22px; }
  .hero-art { order: -1; }
  .hero-art svg { max-height: 240px; margin-inline: auto; }
  .step { padding-top: 56px; }
  .step-head, .two, .pair, .form, .signup { grid-template-columns: minmax(0, 1fr); }
  .step-head { gap: 14px; }
  .signup { gap: 24px; }
  .pad { padding: 20px; }
  .board { padding: 14px; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .signup .fields { grid-template-columns: minmax(0, 1fr); }
  .field { flex-wrap: wrap; }
  .choice { justify-content: flex-start; }
  .actions .btn { width: 100%; }
  .facts dd { font-size: 20px; }
}

.rooms { list-style: none; margin: 0 0 8px; padding: 0; columns: 2; column-gap: 32px; font-size: 15px; }
.rooms li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; break-inside: avoid; }
.rooms b { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .rooms { columns: 1; } }

/* live page */
.hero p.tagline { font-size: clamp(22px, 2.2vw, 32px); font-weight: 600; line-height: 1.25; color: var(--ink); }
[hidden] { display: none !important; }
.step { scroll-margin-top: 60px; }
button:disabled { opacity: .35; cursor: default; }
.wide { width: 100%; }
.link { border: 0; background: none; padding: 10px 4px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.user { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.pickfile { position: relative; overflow: hidden; }
.pickfile input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.pickfile:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }
.drop.over { border-style: solid; background-color: #f0f0f0; }
.pages { display: flex; align-items: center; gap: 10px; }
.pages select { width: auto; }
.msg { min-height: 24px; font-weight: 500; }
.msg.bad { color: #a02020; }
.found { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 4px; font-weight: 500; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.board > .hint { margin-bottom: 12px; min-height: 22px; }
.board .row { margin-top: 12px; }
#board { width: 100%; height: min(70vh, 680px); max-height: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; user-select: none; -webkit-user-select: none; }
#board[data-tool="entrance"], #board[data-tool="window"], #board[data-tool="mamad"], #board[data-tool="wet"], #board[data-tool="draw"], #board[data-tool="step"] { cursor: crosshair; }
#board[data-tool="move"] .grab { cursor: move; touch-action: none; }
#board[data-tool="move"] .grab-x { cursor: ew-resize; touch-action: none; }
#board[data-tool="move"] .grab-y { cursor: ns-resize; touch-action: none; }
#board[data-tool="erase"] [data-window], #board[data-tool="erase"] [data-wet], #board[data-tool="erase"] [data-entrance], #board[data-tool="erase"] [data-mamad] { cursor: pointer; }
.two > .pad { align-self: start; display: grid; gap: 12px; }
.two .legend { margin: 0; }
.more { margin-top: 24px; }
.more summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.more summary::before { content: "+"; margin-inline-end: 10px; font-size: 20px; }
.more[open] summary::before { content: "−"; }
.num { width: 96px; text-align: center; }
.actions .msg { flex: 1 1 260px; }
#results:not(.pair) .plan { max-width: 900px; margin-inline: auto; }
.dialog { width: min(480px, calc(100vw - 32px)); border: 0; border-radius: 22px; padding: 34px 28px 22px; color: var(--ink); box-shadow: 0 24px 70px rgba(0, 0, 0, .3); }
.dialog::backdrop { background: rgba(16, 16, 16, .5); }
.dialog h2 { font-size: 28px; margin-bottom: 8px; padding-inline-end: 40px; }
.dialog form { display: grid; gap: 14px; margin: 18px 0 10px; }
.dialog label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.dialog label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.dialog .x { position: absolute; inset-inline-end: 14px; top: 14px; width: 44px; height: 44px; border: 0; border-radius: 999px; background: #f0f0f0; cursor: pointer; }
.code { font-size: 24px; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { #board { height: 62vh; } .user #userName { display: none; } }

/* v0.3: grouped tools, zoom, size panel and the fixed bar */
body.has-bar { padding-bottom: calc(110px + var(--test-bar, 0px)); }
.toolset { display: grid; gap: 8px; margin-bottom: 12px; }
.toolrow { display: grid; grid-template-columns: 118px 1fr; gap: 10px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.toolrow b { font-size: 14px; line-height: 1.3; }
.toolrow small { display: block; font-weight: 400; color: var(--grey); font-size: 13px; }
.toolrow .tools { margin: 0; gap: 6px; }
.toolrow .chip { padding: 8px 14px; background: #fff; }
.toolrow .chip[aria-pressed="true"] { background: var(--ink); }
.zoom { display: flex; gap: 6px; margin-bottom: 8px; }
.zoom button { min-width: 44px; height: 44px; padding: 0 14px; border: 1.3px solid var(--ink); border-radius: 999px; background: #fff; cursor: pointer; font-weight: 600; }
.size { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.size > b { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; }
.size .more { margin-top: 4px; }
.size .link { justify-self: start; }
.bar { position: fixed; inset-inline: 0; bottom: var(--test-bar, 0px); z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 14px var(--side); background: #fff; border-top: 1.3px solid var(--ink); }
.bar .msg { flex: 1 1 auto; min-height: 0; max-height: 30vh; overflow: auto; }
.bar .btn { white-space: nowrap; }
.barbtns, .tabs { display: flex; align-items: center; gap: 8px; }
.plan { scroll-margin-top: 90px; }
@media (max-width: 900px) {
  .toolrow { grid-template-columns: 1fr; gap: 6px; }
  .bar { flex-direction: column; align-items: stretch; gap: 8px; padding-block: 10px; }
  .barbtns { flex-wrap: wrap; }
  .barbtns #go { flex: 1 1 100%; }
  .tabs { flex: 1 1 100%; }
  .tabs .chip { flex: 1; }
}
.rooms small { display: block; color: var(--grey); font-size: 13px; }
