/* Journey admin dashboard: the questionnaire's calm, light look, denser. Right-to-left; logical properties throughout. */
:root{
  --bg:#fafafa; --surface:#fff; --ink:#1d1d1f; --text:#3a3a3c; --muted:#6e6e73; --line:#e8e8ec; --line-strong:#d2d2d7;
  --accent:#253a97; --accent-hover:#1e2f7d; --accent-soft:#f0f2fa; --danger:#b3261e; --danger-soft:#fdeceb;
  --ok:#2f7d57; --ok-soft:#eaf5ef; --warn:#a15c00; --warn-soft:#fdf3e3; --live:#2e9b5f;
  --radius:12px; --radius-sm:9px; --gutter:20px; --max:1180px;
  --ease:cubic-bezier(.2,.7,.2,1);
}
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);-webkit-text-size-adjust:100%}
body{font-family:'Yekan Bakh',system-ui,sans-serif;font-weight:400;line-height:1.8;font-size:15px}
h1,h2,h3,p,ul,ol,dl,dd,blockquote,figure{margin:0;padding:0}
ul,ol{list-style:none}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
::selection{background:#dfe3f3}
[hidden]{display:none !important}
.small{font-size:13px;color:var(--muted)}
.muted{color:var(--muted)}
.pad{padding:24px 0}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}
.skip{position:absolute;inset-inline-start:12px;inset-block-start:-48px;background:var(--accent);color:#fff;padding:8px 14px;border-radius:8px;z-index:50}
.skip:focus{inset-block-start:10px}
.icon{flex:none}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms !important;transition-duration:.01ms !important}}

/* shell */
.topbar{background:var(--surface);border-block-end:1px solid var(--line);position:sticky;inset-block-start:0;z-index:20}
.topbar-inner{max-width:var(--max);margin-inline:auto;padding:10px var(--gutter);display:flex;align-items:center;gap:24px}
.brand{display:flex;align-items:center}
.brand:hover{text-decoration:none}
.site-logo{display:block;height:36px;width:auto;flex:none}
.nav{display:flex;gap:4px;flex:1}
.nav-link{padding:6px 14px;border-radius:999px;color:var(--text);font-size:14px}
.nav-link:hover{background:var(--accent-soft);text-decoration:none}
.nav-link.is-active{background:var(--accent-soft);color:var(--accent);font-weight:500}
.who{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--muted)}
/* the app is one column as tall as the window, so the rights notice sits at the bottom of short pages too */
#app{min-height:100dvh;display:flex;flex-direction:column}
.main{flex:1;width:100%;max-width:var(--max);margin-inline:auto;padding:28px var(--gutter) 40px;outline:none}
.legal{width:100%;max-width:var(--max);margin-inline:auto;padding:0 var(--gutter) 24px;text-align:center;font-size:12px;color:var(--muted)}
.page-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-block-end:18px}
.page-title{font-weight:600;font-size:clamp(22px,4vw,28px);line-height:1.5;outline:none}
.h2{font-weight:600;font-size:17px;line-height:1.6}
.h3{font-weight:600;font-size:14px;color:var(--accent);margin-block:18px 6px}
.eyebrow{font-size:13px;color:var(--muted)}
.live{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:var(--live)}
.live-dot{width:8px;height:8px;border-radius:50%;background:var(--live);animation:pulse 2s ease-in-out infinite}
.live.is-off{color:var(--muted)}
.live.is-off .live-dot{background:var(--line-strong);animation:none}
@keyframes pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.8)}}

