/* דירומה — layout: a calm architectural sheet. Paper ground, blueprint ink, one coral accent for
   the pins people place. Apple-style materials and motion: translucent chrome, press feedback,
   springs that settle without bouncing. */
:root {
  --paper: #f5f3ee;
  --sheet: #ffffff;
  --ink: #16202c;
  --muted: #5d6877;
  --line: rgba(22, 32, 44, 0.12);
  --blue: #2b5c8a;
  --blue-soft: #e6eef6;
  --accent: #e2583a;
  --accent-soft: #fbe9e3;
  --good: #23885a; --warn: #b7791f; --bad: #c0392b; --info: #2b5c8a;
  --mat: rgba(255, 255, 255, 0.7);
  --shadow-sm: 0 1px 2px rgba(16, 24, 34, 0.06), 0 6px 18px rgba(16, 24, 34, 0.08);
  --shadow-lg: 0 2px 6px rgba(16, 24, 34, 0.06), 0 24px 60px rgba(16, 24, 34, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Hebrew", system-ui, "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
  --spring: linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%, 0.849 31.5%, 0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.9%, 1);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
button, a.btn, .tradeBtn, .typeBtn, .item, .pin { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@media (pointer: coarse) { .f input, .f select, .f textarea, .respRow select, .respRow input { font-size: 16px; } }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }

/* brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; flex: none; }

/* buttons: feedback on press, spring back on release */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 12px 22px; font-weight: 600; text-decoration: none; background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); transition: transform 0.45s var(--spring), background-color 0.2s ease, box-shadow 0.2s ease; }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: #24313f; } }
.btn:active { transform: scale(0.96); transition: transform 0.1s ease-out; }
.btn.accent { background: var(--accent); }
@media (hover: hover) and (pointer: fine) { .btn.accent:hover { background: #cf4b2f; } }
.btn.ghost { background: var(--sheet); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) and (pointer: fine) { .btn.ghost:hover { background: #f9f8f5; } }
.btn.small { padding: 8px 14px; border-radius: 11px; font-size: 14px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ------------------------------------------------------------ landing */
.top { position: sticky; top: 0; z-index: 10; background: rgba(245, 243, 238, 0.72); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.top nav { display: flex; gap: 22px; align-items: center; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .top nav a:hover { color: var(--ink); } }
.hero { padding-block: 64px 40px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--accent); }
.hero h1 { font-size: clamp(36px, 5.4vw, 60px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; margin-top: 10px; }
.hero p.lede { font-size: 19px; color: var(--muted); max-width: 36ch; margin: 18px 0 26px; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .note { font-size: 13px; color: var(--muted); margin-top: 14px; }
.heroArt { position: relative; aspect-ratio: 5 / 4; border-radius: 28px; background: var(--sheet); box-shadow: var(--shadow-lg); overflow: hidden; }
.heroArt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.heroArt .pin { position: absolute; }
.heroArt .chipFloat { position: absolute; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: var(--mat); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); box-shadow: var(--shadow-sm); font-size: 13.5px; font-weight: 600; }
section.band { padding-block: 56px; }
section.band h2 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.025em; line-height: 1.12; }
section.band .sub { color: var(--muted); font-size: 18px; max-width: 60ch; margin: 12px 0 28px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cardL { background: var(--sheet); border-radius: 22px; padding: 24px; box-shadow: var(--shadow-sm); display: grid; gap: 8px; align-content: start; }
.cardL h3 { font-size: 19px; letter-spacing: -0.01em; }
.cardL p { margin: 0; color: var(--muted); font-size: 15.5px; }
.cardL .num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-weight: 700; font-variant-numeric: tabular-nums; }
.side2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.side2 .cardL ul { margin: 6px 0 0; padding-inline-start: 18px; color: var(--muted); }
.side2 .cardL li { margin-block: 4px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); justify-self: start; }
.tag.coral { background: var(--accent-soft); color: var(--accent); }
.vision { background: var(--ink); color: #fff; border-radius: 28px; padding: 40px clamp(20px, 5vw, 56px); display: grid; gap: 14px; }
.vision h2 { color: #fff; }
.vision p { color: rgba(255, 255, 255, 0.78); font-size: 18px; margin: 0; max-width: 62ch; }
footer { padding-block: 36px 48px; color: var(--muted); font-size: 13.5px; display: grid; gap: 8px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-block: 36px 20px; gap: 28px; }
  .grid3, .grid2, .side2 { grid-template-columns: 1fr; }
  .top nav a:not(.btn) { display: none; }
}

/* ------------------------------------------------------------ app */
.appTop { position: sticky; top: 0; z-index: 20; background: rgba(245, 243, 238, 0.76); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); border-bottom: 0.5px solid var(--line); }
.appTop .wrap { max-width: 1400px; display: flex; align-items: center; gap: 16px; padding-block: 10px; }
.appTop .title { display: grid; min-width: 0; flex: 1; }
.appTop .title b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appTop .title small { color: var(--muted); font-size: 12.5px; }
.steps { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: rgba(22, 32, 44, 0.06); }
.steps button { border: 0; background: transparent; border-radius: 10px; padding: 7px 14px; font-size: 14px; font-weight: 600; color: var(--muted); transition: background-color 0.2s, color 0.2s, transform 0.45s var(--spring); }
.steps button:active { transform: scale(0.96); }
.steps button.on { background: var(--sheet); color: var(--ink); box-shadow: var(--shadow-sm); }
.saveState { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.saveState.err { color: var(--bad); }
main.app { max-width: 1400px; margin: 0 auto; padding: 20px; }
.panel { background: var(--sheet); border-radius: 22px; box-shadow: var(--shadow-sm); padding: 22px; }
.panel h2 { font-size: 22px; letter-spacing: -0.015em; }
.panel .sub { color: var(--muted); margin: 6px 0 18px; font-size: 15px; }
.form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.form .full { grid-column: 1 / -1; }
label.f { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
.f input, .f select, .f textarea { width: 100%; border: 0; border-radius: 11px; padding: 10px 12px; background: #f3f2ee; box-shadow: inset 0 0 0 1px transparent; font-weight: 400; color: var(--ink); font-size: 15px; transition: box-shadow 0.15s, background-color 0.15s; }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 1.5px var(--blue); }
.f textarea { min-height: 70px; resize: vertical; }
.sectionT { font-size: 15px; font-weight: 700; margin: 22px 0 10px; }
.deadlines { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; }
.keyBox { margin-top: 18px; display: grid; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--blue-soft); font-size: 14px; }
.keyBox .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.keyBox code { direction: ltr; unicode-bidi: isolate; background: #fff; padding: 4px 8px; border-radius: 8px; font-size: 12.5px; overflow-wrap: anywhere; }

/* workspace */
.work { display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.palette, .side { position: sticky; top: 72px; max-height: calc(100vh - 92px); overflow: auto; }
.trades { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tradeBtn { border: 0; border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; background: #f1f0ec; display: inline-flex; align-items: center; gap: 6px; transition: transform 0.45s var(--spring), background-color 0.2s; }
.tradeBtn i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.tradeBtn.on { background: var(--ink); color: #fff; }
.tradeBtn:active, .typeBtn:active { transform: scale(0.96); }
.types { display: grid; gap: 6px; }
.typeBtn { border: 0; text-align: start; border-radius: 12px; padding: 10px 12px; background: #f7f6f2; font-size: 14.5px; display: flex; justify-content: space-between; gap: 8px; transition: transform 0.45s var(--spring), background-color 0.15s, box-shadow 0.15s; }
.typeBtn small { color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .typeBtn:hover { background: #efeee8; } }
.typeBtn.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.hintBar { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.placing .hintBar { color: var(--accent); font-weight: 600; }

.planBox { position: relative; background: var(--sheet); border-radius: 22px; box-shadow: var(--shadow-sm); overflow: hidden; }
.planTools { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 0.5px solid var(--line); flex-wrap: wrap; }
.planTools .filters { display: flex; gap: 6px; flex-wrap: wrap; }
.planStage { position: relative; overflow: auto; max-height: calc(100vh - 170px); touch-action: pan-x pan-y; }
.planInner { position: relative; transform-origin: 0 0; }
.planInner img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.placing .planInner { cursor: crosshair; }
.pin { position: absolute; transform: translate(-50%, -50%); min-width: 26px; height: 26px; padding: 0 6px; border-radius: 99px; border: 2px solid #fff; background: var(--c, var(--accent)); color: #fff; font: 700 11.5px/22px var(--font); text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28); cursor: grab; touch-action: none; transition: transform 0.4s var(--spring), box-shadow 0.2s; z-index: 1; white-space: nowrap; direction: ltr; }
@media (hover: hover) and (pointer: fine) { .pin:hover { transform: translate(-50%, -50%) scale(1.12); } }
.pin.sel { transform: translate(-50%, -50%) scale(1.25); box-shadow: 0 0 0 4px rgba(226, 88, 58, 0.3), 0 4px 10px rgba(0, 0, 0, 0.3); z-index: 2; }
.pin.dim { opacity: 0.18; pointer-events: none; }
.pin.dragging { cursor: grabbing; transition: none; }
.emptyPlan { display: grid; place-items: center; gap: 14px; padding: 48px 20px; text-align: center; color: var(--muted); }
.emptyPlan .btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.items { display: grid; gap: 6px; }
.item { border: 0; text-align: start; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; background: #f7f6f2; transition: background-color 0.15s, transform 0.45s var(--spring); }
.item:active { transform: scale(0.98); }
.item.sel { background: var(--accent-soft); }
.item .code { min-width: 34px; height: 24px; border-radius: 8px; background: var(--c); color: #fff; font: 700 12px/24px var(--font); text-align: center; direction: ltr; }
.item b { font-size: 14px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item small { color: var(--muted); font-size: 12.5px; }
.badges { display: flex; gap: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.good { background: var(--good); } .dot.info { background: var(--info); }
.editor { margin-top: 14px; display: grid; gap: 12px; padding-top: 14px; border-top: 0.5px solid var(--line); }
.editor .head { display: flex; align-items: center; gap: 10px; }
.editor .head .code { font-size: 14px; min-width: 42px; height: 28px; line-height: 28px; border-radius: 9px; background: var(--c); color: #fff; font-weight: 700; text-align: center; direction: ltr; }
.editor .head b { flex: 1; font-size: 16px; }
.editor .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.warns { display: grid; gap: 6px; }
.warn { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: #fdf3e2; color: #8a5a12; }
.warn.bad { background: #fbe7e4; color: #9b2c20; }
.resp { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); }
.editor .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.linkBtn { border: 0; background: none; color: var(--bad); font-size: 13.5px; padding: 6px 0; }

/* 360 viewer */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(16, 24, 34, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn 0.25s ease; }
.modal .box { width: min(1100px, 100%); height: min(680px, 86vh); border-radius: 24px; overflow: hidden; position: relative; background: #000; box-shadow: var(--shadow-lg); animation: rise 0.5s var(--spring); }
.modal canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.modal .bar { position: absolute; top: 12px; inset-inline: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal .pill { padding: 7px 14px; border-radius: 99px; background: var(--mat); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); font-weight: 600; font-size: 14px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } }

/* report */
.repTabs { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.repActs { display: flex; gap: 8px; flex-wrap: wrap; }
.report { background: var(--sheet); border-radius: 22px; box-shadow: var(--shadow-sm); padding: 32px clamp(18px, 4vw, 44px); }
.rHead { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 16px; margin-bottom: 20px; }
.rHead h1 { font-size: 26px; letter-spacing: -0.02em; }
.rHead .meta { color: var(--muted); font-size: 14px; }
.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.kv div { background: #f7f6f2; border-radius: 12px; padding: 10px 12px; }
.kv small { display: block; color: var(--muted); font-size: 12px; }
.kv b { font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.stats div { border-radius: 14px; padding: 12px 14px; background: var(--blue-soft); }
.stats b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats small { color: var(--muted); font-size: 13px; }
.rPlan { position: relative; border-radius: 14px; overflow: hidden; border: 0.5px solid var(--line); margin-bottom: 22px; }
.rPlan img { display: block; width: 100%; height: auto; }
.rPlan .pin { cursor: default; transition: none; }
@media (hover: hover) and (pointer: fine) { .rPlan .pin:hover { transform: translate(-50%, -50%); } }
.report h2 { font-size: 19px; margin: 24px 0 10px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.report h2 i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 8px; border-bottom: 0.5px solid var(--line); vertical-align: top; }
.tbl .code { direction: ltr; unicode-bidi: isolate; font-weight: 700; color: var(--c); white-space: nowrap; }
.tblWrap { overflow-x: auto; }
.st { font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.st.good { background: #e3f3eb; color: var(--good); } .st.warn { background: #fdf3e2; color: var(--warn); } .st.bad { background: #fbe7e4; color: var(--bad); } .st.info { background: var(--blue-soft); color: var(--info); } .st.none { background: #f1f0ec; color: var(--muted); }
.legal { margin-top: 24px; padding: 14px 16px; border-radius: 14px; background: #f7f6f2; font-size: 13px; color: var(--muted); display: grid; gap: 6px; }
.signs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; margin-top: 36px; }
.signs div { border-top: 1px solid var(--ink); padding-top: 6px; font-size: 13px; color: var(--muted); }
.respRow { display: grid; grid-template-columns: 1.2fr 0.8fr 1.4fr; gap: 6px; }
.respRow select, .respRow input { width: 100%; border: 0; border-radius: 9px; padding: 7px 8px; background: #f3f2ee; font-size: 13.5px; }
.tradePage { break-before: page; }
.reviewBar { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--blue-soft); margin-bottom: 16px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(10px); padding: 10px 18px; border-radius: 14px; background: rgba(22, 32, 44, 0.86); color: #fff; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.45s var(--spring); z-index: 60; backdrop-filter: blur(20px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1100px) {
  .work { grid-template-columns: 1fr; }
  .palette, .side { position: static; max-height: none; }
  .planStage { max-height: 70vh; }
}
@media (max-width: 760px) {
  .form, .deadlines, .kv, .stats { grid-template-columns: 1fr 1fr; }
  .appTop .wrap { flex-wrap: wrap; }
  .steps { order: 3; width: 100%; justify-content: space-between; }
  .steps button { flex: 1; padding: 7px 6px; }
  main.app { padding: 12px; }
  .respRow { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; } }
@media (prefers-reduced-transparency: reduce) { .top, .appTop, .modal .pill, .toast { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; } }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .appTop, .repTabs, .noPrint, .toast { display: none !important; }
  main.app { padding: 0; max-width: none; }
  .report { box-shadow: none; padding: 0; border-radius: 0; }
  .tbl tr { break-inside: avoid; }
  .rPlan { break-inside: avoid; }
  .stats div, .kv div { background: #f4f4f4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pin, .st, .code, .report h2 i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .respRow select, .respRow input { display: none; }
}
