/* ============================================================
   SAKHTEMAN-E JAROUN — chegall
   Brutalist / architectural design system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800;900&family=Space+Mono:wght@400;700&family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

/* --- Gozaar (گذار) — proprietary, licensed by user --- */
@font-face {
  font-family: 'Gozaar'; font-weight: 200; font-style: normal; font-display: swap;
  src: url('assets/fonts/GozaarNoneenglish-ExtraLight.ttf') format('truetype');
}
@font-face {
  font-family: 'Gozaar'; font-weight: 300; font-style: normal; font-display: swap;
  src: url('assets/fonts/GozaarNoneenglish-Light.ttf') format('truetype');
}
@font-face {
  font-family: 'Gozaar'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('assets/fonts/GozaarNoneenglish-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Gozaar'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('assets/fonts/GozaarNoneenglish-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Gozaar'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('assets/fonts/GozaarNoneenglish-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Gozaar'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('assets/fonts/GozaarNoneenglish-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Gozaar'; font-weight: 800; font-style: normal; font-display: swap;
  src: url('assets/fonts/GozaarNoneenglish-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Gozaar'; font-weight: 900; font-style: normal; font-display: swap;
  src: url('assets/fonts/GozaarNoneenglish-Bold.ttf') format('truetype');
}
/* Persian numerals cut */
@font-face {
  font-family: 'GozaarNum'; font-weight: 400 700; font-style: normal; font-display: swap;
  src: url('assets/fonts/GozaarFarsiNumerals-SemiBold.ttf') format('truetype');
}

:root {
  /* DIRECTION A — Cream / brutalist (default) */
  --bg:        #ECE7DD;
  --bg-2:      #E3DDD1;
  --ink:       #16140F;
  --ink-2:     #4a463d;
  --red:       #E1251B;
  --paper:     #F3EFE7;
  --line:      rgba(22,20,15,0.16);
  --line-2:    rgba(22,20,15,0.30);
  --muted:     rgba(22,20,15,0.52);
  --invert-bg: #16140F;
  --invert-ink:#ECE7DD;

  --fa:      'GozaarNum', 'Gozaar', 'Vazirmatn', sans-serif;
  --display: 'Archivo', 'Vazirmatn', sans-serif;
  --mono:    'Space Mono', monospace;

  --ease: cubic-bezier(.22,.61,.36,1);
  --gut: clamp(20px, 4vw, 64px);
}

/* DIRECTION B — Dark editorial */
[data-dir="dark"] {
  --bg:        #131210;
  --bg-2:      #1c1a16;
  --ink:       #EDE9E0;
  --ink-2:     #b7b1a4;
  --red:       #F0392B;
  --paper:     #1c1a16;
  --line:      rgba(237,233,224,0.16);
  --line-2:    rgba(237,233,224,0.32);
  --muted:     rgba(237,233,224,0.55);
  --invert-bg: #EDE9E0;
  --invert-ink:#131210;
}

/* DIRECTION C — High-contrast mono */
[data-dir="mono"] {
  --bg:        #FFFFFF;
  --bg-2:      #F2F2F2;
  --ink:       #0A0A0A;
  --ink-2:     #444;
  --red:       #FF2D16;
  --paper:     #FFFFFF;
  --line:      rgba(10,10,10,0.20);
  --line-2:    rgba(10,10,10,0.45);
  --muted:     rgba(10,10,10,0.5);
  --invert-bg: #0A0A0A;
  --invert-ink:#FFFFFF;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--fa);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  transition: background .6s var(--ease), color .6s var(--ease);
}

#root { height: 100vh; width: 100vw; }

.mono { font-family: var(--mono); }
.en   { direction: ltr; unicode-bidi: isolate; }

::selection { background: var(--red); color: #fff; }

/* tiny grain / texture overlay */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9000;
  opacity: .045; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-dir="dark"] .grain { mix-blend-mode: screen; opacity: .06; }

/* ---- shared chrome ---- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gut);
  mix-blend-mode: var(--bar-blend, normal);
}
.brand-logo { height: clamp(18px, 2.4vw, 28px); width: auto; mix-blend-mode: multiply; }
[data-dir="dark"] .brand-logo,
[data-dir="mono"] .brand-logo { display: none; }
.brand-text {
  font-family: var(--mono); font-weight: 700; font-size: 22px;
  letter-spacing: -1px; color: var(--logo-col, var(--ink)); display: none;
}
[data-dir="dark"] .brand-text,
[data-dir="mono"] .brand-text { display: block; }

.kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted);
}

.hairline { height: 1px; background: var(--line); width: 100%; }

/* buttons */
.btn {
  font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px;
  text-transform: uppercase; cursor: pointer; border: none; background: none;
  color: var(--ink); display: inline-flex; align-items: center; gap: 10px;
  transition: gap .3s var(--ease), color .3s var(--ease);
}
.btn:hover { gap: 16px; color: var(--red); }
.btn .arrow { display: inline-block; transition: transform .3s var(--ease); }

.btn-solid {
  background: var(--red); color: #fff; padding: 14px 26px;
  border-radius: 0;
}
.btn-solid:hover { color: #fff; }

button { font: inherit; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: fixed; inset: 0; overflow: hidden; background: #0b0a08; }
.hero-img {
  position: absolute; inset: -4%;
  transition: transform 1.6s var(--ease), opacity 1.6s var(--ease);
  opacity: 0;
}
.hero-img.in { opacity: 1; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(0.15) contrast(1.04); }
.hero-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(11,10,8,.55) 0%, rgba(11,10,8,0) 26%, rgba(11,10,8,0) 60%, rgba(11,10,8,.66) 100%);
}

.hero-frame {
  position: fixed; inset: 18px; border: 1px solid rgba(236,231,221,.32);
  pointer-events: none; z-index: 5;
}

/* left legibility scrim */
.hero-scrim {
  position: fixed; top: 0; bottom: 0; right: 0; width: min(56%, 760px); z-index: 6;
  background: linear-gradient(270deg, rgba(11,10,8,.82) 0%, rgba(11,10,8,.62) 40%, rgba(11,10,8,.18) 80%, rgba(11,10,8,0) 100%);
  opacity: 0; transition: opacity 1.4s var(--ease);
}
.hero-scrim.in { opacity: 1; }

.hero-meta { position: fixed; z-index: 10; opacity: 0; transform: translateY(8px); transition: all 1s var(--ease) .5s; }
.hero-meta.in { opacity: 1; transform: none; }
.hero-meta .kicker { color: rgba(236,231,221,.82); }
.hero-meta.tr { top: 40px; left: 40px; text-align: left; display: flex; flex-direction: column; gap: 6px; }

/* left content column */
.hero-left {
  position: fixed; z-index: 10; top: 50%; right: var(--gut); transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-start; text-align: right;
  max-width: min(48vw, 620px);
}
.hero-en {
  font-family: var(--mono); font-size: 13px; letter-spacing: 5px; color: rgba(236,231,221,.72);
  opacity: 0; transform: translateY(14px); transition: all 1s var(--ease) .35s;
}
.hero-en.in { opacity: 1; transform: none; }
.hero-title {
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.06;
  color: #f3efe7; font-family: var(--fa); font-weight: 800;
  font-size: clamp(46px, 6.2vw, 112px); letter-spacing: -2px; margin: 10px 0;
  text-shadow: 0 2px 40px rgba(0,0,0,.5);
}
.hero-title span { display: block; padding: 0.04em 0.04em 0.02em; }
.hero-title span:nth-child(1) {
  opacity: 0; transform: translateY(40%); transition: all 1.1s var(--ease) .45s;
  font-size: .42em; font-weight: 400; letter-spacing: 4px; color: rgba(243,239,231,.86);
}
.hero-title span:nth-child(2) {
  opacity: 0; transform: translateY(40%); transition: all 1.1s var(--ease) .6s;
}
.hero-title.in span { opacity: 1; transform: none; }
.hero-title .accent { color: #f3efe7; position: relative; }
.hero-title .accent::after {
  content: ''; position: absolute; left: 6%; right: 6%; bottom: .12em; height: 10px;
  background: var(--red); z-index: -1; transform: scaleX(0); transform-origin: right;
  transition: transform 1s var(--ease) 1.1s;
}
.hero-title.in .accent::after { transform: scaleX(1); }

.hero-line2 {
  font-family: var(--mono); font-size: 13px; letter-spacing: 3px; color: rgba(236,231,221,.78);
  opacity: 0; transform: translateY(14px); transition: all 1s var(--ease) .7s;
}
.hero-line2.in { opacity: 1; transform: none; }

.hero-enter {
  margin-top: 30px; color: #f3efe7; padding: 16px 30px; border: 1px solid rgba(243,239,231,.5);
  font-family: var(--mono); opacity: 0; transform: translateY(14px);
  transition: opacity 1s var(--ease) .85s, transform 1s var(--ease) .85s, background .3s var(--ease), gap .3s var(--ease), border-color .3s var(--ease);
}
.hero-enter.in { opacity: 1; transform: none; }
.hero-enter:hover { background: var(--red); border-color: var(--red); color: #fff; }

.hero-scroll {
  position: fixed; bottom: 40px; left: 40px; z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  opacity: 0; transition: opacity 1s var(--ease) 1.2s;
}
.hero-scroll.in { opacity: 1; }
.hero-scroll .kicker { color: rgba(236,231,221,.7); }
.scroll-line { width: 1px; height: 46px; background: linear-gradient(rgba(236,231,221,.7), transparent); animation: scrolldrop 2s var(--ease) infinite; }
@keyframes scrolldrop { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 50.1% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ============================================================
   SHARED SCREEN CHROME
   ============================================================ */
.screen { position: fixed; inset: 0; padding-top: 72px; display: flex; flex-direction: column;
  animation: scrfade .6s var(--ease); }
@keyframes scrfade { from { opacity: 0; } to { opacity: 1; } }

.crumb { display: flex; align-items: center; gap: 10px; font-size: 11px; letter-spacing: 1px; }
.crumb button { color: var(--muted); background: none; border: none; cursor: pointer; transition: color .2s; }
.crumb button:hover, .crumb button.cur { color: var(--ink); }
.crumb button.cur { color: var(--red); }
.crumb span { color: var(--line-2); }

.scr-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px var(--gut) 22px; border-bottom: 1px solid var(--line);
}
.scr-head-mid { text-align: center; }
.scr-title { font-family: var(--fa); font-weight: 800; font-size: clamp(26px, 3vw, 40px); letter-spacing: -1px; margin-top: 2px; }

/* ============================================================
   FLOOR SELECT
   ============================================================ */
.fs-body { flex: 1; display: grid; grid-template-columns: 1.05fr 1fr; min-height: 0; }
.fs-stack { display: flex; flex-direction: column; justify-content: safe center; padding: clamp(20px,3vw,50px) var(--gut); gap: 0; overflow-y: auto; }
.fs-floor {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 22px;
  padding: clamp(10px, 1.6vh, 20px) 6px; border-bottom: 1px solid var(--line);
  background: none; border-left: none; border-right: none; border-top: none;
  cursor: pointer; text-align: right; position: relative; transition: padding .35s var(--ease), color .35s var(--ease);
}
.fs-floor:first-child { border-top: 1px solid var(--line); }
.fs-floor::before { content: ''; position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease); z-index: -1; }
.fs-floor.hov { padding-right: 26px; padding-left: 26px; color: var(--invert-ink); }
.fs-floor.hov::before { transform: scaleX(1); }
.fs-floor.active { color: var(--red); }
.fs-floor.active.hov { color: var(--invert-ink); }
.fs-num { font-size: clamp(28px, 4vw, 52px); font-weight: 700; line-height: 1; opacity: .85; }
.fs-fa { font-size: clamp(18px, 2vw, 26px); font-weight: 600; }
.fs-tag { font-size: 12px; letter-spacing: 0; opacity: .55; }
.fs-arrow { font-size: 20px; opacity: 0; transform: translateX(8px); transition: all .35s var(--ease); }
.fs-floor.hov .fs-arrow { opacity: 1; transform: none; }
.fs-base { padding: 14px 6px; opacity: .5; }

/* صفحات کوتاه (لپ‌تاپ) — فشرده‌سازی تا همهٔ طبقات جا شوند */
@media (max-height: 860px) {
  .fs-floor { padding: clamp(7px, 1.1vh, 13px) 6px; gap: 16px; }
  .fs-num { font-size: clamp(24px, 3vw, 38px); }
  .fs-fa  { font-size: clamp(16px, 1.8vw, 22px); }
  .fs-stack { padding: clamp(12px,2vw,28px) var(--gut); justify-content: safe center; }
  .scr-head { padding: 16px var(--gut) 14px; }
  .scr-title { font-size: clamp(22px, 2.4vw, 32px); }
}
@media (max-height: 680px) {
  .fs-floor { padding: 6px 6px; gap: 12px; }
  .fs-num { font-size: 22px; }
  .fs-base { padding: 8px 6px; }
}

.fs-preview { background: var(--bg-2); border-right: 1px solid var(--line); display: flex; align-items: center; justify-content: center; padding: clamp(20px,3vw,56px); }
.fs-prev-card { width: 100%; max-width: 460px; }
.fs-prev-plan { position: relative; aspect-ratio: 1800/2548; max-height: 56vh; margin: 0 auto; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.fs-prev-plan img { width: 100%; height: 100%; object-fit: cover; object-position: top; mix-blend-mode: multiply; display: block; }
[data-dir="dark"] .fs-prev-plan img { mix-blend-mode: screen; filter: invert(1); }
.fs-prev-veil { position: absolute; inset: 0; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.fs-prev-meta { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.fs-prev-fa { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.fs-prev-row { display: flex; gap: 10px; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.fs-prev-cta { margin-top: 12px; }

/* ============================================================
   FLOOR PLAN + PINS
   ============================================================ */
.fp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 360px; }
.fp-stage { position: relative; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: clamp(16px,2vw,40px) clamp(24px,3vw,52px); background: var(--bg); }
.fp-plan-wrap { position: relative; display: inline-flex; height: 100%; max-width: 100%; align-items: center; justify-content: center; }
.fp-plan-img { height: 100%; max-width: 100%; width: auto; object-fit: contain; display: block; }
[data-dir="dark"] .fp-plan-img { filter: invert(0.92) hue-rotate(180deg); }

/* red selection pins placed over the plan at each unit */
.unitpin {
  position: absolute; transform: translate(-50%, -50%);
  background: none; border: none; padding: 0; cursor: pointer; z-index: 3;
  line-height: 1;
}
.unitpin-dot {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: clamp(30px, 3.2vw, 40px); height: clamp(30px, 3.2vw, 40px); border-radius: 50%;
  background: var(--red); color: #fff; font-weight: 700; font-size: clamp(13px, 1.5vw, 16px);
  border: 2px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.3);
  transition: transform .25s var(--ease), background .25s, box-shadow .25s;
}
.unitpin-dot::after {
  content: ''; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid var(--red); animation: pinpulse 2.6s var(--ease) infinite; pointer-events: none;
}
@keyframes pinpulse {
  0%   { transform: scale(1);   opacity: .65; }
  70%  { transform: scale(2);   opacity: 0; }
  100% { opacity: 0; }
}
.unitpin:hover .unitpin-dot { transform: scale(1.16); }
.unitpin.on .unitpin-dot { background: var(--ink); box-shadow: 0 5px 20px rgba(0,0,0,.45); transform: scale(1.16); }
.unitpin.on .unitpin-dot::after { display: none; }

.fp-side { background: var(--bg); border-right: 1px solid var(--line); padding: 26px var(--gut) 20px; display: flex; flex-direction: column; min-height: 0; }
.fp-hint { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 12px 0 18px; }
.fp-list { list-style: none; display: flex; flex-direction: column; overflow-y: auto; flex: 1; }
.fp-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 14px 8px; border-bottom: 1px solid var(--line); cursor: pointer;
  transition: padding .25s var(--ease), background .25s; position: relative;
}
.fp-row:first-child { border-top: 1px solid var(--line); }
.fp-row-no { font-size: 22px; font-weight: 700; width: 44px; }
.fp-row-area { font-size: 11px; color: var(--muted); letter-spacing: .5px; }
.fp-row-arrow { opacity: 0; transform: translateX(6px); transition: all .25s var(--ease); color: var(--red); }
.fp-row:hover { padding-right: 16px; background: var(--bg-2); }
.fp-row:hover .fp-row-arrow, .fp-row.on .fp-row-arrow { opacity: 1; transform: none; }
.fp-row.on { background: var(--bg-2); }
.fp-row.on .fp-row-no { color: var(--red); }
.fp-foot { margin-top: 14px; font-size: 11px; color: var(--muted); letter-spacing: 1px; }

/* ============================================================
   OWNER PANEL (side drawer)
   ============================================================ */
.op-shell {
  position: fixed; top: 0; left: 0; height: 100vh; width: min(440px, 92vw); z-index: 300;
  background: var(--paper); border-right: 1px solid var(--line-2);
  transform: translateX(-100%); transition: transform .5s var(--ease);
  box-shadow: 8px 0 40px rgba(0,0,0,.12); overflow-y: auto;
}
.op-shell.open { transform: none; }
.op-scrim { position: fixed; inset: 0; background: rgba(11,10,8,.28); z-index: 290; opacity: 0; pointer-events: none; transition: opacity .5s; }
.op-scrim.on { opacity: 1; pointer-events: auto; }

.owner-panel { padding: 30px 32px 40px; }
.op-head { display: flex; align-items: flex-start; justify-content: space-between; }
.op-unit { font-size: 56px; font-weight: 700; line-height: 1; margin-top: 4px; }
.op-x { font-size: 30px; line-height: 1; background: none; border: none; cursor: pointer; color: var(--muted); transition: color .2s, transform .2s; }
.op-x:hover { color: var(--red); transform: rotate(90deg); }
.op-divider { height: 1px; background: var(--line); margin: 22px 0; }
.op-label { margin-bottom: 12px; }
.op-name { display: flex; align-items: center; gap: 12px; background: none; border: none; cursor: pointer; text-align: right; padding: 0; color: var(--ink); transition: color .25s, gap .25s; }
.op-name span:first-child { font-size: 34px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; border-bottom: 2px solid transparent; transition: border-color .25s; }
.op-name-arrow { font-size: 22px; color: var(--red); }
.op-name:hover { gap: 18px; }
.op-name:hover span:first-child { border-color: var(--red); }
.op-sub { font-size: 12px; color: var(--muted); margin-top: 10px; letter-spacing: .5px; }

.op-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: 28px 0; background: var(--line); border: 1px solid var(--line); }
.op-stat { background: var(--paper); padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.op-stat-v { font-size: 26px; font-weight: 700; }
.op-stat-v .u { font-size: 12px; font-weight: 400; color: var(--muted); margin-right: 3px; }

.op-status { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; padding: 9px 16px; border: 1px solid var(--line-2); border-radius: 999px; }
.op-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.op-status.paid .dot { background: #1f9d57; } .op-status.paid { color: #1f9d57; border-color: rgba(31,157,87,.4); }
.op-status.progress .dot { background: #d9a019; } .op-status.progress { color: #b9851a; border-color: rgba(217,160,25,.4); }
.op-status.due .dot { background: var(--red); } .op-status.due { color: var(--red); border-color: rgba(225,37,27,.4); }

.op-cta {
  width: 100%; margin-top: 28px; background: var(--red); color: #fff; border: none; cursor: pointer;
  padding: 18px 22px; font-family: var(--fa); font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
  transition: gap .25s, background .25s;
}
.op-cta:hover { background: var(--ink); }
.op-cta .arrow { transition: transform .25s; }
.op-cta:hover .arrow { transform: translateX(-6px); }

.op-name-static { cursor: default; }
.op-private {
  display: flex; align-items: center; gap: 10px;
  width: 100%; margin-top: 28px; padding: 16px 18px;
  border: 1px dashed var(--line); color: var(--muted);
  font-size: 12px; letter-spacing: .5px; line-height: 1.5;
}
.op-private .lockico { color: var(--red); font-size: 14px; }

/* ---- loading / offline ---- */
.app-loading {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: var(--bg);
}
.loading-spinner {
  width: 36px; height: 36px; border: 3px solid var(--line);
  border-top-color: var(--red); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.api-warn {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 11px; letter-spacing: .5px;
  padding: 8px 16px; z-index: 9999; opacity: .75; pointer-events: none;
}



/* ============================================================
   PERSON SHEET (modal)
   ============================================================ */
.sheet-wrap { position: fixed; inset: 0; z-index: 400; background: rgba(11,10,8,.5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 30px; animation: scrfade .35s var(--ease); }
.sheet { position: relative; width: min(920px, 96vw); max-height: 90vh; overflow-y: auto; background: var(--paper); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0,0,0,.4); animation: sheetpop .45s var(--ease); }
@keyframes sheetpop { from { transform: translateY(24px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-x { position: absolute; top: 22px; left: 24px; font-size: 30px; background: none; border: none; cursor: pointer; color: var(--muted); z-index: 2; transition: color .2s, transform .2s; }
.sheet-x:hover { color: var(--red); transform: rotate(90deg); }
.sheet-grid { display: grid; grid-template-columns: 320px 1fr; }
.sheet-id { background: var(--invert-bg); color: var(--invert-ink); padding: 48px 36px; display: flex; flex-direction: column; gap: 16px; }
.sheet-avatar { width: 110px; height: 110px; background: var(--red); display: flex; align-items: center; justify-content: center; position: relative; }
.sheet-initial { font-size: 52px; font-weight: 800; color: #fff; font-family: var(--fa); }
.sheet-avatar-tag { position: absolute; bottom: -10px; right: -10px; background: var(--invert-ink); color: var(--invert-bg); font-size: 9px; letter-spacing: 2px; padding: 5px 9px; }
.sheet-name { font-size: 32px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; margin-top: 8px; }
.sheet-role { font-size: 12px; letter-spacing: 1.5px; opacity: .7; }
.sheet-id .op-status { align-self: flex-start; margin-top: 6px; border-color: rgba(255,255,255,.25); }

.sheet-detail { padding: 48px 40px; }
.sheet-dl { margin: 22px 0 0; display: flex; flex-direction: column; }
.sheet-dl-row { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.sheet-dl-row dt { font-size: 13px; color: var(--muted); }
.sheet-dl-row dd { font-size: 18px; font-weight: 600; }
.sheet-dl-row dd.mono { font-size: 16px; letter-spacing: .5px; }

.sheet-assets { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 28px; }
.sheet-asset { background: var(--paper); padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.sheet-asset-v { font-size: 19px; font-weight: 700; }
.sheet-back { margin-top: 28px; }

/* ============================================================
   TWEAKS PANEL
   ============================================================ */
.tw { position: fixed; bottom: 20px; left: 20px; z-index: 800; width: 244px; background: var(--paper); border: 1px solid var(--line-2); box-shadow: 0 16px 50px rgba(0,0,0,.22); font-family: var(--fa); }
.tw-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tw-head .kicker { color: var(--ink); }
.tw-body { padding: 16px; }
.tw-label { font-size: 11px; color: var(--muted); letter-spacing: 1px; margin-bottom: 10px; font-family: var(--mono); text-transform: uppercase; }
.tw-dirs { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.tw-dir { cursor: pointer; border: 1px solid var(--line-2); padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; background: none; transition: border-color .2s; }
.tw-dir.on { border-color: var(--red); }
.tw-sw { width: 100%; height: 26px; border: 1px solid rgba(0,0,0,.12); }
.tw-dir span { font-size: 10px; font-family: var(--mono); letter-spacing: .5px; }
.tw-fab { position: fixed; bottom: 20px; left: 20px; z-index: 800; width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--bg); border: none; cursor: pointer; font-size: 20px; box-shadow: 0 8px 24px rgba(0,0,0,.25); transition: transform .25s; }
.tw-fab:hover { transform: scale(1.08); }

/* ============================================================
   MANAGER (ADMIN) — login + editable records
   ============================================================ */
.topbar-right { display: flex; align-items: center; gap: 16px; }

.admin-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .5px;
  padding: 8px 14px; border: 1px solid var(--line-2); background: none;
  color: var(--ink); cursor: pointer; border-radius: 999px;
  transition: border-color .25s, color .25s, background .25s;
}
.admin-pill:hover { border-color: var(--red); color: var(--red); }
.admin-pill .lockico { font-size: 12px; }
.admin-pill.on { border-color: var(--red); color: #fff; background: var(--red); }
.admin-pill.on:hover { background: var(--ink); border-color: var(--ink); }
.admin-pill.on .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.25); }

/* ---- login modal ---- */
.login-wrap {
  position: fixed; inset: 0; z-index: 500; background: rgba(11,10,8,.55);
  backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center;
  padding: 30px; animation: scrfade .3s var(--ease);
}
.login-card {
  position: relative; width: min(420px, 94vw); background: var(--paper);
  border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0,0,0,.45);
  padding: 44px 40px 38px; display: flex; flex-direction: column;
  animation: sheetpop .4s var(--ease);
}
.login-card.shake { animation: sheetpop .4s var(--ease), lshake .42s var(--ease); }
@keyframes lshake { 10%,90%{transform:translateX(-2px)} 30%,70%{transform:translateX(5px)} 50%{transform:translateX(-7px)} }
.login-lock {
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff; font-size: 24px; margin-bottom: 22px;
}
.login-title { font-family: var(--fa); font-weight: 800; font-size: 30px; letter-spacing: -.5px; margin: 8px 0 0; }
.login-note { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 12px 0 24px; }
.login-field { display: flex; flex-direction: column; gap: 9px; }
.login-input {
  width: 100%; padding: 15px 16px; font-size: 22px; letter-spacing: 6px;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink);
  outline: none; transition: border-color .2s; text-align: center;
}
.login-input::placeholder { letter-spacing: 6px; color: var(--line-2); }
.login-input:focus { border-color: var(--red); }
.login-input.err { border-color: var(--red); }
.login-err { color: var(--red); font-size: 12.5px; margin-top: 12px; }
.login-cta { margin-top: 24px; }

/* ---- edit affordances ---- */
.edited-tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .5px; color: #1f9d57;
  margin-right: 8px; padding: 3px 8px; border: 1px solid rgba(31,157,87,.4); border-radius: 999px;
}
.sheet-edited {
  font-size: 9.5px; letter-spacing: 2px; color: #6cd49a; margin-top: 4px;
  border: 1px solid rgba(108,212,154,.4); padding: 6px 10px; align-self: flex-start;
}

/* ---- ownership chain (inside the dark id column) ---- */
.owner-rank {
  font-family: var(--mono); font-size: 11px; letter-spacing: .5px;
  color: var(--red); margin-top: 2px;
}
.owner-chain { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.16); }
.owner-chain .kicker { color: rgba(255,255,255,.55); }
.chain-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.chain-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.1); opacity: .62;
}
.chain-item:last-child { border-bottom: none; }
.chain-no {
  width: 22px; height: 22px; flex: none; border: 1px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.chain-name { font-size: 14px; font-weight: 600; flex: 1; }
.chain-item.cur { opacity: 1; }
.chain-item.cur .chain-no { background: var(--red); border-color: var(--red); color: #fff; }
.chain-tag {
  font-family: var(--mono); font-size: 9px; letter-spacing: 1px; color: var(--red);
  border: 1px solid var(--red); padding: 3px 7px;
}

/* ---- transfer (new owner) ---- */
.transfer-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 14px;
  padding: 16px 18px; background: none; border: 1px dashed var(--line-2); color: var(--ink);
  cursor: pointer; text-align: right; font-family: var(--fa);
  transition: border-color .2s, background .2s, gap .2s;
}
.transfer-btn:hover { border-color: var(--red); background: var(--bg-2); }
.transfer-btn span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.transfer-btn strong { font-size: 14.5px; font-weight: 700; }
.transfer-sub { font-size: 11.5px; color: var(--muted); }
.transfer-btn .plus {
  width: 34px; height: 34px; flex: none; background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.transfer-btn .arrow { color: var(--red); }
.transfer-max {
  margin-top: 14px; padding: 14px; text-align: center; font-size: 11px; letter-spacing: 1px;
  color: var(--muted); border: 1px dashed var(--line-2);
}
.transfer-hint {
  font-size: 13px; color: var(--muted); line-height: 1.85; margin: 18px 0 6px;
  padding: 14px 16px; background: var(--bg-2); border-right: 2px solid var(--red);
}
.sheet-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.edit-btn {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--fa); font-size: 13px;
  padding: 7px 14px; border: 1px solid var(--line-2); background: none; color: var(--ink);
  cursor: pointer; transition: border-color .2s, color .2s;
}
.edit-btn:hover { border-color: var(--red); color: var(--red); }

.sheet-dl-row.edit { grid-template-columns: 180px 1fr; align-items: center; }
.edit-input {
  width: 100%; padding: 11px 13px; font-family: var(--fa); font-size: 16px;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink);
  outline: none; transition: border-color .2s; text-align: right;
}
.edit-input.en { text-align: left; }
.edit-input:focus { border-color: var(--red); background: var(--paper); }
.edit-area { resize: vertical; line-height: 1.7; min-height: 56px; }

.edit-status { display: flex; flex-wrap: wrap; gap: 8px; }
.edit-status-btn {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--fa); font-size: 12.5px;
  padding: 8px 13px; border: 1px solid var(--line-2); background: none; color: var(--muted);
  cursor: pointer; border-radius: 999px; transition: all .2s;
}
.edit-status-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.edit-status-btn.paid .dot { background: #1f9d57; }
.edit-status-btn.progress .dot { background: #d9a019; }
.edit-status-btn.due .dot { background: var(--red); }
.edit-status-btn.on { color: var(--ink); border-color: var(--ink); }
.edit-status-btn.on.paid { border-color: #1f9d57; color: #1f9d57; }
.edit-status-btn.on.progress { border-color: #b9851a; color: #b9851a; }
.edit-status-btn.on.due { border-color: var(--red); color: var(--red); }

.note-text { font-size: 15px; font-weight: 500; line-height: 1.7; }
.note-row dd { color: var(--ink-2); }

.edit-bar { display: flex; align-items: center; gap: 14px; margin-top: 28px; }
.edit-save { flex: 1; }
.edit-cancel { color: var(--muted); }
.edit-cancel:hover { color: var(--red); }

.sheet-foot { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.sheet-foot .sheet-back { margin-top: 0; white-space: nowrap; }
.sheet-edit-cta { margin-top: 0; flex: 1; }

/* responsive */
@media (max-width: 900px) {
  .fs-body { grid-template-columns: 1fr; }
  .fs-preview { display: none; }
  .fp-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .fp-stage { padding: 14px clamp(48px,14vw,72px); }
  .fp-side { border-right: none; border-top: 1px solid var(--line); max-height: 38vh; }
  .sheet-grid { grid-template-columns: 1fr; }
  .sheet-assets { grid-template-columns: repeat(2,1fr); }
}

/* short laptop screens — keep the hero title fully visible */
@media (max-height: 860px) {
  .hero-title { font-size: clamp(42px, 8vh, 92px); margin: 8px 0; }
  .hero-left { max-width: min(56vw, 620px); }
  .hero-enter { margin-top: 20px; padding: 13px 26px; }
}
@media (max-height: 680px) {
  .hero-title { font-size: clamp(38px, 7vh, 74px); }
  .hero-en { font-size: 11px; letter-spacing: 4px; }
}
