@font-face { font-family: "Clash Display"; src: url("/wp-content/uploads/2024/11/ClashDisplay-Variable.ttf") format("truetype"); font-weight: 200 700; font-display: swap; }

:root {
  --bg: #01050C; --panel: #0B0B0C; --panel-2: #131314; --panel-3: #1a1a1c; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.15);
  --text: #F4F1EE; --muted: #A69C97; --orange: #FF8142; --orange-soft: rgba(255,129,66,.12); --orange-ink: #1a0b03;
  --green: #3fb97d; --red: #e5484d; --amber: #f5b547;
  --radius: 12px; --display: "Clash Display", "Inter", system-ui, sans-serif; --body: "Inter", system-ui, sans-serif;
  --nav-h: 0px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 16px; }
.muted { color: var(--muted); margin: 4px 0 0; }
em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: var(--orange); }
[hidden] { display: none !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; cursor: pointer; font-family: var(--display); font-weight: 500; letter-spacing: .03em; font-size: 14px; white-space: nowrap; text-decoration: none; color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s; }
.btn:hover { border-color: var(--text); }
.btn:focus-visible, .iconbtn:focus-visible, .seg__btn:focus-visible, .suggest__item:focus-visible, .pcard:focus-visible, .sendbtn:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.btn--primary { background: var(--orange); border-color: var(--orange); color: var(--orange-ink); }
.btn--primary:hover { box-shadow: 0 0 0 3px rgba(255,129,66,.3); border-color: var(--orange); }
.btn--danger { color: #ff8a8d; border-color: rgba(229,72,77,.4); }
.btn--danger:hover { border-color: var(--red); }
.btn--sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.iconbtn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; flex: none; transition: border-color .15s, background .15s; }
.iconbtn:hover { border-color: var(--text); }
.iconbtn--sm { width: 34px; height: 34px; }
.iconbtn--sm svg { width: 16px; height: 16px; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 4px; font-size: 13px; }
.linkbtn:hover { color: var(--text); }

/* Layout */
.app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; height: 100dvh; }
.side { display: flex; flex-direction: column; gap: 2px; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--panel); }
.side__brand { display: block; padding: 6px 10px 26px; }
.side__brand img { height: 28px; display: block; }
.side__link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; border: 1px solid transparent; transition: color .15s, border-color .15s, background .15s; }
.side__link:hover { color: var(--text); border-color: var(--line-2); }
.side__link.is-on { color: var(--text); background: var(--orange-soft); border-color: rgba(255,129,66,.35); }
.side__link.is-on svg { color: var(--orange); }
.side__foot { margin-top: auto; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border-top: 1px solid var(--line); }
.side__foot form { margin: 0; }
.side__user { font-size: 13px; color: var(--text); display: flex; flex-direction: column; padding: 2px 4px 6px; }
.side__user small { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.view { flex: 1; min-height: 0; overflow-y: auto; padding: 32px 36px 56px; }
.viewhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }

/* Draft bar */
.draftbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; background: linear-gradient(90deg, rgba(255,129,66,.14), rgba(255,129,66,.03)); border-bottom: 1px solid rgba(255,129,66,.28); }
.draftbar__info { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.draftbar__actions { display: flex; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(255,129,66,.2); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255,129,66,0); } }

/* ---------- Assistant ---------- */
.view--assistant { display: grid; grid-template-columns: minmax(380px, 480px) 1fr; padding: 0; overflow: hidden; }
.chat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); }
.chat__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat__head strong { display: block; font-family: var(--display); font-weight: 500; font-size: 16px; }
.chat__head .muted { display: block; font-size: 12.5px; margin: 1px 0 0; }
.chat__head-actions { display: flex; gap: 8px; align-items: center; }
.chat__log { flex: 1; overflow-y: auto; padding: 22px 18px 12px; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; }

