/* Tashteeby — Plan Studio extras: the estimate assistant, styles + material boards per room, photo renders (before /
   after), share links and the shared-plan page, price history. Builds on css/styles.css tokens. */

/* ================================================================ "Ask about your estimate" */
.as-fab { position: fixed; z-index: 70; inset-inline-end: clamp(14px, 3vw, 28px); bottom: calc(clamp(14px, 3vw, 28px) + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 0.55rem; min-height: 54px; padding: 0 1.2rem 0 1rem; border-radius: 999px; border: 1px solid rgba(245, 207, 111, 0.55); background: linear-gradient(160deg, #13306a, #061534 70%); color: var(--on-navy); font-weight: 700; font-size: 0.95rem; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.85), 0 0 0 6px rgba(232, 181, 71, 0.08); transition: transform 0.25s var(--ease-out), box-shadow 0.25s; }
html[dir="rtl"] .as-fab { padding: 0 1rem 0 1.2rem; }
.as-fab svg { width: 22px; height: 22px; color: var(--gold-300); flex: none; }
.as-fab:hover { transform: translateY(-2px); box-shadow: 0 22px 44px -16px rgba(0, 0, 0, 0.9), 0 0 0 7px rgba(232, 181, 71, 0.14); }
html.as-open .as-fab { opacity: 0; pointer-events: none; }
@media (max-width: 560px) { .as-fab { min-height: 52px; padding: 0 1rem; font-size: 0.88rem; } }
@media print { .as-fab, .as-root, .tb-modal { display: none !important; } }

.as-root { position: fixed; inset: 0; z-index: 95; }
.as-scrim { position: absolute; inset: 0; background: rgba(4, 14, 36, 0.55); backdrop-filter: blur(2px); opacity: 0; transition: opacity 0.22s; }
.as-root.on .as-scrim { opacity: 1; }
.as-drawer { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(440px, 100%); display: grid; grid-template-rows: auto 1fr auto auto; background: var(--paper); color: var(--ink); box-shadow: -30px 0 60px -30px rgba(0, 0, 0, 0.7); transform: translateX(104%); transition: transform 0.26s var(--ease-out); }
html[dir="rtl"] .as-drawer { transform: translateX(-104%); }
.as-root.on .as-drawer { transform: none; }
@media (prefers-reduced-motion: reduce) { .as-drawer, .as-scrim { transition: none; } }
.as-head { display: flex; align-items: center; gap: 0.7rem; padding: 1rem 1rem 0.9rem; border-bottom: 1px solid var(--paper-line); background: linear-gradient(180deg, #fff, var(--paper)); }
.as-avatar { flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(160deg, #13306a, #061534); color: var(--gold-300); }
.as-avatar svg { width: 22px; height: 22px; }
.as-heading { flex: 1; min-width: 0; }
.as-heading h2 { font-size: 1.05rem; line-height: 1.3; }
.as-sub { color: var(--muted); font-size: 0.78rem; }
.as-icon-btn { flex: none; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--paper-line); background: #fff; color: var(--ink-2); display: grid; place-items: center; transition: border-color 0.2s, color 0.2s; }
.as-icon-btn:hover { border-color: var(--gold-500); color: var(--ink); }
.as-icon-btn svg { width: 18px; height: 18px; }
.as-list { overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; overscroll-behavior: contain; }
.as-msg { display: flex; }
.as-msg.me { justify-content: flex-end; }
.as-bubble { max-width: 88%; padding: 0.7rem 0.9rem; border-radius: 18px; font-size: 0.92rem; line-height: 1.75; background: #fff; border: 1px solid var(--paper-line); box-shadow: 0 6px 18px -14px rgba(16, 23, 40, 0.5); overflow-wrap: anywhere; }
.as-msg.bot .as-bubble { border-start-start-radius: 6px; }
.as-msg.me .as-bubble { background: var(--navy-900); color: var(--on-navy); border-color: var(--navy-900); border-start-end-radius: 6px; }
.as-msg.err .as-bubble { border-color: #ecc4c4; background: #fff6f6; color: #8f1c1c; }
.as-bubble p + p, .as-bubble p + ul, .as-bubble ul + p { margin-top: 0.45rem; }
.as-bubble ul { list-style: disc; padding-inline-start: 1.2rem; display: grid; gap: 0.2rem; }
.as-bubble b { color: #7a560e; }
.as-msg.me .as-bubble b { color: var(--gold-300); }
.as-typing { display: inline-flex; gap: 5px; padding: 0.85rem 1rem; }
.as-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-500); animation: asDot 1.1s infinite ease-in-out; }
.as-typing i:nth-child(2) { animation-delay: 0.15s; } .as-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes asDot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.as-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.2rem; }
.as-chip { text-align: start; padding: 0.5rem 0.8rem; border-radius: 14px; border: 1.5px solid #ead9ad; background: #fffaf0; color: #7a560e; font-weight: 600; font-size: 0.84rem; line-height: 1.5; transition: border-color 0.2s, background 0.2s; }
.as-chip:hover { border-color: var(--gold-500); background: #fff3d6; }
.as-card { display: grid; gap: 0.7rem; justify-items: start; padding: 0.9rem 1rem; border-radius: 16px; background: #fbf6e8; border: 1px solid #efe3c2; font-size: 0.88rem; color: var(--ink-2); }
.as-card .btn { min-height: 42px; }
.as-compose { display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.75rem 1rem 0.5rem; border-top: 1px solid var(--paper-line); background: #fff; }
.as-input { flex: 1; min-height: 46px; max-height: 140px; resize: none; overflow-y: hidden; box-sizing: border-box; padding: 0.7rem 0.9rem; border-radius: 14px; border: 1px solid var(--paper-line); background: var(--paper); color: var(--ink); font: inherit; font-size: 0.95rem; line-height: 1.5; }
.as-input:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 4px rgba(232, 181, 71, 0.18); background: #fff; }
.as-send { flex: none; width: 46px; height: 46px; border-radius: 14px; border: 0; display: grid; place-items: center; background: linear-gradient(180deg, var(--gold-300), var(--gold-500)); color: var(--gold-ink); transition: transform 0.15s, opacity 0.2s; }
.as-send svg { width: 20px; height: 20px; }
html[dir="rtl"] .as-send svg { transform: scaleX(-1); }
.as-send:disabled { opacity: 0.45; cursor: default; }
.as-send:not(:disabled):active { transform: scale(0.95); }
.as-foot { display: grid; gap: 0.15rem; padding: 0 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px)); background: #fff; font-size: 0.72rem; color: var(--muted); line-height: 1.5; }
.as-left { color: #7a560e; font-weight: 600; }
@media (max-width: 560px) { .as-drawer { width: 100%; } .as-bubble { max-width: 92%; } }

/* ================================================================ Plan Studio frame */
.studio-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0.9rem 0.75rem 1.1rem; border-radius: 18px; border: 1px solid var(--line); background: rgba(246, 241, 228, 0.04); }
html[dir="rtl"] .studio-bar { padding: 0.75rem 1.1rem 0.75rem 0.9rem; }
.sb-title { display: grid; min-width: 0; }
.sb-title small { color: var(--gold-300); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; }
.sb-title b { font-size: 1.02rem; color: var(--on-navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-share { position: relative; flex: none; min-height: 44px; gap: 0.45rem; color: var(--on-navy); background: rgba(246, 241, 228, 0.06); border-color: var(--line-strong); }
.sb-share:hover { border-color: var(--gold-400); color: #fff; }
.sb-share svg { width: 18px; height: 18px; color: var(--gold-300); }
.sb-live { position: absolute; top: 7px; inset-inline-end: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(76, 181, 127, 0.25); }
.stepper.has-4 { grid-template-columns: repeat(4, 1fr); }
.studio-col { display: grid; gap: 1.5rem; align-content: start; }
.studio-grid.one { grid-template-columns: minmax(0, 1fr); }
.img-badge { position: absolute; z-index: 2; top: 8px; inset-inline-start: 8px; padding: 0.15rem 0.55rem; border-radius: 999px; background: rgba(6, 21, 52, 0.82); border: 1px solid rgba(245, 207, 111, 0.5); color: var(--gold-300); font-size: 0.7rem; font-weight: 700; }

/* ---- style per room ---- */
.rs { border-radius: 14px; border: 1px solid var(--paper-line); background: #fff; }
.rs summary { display: flex; align-items: center; gap: 0.55rem; padding: 0.75rem 0.9rem; cursor: pointer; list-style: none; font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.rs summary::-webkit-details-marker { display: none; }
.rs summary > svg:first-child { width: 18px; height: 18px; color: var(--gold-600); flex: none; }
.rs-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: #fff3d6; color: #7a560e; font-style: normal; font-size: 0.75rem; font-weight: 700; }
.rs-chev { width: 18px; height: 18px; margin-inline-start: auto; color: var(--muted); transition: transform 0.2s; }
.rs[open] .rs-chev { transform: rotate(180deg); }
.rs .hint { padding: 0 0.9rem; font-size: 0.8rem; }
.rs-list { display: grid; gap: 0.4rem; padding: 0.6rem 0.9rem 0.9rem; }
.rs-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 46%); gap: 0.6rem; align-items: center; padding: 0.35rem 0.35rem 0.35rem 0.7rem; border-radius: 12px; background: var(--paper); }
html[dir="rtl"] .rs-row { padding: 0.35rem 0.7rem 0.35rem 0.35rem; }
.rs-row.custom { background: #fff8e6; box-shadow: inset 0 0 0 1px #f0dca8; }
.rs-name { display: grid; min-width: 0; }
.rs-name b { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-name small { color: var(--muted); font-size: 0.72rem; }
.rs-row select, .mb-style select, .pr-field select { width: 100%; min-height: 40px; padding: 0 0.6rem; border-radius: 10px; border: 1px solid var(--paper-line); background: #fff; color: var(--ink); font: inherit; font-size: 0.86rem; }
.rs-reset { margin: 0 0.9rem 0.9rem; font-size: 0.82rem; }

/* ---- render your own photo ---- */
.pr-panel { gap: 1.1rem; }
.pr-head { display: flex; gap: 0.85rem; align-items: flex-start; }
.pr-ico { flex: none; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(160deg, #13306a, #061534); color: var(--gold-300); }
.pr-ico svg { width: 24px; height: 24px; }
.pr-head h2 { justify-content: flex-start; gap: 0.5rem; flex-wrap: wrap; }
.pr-head .pill { font-size: 0.68rem; color: #7a560e; border-color: #e6c77a; background: #fff3d6; }
.pr-drop { position: relative; display: grid; justify-items: center; gap: 0.3rem; text-align: center; padding: 1.6rem 1rem; border-radius: 18px; border: 2px dashed var(--paper-line); background: #fff; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.pr-drop:hover, .pr-drop.drag { border-color: var(--gold-500); background: #fff8e6; }
.pr-drop-ico { width: 40px; height: 40px; color: var(--gold-600); margin-bottom: 0.2rem; }
.pr-drop b { color: var(--ink); font-size: 1rem; }
.pr-drop small { color: var(--muted); font-size: 0.82rem; }
.pr-drop .pr-hint { font-size: 0.74rem; }
.pr-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pr-stage { position: relative; border-radius: 16px; overflow: hidden; background: #e9e3d3; aspect-ratio: 3 / 2; }
.pr-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pr-stage img.broken { opacity: 0; }
.pr-stage.is-busy img { filter: saturate(0.6) brightness(0.8); }
.pr-scan { position: absolute; inset-inline: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--gold-300), transparent); box-shadow: 0 0 28px 8px rgba(232, 181, 71, 0.55); animation: scan 2.2s ease-in-out infinite; }
.pr-status { position: absolute; inset-inline: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.8rem; background: linear-gradient(180deg, transparent, rgba(4, 14, 36, 0.9)); color: var(--on-navy); font-weight: 600; font-size: 0.88rem; }
.pr-status .spinner { width: 18px; height: 18px; border-color: var(--gold-300); border-inline-end-color: transparent; }
.pr-change { position: absolute; top: 10px; inset-inline-end: 10px; padding: 0.35rem 0.8rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.5); background: rgba(6, 21, 52, 0.7); color: #fff; font-size: 0.78rem; font-weight: 600; }
.pr-form { display: grid; gap: 0.9rem; }
.pr-field { display: grid; gap: 0.4rem; }
.pr-field > span { font-weight: 600; font-size: 0.88rem; color: var(--ink); }
.pr-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pr-actions .btn svg, .cost-box .btn svg { width: 18px; height: 18px; }

/* ---- before / after ---- */
.ba { --pos: 50%; position: relative; overflow: hidden; border-radius: 16px; background: #0b2454; user-select: none; touch-action: pan-y; direction: ltr; }
.ba img { display: block; width: 100%; height: auto; pointer-events: none; }
.ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-before img { width: 100%; height: 100%; object-fit: cover; }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 0; pointer-events: none; }
.ba-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, 0.4); }
.ba-handle i { position: absolute; top: 50%; left: 0; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; background: #fff; box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.6); }
.ba-handle i::before, .ba-handle i::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -6px; border: 6px solid transparent; }
.ba-handle i::before { left: 7px; border-right-color: var(--navy-900); }
.ba-handle i::after { right: 7px; border-left-color: var(--navy-900); }
.ba-tag { position: absolute; top: 10px; padding: 0.2rem 0.6rem; border-radius: 999px; background: rgba(6, 21, 52, 0.75); color: #fff; font-size: 0.74rem; font-weight: 700; pointer-events: none; }
.ba-l { left: 10px; } .ba-r { right: 10px; color: var(--gold-300); }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.ba-range:focus-visible + * { outline: none; }
.ba:focus-within .ba-handle i { box-shadow: 0 0 0 4px rgba(232, 181, 71, 0.55), 0 8px 20px -6px rgba(0, 0, 0, 0.6); }
.lightbox .ba { display: inline-block; max-width: min(96vw, 1400px); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.9); }
.lightbox .ba img { border-radius: 0; box-shadow: none; }
.lightbox .ba img.ba-after { width: auto; max-width: 100%; max-height: 82vh; }

/* ---- material board ---- */
.mb-panel { gap: 1.2rem; }
.mb-head { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; justify-content: space-between; }
.mb-heading { flex: 1 1 26rem; display: grid; gap: 0.35rem; }
.mb-heading h2 { justify-content: flex-start; }
.mb-acts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mb-acts .btn { min-height: 44px; gap: 0.45rem; }
.mb-acts .btn svg { width: 18px; height: 18px; }
.mb-meta { color: var(--muted); font-size: 0.8rem; margin-top: -0.6rem; }
.mb-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); transition: opacity 0.2s; }
.mb-grid.is-loading { opacity: 0.55; pointer-events: none; }
@media (min-width: 760px) { .mb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1160px) { .mb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mb-card { border-radius: 18px; background: #fff; border: 1px solid var(--paper-line); overflow: hidden; display: grid; align-content: start; box-shadow: 0 18px 40px -34px rgba(16, 23, 40, 0.6); }
.mb-card-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.85rem 0.9rem; background: linear-gradient(180deg, #fffaf0, #fff); border-bottom: 1px solid var(--paper-line); }
.mb-palette { flex: none; display: flex; }
.mb-palette i { width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--paper-line); }
.mb-palette i + i { margin-inline-start: -10px; }
.mb-room { flex: 1; display: grid; min-width: 0; }
.mb-room b { font-size: 0.98rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-room small { color: var(--muted); font-size: 0.75rem; }
.mb-style { flex: none; width: 8.5rem; }
.mb-style select { min-height: 36px; font-size: 0.8rem; font-weight: 600; color: #7a560e; border-color: #ead9ad; background: #fffaf0; }
.mb-items { display: grid; }
.mb-item { display: grid; grid-template-columns: 6.6rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: start; padding: 0.6rem 0.9rem; border-top: 1px solid #f1ece0; font-size: 0.84rem; }
.mb-item:first-child { border-top: 0; }
.mb-k { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.76rem; padding-top: 0.1rem; }
.mb-k svg { width: 16px; height: 16px; color: var(--gold-600); flex: none; }
.mb-k em { font-style: normal; }
.mb-v { display: grid; gap: 0.1rem; min-width: 0; }
.mb-v b { color: var(--ink); font-weight: 600; line-height: 1.5; }
.mb-v small { color: var(--muted); font-size: 0.74rem; line-height: 1.45; }
.mb-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(16, 23, 40, 0.18); margin-inline-end: 0.35rem; vertical-align: -1px; }
.mb-p { text-align: end; white-space: nowrap; color: var(--ink); font-weight: 700; font-size: 0.84rem; }
.mb-p small { display: block; color: var(--muted); font-weight: 400; font-size: 0.7rem; }
.mb-loading { display: flex; align-items: center; justify-content: center; gap: 0.7rem; padding: 3rem 1rem; color: var(--ink-2); font-weight: 600; }
.mb-loading .spinner { width: 22px; height: 22px; border-color: var(--gold-500); border-inline-end-color: transparent; }
.mb-note { color: var(--muted); font-size: 0.78rem; line-height: 1.7; padding-top: 0.6rem; border-top: 1px solid var(--paper-line); }
@media (max-width: 560px) { .mb-item { grid-template-columns: minmax(0, 1fr) auto; } .mb-k { grid-column: 1 / -1; } .mb-style { width: 7.5rem; } }

/* ---- material board PDF (printed as html.tb-print-board) ---- */
#mbPrint { display: none; }
html.tb-print-board, html.tb-print-board body { background: #fff !important; color: #101728 !important; padding: 0 !important; margin: 0 !important; min-height: 0; }
html.tb-print-board body > *:not(#mbPrint) { display: none !important; }
html.tb-print-board #mbPrint { display: block; }
#mbPrint { font-family: var(--font-body); font-size: 9.5pt; line-height: 1.5; color: #101728; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#mbPrint .mp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 14px; border-bottom: 2px solid #061534; margin-bottom: 14px; }
#mbPrint .mp-brand { display: flex; align-items: center; gap: 10px; flex: none; }
#mbPrint .mp-brand img { width: 40px; height: 40px; border-radius: 10px; }
#mbPrint .mp-brand b { display: block; font-family: var(--font-display); font-size: 14pt; color: #061534; line-height: 1.2; }
#mbPrint .mp-brand small { display: block; font-size: 8pt; color: #5f6879; direction: ltr; }
#mbPrint .mp-meta { text-align: end; }
#mbPrint .mp-meta h1 { font-family: var(--font-display); font-size: 14pt; color: #061534; line-height: 1.3; margin: 0; }
#mbPrint .mp-meta p { margin: 2px 0 0; }
#mbPrint .mp-muted { color: #5f6879; font-size: 8pt; }
#mbPrint .mp-room { break-inside: avoid; margin-bottom: 12px; border: 1px solid #e2dbc8; border-radius: 8px; overflow: hidden; }
#mbPrint .mp-room-head { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #f6f1e4; }
#mbPrint .mp-room-head h2 { font-size: 11pt; margin: 0 4px; color: #061534; }
#mbPrint .mp-room-head span:last-child { margin-inline-start: auto; color: #5f6879; font-size: 8.5pt; }
#mbPrint .mp-sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #c9c1ab; }
#mbPrint .mp-table { width: 100%; border-collapse: collapse; }
#mbPrint .mp-table th, #mbPrint .mp-table td { padding: 5px 10px; border-top: 1px solid #efe9da; text-align: start; vertical-align: top; }
#mbPrint .mp-table th { width: 22%; color: #5f6879; font-weight: 600; font-size: 8.5pt; }
#mbPrint .mp-table td small { display: block; color: #5f6879; font-size: 8pt; }
#mbPrint .mp-table td.num { width: 22%; text-align: end; white-space: nowrap; font-weight: 600; }
#mbPrint .mp-foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid #e2dbc8; color: #5f6879; font-size: 8pt; }
#mbPrint.lh-doc .mp-head { border-bottom-color: var(--lh, #061534); }
#mbPrint.lh-doc .mp-meta h1, #mbPrint.lh-doc .mp-room-head h2 { color: var(--lh, #061534); }
@page { size: A4; margin: 14mm 12mm; }

/* ---- modal (share link) ---- */
.tb-modal { position: fixed; inset: 0; z-index: 96; display: grid; place-items: center; padding: 1rem; }
.tb-modal-scrim { position: absolute; inset: 0; background: rgba(4, 14, 36, 0.6); backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.18s; }
.tb-modal.on .tb-modal-scrim { opacity: 1; }
.tb-modal-card { position: relative; width: min(480px, 100%); max-height: calc(100vh - 2rem); overflow: auto; border-radius: 24px; background: var(--paper); color: var(--ink); padding: 1.6rem 1.4rem 1.3rem; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8); transform: translateY(10px) scale(0.98); opacity: 0; transition: transform 0.2s var(--ease-out), opacity 0.18s; }
.tb-modal.on .tb-modal-card { transform: none; opacity: 1; }
.tb-modal-x { position: absolute; top: 12px; inset-inline-end: 12px; width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--paper-line); background: #fff; display: grid; place-items: center; color: var(--ink-2); }
.tb-modal-x svg { width: 16px; height: 16px; }
.sh-body { display: grid; gap: 0.9rem; justify-items: start; }
.sh-ico { width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; background: linear-gradient(160deg, #13306a, #061534); color: var(--gold-300); }
.sh-ico svg { width: 24px; height: 24px; }
.sh-body h2 { font-size: 1.25rem; }
.sh-body > p { color: var(--ink-2); font-size: 0.9rem; line-height: 1.75; }
.sh-loading { width: 100%; display: grid; place-items: center; padding: 1rem; }
.sh-loading .spinner { width: 24px; height: 24px; border-color: var(--gold-500); border-inline-end-color: transparent; }
.sh-create { width: 100%; min-height: 50px; gap: 0.5rem; }
.sh-create svg, .sh-link .btn svg, .sh-acts .btn svg { width: 18px; height: 18px; }
.sh-link { width: 100%; display: flex; gap: 0.5rem; }
.sh-link input { flex: 1; min-width: 0; min-height: 48px; padding: 0 0.9rem; border-radius: 14px; border: 1px solid var(--paper-line); background: #fff; color: var(--ink); font: inherit; font-size: 0.88rem; }
.sh-link .btn { min-height: 48px; gap: 0.4rem; }
.sh-link .btn.ok { background: var(--success); color: #fff; }
.sh-acts { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.sh-acts .btn { min-height: 46px; gap: 0.45rem; }
.sh-foot { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--paper-line); font-size: 0.82rem; }
.sh-views { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.sh-views svg { width: 16px; height: 16px; }
.sh-stop { color: #b42525; font-weight: 600; }

/* ================================================================ shared-plan page (share.html) */
.sp-hero { padding-block: clamp(2rem, 5vw, 3.5rem) 1.5rem; }
.sp-hero .pill { margin-bottom: 0.8rem; }
.sp-hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
.sp-hero .lead { color: var(--on-navy-muted); margin-top: 0.6rem; }
.sp-by { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.9rem; color: var(--on-navy-muted); font-size: 0.9rem; }
.sp-by .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(232, 181, 71, 0.16); color: var(--gold-300); font-weight: 700; font-size: 0.85rem; }
.sp-grid { display: grid; gap: 1.5rem; padding-bottom: 2rem; align-items: start; }
@media (min-width: 980px) { .sp-grid { grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr); } .sp-grid > aside { position: sticky; top: 92px; } }
.sp-section { display: grid; gap: 1rem; }
.sp-section h2 { font-size: 1.2rem; color: var(--on-navy); }
.sp-renders { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, 1fr); }
.sp-renders .img-card:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.sp-rooms { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sp-room { display: grid; gap: 0.1rem; padding: 0.7rem 0.85rem; border-radius: 14px; border: 1px solid var(--line); background: rgba(246, 241, 228, 0.04); }
.sp-room b { color: var(--on-navy); font-size: 0.92rem; }
.sp-room small { color: var(--on-navy-muted); font-size: 0.76rem; }
.sp-room em { font-style: normal; color: var(--gold-300); font-size: 0.72rem; font-weight: 600; }
.sp-plan img { width: 100%; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.sp-board .mb-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .sp-board .mb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sp-tl { display: grid; gap: 0.3rem; padding: 1rem 1.1rem; border-radius: 18px; border: 1px solid var(--line); background: rgba(246, 241, 228, 0.04); }
.sp-tl b { font-size: 1.5rem; color: var(--gold-300); }
.sp-tl small { color: var(--on-navy-muted); font-size: 0.82rem; }
.sp-cta { display: grid; gap: 0.8rem; justify-items: start; padding: clamp(1.4rem, 4vw, 2rem); border-radius: var(--r-lg); background: linear-gradient(150deg, var(--navy-600), var(--navy-800) 55%, var(--navy-950)); border: 1px solid rgba(232, 181, 71, 0.4); margin-block: 1rem clamp(3rem, 6vw, 5rem); }
.sp-cta h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
.sp-cta p { color: var(--on-navy-muted); max-width: 38rem; }
.sp-cta .acts { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.sp-state { display: grid; justify-items: center; text-align: center; gap: 0.8rem; padding: clamp(3rem, 8vw, 6rem) 1rem; }
.sp-state .spinner { width: 30px; height: 30px; border-color: var(--gold-300); border-inline-end-color: transparent; }
.sp-state h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
.sp-state p { color: var(--on-navy-muted); }

/* ================================================================ price history (prices.html) */
.ph-wrap { display: grid; gap: 1.2rem; }
.ph-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 0.8rem 1.5rem; }
.ph-head h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.ph-head p { color: var(--on-navy-muted); font-size: 0.92rem; max-width: 40rem; }
.ph-tabs { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(246, 241, 228, 0.06); border: 1px solid var(--line); }
.ph-tabs button { min-height: 36px; padding: 0 0.9rem; border: 0; border-radius: 10px; background: transparent; color: var(--on-navy-muted); font-weight: 600; font-size: 0.84rem; }
.ph-tabs button.on { background: var(--gold-400); color: var(--gold-ink); }
.ph-movers { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.ph-mover { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.6rem; align-items: center; padding: 0.8rem 0.95rem; border-radius: 16px; border: 1px solid var(--line); background: rgba(246, 241, 228, 0.04); text-align: start; transition: border-color 0.2s, background 0.2s; }
.ph-mover:hover, .ph-mover.on { border-color: rgba(232, 181, 71, 0.55); background: rgba(232, 181, 71, 0.08); }
.ph-mover b { color: var(--on-navy); font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-mover small { color: var(--on-navy-muted); font-size: 0.76rem; grid-column: 1; }
.ph-chg { grid-row: 1 / span 2; grid-column: 2; display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.25rem 0.55rem; border-radius: 999px; font-weight: 700; font-size: 0.82rem; }
.ph-chg.up { background: rgba(229, 115, 92, 0.16); color: #ff9c87; }
.ph-chg.down { background: rgba(76, 181, 127, 0.16); color: #7fd8a8; }
.ph-chg.flat { background: rgba(246, 241, 228, 0.08); color: var(--on-navy-muted); }
.ph-chart { display: grid; gap: 0.6rem; padding: 1rem 1.1rem 0.9rem; border-radius: 20px; border: 1px solid var(--line); background: rgba(4, 14, 36, 0.35); }
.ph-chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem; }
.ph-chart-head select { min-height: 40px; padding: 0 0.7rem; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--navy-800); color: var(--on-navy); font: inherit; font-size: 0.88rem; }
.ph-chart-head b { color: var(--on-navy); }
.ph-svg { width: 100%; height: auto; overflow: visible; direction: ltr; }
.ph-svg .grid { stroke: rgba(246, 241, 228, 0.08); }
.ph-svg .area { fill: url(#phFill); }
.ph-svg .line { fill: none; stroke: var(--gold-300); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.ph-svg .dot { fill: var(--navy-900); stroke: var(--gold-300); stroke-width: 2; }
.ph-svg text { fill: var(--on-navy-faint); font-size: 11px; font-family: var(--font-body); }
.ph-note { color: var(--on-navy-muted); font-size: 0.82rem; display: flex; gap: 0.5rem; align-items: flex-start; }
.ph-note svg { width: 18px; height: 18px; color: var(--gold-300); flex: none; margin-top: 2px; }