/* buttons and fields */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:0 16px;border-radius:999px;border:1px solid transparent;background:none;font-size:14px;font-weight:500;white-space:nowrap;transition:background .2s,border-color .2s,color .2s}
.btn:hover{text-decoration:none}
.btn:disabled{opacity:.4;cursor:not-allowed}
.btn-primary{background:var(--accent);color:#fff}
.btn-primary:hover:not(:disabled){background:var(--accent-hover)}
.btn-ghost{border-color:var(--line-strong);color:var(--ink);background:var(--surface)}
.btn-ghost:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}
.btn-quiet{color:var(--muted);padding:0 10px}
.btn-quiet:hover:not(:disabled){color:var(--accent);background:var(--accent-soft)}
.btn-danger{background:var(--danger);color:#fff}
.btn-quiet-danger{color:var(--danger);border-color:transparent;padding:0 12px}
.btn-quiet-danger:hover{background:var(--danger-soft)}
.btn-block{width:100%}
.input{width:100%;min-height:40px;padding:8px 12px;background:var(--surface);border:1px solid var(--line-strong);border-radius:var(--radius-sm);font-size:14px;outline:none;transition:border-color .2s,box-shadow .2s}
.input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
textarea.input{line-height:1.9;resize:vertical;min-height:110px}
select.input{padding-inline-end:8px}
.field{display:flex;flex-direction:column;gap:6px}
.field>span{font-size:13px;color:var(--text)}
.field-inline{min-width:140px}
.form-error{font-size:13px;color:var(--danger)}
.form-status{font-size:13px;color:var(--ok)}
.row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}

/* cards, stats */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:20px;display:flex;flex-direction:column;gap:12px}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-block-end:18px}
.stat{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;display:flex;flex-direction:column;gap:2px;min-width:0}
.stat-value{font-weight:600;font-size:26px;line-height:1.3;color:var(--ink)}
.stat-label{font-size:13px;color:var(--text)}
.stat-note{font-size:12px;color:var(--muted)}
.tone-ok .stat-value{color:var(--ok)}
.tone-live .stat-value{color:var(--live)}
.tone-new .stat-value{color:var(--accent)}

/* filters */
.filters{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;align-items:end;margin-block-end:14px;padding:14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}
.filters .field-inline{min-width:0}
.search{position:relative;grid-column:span 2;display:flex;align-items:center}
.search .icon{position:absolute;inset-inline-start:12px;color:var(--muted);pointer-events:none}
.search .input{padding-inline-start:38px}
.filter-actions{grid-column:span 3;display:flex;gap:8px;flex-wrap:wrap}