.welcome { margin: auto 0; text-align: center; padding: 12px 4px; }
.welcome__mark { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 16px; background: var(--orange-soft); color: var(--orange); border: 1px solid rgba(255,129,66,.3); }
.welcome__mark svg { width: 24px; height: 24px; }
.welcome h2 { font-size: 24px; }
.welcome .muted { max-width: 340px; margin: 8px auto 22px; font-size: 14px; }
.suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.suggest__item { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font-size: 13.5px; line-height: 1.35; text-align: left; transition: border-color .15s, background .15s; }
.suggest__item:hover { border-color: rgba(255,129,66,.5); background: var(--panel-3); }
.suggest__icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange); }
.suggest__icon svg { width: 16px; height: 16px; }

.msg { display: flex; gap: 10px; max-width: 100%; animation: msgIn .25s ease both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; }
.msg ul { margin: 6px 0; padding-left: 18px; }
.msg--me { align-self: flex-end; max-width: 86%; padding: 10px 14px; border-radius: 18px 18px 4px 18px; background: #2a1a10; border: 1px solid rgba(255,129,66,.35); font-size: 14.5px; line-height: 1.5; word-wrap: break-word; flex-direction: column; }
.msg__imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg__imgs img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.msg--bot { align-self: stretch; }
.msg__avatar { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--orange); color: var(--orange-ink); font: 600 11px/1 var(--display); letter-spacing: .04em; margin-top: 2px; }
.msg__body { min-width: 0; flex: 1; font-size: 14.5px; line-height: 1.55; display: grid; gap: 10px; }
.msg__error { color: #ff8a8d; }
.typing { display: inline-flex; gap: 5px; padding: 10px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.steps { list-style: none; margin: 0; padding: 10px 12px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.steps li { display: flex; gap: 8px; align-items: center; }
.steps li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--green); background: radial-gradient(var(--green) 38%, transparent 42%); flex: none; }
.steps li.is-live { color: var(--text); }
.steps li.is-live::before { border-color: var(--orange); border-right-color: transparent; background: none; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ready { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--orange-soft); border: 1px solid rgba(255,129,66,.3); font-size: 13.5px; }
.ready span { display: inline-flex; gap: 6px; align-items: center; color: var(--orange); }
.ready svg { width: 15px; height: 15px; }
.ready div { display: flex; gap: 6px; }

.composer { padding: 12px 14px 14px; border-top: 1px solid var(--line); background: var(--panel); }
.composer__box { border: 1px solid var(--line-2); border-radius: 16px; background: var(--bg); padding: 10px 10px 8px 14px; transition: border-color .15s, box-shadow .15s; }
.composer__box:focus-within { border-color: rgba(255,129,66,.7); box-shadow: 0 0 0 3px rgba(255,129,66,.12); }
.composer textarea { display: block; width: 100%; resize: none; border: 0; outline: 0; background: transparent; min-height: 26px; max-height: 200px; padding: 4px 0; line-height: 1.5; font-size: 15px; }
.composer__bar { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.composer__hint { flex: 1; font-size: 11.5px; color: var(--muted); opacity: .7; }
.sendbtn { width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--orange); color: var(--orange-ink); cursor: pointer; transition: transform .15s, opacity .15s; flex: none; }
.sendbtn:hover { transform: translateX(1px); }
.sendbtn[disabled] { opacity: .4; pointer-events: none; }
.composer__thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.composer__thumbs:not(:empty) { margin-bottom: 10px; }
.thumb { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.75); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; }
.thumb.is-loading::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.55); }

.preview { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #070809; }
.preview__bar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.preview__bar select { flex: 1; min-width: 0; height: 36px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); padding: 0 14px; }
.preview__label { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 14px; border-bottom: 1px solid var(--line); }
.preview__stage { flex: 1; min-height: 0; display: flex; justify-content: center; overflow: hidden; }
.preview__stage iframe { width: 100%; height: 100%; border: 0; background: #01050C; }
.preview__stage.is-mobile { padding: 18px 0; }
.preview__stage.is-mobile iframe { width: 390px; max-width: calc(100% - 24px); border-radius: 28px; border: 8px solid #1d1d1f; }

.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; }
.seg__btn { border: 0; background: transparent; padding: 5px 13px; border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--muted); }
.seg__btn.is-on { background: var(--text); color: var(--bg); }

