@font-face { font-family: 'Lia Element'; src: url('/fonts/LiaElement-Light.woff2') format('woff2'); font-weight: 300 400; font-display: swap; }
@font-face { font-family: 'Lia Element'; src: url('/fonts/LiaElement-Bold.woff2') format('woff2'); font-weight: 600 800; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/IBMPlexMono-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #2B0E6A;
  --ink-2: #3d1d8a;
  --accent: #EE7474;
  --bg: #faf8f5;
  --soft: #ece6ff;
  --text: #2a2540;
  --muted: #6d6884;
  --line: rgba(43, 14, 106, .12);
  --card: #fff;
  --red: #d64545;
  --green: #2f9e6e;
  --amber: #c98a1b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(43,14,106,.06), 0 12px 30px -18px rgba(43,14,106,.28);
  --font: 'Lia Element', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --side-w: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-weight: 400; font-size: 16px; line-height: 1.5; color: var(--text);
  background-color: var(--bg);
  background-image: linear-gradient(rgba(43,14,106,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(43,14,106,.045) 1px, transparent 1px);
  background-size: 54px 54px;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 80; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
svg:not(.crm-app svg) { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- contacts module (CRM) inside the panel ---------- */
.crm-app .crm-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.crm-app .crm-bar .search { margin-inline-start: 0; }
.crm-app .crm-nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-bottom: 14px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.crm-app .crm-nav .nav-i { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 15px; border: 1px solid transparent; }
.crm-app .crm-nav .nav-i:hover { background: #fff; border-color: var(--line); color: var(--ink); }
.crm-app .crm-nav .nav-i .nav-l { flex: none; }
.crm-app .crm-nav .nav-sub { display: none; }
.crm-app .crm-nav .nav-foot { margin: 0 0 0 0; margin-inline-start: auto; padding: 0; border: 0; flex-direction: row; }
.crm-app .crm-nav .nav-tool { min-height: 36px; font-size: 14px; }
.toast.on { opacity: 1; translate: 50% 0; }
@media (max-width: 760px) {
  .crm-app .crm-bar { flex-wrap: wrap; }
  .crm-app .crm-bar .search { flex: 1 1 100%; max-width: none; }
  .crm-app .crm-bar .btn { flex: 1; }
  .crm-app .crm-nav { gap: 4px; }
  .crm-app .crm-nav .nav-i { min-height: 36px; padding: 0 10px; font-size: 14px; gap: 6px; }
  .crm-app .crm-nav .nav-ico { display: none; }
  .crm-app .crm-nav .nav-foot { display: none; }
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: var(--ink); color: #fff; padding: 22px 14px 18px;
}
.brand { display: block; padding: 4px 10px 0; }
.brand img { display: block; width: 150px; height: auto; filter: brightness(0) invert(1); }
.brand-tag { margin: 4px 10px 18px; font-size: 13px; color: var(--accent); font-weight: 700; }
#nav { flex: 1; }
.nav-group { margin: 14px 0 4px; padding: 0 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: rgba(255,255,255,.45); }
.nav-link {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 10px;
  text-decoration: none; color: rgba(255,255,255,.82); font-size: 15px; transition: background .15s, color .15s;
}
.nav-link svg { flex: none; width: 19px; height: 19px; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link[aria-current="page"] { background: #fff; color: var(--ink); font-weight: 700; }
.nav-link .soon { margin-inline-start: auto; font-family: var(--mono); font-size: 10px; padding: 2px 6px; border-radius: 999px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.6); }
.nav-link[aria-current="page"] .soon { background: var(--soft); color: var(--ink); }
.logout { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; margin-top: 14px; border-radius: 10px; color: rgba(255,255,255,.65); text-decoration: none; font-size: 14px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; }
.logout svg { width: 18px; height: 18px; }
.logout:hover { color: #fff; }

.mbar { display: none; }
.scrim { display: none; }

main { padding: clamp(22px, 3.5vw, 44px) clamp(16px, 3.5vw, 44px) 80px; max-width: 1240px; width: 100%; margin: 0 auto; outline: none; min-width: 0; }

/* ---------- page heads ---------- */
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--accent); margin: 0 0 8px; }
.page-title { margin: 0 0 6px; font-size: clamp(28px, 3.6vw, 44px); line-height: 1.08; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.page-sub { margin: 0 0 28px; color: var(--muted); font-size: 17px; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.head-row .page-sub { margin: 0; }
h2.sec { margin: 0 0 14px; font-size: 21px; font-weight: 800; color: var(--ink); display: flex; align-items: baseline; gap: 10px; }
h2.sec small { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; white-space: nowrap;
  text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; font-size: 15px;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.icon-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: color .15s, border-color .15s; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- dashboard ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.hello .page-sub { margin: 0; }
.today-date { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.quote-card {
  position: relative; overflow: hidden; border-radius: 24px; padding: clamp(24px, 4vw, 40px);
  background: var(--ink); color: #fff; box-shadow: var(--shadow); margin-bottom: 26px;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 36px 36px;
}
.quote-card::after { content: ''; position: absolute; inset-inline-start: -60px; bottom: -80px; width: 220px; height: 220px; border-radius: 50%; background: var(--accent); opacity: .22; filter: blur(4px); pointer-events: none; }
.quote-card .eyebrow { color: var(--accent); }
.quote-text { position: relative; z-index: 1; margin: 0; font-size: clamp(22px, 3vw, 34px); line-height: 1.3; font-weight: 800; max-width: 30ch; }
.quote-src { position: relative; z-index: 1; margin: 12px 0 0; color: rgba(255,255,255,.7); font-size: 15px; }
.quote-actions { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.quote-actions .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; }
.quote-actions .btn:hover { background: rgba(255,255,255,.18); box-shadow: none; }
.quote-actions .btn[aria-pressed="true"] svg { fill: var(--accent); stroke: var(--accent); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi b { display: block; font-family: var(--mono); font-weight: 400; font-size: clamp(28px, 3vw, 38px); line-height: 1; color: var(--ink); }
.kpi span { display: block; margin-top: 8px; font-weight: 700; color: var(--text); font-size: 15px; }
.kpi small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.kpi.off b { color: #c9c3dc; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: clamp(18px, 2.4vw, 24px); min-width: 0; }
.card h2.sec { font-size: 19px; }
.empty { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--bg); color: var(--muted); font-size: 14.5px; }
.empty svg { flex: none; width: 22px; height: 22px; color: var(--ink); opacity: .5; margin-top: 1px; }
.empty b { color: var(--ink); }

.stages { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.stage { text-align: center; padding: 12px 6px; border-radius: 12px; background: var(--bg); min-width: 0; }
.stage b { display: block; font-family: var(--mono); font-weight: 400; font-size: 22px; color: #c9c3dc; }
.stage span { display: block; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

.quick { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- coming soon ---------- */
.soon-card { max-width: 720px; }
.soon-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--soft); color: var(--ink); font-weight: 700; font-size: 14px; margin-bottom: 18px; }
.soon-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.soon-list li { display: flex; gap: 10px; align-items: flex-start; }
.soon-list li::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 9px; }

/* ---------- quotes manager ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.field-search { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.field-search svg { position: absolute; inset-inline-start: 13px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); }
.field-search input { width: 100%; height: 44px; padding-inline: 42px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; outline: none; }
.field-search input:focus, .input:focus, .select:focus, textarea.input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(43,14,106,.08); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-btn { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; color: var(--muted); }
.chip-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.qlist { display: grid; gap: 10px; }
.qrow { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.qrow.off { opacity: .55; }
.qrow .qbody { flex: 1; min-width: 0; }
.qrow .qbody p { margin: 0; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.qrow .qbody small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: 12px; font-weight: 700; margin-inline-start: 6px; }
.qrow .act { display: flex; gap: 6px; flex: none; }
.icon-btn.fav[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.icon-btn.fav[aria-pressed="true"] svg { fill: var(--accent); }
.count { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label.lbl { display: grid; gap: 6px; font-weight: 700; font-size: 14.5px; color: var(--ink); }
label.lbl small { font-weight: 400; color: var(--muted); }
.input, .select { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; outline: none; font-weight: 400; color: var(--text); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.form-actions { display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; margin-top: 4px; }
.err-msg { color: var(--red); font-size: 14px; margin: 0; }

dialog { border: 0; border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(43,14,106,.45); color: var(--text); }
dialog::backdrop { background: rgba(26, 10, 60, .45); backdrop-filter: blur(2px); }
.dlg-in { padding: 24px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dlg-head h2 { margin: 0; font-size: 21px; color: var(--ink); }

.toast { position: fixed; inset-inline-start: 50%; bottom: 24px; translate: 50% 20px; z-index: 90; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, translate .2s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; translate: 50% 0; }
.loading { color: var(--muted); padding: 40px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .mbar {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: rgba(250,248,245,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  /* RTL: the burger (first) sits on the RIGHT, the logo on the LEFT */
  .burger { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
  .burger svg { width: 22px; height: 22px; }
  .mbrand img { display: block; height: 30px; width: auto; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; width: min(300px, 86vw); height: 100dvh; translate: 100% 0; transition: translate .25s ease; }
  .side.open { translate: 0 0; }
  .scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(26,10,60,.4); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qrow { flex-wrap: wrap; }
  .qrow .act { width: 100%; justify-content: flex-end; }
  .quote-actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* login page bits shared with login.html */
.login-wrap { font-size: 16px; }

/* ---------- meetings module (booking system) inside the panel ---------- */
.bk-app .bk-nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-bottom: 14px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.bk-app .bk-nav-i { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 15px; border: 1px solid transparent; }
.bk-app .bk-nav-i span { display: grid; place-items: center; }
.bk-app .bk-nav-i svg { width: 19px; height: 19px; }
.bk-app .bk-nav-i:hover { background: #fff; border-color: var(--line); color: var(--ink); }
.bk-app .bk-nav-i.on { background: var(--ink); color: #fff; }
.bk-app .bk-nav-i.ext { margin-inline-start: auto; }
.bk-app .bk-content { padding: 0; max-width: none; min-height: 0; }
@media (max-width: 760px) {
  .bk-app .bk-nav { gap: 4px; }
  .bk-app .bk-nav-i { min-height: 36px; padding: 0 10px; font-size: 14px; gap: 6px; }
  .bk-app .bk-nav-i svg { display: none; }
  .bk-app .bk-nav-i.ext { margin-inline-start: 0; }
}

/* contact card: meetings */
.crm-app .meet-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.crm-app .meet-box h3 { margin: 0 0 8px; font-size: 17px; color: var(--ink); display: flex; gap: 8px; align-items: baseline; }
.crm-app .meet-box h3 small { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 400; }
.crm-app .meet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.crm-app .meet-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; background: var(--bg); font-size: 14.5px; }
.crm-app .meet-list li b { color: var(--ink); }
.crm-app .meet-list li span { color: var(--muted); flex: 1; min-width: 0; }
.crm-app .meet-list li.is-off { opacity: .6; }

/* dashboard: today */
.today-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.today-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); min-width: 0; }
.today-list .t { font-family: var(--mono); font-size: 13px; color: var(--ink); flex: none; min-width: 44px; }
.today-list .w { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.today-list .w b { display: block; color: var(--ink); }
.today-list .w small { color: var(--muted); font-size: 13px; }
.today-list a.w { text-decoration: none; }
.today-sub { margin: 14px 0 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.kpi a { color: inherit; text-decoration: none; }
a.kpi { text-decoration: none; color: inherit; display: block; }
a.kpi:hover { border-color: var(--ink); }

/* the panel's side menu takes 248px, so the contact card stacks earlier than in the stand-alone CRM */
@media (max-width: 1240px) {
  .crm-app .card-grid { grid-template-columns: minmax(0, 1fr); }
  .crm-app .details { position: static; }
}

/* ---------- leads ---------- */
.head-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.warn { color: var(--red); font-weight: 700; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.lead-list { display: grid; gap: 10px; }
.lead { display: flex; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-inline-start: 4px solid var(--soft); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.lead.tone-new { border-inline-start-color: var(--accent); }
.lead.tone-work { border-inline-start-color: var(--amber); }
.lead.tone-meet { border-inline-start-color: var(--ink); }
.lead.tone-won { border-inline-start-color: var(--green); }
.lead.tone-lost { opacity: .6; }
.lead-main { flex: 1; min-width: 0; }
.lead-name { all: unset; cursor: pointer; font-weight: 700; font-size: 17px; color: var(--ink); overflow-wrap: anywhere; }
.lead-name:hover { text-decoration: underline; }
.lead-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.lead-meta { margin: 2px 0 0; color: var(--text); font-size: 14.5px; overflow-wrap: anywhere; }
.lead-sub { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; color: var(--muted); font-size: 13px; }
.lead-sub .tag { margin: 0; }
.lead-sub a { display: inline-flex; gap: 4px; align-items: center; color: var(--green); font-weight: 700; text-decoration: none; }
.lead-sub a svg { width: 14px; height: 14px; }
.lead-notes { margin: 8px 0 0; padding: 8px 10px; background: var(--bg); border-radius: 10px; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.lead-acts { display: flex; gap: 6px; align-items: center; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.lead-icons { display: flex; gap: 6px; }
.status-sel { width: auto; min-width: 132px; min-height: 40px; padding: 6px 10px; font-size: 14px; }
.icon-btn.wa { color: #1f9d55; border-color: rgba(31,157,85,.35); }
.icon-btn.wa:hover { background: #1f9d55; color: #fff; border-color: #1f9d55; }
.ro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.ro { background: var(--bg); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.ro span { display: block; font-size: 12px; color: var(--muted); }
.ro b { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.ro-msg { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--soft); white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .lead { flex-direction: column; align-items: stretch; gap: 10px; }
  .lead-acts { justify-content: space-between; }
  .status-sel { flex: 1; }
}

/* ---------- projects ---------- */
a.stage { text-decoration: none; color: inherit; }
.stage.on b { color: var(--ink); }
.proj-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.proj { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--soft); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; transition: border-color .15s, transform .15s; }
.proj:hover { transform: translateY(-2px); }
.proj.tone-work { border-top-color: var(--amber); }
.proj.tone-meet { border-top-color: var(--ink); }
.proj.tone-won { border-top-color: var(--green); }
.proj.tone-lost { opacity: .7; }
.proj-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.proj-top > div { min-width: 0; }
.proj-name { display: block; font-size: 18px; color: var(--ink); overflow-wrap: anywhere; }
.proj-top small { color: var(--muted); font-size: 13px; }
.proj-top .tag { flex: none; margin: 2px 0 0; }
.proj-line { display: flex; align-items: center; gap: 6px; margin: 12px 0 8px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.proj-line svg { width: 16px; height: 16px; flex: none; }
.proj-line b { color: var(--text); }
.bar { height: 8px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ink), var(--accent)); border-radius: inherit; }
.proj-money { display: flex; justify-content: space-between; gap: 8px; margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.proj-money b { color: var(--text); font-family: var(--mono); font-weight: 400; }
.proj-next { margin: 4px 0 0; font-size: 12.5px; color: var(--amber); }

.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; }
.back svg { width: 16px; height: 16px; }
.back:hover { color: var(--ink); }
.pj-status { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.pj-status .lbl { flex: 1 1 200px; max-width: 280px; }
.pj-sec { margin-top: 18px; }
.pj-sec h2.sec small { display: block; margin-top: 2px; font-weight: 400; }
.pj-steps { display: grid; gap: 10px; margin-top: 12px; }
.pj-add { margin-top: 14px; }
.chk { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; flex: 1; }
.chk input { flex: none; width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.chk span, .chk b { min-width: 0; overflow-wrap: anywhere; }
.row-acts { display: flex; gap: 4px; flex: none; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 15px; height: 15px; }

.pay { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; border: 1px solid rgba(201,138,27,.45); background: linear-gradient(90deg, rgba(201,138,27,.10), rgba(238,116,116,.06)); }
.pay .badge { flex: none; padding: 2px 9px; border-radius: 999px; background: rgba(201,138,27,.18); color: #8a5c0c; font-size: 12px; font-weight: 700; }
.pay-t { font-weight: 700; }
.pay.done .pay-t { text-decoration: line-through; color: var(--muted); }
.pay.done { background: rgba(47,158,110,.07); border-color: rgba(47,158,110,.4); }
.amt { display: flex; align-items: center; gap: 4px; flex: none; font-family: var(--mono); color: var(--amber); font-weight: 700; }
.amt input { width: 92px; min-height: 36px; padding: 4px 8px; font-family: var(--mono); text-align: end; }

.stg { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.stg-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg); }
.stg.done .stg-head { background: var(--soft); }
.stg-head b { font-size: 16px; color: var(--ink); }
.stg.done .stg-head b { text-decoration: line-through; opacity: .7; }
.stg-meta { flex: none; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.tasks { list-style: none; margin: 0; padding: 4px 14px; }
.tasks li { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.tasks li:first-child { border-top: 0; }
.tasks li.done span { text-decoration: line-through; color: var(--muted); }
.time { display: flex; gap: 6px; flex: none; }
.time label { display: flex; align-items: center; gap: 3px; }
.time input { width: 58px; min-height: 34px; padding: 2px 6px; font-family: var(--mono); text-align: center; }
.time small { color: var(--muted); font-size: 12px; }
.add-task { margin: 2px 14px 12px; }

.legal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.legal-i { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.legal-i input { grid-row: span 2; width: 20px; height: 20px; accent-color: var(--green); margin: 0; }
.legal-i small { color: var(--muted); font-size: 12.5px; }
.legal-i.on { border-color: rgba(47,158,110,.5); background: rgba(47,158,110,.06); }
.legal-i:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.recs { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; gap: 8px; }
.recs li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
.recs li.done span { text-decoration: line-through; color: var(--muted); }

@media (max-width: 760px) {
  .pay { flex-wrap: wrap; }
  .pay .chk { flex: 1 1 100%; flex-wrap: wrap; }
  .pay .amt { margin-inline-end: auto; }
  .stg-head { flex-wrap: wrap; gap: 8px; }
  .stg-head .chk { flex: 1 1 100%; }
  .stg-head .stg-meta { margin-inline-end: auto; }
  .tasks li { flex-wrap: wrap; gap: 8px; }
  .tasks li .chk { flex: 1 1 100%; }
  .tasks li .time { margin-inline-end: auto; }
  .legal { grid-template-columns: 1fr; }
  .pj-status .lbl { max-width: none; }
}

/* ---------- quotes ---------- */
.save-state { margin-inline-start: 8px; font-size: 13px; color: var(--muted); }
.of-more { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.pj-status .lbl:has(#of-lang) { flex: 0 1 110px; }
.warn-box { background: #fff6e8; border: 1px solid #f1d5a2; color: #7a5208; border-radius: 12px; padding: 10px 14px; margin: 0 0 16px; }
.ln-head, .ln { display: grid; grid-template-columns: 92px minmax(120px, 1.1fr) minmax(140px, 1.6fr) 128px 84px 86px auto; gap: 8px; align-items: center; }
.ln-head { font-size: 12.5px; color: var(--muted); padding: 0 2px 6px; margin-top: 10px; }
.ln-head span:nth-child(5) { grid-column: 6; }
.ln { padding: 6px 0; border-top: 1px solid var(--line); }
.ln .input { min-height: 38px; padding: 6px 10px; font-size: 14.5px; min-width: 0; }
.ln-manual[hidden] { display: block !important; visibility: hidden; }
.ln-price { font-family: var(--mono); font-weight: 400; font-size: 14px; color: var(--ink); text-align: end; }
.le { display: grid; gap: 8px; margin-top: 10px; }
.le-row { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.le-row:first-child { border-top: 0; }
.le-row .input { min-height: 38px; padding: 6px 10px; font-size: 14.5px; min-width: 0; }
.le-row textarea.input { flex: 2 1 260px; min-height: 38px; resize: vertical; }
.le-title { flex: 1 1 180px; }
.le-days, .le-value, .le-price, .le-pct { flex: 0 0 96px; }
.le-text { flex: 1 1 auto !important; }
.le-chk { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); white-space: nowrap; min-height: 38px; }
.le-chk input { width: 18px; height: 18px; accent-color: var(--accent); }
.le-calc { flex: 0 0 90px; font-family: var(--mono); color: var(--ink); min-height: 38px; display: flex; align-items: center; }
.le > .btn { justify-self: start; }
.price-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.tile-p { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 6px; }
.tile-p b { color: var(--ink); }
@media (max-width: 1100px) {
  .ln-head { display: none; }
  .ln { grid-template-columns: 92px 1fr 128px; }
  .ln-desc { grid-column: 1 / -1; grid-row: 2; }
  .ln-manual { grid-column: 1; grid-row: 3; }
  .ln-price { grid-column: 2; grid-row: 3; text-align: start; }
  .ln .row-acts { grid-column: 3; grid-row: 3; justify-content: flex-end; }
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .ln { grid-template-columns: 1fr 1fr; }
  .ln-name { grid-column: 1 / -1; grid-row: 1; }
  .ln-kind { grid-column: 1; grid-row: 2; }
  .ln-cx { grid-column: 2; grid-row: 2; }
  .ln-desc { grid-column: 1 / -1; grid-row: 3; }
  .ln-manual { grid-column: 1; grid-row: 4; }
  .ln-price { grid-column: 1; grid-row: 4; text-align: start; }
  .ln-manual:not([hidden]) + .ln-price { grid-column: 2; }
  .ln .row-acts { grid-column: 2; grid-row: 4; }
  .ln-manual:not([hidden]) ~ .row-acts { grid-row: 5; grid-column: 1 / -1; }
  .le-row { flex-wrap: wrap; }
  .le-row .input, .le-row textarea.input { flex: 1 1 100%; }
  .le-days, .le-value, .le-price, .le-pct { flex: 1 1 40% !important; }
  .price-grid { grid-template-columns: 1fr; }
  .of-more { width: 100%; }
}

/* ---------- calls ---------- */
.call-snip { margin: 8px 0; font-size: 14px; color: var(--muted); line-height: 1.6; }
.call-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.call-grid > .card { margin: 0; }
.rec-modes { border: 0; padding: 0; margin: 6px 0 14px; display: grid; gap: 10px; }
.rec-mode { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.rec-mode:has(input:checked) { border-color: var(--ink); background: var(--soft); }
.rec-mode input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--ink); flex: none; }
.rec-mode b { display: block; color: var(--ink); }
.rec-mode small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.55; margin-top: 2px; }
.btn.big { min-height: 50px; padding: 0 22px; font-size: 16.5px; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.hint { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 10px 0 0; }
.call-notes { background: var(--bg); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; white-space: pre-wrap; }
.q-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; line-height: 1.55; }
.q-list label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.q-list input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--green); flex: none; }
.q-list input:checked + * , .q-list label:has(input:checked) { color: var(--muted); text-decoration: line-through; }
.rec-card.live { border-color: var(--red); }
.rec-time { font-size: 44px; color: var(--ink); margin: 4px 0 10px; direction: ltr; text-align: start; }
.meter { height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-bottom: 4px; --lvl: 0; }
.meter i { display: block; height: 100%; width: calc(var(--lvl) * 100%); background: var(--green); transition: width .25s; }
.rec-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--red); animation: recpulse 1.2s infinite; flex: none; }
.rec-dot.off { background: var(--amber); }
@keyframes recpulse { 50% { opacity: .35; } }
.sec .rec-dot { margin-inline-end: 8px; }
.rec-bar { position: fixed; z-index: 40; bottom: 16px; inset-inline-start: 50%; transform: translateX(50%); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  background: var(--ink); color: #fff; padding: 8px 10px 8px 16px; border-radius: 999px; box-shadow: 0 12px 30px -10px rgba(43,14,106,.6); max-width: calc(100vw - 32px); }
.rec-bar a { color: #fff; text-decoration: none; }
.rec-bar .btn { background: #fff; color: var(--ink); border-color: #fff; }
.rec-warn { font-size: 12.5px; color: #ffd3d3; }
.c-steps { margin: 4px 0 0; padding-inline-start: 22px; display: grid; gap: 8px; color: var(--muted); }
.c-steps li { padding: 2px 0; }
.c-steps[data-step="upload"] li[data-s="upload"], .c-steps[data-step="transcribe"] li[data-s="transcribe"], .c-steps[data-step="analyze"] li[data-s="analyze"] { color: var(--ink); font-weight: 700; }
.c-steps[data-step="transcribe"] li[data-s="upload"], .c-steps[data-step="analyze"] li[data-s="upload"], .c-steps[data-step="analyze"] li[data-s="transcribe"] { color: var(--green); }
.player { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.player-card .player { margin: 0; }
.player audio { flex: 1 1 320px; min-width: 0; height: 42px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 12px; }
.tab { flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.call-sum { line-height: 1.75; margin: 0; white-space: pre-wrap; }
.call-next { margin: 12px 0 0; padding: 10px 12px; background: var(--soft); border-radius: 12px; }
.score { margin: 0 0 8px; color: var(--muted); }
.score b { font-size: 40px; color: var(--ink); }
.kp { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kp li { display: flex; gap: 10px; align-items: baseline; line-height: 1.6; }
.tlink { flex: none; border: 0; background: var(--soft); color: var(--ink); border-radius: 8px; padding: 2px 8px; font-size: 13px; cursor: pointer; direction: ltr; min-height: 26px; }
.tlink:hover { background: var(--ink); color: #fff; }
.qa { margin: 0; display: grid; gap: 4px; }
.qa dt { font-weight: 700; color: var(--ink); margin-top: 8px; }
.qa dd { margin: 0; line-height: 1.6; }
.tr-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tr-head .sec { margin: 0; }
.sp-names { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.sp-names .lbl { flex: 0 1 200px; }
.tr { display: grid; gap: 10px; margin-top: 12px; }
.seg { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: baseline; margin: 0; line-height: 1.7; }
.seg b { color: var(--ink); white-space: nowrap; font-size: 14px; }
.seg span { min-width: 0; overflow-wrap: anywhere; }
.task-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; line-height: 1.55; }
.task-row:first-of-type { border-top: 0; }
.task-row input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--green); flex: none; }
.task-row:has(input:checked) span { color: var(--muted); text-decoration: line-through; }
.task-row small { color: var(--muted); }
.big-text { width: 100%; min-height: 220px; line-height: 1.7; resize: vertical; }
.big-text.tall { min-height: 480px; }
.q-set { display: grid; gap: 16px; }
.q-set .card { margin: 0; }
@media (max-width: 900px) { .call-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .seg { grid-template-columns: auto 1fr; }
  .seg span { grid-column: 1 / -1; }
  .rec-time { font-size: 36px; }
  .rec-bar { bottom: 10px; border-radius: 18px; padding: 8px 12px; }
}
.warn-box { display: flex; gap: 8px; align-items: flex-start; line-height: 1.6; }
.warn-box svg { width: 18px; height: 18px; flex: none; margin-top: 3px; }
.head-acts .tag { align-self: center; margin: 0; padding: 4px 12px; }
.sec > svg { width: 20px; height: 20px; flex: none; vertical-align: -4px; margin-inline-end: 6px; color: var(--accent); }