/* table */
.table-wrap{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
table{width:100%;border-collapse:collapse}
.clients th{font-weight:500;font-size:12px;color:var(--muted);text-align:start;padding:10px 14px;border-block-end:1px solid var(--line);background:#fcfcfd;white-space:nowrap}
.th-button{background:none;border:0;padding:0;color:inherit;font:inherit;display:inline-flex;gap:6px;align-items:center}
.th-button:hover{color:var(--accent)}
.sort-mark{font-size:9px;color:var(--accent)}
.clients td{padding:12px 14px;border-block-end:1px solid var(--line);vertical-align:top;font-size:14px}
.clients tbody tr:last-child td{border-block-end:0}
.clients tbody tr:hover{background:#fbfbfd}
.clients tr.is-archived{opacity:.6}
.chip-aside{margin-inline-start:6px;color:var(--muted)}
.client-link{display:inline-flex;align-items:center;gap:8px;color:var(--ink)}
.client-link b{font-weight:600}
.client-link:hover b{color:var(--accent)}
.new-dot{width:8px;height:8px;border-radius:50%;background:var(--accent);flex:none}
.c-client .small{display:block;margin-block-start:2px}
.badge{display:inline-flex;align-items:center;gap:6px;padding:1px 10px;border-radius:999px;font-size:12px;border:1px solid var(--line-strong);background:var(--surface);white-space:nowrap}
.badge .dot{width:7px;height:7px;border-radius:50%;background:var(--muted)}
.badge-active{color:var(--ok);border-color:#bfe0cf;background:var(--ok-soft)}
.badge-active .dot{background:var(--live);animation:pulse 2s ease-in-out infinite}
.badge-in_progress{color:var(--warn);border-color:#f0d9b0;background:var(--warn-soft)}
.badge-in_progress .dot{background:#d9922b}
.badge-abandoned,.badge-replaced{color:var(--muted)}
.badge-completed{color:var(--accent);border-color:#cdd5f0;background:var(--accent-soft)}
.badge-completed .dot{background:var(--accent)}
.progress-text{display:block;font-size:12px;color:var(--muted);margin-block-start:4px}
.progress{display:block;height:3px;border-radius:3px;background:var(--line);margin-block-start:4px;overflow:hidden;max-width:140px}
.progress i{display:block;height:100%;background:var(--accent)}
.chip{display:inline-block;padding:0 9px;border-radius:999px;font-size:12px;border:1px solid var(--line-strong);background:var(--surface);color:var(--text);white-space:nowrap}
.chip-high{border-color:#bfe0cf;color:var(--ok);background:var(--ok-soft)}
.chip-medium{border-color:#cdd5f0;color:var(--accent);background:var(--accent-soft)}
.chip-low{border-color:#f0d9b0;color:var(--warn);background:var(--warn-soft)}
.c-persona .chip{margin-inline-start:4px}
.c-updated,.c-started,.c-duration{white-space:nowrap;color:var(--text);font-size:13px}
.pager{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 4px;flex-wrap:wrap}
.pager-info,.pager-page{font-size:13px;color:var(--muted)}
.pager-buttons{display:flex;align-items:center;gap:6px}
.page-size{flex-direction:row;align-items:center;gap:8px}
.page-size .input{width:auto}
.empty{padding:44px 20px;text-align:center}
.empty-title{font-weight:600;font-size:16px;margin-block-end:4px}

/* client detail */
.detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-block-end:16px}
.back{display:inline-flex;align-items:center;gap:4px;color:var(--muted)}
.contact{color:var(--text);font-size:14px}
.detail-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.note{padding:12px 16px;border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--surface);font-size:14px;line-height:1.9;margin-block-end:14px}
.detail-grid{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px;align-items:start}
.detail-main,.detail-side{display:flex;flex-direction:column;gap:16px;min-width:0}
.summary-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;flex-wrap:wrap}
.arch-name{font-weight:600;font-size:28px;line-height:1.4;color:var(--accent)}
.arch-en{display:block;font-family:system-ui,sans-serif;font-size:11px;letter-spacing:.2em;color:var(--muted);text-transform:uppercase}
.chips-col{display:flex;gap:6px;flex-wrap:wrap}
.lead{font-size:15px;color:var(--text);line-height:2}
.statement{font-weight:500;font-size:17px;line-height:1.9;padding-inline-start:14px;border-inline-start:3px solid var(--accent)}
.tensions ul{display:flex;flex-direction:column;gap:6px;font-size:14px;color:var(--text)}
.facts{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;font-size:13px}
.facts dt{color:var(--muted)}
.facts dd{margin:0;color:var(--ink);overflow-wrap:anywhere}
.answers{display:flex;flex-direction:column}
.answer-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:8px 20px;padding:12px 0;border-block-start:1px dashed var(--line)}
.answer-row:first-child{border-block-start:0}
.answer-q{display:flex;flex-direction:column;font-size:13px;color:var(--muted);line-height:1.8}
.answer-n{font-size:11px;color:var(--accent)}
.answer-a{font-size:14px;color:var(--ink);min-width:0}
.answer{font-weight:500}
.choice-list{display:flex;flex-direction:column;gap:2px}
.free-text{white-space:pre-wrap;overflow-wrap:anywhere;background:#fafafc;border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px}
.logo-list{display:flex;flex-wrap:wrap;gap:6px}
.logo-chip{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border:1px solid var(--line);border-radius:999px;font-family:system-ui,sans-serif;font-size:12px;background:var(--surface)}
.logo-chip img{filter:grayscale(1);object-fit:contain}
.swatch-list{display:flex;flex-direction:column;gap:6px}
.swatch-item{display:flex;align-items:center;gap:10px;font-size:13px}
.swatches{display:flex;width:64px;height:24px;border-radius:6px;overflow:hidden;border:1px solid var(--line);flex:none}
.swatches i{flex:1;display:block}
.notes{min-height:120px}

/* the two-sided dimension bars (same drawing as the report: every segment is exactly as wide as its percentage) */
.meters{display:flex;flex-direction:column}
.meter{display:grid;gap:6px;padding:12px 0;border-block-end:1px solid var(--line)}
.meter:last-child{border-block-end:0}
.meter-name{font-weight:500;font-size:14px}
.meter-bar{position:relative;display:flex;height:9px;border-radius:999px;overflow:hidden;background:var(--line)}
.meter-bar i{display:block;height:100%;flex:none}
.meter-bar::after{content:"";position:absolute;inset-block:0;left:50%;width:2px;margin-left:-1px;background:var(--surface);opacity:.9}
.seg-low,.seg-high{background:#d5daef}
.lean-low .seg-low,.lean-high .seg-high{background:var(--accent)}
.lean-balanced .seg-low,.lean-balanced .seg-high{background:#c4c9de}
.meter-ends{display:flex;justify-content:space-between;align-items:baseline;gap:16px;font-size:12px;color:var(--muted)}
.meter-ends b{font-weight:600;color:var(--muted)}
.end{display:flex;align-items:baseline;gap:6px}
.end-high{flex-direction:row-reverse}
.lean-low .end-low,.lean-high .end-high{color:var(--ink)}
.lean-low .end-low b,.lean-high .end-high b{color:var(--accent)}
.meter-src{font-size:12px;color:var(--muted)}

/* insights */
.insights{display:flex;flex-direction:column;gap:16px}
.two-cols{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.hbars{display:flex;flex-direction:column;gap:8px}
.hbar{display:grid;grid-template-columns:minmax(90px,150px) 1fr auto;align-items:center;gap:12px;font-size:13px}
.hbar-track{display:block;height:8px;border-radius:999px;background:var(--line);overflow:hidden}
.hbar-track i{display:block;height:100%;background:var(--accent);border-radius:999px}
.hbar-value{font-weight:600;white-space:nowrap}
.chart{width:100%;height:auto;display:block}
.chart .axis{stroke:var(--line-strong);stroke-width:1}
.chart .bar-started{fill:#b7bfe2}
.chart .bar-completed{fill:var(--accent)}
.chart .tick{font-size:10px;fill:var(--muted);font-family:'Yekan Bakh',system-ui,sans-serif}
.legend{display:flex;gap:16px;font-size:12px;color:var(--muted)}
.swatch{display:inline-block;width:10px;height:10px;border-radius:3px;margin-inline-end:6px}
.swatch-started{background:#b7bfe2}
.swatch-completed{background:var(--accent)}
.funnel{display:flex;flex-direction:column;gap:6px}
.funnel-row{display:grid;grid-template-columns:24px minmax(120px,260px) 1fr 80px;align-items:center;gap:12px;font-size:13px}
.funnel-n{color:var(--accent);font-weight:600;text-align:center}
.funnel-q{color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.funnel-v{text-align:end;white-space:nowrap}
.lost{color:var(--danger);font-weight:400;font-size:12px}
.is-worst .funnel-q{color:var(--danger);font-weight:500}

/* account */
.form{max-width:460px}
.log{font-size:13px}
.log td{padding:7px 10px;border-block-end:1px solid var(--line)}
.log-time{white-space:nowrap;color:var(--muted)}
.log-who{color:var(--text)}

/* accounts */
.who-role{font-size:11px;padding:0 8px}
.roles{margin-block-end:16px}
.role-help{display:flex;flex-direction:column;gap:8px;font-size:13px;color:var(--text);line-height:1.9}
.badge-role-admin{color:var(--accent);border-color:#cdd5f0;background:var(--accent-soft)}
.badge-role-manager{color:var(--ok);border-color:#bfe0cf;background:var(--ok-soft)}
.badge-role-viewer{color:var(--muted)}
.badge-enabled{color:var(--ok);border-color:#bfe0cf;background:var(--ok-soft)}
.badge-off{color:var(--danger);border-color:#f0c9c6;background:var(--danger-soft)}
.you{margin-inline-start:6px;color:var(--accent);border-color:#cdd5f0;background:var(--accent-soft)}
.accounts td.c-client{min-width:220px}
.accounts td.c-client .small{display:block}
.accounts .c-actions{white-space:nowrap;text-align:end}
.accounts .c-actions .btn+.btn{margin-inline-start:6px}
.btn-small{min-height:32px;padding:0 12px;font-size:13px}
.dialog-wide{width:min(520px,calc(100vw - 32px));max-width:none}
.dialog-form{display:flex;flex-direction:column;gap:14px}
.dialog-form .dialog-actions{margin-block-start:6px}
.pw-row{display:flex;gap:8px;flex-wrap:wrap}
.pw-row .input{flex:1 1 200px;width:auto;min-width:0}
.check{display:flex;align-items:center;gap:10px;font-size:14px}
.check input{width:18px;height:18px;accent-color:var(--accent)}
.log-detail{margin-inline-start:6px}

/* login */
.login-page{flex:1;display:grid;place-items:center;padding:24px}
.login-card{width:min(400px,100%);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:32px 28px;display:flex;flex-direction:column;gap:14px}
.login-card .site-logo{align-self:flex-start}
.login-title{font-weight:600;font-size:22px;line-height:1.5}

/* dialog and toasts */
.dialog{border:1px solid var(--line);border-radius:var(--radius);padding:24px;max-width:min(440px,calc(100vw - 32px));background:var(--surface);color:var(--ink)}
.dialog::backdrop{background:rgba(29,29,31,.4)}
.dialog-title{font-weight:600;font-size:18px;margin-block-end:8px}
.dialog-text{font-size:14px;color:var(--text);line-height:1.9}
.dialog-actions{display:flex;gap:10px;margin-block-start:18px;justify-content:flex-start}
.toasts{position:fixed;inset-block-end:20px;inset-inline-start:20px;display:flex;flex-direction:column;gap:8px;z-index:60;max-width:min(360px,calc(100vw - 40px))}
.toast{padding:10px 16px;border-radius:var(--radius-sm);background:var(--ink);color:#fff;font-size:14px;box-shadow:0 6px 24px rgba(0,0,0,.18)}
.toast-error{background:var(--danger)}

/* narrow screens: the table becomes a list of cards */
@media (max-width:980px){
  .detail-grid{grid-template-columns:1fr}
  .two-cols{grid-template-columns:1fr}
  .filters{grid-template-columns:repeat(3,minmax(0,1fr))}
  .search{grid-column:1/-1}
  .filter-actions{grid-column:1/-1}
}
@media (max-width:760px){
  :root{--gutter:14px}
  .topbar-inner{gap:10px;flex-wrap:wrap}
  .nav{order:3;flex-basis:100%}
  .btn-text{display:none}
  .clients thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .clients,.clients tbody,.clients tr,.clients td{display:block;width:100%}
  .clients tr{padding:12px 14px;border-block-end:1px solid var(--line)}
  .clients tbody tr:last-child{border-block-end:0}
  .clients td{padding:3px 0;border:0;display:flex;gap:10px;align-items:baseline;justify-content:space-between}
  .clients td::before{content:attr(data-label);font-size:12px;color:var(--muted);flex:none}
  .clients td.c-client{display:block}
  .clients td.c-client::before{content:none}
  .accounts .c-actions{justify-content:flex-start;gap:8px;padding-block-start:6px}
  .accounts td.c-client{min-width:0}
  .answer-row{grid-template-columns:1fr}
  .funnel-row{grid-template-columns:22px 1fr 70px}
  .funnel-q{display:none}
  .hbar{grid-template-columns:90px 1fr auto}
  .filters{padding:12px;grid-template-columns:repeat(2,minmax(0,1fr))}
}