/* ---------- Projects ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.pcard { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); cursor: pointer; text-align: left; padding: 0; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.pcard:hover { border-color: var(--line-2); box-shadow: 0 0 0 2px var(--orange); }
.pcard__img { aspect-ratio: 16 / 10; background: #222 center / cover; position: relative; }
.pcard__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.5), transparent 60%); }
.pcard__body { padding: 14px 16px 16px; }
.pcard__meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.badge--completed { color: var(--green); border-color: rgba(63,185,125,.4); }
.badge--under-construction { color: var(--orange); border-color: rgba(255,129,66,.4); }
.badge--ongoing { color: var(--amber); border-color: rgba(245,181,71,.4); }
.pcard .badge { position: absolute; top: 12px; left: 12px; z-index: 1; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); }

/* ---------- History ---------- */
.timeline { position: relative; max-width: 860px; display: grid; gap: 14px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 1px; background: var(--line-2); }
.hist { position: relative; display: grid; grid-template-columns: 16px 1fr; gap: 18px; }
.hist__dot { width: 15px; height: 15px; border-radius: 50%; margin-top: 18px; background: var(--bg); border: 2px solid var(--orange); position: relative; z-index: 1; }
.hist--initial .hist__dot { border-color: var(--muted); }
.hist--undo .hist__dot { border-color: var(--amber); }
.hist.is-undone .hist__card { opacity: .6; }
.hist__card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px 18px; transition: border-color .15s; }
.hist__card:hover { border-color: var(--line-2); }
.hist__top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.hist__top h3 { font-size: 16px; }
.hist__meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.hist__badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.hist__actions { margin-top: 12px; }
.changes { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.changes li { display: grid; gap: 2px; padding: 9px 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; }
.changes small { color: var(--muted); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips span { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }

/* Lists */
.list { display: grid; gap: 10px; max-width: 900px; }
.row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.row__title { font-weight: 600; }
.row__meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.row__body { margin-top: 8px; white-space: pre-wrap; font-size: 14px; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 28px 12px; border: 1px dashed var(--line-2); border-radius: var(--radius); }

.skel { border-radius: var(--radius); background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Modal ---------- */
.modal { width: min(640px, calc(100vw - 32px)); max-height: min(90vh, 920px); padding: 0; border: 1px solid var(--line-2); border-radius: 16px; background: var(--panel); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal--wide { width: min(820px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(0,0,0,.66); backdrop-filter: blur(3px); }
.modal[open] { animation: modalIn .22s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal__inner { display: flex; flex-direction: column; max-height: inherit; margin: 0; }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); gap: 12px; }
.modal__head .muted { font-size: 13.5px; }
.modal__body { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; overscroll-behavior: contain; min-height: 0; flex: 1 1 auto; }
.modal__body > * { flex: none; min-width: 0; }
.modal__head, .modal__foot { flex: none; }
.modal__foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; background: var(--panel); }
.modal__foot > div { display: flex; gap: 8px; flex-wrap: wrap; }
.formgroup { display: grid; gap: 12px; }
.formgroup > h3, .formgroup__head h3 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-family: var(--body); font-weight: 600; }
.formgroup__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.field > span em { margin-left: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 15px; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,129,66,.12); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.section { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; background: var(--panel-2); min-width: 0; }
.formgroup { min-width: 0; }
.grid2 > * { min-width: 0; }
.section__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.section__head strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section__tools { display: flex; gap: 4px; flex: none; }
.imgpick { display: flex; gap: 10px; flex-wrap: wrap; }
.imgpick__item { position: relative; width: 96px; height: 72px; border-radius: 9px; background: #222 center / cover; border: 1px solid var(--line-2); }
.imgpick__item--lg { width: 180px; height: 112px; }
.imgpick__item button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.75); color: #fff; cursor: pointer; }
.imgpick__add { min-width: 96px; height: 72px; padding: 0 12px; border-radius: 9px; border: 1px dashed var(--line-2); background: transparent; display: grid; place-items: center; color: var(--muted); cursor: pointer; font-size: 12.5px; text-align: center; transition: border-color .15s, color .15s; }
.imgpick__add:hover { border-color: var(--orange); color: var(--text); }

.brief { border: 1px solid rgba(255,129,66,.35); border-radius: var(--radius); background: linear-gradient(160deg, rgba(255,129,66,.1), rgba(255,129,66,.02)); overflow: hidden; }
.brief__toggle { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 0; background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.brief__toggle > svg { color: var(--orange); width: 22px; height: 22px; }
.brief__toggle strong { display: block; font-family: var(--display); font-weight: 500; font-size: 15px; }
.brief__toggle small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.brief__toggle > span:nth-child(2) { flex: 1; }
.brief__chev { font-size: 20px; color: var(--muted); width: 20px; text-align: center; }
.brief__body { padding: 0 16px 16px; display: grid; gap: 12px; }
.brief__note { margin: 0; font-size: 13.5px; color: var(--amber); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--nav-h)); transform: translateX(-50%); max-width: calc(100vw - 32px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 50; animation: modalIn .2s ease; text-align: center; }
.toast--error { background: var(--red); color: #fff; }

/* Login */
.login-body { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 16px; background: radial-gradient(circle at 50% 0%, rgba(255,129,66,.12), transparent 50%), var(--bg); }
.login { width: min(400px, 100%); padding: 36px 30px; border: 1px solid var(--line-2); border-radius: 18px; background: var(--panel); }
.login__logo { height: 32px; margin-bottom: 26px; }
.login form { display: grid; gap: 14px; margin-top: 22px; }
.login label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.login input { padding: 13px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 16px; }
.login input:focus { outline: none; border-color: var(--orange); }
.login__error { color: #ff8a8d; font-size: 13px; margin: 0; }

/* ---------- Tablet & phone ---------- */
.mobile-only { display: none; }
@media (max-width: 1100px) { .view--assistant { grid-template-columns: minmax(340px, 420px) 1fr; } }
@media (max-width: 900px) {
  :root { --nav-h: 64px; }
  .mobile-only { display: inline-flex; }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .side { order: 2; flex-direction: row; justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); gap: 0; }
  .side__brand, .side__foot { display: none; }
  .side__link { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 4px; flex: 1; align-items: center; border-radius: 10px; }
  .main { order: 1; min-height: 0; }
  .view { padding: 22px 16px 32px; }
  h1 { font-size: 24px; }
  .draftbar { padding: 8px 12px; }
  .draftbar__info { font-size: 13px; }
  /* Chat takes the screen; preview slides over it */
  .view--assistant { display: block; position: relative; }
  .chat { height: 100%; border-right: 0; }
  .chat__head { padding: 12px 14px; }
  .chat__head .muted { display: none; }
  .chat__log { padding: 16px 14px 8px; }
  .composer { padding: 10px 10px calc(10px + 0px); }
  .composer__hint { display: none; }
  .composer textarea { font-size: 16px; } /* no iOS zoom on focus */
  .suggest { grid-template-columns: 1fr 1fr; }
  .welcome h2 { font-size: 22px; }
  .preview { position: absolute; inset: 0; z-index: 5; transform: translateX(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
  .view--assistant.show-preview .preview { transform: none; }
  .preview__bar { padding: 8px 10px; gap: 8px; }
  .preview__bar .seg, #openPreview { display: none; }
  .preview__stage.is-mobile { padding: 0; }
  .preview__stage.is-mobile iframe { width: 100%; max-width: 100%; border: 0; border-radius: 0; }
  .grid2 { grid-template-columns: 1fr; }
  .modal, .modal--wide { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
  .modal[open] { animation: sheetIn .28s cubic-bezier(.2,.8,.2,1); }
  @keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }
  .modal__head, .modal__body, .modal__foot { padding-left: 16px; padding-right: 16px; }
  .modal__foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal__foot { flex-wrap: nowrap; align-items: center; }
  .modal__foot > div:first-child { flex: 0 1 auto; }
  .modal__foot > div:last-child { flex: 1; justify-content: flex-end; }
  .modal__foot .btn--danger { border: 0; padding: 0 6px; min-height: 34px; font-size: 13px; }
  .imgpick__item--lg { width: 100%; height: 160px; }
  .hist { gap: 12px; }
  .hist__top { flex-direction: column; }
  .hist__badges { justify-content: flex-start; }
  .cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.welcome__off { display: none; margin: -8px auto 18px; max-width: 360px; padding: 10px 14px; border-radius: 10px; font-size: 13px; color: var(--amber); background: rgba(245,181,71,.08); border: 1px solid rgba(245,181,71,.3); }
.assistant-off .welcome__off { display: block; }

/* Phones: comfortable thumb targets and readable small text */
@media (max-width: 900px) {
  .side__link { font-size: 12px; min-height: 52px; justify-content: center; }
  .side__link svg { width: 20px; height: 20px; }
  .badge { font-size: 12px; }
  .iconbtn--sm, .iconbtn { width: 44px; height: 44px; }
  .btn--sm { min-height: 42px; padding: 0 16px; }
  .btn { min-height: 46px; }
  .sendbtn { width: 44px; height: 44px; }
  .linkbtn { padding: 10px 8px; }
  .composer__box { padding: 10px 10px 8px 14px; }
  .composer textarea { min-height: 30px; }
  .chat__head strong { font-size: 17px; }
  .imgpick__add { min-height: 72px; min-width: 110px; }
  .imgpick__item button { width: 30px; height: 30px; }
  .thumb button { width: 26px; height: 26px; }
  .field input, .field select, .field textarea { font-size: 16px; padding: 12px; } /* no iOS zoom on focus */
  .draftbar__actions .btn { flex: 1; }
  .viewhead { gap: 12px; }
  .viewhead > .btn { width: 100%; }
}

.reply--live { white-space: pre-wrap; }
.reply--live::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--orange); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* People */
.people { display: grid; gap: 10px; padding: 0 22px 28px; }
.person { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.3fr) auto; gap: 16px; align-items: center;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); transition: border-color .15s; }
.person:hover { border-color: var(--line-2); }
.person.is-off { opacity: .55; }
.person__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.person__who strong { font-family: var(--display); font-weight: 500; }
.person__who span, .person__who small { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
.person__who small { font-size: 12px; }
.person__role { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.person__role small { font-size: 12px; margin: 0; }
.person__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill { align-self: flex-start; font-family: var(--display); font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); }
.pill--admin { background: var(--orange-soft); border-color: rgba(255,129,66,.4); color: var(--orange); }
.pill--editor { background: rgba(63,185,125,.12); border-color: rgba(63,185,125,.35); color: var(--green); }
.pill--viewer { background: rgba(255,255,255,.05); color: var(--muted); }
.tag { font-family: var(--body); font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--orange); }
.temppass { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel-3); }
.temppass code { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: .04em; word-break: break-all; }

/* Viewers see the site but can't change it */
body.read-only .draftbar__actions, body.read-only #newProject, body.read-only .composer { display: none; }

@media (max-width: 900px) {
  .person { grid-template-columns: 1fr; gap: 10px; }
  .person__actions { justify-content: flex-start; }
}

/* Save points */
.viewhead__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.savepoints { padding: 0 22px 8px; display: grid; gap: 8px; }
.savepoints__title { font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 4px 0 2px; }
.savepoints__empty { padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); margin: 0; font-size: 14px; }
.savepoint { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); transition: border-color .15s; }
.savepoint:hover { border-color: var(--line-2); }
.savepoint.is-current { border-color: rgba(255,129,66,.45); background: var(--orange-soft); }
.savepoint strong { font-family: var(--display); font-weight: 500; }
.savepoint small { display: block; font-size: 12px; margin: 2px 0 0; }
.savepoint__actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 900px) {
  .savepoint { flex-direction: column; align-items: flex-start; gap: 10px; }
  .savepoints { padding: 0 16px 8px; }
}
