/* CJL portal design system: white surfaces, orange accents, Fakt type.
   Used by client.canethebuilder.com and admin.canethebuilder.com.
   Motion never hides content: no first keyframe is invisible, and everything
   still reads with animations off (prefers-reduced-motion). */
@font-face { font-family: 'FaktBlock'; src: url('/fonts/FaktBlock-Normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fakt'; src: url('/fonts/Fakt-Normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fakt'; src: url('/fonts/Fakt-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --orange: #FF7C55;
  --orange-600: #F0602F;
  --orange-700: #B8441C;   /* orange text on white: 5.0:1 */
  --orange-50: #FFF5F1;
  --orange-100: #FFE7DD;
  --orange-200: #FFD2C2;
  --ink: #111111;
  --ink-2: #2B2B2B;
  --muted: #5E5E5E;
  --faint: #8A8A8A;
  --line: #EEE7E3;
  --line-2: #E2D8D2;
  --bg: #FFFFFF;
  --soft: #FBF9F8;
  --ok: #1F7A4D;    --ok-bg: #E7F5EE;
  --warn: #8A5A00;  --warn-bg: #FFF3D6;
  --bad: #B3261E;   --bad-bg: #FDECEA;
  --info: #1D4ED8;  --info-bg: #EEF3FF;
  --sans: Fakt, Roboto, "San Francisco", "Helvetica Neue", Arial, sans-serif;
  --display: FaktBlock, Fakt, Roboto, "San Francisco", "Helvetica Neue", Arial, sans-serif;
  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(17, 17, 17, .05);
  --shadow: 0 4px 18px rgba(17, 17, 17, .07);
  --shadow-lg: 0 18px 50px rgba(17, 17, 17, .14);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--orange-200); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ header */
.app-head { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.app-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--orange), #FFB59B 60%, transparent); }
.app-head-in { max-width: 1240px; margin: 0 auto; height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand small { font: 400 10px/12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.brand .tag-area { font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--orange-700); background: var(--orange-50); border: 1px solid var(--orange-100); padding: 6px 9px; border-radius: 999px; }
.head-right { display: flex; align-items: center; gap: 10px; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.user-chip:hover { border-color: var(--orange-200); box-shadow: var(--shadow-sm); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--orange), #FFB08F); color: #111; font: 600 13px/1 var(--sans); flex-shrink: 0; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.menu { position: absolute; right: 20px; top: 62px; min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.menu button, .menu a { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; text-decoration: none; font-size: 15px; }
.menu button:hover, .menu a:hover { background: var(--orange-50); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .who { padding: 10px 12px 8px; font-size: 13px; color: var(--muted); }
.menu .who b { display: block; color: var(--ink); font-size: 15px; }

/* ------------------------------------------------------------ preview ribbon */
.preview-ribbon { background: linear-gradient(90deg, var(--orange), #FF9E7D); color: #111; font-size: 14px; }
.preview-ribbon .in { max-width: 1240px; margin: 0 auto; padding: 9px 20px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; }
.preview-ribbon b { font-weight: 600; }
.preview-ribbon .seg { background: rgba(255, 255, 255, .45); }

/* ------------------------------------------------------------ layout */
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 72px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 980px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .g2, .g4 { grid-template-columns: 1fr; } .wrap { padding: 18px 16px 64px; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }
.xs { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.eyebrow { font: 600 12px/16px var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--orange-700); margin: 0 0 6px; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h1 { font: 400 clamp(28px, 4.2vw, 44px)/1.08 var(--display); letter-spacing: -.015em; }
h2 { font: 400 24px/1.2 var(--display); }
h3 { font: 600 17px/1.35 var(--sans); }

/* ------------------------------------------------------------ cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.card.pad-sm { padding: 16px; }
.card.soft { background: var(--soft); }
.card.link { cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s, border-color .18s; text-decoration: none; display: block; }
.card.link:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--orange-200); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; max-width: 64ch; }
.count { font: 600 12px/1 var(--sans); background: var(--orange-50); color: var(--orange-700); border: 1px solid var(--orange-100); padding: 6px 9px; border-radius: 999px; white-space: nowrap; }

/* ------------------------------------------------------------ project hero */
.hero { position: relative; overflow: hidden; border-radius: 22px; border: 1px solid var(--line); background: #fff; padding: 26px 26px 22px; box-shadow: var(--shadow-sm); }
.hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--orange), #FFB59B); }
.hero::after { content: ""; position: absolute; right: -80px; top: -90px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 124, 85, .13), transparent 68%); pointer-events: none; }
.hero-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; position: relative; }
.hero .loc { color: var(--muted); margin-top: 6px; }
.ring { width: 104px; height: 104px; position: relative; flex-shrink: 0; }
.ring svg { width: 104px; height: 104px; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--orange-50); stroke-width: 10; }
.ring .val { fill: none; stroke: url(#ringGrad); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .lbl b { font: 400 26px/1 var(--display); display: block; }
.ring .lbl span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; position: relative; }
@media (max-width: 800px) { .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hstat { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 14px 12px; background: var(--soft); text-align: left; cursor: default; transition: border-color .15s, background .15s, transform .15s var(--ease); }
button.hstat { cursor: pointer; width: 100%; }
button.hstat:hover { border-color: var(--orange-200); background: var(--orange-50); transform: translateY(-1px); }
.hstat .k { font: 600 11px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hstat .v { font: 400 21px/1.25 var(--display); margin-top: 6px; overflow-wrap: anywhere; }
.hstat .d { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ------------------------------------------------------------ tabs */
.tabs-wrap { position: sticky; top: 68px; z-index: 30; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); margin: 18px -20px 22px; padding: 8px 20px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--muted); font-size: 15px; white-space: nowrap; scroll-snap-align: start; transition: background .15s, color .15s, border-color .15s; min-height: 42px; }
.tab svg { width: 17px; height: 17px; stroke: currentColor; }
.tab:hover { background: var(--orange-50); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; }
.tab .badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #111; font: 600 11.5px/20px var(--sans); text-align: center; }
.tab[aria-selected="true"] .badge { background: var(--orange); }
.panel-anim { animation: panelIn .32s var(--ease) both; }
@keyframes panelIn { from { opacity: .35; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }

/* ------------------------------------------------------------ buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; font-size: 15px; text-decoration: none; transition: background .15s, border-color .15s, transform .12s var(--ease), box-shadow .15s; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(.98); }
.btn svg { width: 17px; height: 17px; stroke: currentColor; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #111; box-shadow: 0 6px 16px rgba(255, 124, 85, .28); }
.btn.primary:hover { background: var(--orange-600); border-color: var(--orange-600); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #000; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--orange-50); }
.btn.danger { color: var(--bad); border-color: #F2C4BF; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font: 600 13px/1.3 var(--sans); color: var(--ink-2); }
.field small, .hint { font-size: 13px; color: var(--muted); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; font-size: 16px; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-50); }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.fields-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 640px) { .fields-2, .fields-3 { grid-template-columns: 1fr; } }
.req { color: var(--orange-700); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--orange); flex-shrink: 0; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); gap: 4px; flex-wrap: wrap; }
.seg button, .seg label { border: 0; background: none; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-size: 14.5px; color: var(--muted); min-height: 38px; display: inline-flex; align-items: center; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg [aria-pressed="true"], .seg label:has(input:checked) { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 14.5px; margin: 0 0 14px; border: 1px solid transparent; }
.notice.ok { background: var(--ok-bg); color: #145235; }
.notice.err { background: var(--bad-bg); color: #8A1F14; }
.notice.info { background: var(--orange-50); color: var(--ink); border-color: var(--orange-100); }
.notice.warn { background: var(--warn-bg); color: #5E3D00; }

/* ------------------------------------------------------------ tags */
.tag { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--sans); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); background: #fff; white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.tag.plain::before { display: none; }
.tag.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.tag.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.tag.bad { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.tag.info { color: var(--info); background: var(--info-bg); border-color: transparent; }
.tag.orange { color: var(--orange-700); background: var(--orange-50); border-color: var(--orange-100); }

/* ------------------------------------------------------------ lists */
.list { display: grid; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.item:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.item-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.item h3 { margin: 2px 0 4px; }
.item p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; white-space: pre-wrap; }
.meta { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }
.amount { font: 400 22px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 34px 18px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--soft); }
.empty svg { width: 30px; height: 30px; stroke: var(--orange); margin: 0 auto 10px; }
.empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font: 600 11.5px/1.2 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--orange-50); }
.scroll { overflow-x: auto; }

/* ------------------------------------------------------------ phases */
.phase { display: grid; grid-template-columns: 40px 1fr auto; gap: 4px 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.phase:first-child { border-top: 0; padding-top: 4px; }
.pdot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 600 13px/1 var(--sans); border: 2px solid var(--line-2); color: var(--muted); background: #fff; }
.phase.done .pdot { background: var(--ok); border-color: var(--ok); color: #fff; }
.phase.now .pdot { border-color: var(--orange); color: var(--orange-700); box-shadow: 0 0 0 4px var(--orange-50); }
.phase ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.phase li label { display: flex; gap: 9px; align-items: flex-start; font-size: 14.5px; }
.phase li input { accent-color: var(--orange); width: 16px; height: 16px; margin-top: 3px; }
.phase li input:checked + span { color: var(--muted); text-decoration: line-through; }
@media (max-width: 600px) { .phase { grid-template-columns: 36px 1fr; } .phase > .tag { grid-column: 2; justify-self: start; } }
.bar { height: 8px; border-radius: 99px; background: var(--orange-50); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--orange), #FFAA8B); transition: width 1s var(--ease); }

/* ------------------------------------------------------------ feed & timeline */
.feed { display: grid; gap: 14px; }
.post { display: grid; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.post.has-photo { grid-template-columns: 220px 1fr; }
@media (max-width: 640px) { .post.has-photo { grid-template-columns: 1fr; } }
.post .ph { background: var(--soft); cursor: zoom-in; min-height: 150px; }
.post .ph img { width: 100%; height: 100%; object-fit: cover; }
.post .body { padding: 14px 16px; }
.tl { position: relative; padding-left: 28px; }
.tl::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content: ""; position: absolute; left: -24px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--line-2); }
.tl-item.past::before { background: var(--ok); border-color: var(--ok); }
.tl-item.today::before { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 5px var(--orange-50); }
.tl-item .when { font: 600 12.5px/1.3 var(--sans); color: var(--muted); }
.tl-item h3 { margin: 2px 0; }

/* ------------------------------------------------------------ calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cal-head h3 { font: 400 22px/1.2 var(--display); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cal .dow { background: var(--soft); font: 600 11.5px/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.cal .day { min-height: 96px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; background: #fff; text-align: left; cursor: pointer; transition: background .12s; display: flex; flex-direction: column; gap: 3px; border-top: 0; border-left: 0; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day:hover { background: var(--orange-50); }
.cal .day.out { background: var(--soft); color: var(--faint); }
.cal .day.sel { box-shadow: inset 0 0 0 2px var(--orange); }
.cal .num { font: 600 13px/1 var(--sans); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal .day.today .num { background: var(--orange); color: #111; }
.cal .ev { font-size: 12px; line-height: 1.25; padding: 3px 6px; border-radius: 6px; background: var(--orange-50); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--orange); }
.cal .ev.inspection { border-left-color: var(--info); background: var(--info-bg); }
.cal .ev.meeting { border-left-color: #7C3AED; background: #F3EEFF; }
.cal .ev.delivery { border-left-color: var(--warn); background: var(--warn-bg); }
.cal .ev.milestone { border-left-color: var(--ok); background: var(--ok-bg); }
.cal .ev.update { border-left-color: var(--ink); background: #F2F2F2; }
.cal .ev.decision { border-left-color: var(--bad); background: var(--bad-bg); }
.cal .more { font-size: 11.5px; color: var(--muted); padding-left: 4px; }
@media (max-width: 700px) { .cal .day { min-height: 58px; } .cal .ev { font-size: 0; height: 6px; padding: 0; border-left-width: 0; } }

/* ------------------------------------------------------------ decisions */
.opts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin: 12px 0; }
.opt { position: relative; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s, transform .12s var(--ease); display: flex; gap: 10px; align-items: center; min-height: 52px; }
.opt:hover { border-color: var(--orange-200); transform: translateY(-1px); }
.opt input { position: absolute; opacity: 0; }
.opt .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); flex-shrink: 0; display: grid; place-items: center; }
.opt:has(input:checked) { border-color: var(--orange); background: var(--orange-50); }
.opt:has(input:checked) .dot { border-color: var(--orange); }
.opt:has(input:checked) .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.opt:has(input:focus-visible) { outline: 3px solid var(--orange-200); outline-offset: 2px; }
.opt .votes { margin-left: auto; font-size: 12px; color: var(--muted); }
.opt.final { border-color: var(--ok); background: var(--ok-bg); }
.final-box { border-radius: 12px; background: var(--ok-bg); color: #145235; padding: 12px 14px; margin-top: 10px; }

/* ------------------------------------------------------------ chat */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 460px; overflow-y: auto; padding: 4px 2px 8px; scroll-behavior: smooth; }
.bubble { max-width: 78%; padding: 10px 13px; border-radius: 16px; background: var(--soft); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { margin-left: auto; background: var(--ink); color: #fff; border-color: var(--ink); border-bottom-right-radius: 5px; }
.bubble.them { border-bottom-left-radius: 5px; }
.bubble small { display: block; font-size: 11.5px; opacity: .72; margin-bottom: 3px; }
.bubble .subj { font-weight: 600; display: block; margin-bottom: 2px; }
.composer { display: grid; gap: 8px; border: 1px solid var(--line-2); border-radius: 14px; padding: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-50); }
.composer input, .composer textarea { border: 0; outline: none; background: none; width: 100%; resize: none; font-size: 15.5px; }
.composer textarea { min-height: 48px; }
.threads { display: grid; gap: 6px; }
.thread-btn { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; background: none; cursor: pointer; }
.thread-btn:hover { background: var(--orange-50); }
.thread-btn[aria-current="true"] { background: var(--orange-50); border-color: var(--orange-100); }
.thread-btn .tx { min-width: 0; flex: 1; }
.thread-btn .tx b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-btn .tx span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ files */
.file { display: flex; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.file:hover { border-color: var(--orange-200); box-shadow: var(--shadow-sm); }
.ftype { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; background: var(--orange-50); color: var(--orange-700); font: 600 11px/1 var(--sans); flex-shrink: 0; letter-spacing: .04em; }
.ftype.pdf { background: var(--bad-bg); color: var(--bad); }
.ftype.img { background: var(--info-bg); color: var(--info); }
.file .tx { flex: 1; min-width: 0; }
.file .tx b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.file .tx span { font-size: 13px; color: var(--muted); }
.drop { border: 2px dashed var(--line-2); border-radius: 14px; padding: 18px; text-align: center; color: var(--muted); background: var(--soft); transition: border-color .15s, background .15s; cursor: pointer; display: block; }
.drop:hover, .drop.over { border-color: var(--orange); background: var(--orange-50); color: var(--ink); }
.drop input { display: block; margin: 8px auto 0; max-width: 100%; }
.drop b { color: var(--ink); }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.gallery button { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--soft); aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.gallery button:hover img { transform: scale(1.04); }

/* ------------------------------------------------------------ job ai */
.tasks-ai { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 16px; }
.task-ai { text-align: left; border: 1.5px solid var(--line-2); border-radius: 14px; background: #fff; padding: 14px; cursor: pointer; transition: border-color .15s, background .15s, transform .12s var(--ease); }
.task-ai:hover { border-color: var(--orange-200); transform: translateY(-1px); }
.task-ai[aria-pressed="true"] { border-color: var(--orange); background: var(--orange-50); }
.task-ai .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--orange-100); display: grid; place-items: center; margin-bottom: 10px; }
.task-ai .ic svg { width: 19px; height: 19px; stroke: var(--orange-700); }
.task-ai b { display: block; font-weight: 600; }
.task-ai span { font-size: 13.5px; color: var(--muted); }
.ai-out { border: 1px solid var(--orange-100); background: linear-gradient(180deg, var(--orange-50), #fff 60%); border-radius: 14px; padding: 16px; white-space: pre-wrap; line-height: 1.6; }
.ai-out .eyebrow { margin-bottom: 8px; }

/* ------------------------------------------------------------ pay box */
.pay { border-radius: 16px; padding: 18px; background: linear-gradient(135deg, #111 0%, #2A2A2A 100%); color: #fff; }
.pay .eyebrow { color: #FFB59B; }
.pay .big { font: 400 22px/1.2 var(--display); overflow-wrap: anywhere; }
.pay ul { margin: 10px 0 0; padding-left: 18px; color: #DADADA; font-size: 14px; }
.copy { border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 13px; }

/* ------------------------------------------------------------ properties grid (admin) */
.props { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.prop { position: relative; overflow: hidden; }
.prop::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--orange), #FFB59B); }
.prop h3 { font: 400 21px/1.25 var(--display); margin: 10px 0 2px; }
.prop .next { font-size: 14px; color: var(--muted); margin-top: 10px; }
.prop .go { margin-top: 14px; font-weight: 600; color: var(--orange-700); }

/* ------------------------------------------------------------ toast, modal, lightbox, skeleton */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; animation: toastIn .3s var(--ease) both; }
.toast .ic { width: 20px; height: 20px; border-radius: 50%; background: var(--orange); color: #111; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.toast.err .ic { background: #FF8A80; }
@keyframes toastIn { from { opacity: .4; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
.modal-back { position: fixed; inset: 0; background: rgba(17, 17, 17, .45); z-index: 90; display: grid; place-items: center; padding: 18px; animation: fadeIn .2s ease both; }
@keyframes fadeIn { from { opacity: .4; } to { opacity: 1; } }
.modal { background: #fff; border-radius: 20px; width: min(560px, 100%); max-height: calc(100vh - 36px); overflow: auto; box-shadow: var(--shadow-lg); padding: 24px; animation: modalIn .28s var(--ease) both; }
.modal.wide { width: min(760px, 100%); }
@keyframes modalIn { from { opacity: .5; scale: .97; } to { opacity: 1; scale: 1; } }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.modal-x { border: 0; background: var(--soft); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 18px; flex-shrink: 0; }
.modal-x:hover { background: var(--orange-50); }
.lightbox { position: fixed; inset: 0; z-index: 110; background: rgba(10, 10, 10, .92); display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 20px; animation: fadeIn .2s ease both; }
.lightbox img { max-width: min(1200px, 100%); max-height: calc(100vh - 140px); object-fit: contain; border-radius: 10px; }
.lightbox .cap { color: #EEE; font-size: 14px; text-align: center; padding: 12px; }
.lightbox .nav { position: absolute; top: 50%; translate: 0 -50%; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 24px; cursor: pointer; }
.lightbox .nav:hover { background: rgba(255, 255, 255, .25); }
.lightbox .prev { left: 18px; } .lightbox .next { right: 18px; }
.lightbox .close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 20px; cursor: pointer; }
.skel { border-radius: 10px; background: linear-gradient(90deg, #F4EFEC 25%, #FBF7F5 37%, #F4EFEC 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ------------------------------------------------------------ auth */
.auth { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { position: relative; overflow: hidden; background: linear-gradient(160deg, #FFF5F1 0%, #FFE2D6 100%); padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.auth-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 124, 85, .28), transparent 70%); }
.auth-side h1 { position: relative; max-width: 14ch; }
.auth-side p { position: relative; color: var(--ink-2); max-width: 44ch; font-size: 17px; margin: 0; }
.auth-pts { position: relative; display: grid; gap: 10px; margin-top: 8px; }
.auth-pt { display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 124, 85, .25); border-radius: 14px; padding: 12px 14px; }
.auth-pt .ic { width: 34px; height: 34px; border-radius: 10px; background: #fff; display: grid; place-items: center; flex-shrink: 0; }
.auth-pt .ic svg { width: 18px; height: 18px; stroke: var(--orange-700); }
.auth-pt b { display: block; font-weight: 600; font-size: 15px; }
.auth-pt span { font-size: 13.5px; color: var(--muted); }
.auth-main { display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: min(440px, 100%); }
.auth-card h2 { font: 400 30px/1.15 var(--display); margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin: 0 0 20px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { border: 0; background: none; border-radius: 9px; padding: 10px; cursor: pointer; color: var(--muted); min-height: 44px; }
.auth-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.auth-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: 14px; }
.linkish { border: 0; background: none; padding: 8px 2px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14.5px; }
.linkish:hover { color: var(--orange-700); }
.auth-help { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.pw-meter { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-top: 6px; }
.pw-meter i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .25s, background .25s; }
/* sign-in: photo panel with a sample portal card */
.auth-visual { padding: 0; background: #2a2622; justify-content: stretch; }
.auth-visual::after { display: none; }
.auth-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(1.12) saturate(1.05); }
.auth-visual::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(20, 16, 14, 0) 0%, rgba(20, 16, 14, .04) 50%, rgba(20, 16, 14, .78) 100%); }
.auth-overlay { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; padding: 40px 44px 44px; }
.auth-caption .eyebrow { color: #FFC2AE; margin: 0 0 8px; }
.auth-visual h1 { color: #fff; max-width: 15ch; text-shadow: 0 1px 18px rgba(0, 0, 0, .35); }
.auth-preview-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.auth-preview-link:hover { color: #FFC2AE; }
.pv-card { align-self: flex-end; width: min(330px, 100%); display: grid; gap: 10px; padding: 16px; border-radius: 18px; background: rgba(255, 255, 255, .94); color: var(--ink); text-decoration: none; box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .45); backdrop-filter: blur(8px); animation: pv-in .7s cubic-bezier(.2, .8, .2, 1) both; transition: translate .25s, box-shadow .25s; }
.pv-card:hover { translate: 0 -3px; box-shadow: 0 30px 70px -18px rgba(0, 0, 0, .5); }
.pv-card:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
@keyframes pv-in { from { translate: 0 16px; scale: .97; } to { translate: 0 0; scale: 1; } }
.pv-chip { justify-self: start; font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--orange-700); background: var(--orange-50); border: 1px solid var(--orange-100); padding: 6px 9px; border-radius: 999px; }
.pv-top { display: flex; align-items: center; gap: 12px; }
.pv-ring { --p: 50; width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: conic-gradient(var(--orange) calc(var(--p) * 1%), #F1ECE9 0); }
.pv-ring b { width: 42px; height: 42px; border-radius: 50%; background: #fff; display: grid; place-items: center; font: 600 13px/1 var(--sans); }
.pv-name { display: block; font-weight: 600; font-size: 15px; }
.pv-sub { font-size: 13px; color: var(--muted); }
.pv-label { font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.pv-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pv-thumbs img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.pv-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.pv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex-shrink: 0; }
.pv-dot.ok { background: #1F7A4D; }
.pv-prop { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; }
.pv-prop img { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; display: block; }
.pv-prop b { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.pv-prop em { font: 600 13px/1 var(--sans); font-style: normal; color: var(--ink-2); }
.pv-bar { display: block; height: 6px; border-radius: 99px; background: #F1ECE9; overflow: hidden; }
.pv-bar i { display: block; height: 100%; border-radius: 99px; background: var(--orange); }

.pv-stage { display: flex; flex-direction: column; align-items: flex-end; }
.pv-b, .pv-c { display: none; }
.pv-msg, .pv-ev { display: flex; align-items: center; gap: 10px; }
.pv-msg b, .pv-ev b { display: block; font-weight: 600; font-size: 14px; }
.pv-av { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--orange), #FFB08F); font: 600 12px/1 var(--sans); color: #111; }
.pv-bubble { display: block; background: var(--soft); border-radius: 4px 14px 14px 14px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.pv-date { width: 46px; height: 50px; flex-shrink: 0; border-radius: 12px; background: var(--orange-50); border: 1px solid var(--orange-100); display: grid; place-content: center; text-align: center; }
.pv-date small { font: 600 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--orange-700); }
.pv-date b { font: 600 14px/1.2 var(--sans); }

/* desktop: the photo fills the whole frame; cards float on it; the sign-in card is raised on the right */
@media (min-width: 1100px) {
  .auth { position: relative; isolation: isolate; grid-template-columns: minmax(0, 1.45fr) minmax(500px, 1fr); min-height: calc(100vh - 68px); min-height: calc(100dvh - 68px); background: #2a2622; }
  .auth-visual { position: static; background: none; }
  .auth-photo { z-index: -2; }
  .auth-visual::before { z-index: -1; background: linear-gradient(90deg, rgba(20, 16, 14, .10) 0%, rgba(20, 16, 14, 0) 45%, rgba(20, 16, 14, .28) 100%), linear-gradient(180deg, rgba(20, 16, 14, 0) 45%, rgba(20, 16, 14, .72) 100%); }
  .auth-overlay { padding: 48px 56px 52px; }
  .pv-stage { position: relative; display: block; flex: 1; min-height: 440px; }
  .pv-a, .pv-b, .pv-c { position: absolute; }
  .pv-a { right: 2%; top: 0; width: 340px; }
  .pv-b { display: grid; left: 0; top: 40%; width: 310px; }
  .pv-c { display: grid; right: 14%; bottom: 0; width: 270px; }
  .pv-stage .pv-card { animation: pv-in .7s cubic-bezier(.2, .8, .2, 1) both, pv-float 7s ease-in-out 1s infinite; }
  .pv-b { animation-delay: .12s, 1.6s !important; }
  .pv-c { animation-delay: .24s, 2.2s !important; }
  .pv-stage .pv-card:hover { animation-play-state: paused; }
  .auth-visual h1 { font-size: clamp(40px, 3.6vw, 56px); max-width: 13ch; }
  .auth-main { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 26px; padding: 36px clamp(40px, 5vw, 80px); background: rgba(255, 255, 255, .97); backdrop-filter: blur(16px); box-shadow: -40px 0 90px -50px rgba(0, 0, 0, .6); }
  .auth-card { width: min(460px, 100%); }
  .auth-card h2 { font-size: 38px; }
  .auth-card .auth-help { margin-top: 16px; padding-top: 12px; }
  .auth-card .lead { font-size: 16.5px; }
  .auth-card .field input:not([type=checkbox]):not([type=radio]) { min-height: 52px; }
  .auth-card .btn { min-height: 52px; }
  .auth-perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(460px, 100%); margin: 0; padding: 20px 0 0; list-style: none; border-top: 1px solid var(--line); }
  .auth-perks li { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
  .auth-perks .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--orange-50); border: 1px solid var(--orange-100); display: grid; place-items: center; flex-shrink: 0; }
  .auth-perks .ic svg { width: 18px; height: 18px; stroke: var(--orange-700); }
  .auth-perks b { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.3; }
  .auth-perks li > span:last-child > span { display: none; }
}
.auth-perks { display: none; }
@media (min-width: 1100px) { .auth-perks { display: grid; } }
@keyframes pv-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

/* sign-in helpers */
.sent-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--orange-50); border: 1px solid var(--orange-100); margin-bottom: 12px; }
.sent-box > span:last-child { display: grid; gap: 2px; font-size: 14.5px; color: var(--ink-2); }
.sent-box > span:last-child > b { font-size: 16px; color: var(--ink); }
.sent-ic { width: 38px; height: 38px; border-radius: 12px; background: #fff; display: grid; place-items: center; flex-shrink: 0; }
.sent-ic svg { width: 20px; height: 20px; stroke: var(--orange-700); }
.code-alt { border-top: 1px solid var(--line); padding-top: 10px; }
.code-alt summary { cursor: pointer; font-size: 14px; color: var(--ink-2); min-height: 36px; display: flex; align-items: center; }
.code-alt summary { list-style: none; gap: 10px; }
.code-alt summary::-webkit-details-marker { display: none; }
.code-alt summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--orange-700); border-bottom: 2px solid var(--orange-700); rotate: -45deg; transition: rotate .2s; flex-shrink: 0; }
.code-alt[open] summary::before { rotate: 45deg; }
.auth-help a[href^="tel"] { white-space: nowrap; }
.auth-card[data-mode="code"] > .lead, .auth-card[data-mode="forgot"] > .lead, .auth-card[data-mode="resend"] > .lead { display: none; }
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn[data-mode="code"] svg { width: 18px; height: 18px; stroke: currentColor; }
.code-input { text-align: center; font: 600 26px/1 var(--sans) !important; letter-spacing: .35em; font-variant-numeric: tabular-nums; min-height: 56px !important; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 70px !important; }
.pw-eye { position: absolute; right: 5px; top: 50%; translate: 0 -50%; min-width: 58px; min-height: 36px; border: 0; border-radius: 8px; background: none; color: var(--orange-700); font: 600 13px/1 var(--sans); cursor: pointer; }
.pw-eye:hover { background: var(--orange-50); }
.pw-eye:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth-main { order: -1; padding: 28px 16px 32px; }
  .auth-visual { min-height: 460px; }
  .auth-overlay { padding: 24px 20px 28px; }
  .pv-card { align-self: stretch; width: auto; max-width: 360px; }
}

/* ------------------------------------------------------------ footer */
.app-foot { border-top: 1px solid var(--line); }
.app-foot .in { max-width: 1240px; margin: 0 auto; padding: 18px 20px 30px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.app-foot a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
