/* ============================================================
   TB ADVISORY — REPORT STUDIO
   App chrome: dark premium graphite + parsimonious gold.
   ============================================================ */

@font-face {
  font-family: "TatianaB";
  src: url("../assets/TatianaB-v2.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cinzel";
  src: url("../assets/Cinzel-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("../assets/CormorantGaramond-VariableFont_wght.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../assets/CormorantGaramond-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("../assets/EBGaramond-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../assets/EBGaramond-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Brand */
  --gold:        #C9A347;
  --gold-deep:   #8B6914;
  --gold-bright: #E0C277;
  --ink:         #1A1A1A;
  --paper:       #FFFFFF;
  --paper-tint:  #F5F5F0;
  --gray-mid:    #888880;

  /* App chrome (dark) */
  --bg:          #131211;
  --bg-2:        #1A1916;
  --panel:       #211F1B;
  --panel-2:     #272420;
  --line:        rgba(201,163,71,0.16);
  --line-soft:   rgba(255,255,255,0.06);
  --txt:         #ECE7DC;
  --txt-2:       #B6B0A2;
  --txt-3:       #837D70;

  --serif:     "Cormorant Garamond", "Georgia", serif;
  --serif-alt: "EB Garamond", "Cormorant Garamond", "Georgia", serif;
  --display:   "Cinzel", "Cormorant Garamond", "Georgia", serif;
  --sans:  "Inter", system-ui, -apple-system, sans-serif;
  --brand: "TatianaB", "Cinzel", "Cormorant Garamond", "Georgia", serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --shadow: 0 18px 50px -20px rgba(0,0,0,0.7);
  --gold-grad: linear-gradient(135deg, #E6CE8C 0%, #C9A347 38%, #8B6914 72%, #B8923A 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--sans);
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(201,163,71,0.08), transparent 60%),
    radial-gradient(900px 600px at -5% 100%, rgba(201,163,71,0.05), transparent 55%),
    var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { min-height: 100%; }

button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(201,163,71,0.32); color: #fff; }

/* ---- thin custom scrollbars ---- */
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-track { background: transparent; }
.scroll::-webkit-scrollbar-thumb {
  background: rgba(201,163,71,0.22);
  border-radius: 20px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.scroll::-webkit-scrollbar-thumb:hover { background: rgba(201,163,71,0.4); background-clip: content-box; }

/* ============================================================
   App shell
   ============================================================ */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px; height: 66px;
  background: rgba(19,18,17,0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.topbar .brand img.brand-icon { height: 34px; width: auto; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
.brand-txt { display: flex; flex-direction: column; line-height: 1; gap: 6px; }
.brand-txt .brand-logo { height: 15px; width: auto; display: block; }
.brand-txt .wm { font-family: var(--serif); font-weight: 600; font-size: 20px; letter-spacing: 0.18em; color: var(--gold); }
.brand-txt .sub { font-size: 9.5px; letter-spacing: 0.42em; color: var(--txt-3); text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a {
  font-size: 13px; letter-spacing: 0.04em; color: var(--txt-2);
  padding: 8px 16px; border-radius: 100px; text-decoration: none;
  transition: all .18s ease; position: relative; cursor: pointer;
}
.nav a:hover { color: var(--txt); background: rgba(255,255,255,0.04); }
.nav a.active { color: var(--ink); background: var(--gold-grad); font-weight: 600; box-shadow: 0 4px 14px -4px rgba(201,163,71,0.6); }

.topbar .spacer { flex: 1; }

.lang-toggle { display: flex; border: 1px solid var(--line); border-radius: 100px; overflow: hidden; flex-shrink: 0; }
.lang-toggle button {
  background: transparent; border: 0; color: var(--txt-3);
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; padding: 6px 12px; transition: all .16s;
}
.lang-toggle button.on { background: var(--gold); color: var(--ink); }

/* session chip */
.session { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding-left: 4px; }
.session-av {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(150deg, rgba(201,163,71,0.9), rgba(201,163,71,0.5));
  color: var(--ink); display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 13px;
}
.session-id { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.session-id b { font-size: 12.5px; font-weight: 600; color: var(--txt); white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.session-id i { font-style: normal; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }
.session-out {
  background: none; border: 0; color: var(--txt-3); padding: 7px; border-radius: 8px;
  display: flex; transition: all .15s;
}
.session-out:hover { color: var(--gold); background: rgba(201,163,71,0.1); }

/* generic buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border-radius: 100px; border: 1px solid var(--line); background: var(--panel);
  color: var(--txt); font-size: 13px; font-weight: 500; padding: 9px 18px;
  transition: all .18s ease; letter-spacing: 0.01em;
}
.btn:hover { border-color: rgba(201,163,71,0.5); background: var(--panel-2); transform: translateY(-1px); }
.btn svg { width: 15px; height: 15px; }
.btn-gold { background: var(--gold-grad); color: var(--ink); border-color: transparent; font-weight: 600; box-shadow: 0 6px 18px -6px rgba(201,163,71,0.55); }
.btn-gold:hover { filter: brightness(1.06); box-shadow: 0 9px 24px -7px rgba(201,163,71,0.7); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: 50%; }
.btn-danger:hover { border-color: rgba(200,80,70,0.6); color: #e88; }

/* ============================================================
   Page wrap
   ============================================================ */
.page-wrap { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 44px 28px 80px; }
.eyebrow { font-size: 11px; letter-spacing: 0.4em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.h-display { font-family: var(--brand); font-weight: 500; letter-spacing: 0.01em; color: var(--txt); }

.rule-gold { height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .5; }

/* ---- Home hero ---- */
.hero { text-align: center; padding: 26px 0 48px; position: relative; }
.hero .filete { width: 54px; height: 1.5px; background: var(--gold); margin: 0 auto 22px; }
.hero h1 { font-family: var(--brand); font-size: clamp(36px, 5.6vw, 58px); font-weight: 500; margin: 8px 0 0; line-height: 1.04; letter-spacing: 0.005em; }
.hero h1 em { font-style: italic; color: var(--gold); }
.hero p { color: var(--txt-2); font-size: 16px; max-width: 540px; margin: 18px auto 0; line-height: 1.6; }
.hero-cta { margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.hero-cta-or { font-size: 12px; letter-spacing: 0.08em; color: var(--txt-3); text-transform: uppercase; }
.ai-topbtn { flex-shrink: 0; }
@media (max-width: 640px) { .ai-topbtn span, .ai-topbtn { font-size: 0; } .ai-topbtn svg { margin: 0; } }

/* ---- Type gallery ---- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 10px; }
.type-card {
  position: relative; text-align: left; background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 24px 24px; overflow: hidden; transition: all .22s cubic-bezier(.2,.7,.3,1);
  display: flex; flex-direction: column; min-height: 186px;
}
.type-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(150deg, rgba(201,163,71,0.5), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .25s;
}
.type-card:hover { transform: translateY(-4px); background: linear-gradient(180deg, rgba(201,163,71,0.06), rgba(255,255,255,0)); box-shadow: var(--shadow); border-color: rgba(201,163,71,0.35); }
.type-card:hover::before { opacity: 1; }
.type-card .tc-icon { width: 46px; height: 46px; color: var(--gold); margin-bottom: 18px; }
.type-card .tc-icon svg { width: 100%; height: 100%; stroke-width: 1.3; }
.type-card h3 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0 0 6px; color: var(--txt); }
.type-card p { font-size: 13px; color: var(--txt-2); margin: 0; line-height: 1.5; flex: 1; }
.type-card .tc-go { margin-top: 16px; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); display: flex; align-items: center; gap: 8px; opacity: 0; transform: translateX(-6px); transition: all .22s; }
.type-card:hover .tc-go { opacity: 1; transform: translateX(0); }
.type-card .tc-num { position: absolute; top: 20px; right: 22px; font-family: var(--serif); font-size: 15px; color: var(--txt-3); font-style: italic; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 46px 0 20px; }
.section-head h2 { font-family: var(--brand); font-size: 25px; font-weight: 500; margin: 0; }
.section-head .meta { font-size: 12px; color: var(--txt-3); letter-spacing: 0.04em; }

/* ============================================================
   Library
   ============================================================ */
.lib-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 100px; padding: 0 18px; height: 42px;
}
.search input { flex: 1; background: transparent; border: 0; outline: none; color: var(--txt); font-size: 14px; }
.search input::placeholder { color: var(--txt-3); }
.search svg { width: 16px; height: 16px; color: var(--txt-3); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 7px 14px; border-radius: 100px; border: 1px solid var(--line); color: var(--txt-2); background: transparent; transition: all .16s; }
.chip:hover { color: var(--txt); border-color: rgba(201,163,71,0.4); }
.chip.on { background: var(--gold-grad); color: var(--ink); border-color: transparent; font-weight: 600; }

.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.doc-card {
  text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; transition: all .2s; display: flex; flex-direction: column;
}
.doc-card:hover { transform: translateY(-3px); border-color: rgba(201,163,71,0.4); box-shadow: var(--shadow); }
.doc-thumb { height: 150px; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.doc-thumb .mini-cover { transform: scale(0.42); transform-origin: center; }
.doc-card .dc-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.dc-type { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.dc-title { font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 7px 0 4px; line-height: 1.15; color: var(--txt); }
.dc-meta { font-size: 12px; color: var(--txt-3); margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; }
.dc-actions { display: flex; gap: 6px; padding: 0 14px 14px; }

.empty-state { text-align: center; padding: 80px 20px; border: 1px dashed var(--line); border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent); }
.empty-state .es-mark { width: 80px; height: 80px; margin: 0 auto 22px; opacity: 0.85; }
.empty-state h3 { font-family: var(--brand); font-size: 26px; font-weight: 500; margin: 0 0 8px; }
.empty-state p { color: var(--txt-2); max-width: 380px; margin: 0 auto 24px; line-height: 1.6; }

/* ============================================================
   Editor
   ============================================================ */
.editor { display: grid; grid-template-columns: 408px 1fr; height: calc(100vh - 66px); overflow: hidden; }
.ed-form { border-right: 1px solid var(--line); background: var(--bg-2); overflow-y: auto; padding: 0 0 60px; }
.ed-preview { background: #0E0D0C; overflow-y: auto; position: relative; }

.ed-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 14px 22px; background: rgba(26,25,22,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.ed-bar .back { color: var(--txt-2); display: flex; align-items: center; gap: 7px; font-size: 13px; background: none; border: 0; }
.ed-bar .back:hover { color: var(--gold); }
.ed-bar .title-mini { font-family: var(--serif); font-size: 16px; font-weight: 600; flex: 1; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.preview-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; padding: 12px 22px; background: rgba(14,13,12,0.9); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,0.05); }
.preview-bar .pb-label { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--txt-3); }
.zoom-ctl { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 100px; padding: 2px; }
.zoom-ctl button { background: none; border: 0; color: var(--txt-2); width: 26px; height: 26px; border-radius: 50%; font-size: 15px; display: grid; place-items: center; }
.zoom-ctl button:hover { background: rgba(255,255,255,0.06); color: var(--txt); }
.zoom-ctl span { font-size: 11px; color: var(--txt-3); min-width: 38px; text-align: center; }

/* preview stage */
.preview-stage { padding: 34px; display: flex; flex-direction: column; align-items: center; gap: 26px; }

/* form sections */
.fgroup { border-bottom: 1px solid var(--line-soft); }
.fgroup-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px; width: 100%; background: none; border: 0; color: var(--txt); text-align: left; }
.fgroup-head:hover { background: rgba(255,255,255,0.02); }
.fgroup-head .fg-ico { width: 16px; height: 16px; color: var(--gold); flex-shrink: 0; }
.fgroup-head .fg-title { flex: 1; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; color: var(--txt-2); }
.fgroup-head .chev { transition: transform .2s; color: var(--txt-3); }
.fgroup-head.open .chev { transform: rotate(90deg); }
.fgroup-body { padding: 4px 22px 22px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; color: var(--txt-3); letter-spacing: 0.06em; margin-bottom: 6px; text-transform: uppercase; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--txt); font-family: var(--sans); font-size: 13.5px; padding: 10px 12px; outline: none; transition: border-color .16s, box-shadow .16s;
}
.field textarea { resize: vertical; min-height: 78px; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: rgba(201,163,71,0.6); box-shadow: 0 0 0 3px rgba(201,163,71,0.1); }
.field input::placeholder, .field textarea::placeholder { color: var(--txt-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { font-size: 11px; color: var(--txt-3); margin-top: 5px; line-height: 1.4; }

.seg { display: flex; gap: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg button { flex: 1; background: var(--panel); border: 0; color: var(--txt-2); font-size: 12px; padding: 9px; transition: all .16s; }
.seg button.on { background: var(--gold-grad); color: var(--ink); font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.toggle-row .tr-label { font-size: 13px; color: var(--txt-2); }
.switch { width: 40px; height: 23px; border-radius: 100px; background: var(--panel-2); border: 1px solid var(--line); position: relative; transition: all .18s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; width: 17px; height: 17px; border-radius: 50%; background: var(--txt-3); top: 2px; left: 2px; transition: all .2s; }
.switch.on { background: var(--gold); border-color: transparent; }
.switch.on::after { background: var(--ink); transform: translateX(17px); }

/* section list in editor */
.sec-list { display: flex; flex-direction: column; gap: 8px; }
.sec-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); transition: border-color .16s; }
.sec-item.open { border-color: rgba(201,163,71,0.4); }
.sec-item-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px; }
.sec-item-head .grip { color: var(--txt-3); cursor: grab; display: flex; }
.sec-item-head .sec-name { flex: 1; font-size: 13px; color: var(--txt); font-weight: 500; background: none; border: 0; outline: none; padding: 2px 0; }
.sec-item-head .sec-name:focus { border-bottom: 1px solid var(--gold); }
.mini-btn { background: none; border: 0; color: var(--txt-3); width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center; transition: all .14s; }
.mini-btn:hover { background: rgba(255,255,255,0.06); color: var(--txt); }
.mini-btn.danger:hover { color: #e88; }
.mini-btn svg { width: 15px; height: 15px; }
.sec-item-body { padding: 0 12px 12px; border-top: 1px solid var(--line-soft); margin-top: 2px; padding-top: 12px; }

.block { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 10px; margin-bottom: 8px; position: relative; }
.block-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.block-head .bt { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 600; flex: 1; }
.block textarea, .block input { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; color: var(--txt); font-size: 13px; padding: 8px 10px; outline: none; font-family: var(--sans); }
.block textarea.code-area { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.5; background: #15140f; color: #d6cdb0; }
.block textarea:focus, .block input:focus { border-color: rgba(201,163,71,0.5); }

/* ---- per-section data importer ---- */
.sec-import { margin-bottom: 10px; }
.sec-import-toggle { width: 100%; display: flex; align-items: center; gap: 7px; background: var(--bg-2); border: 1px dashed var(--line); color: var(--txt-2); font-size: 12px; font-weight: 500; padding: 9px 12px; border-radius: var(--r-sm); transition: all .15s; }
.sec-import-toggle:hover { border-color: rgba(201,163,71,0.5); color: var(--gold); }
.sec-import-toggle.on { color: var(--gold); border-color: rgba(201,163,71,0.5); border-style: solid; background: rgba(201,163,71,0.05); }
.sec-import-toggle .chev { color: var(--txt-3); }
.imp-panel { margin-top: 8px; padding: 12px; background: #15140f; border: 1px solid var(--line); border-radius: var(--r-sm); display: flex; flex-direction: column; gap: 9px; }
.imp-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; border: 1px dashed var(--line); border-radius: 6px; color: var(--txt-3); font-size: 11.5px; text-align: center; cursor: pointer; transition: all .15s; background: rgba(255,255,255,0.01); }
.imp-drop svg { color: var(--gold); opacity: 0.8; }
.imp-drop:hover { border-color: rgba(201,163,71,0.5); color: var(--txt-2); }
.imp-drop.drag { border-color: var(--gold); background: rgba(201,163,71,0.08); color: var(--gold); }
.imp-drop.busy { cursor: progress; border-color: rgba(201,163,71,0.4); color: var(--gold); }
.imp-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(201,163,71,0.25); border-top-color: var(--gold); animation: imp-spin 0.7s linear infinite; }
@keyframes imp-spin { to { transform: rotate(360deg); } }
.imp-text { width: 100%; min-height: 92px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; color: var(--txt); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.55; padding: 9px 11px; outline: none; resize: vertical; }
.imp-text:focus { border-color: rgba(201,163,71,0.55); box-shadow: 0 0 0 3px rgba(201,163,71,0.08); }
.imp-text::placeholder { color: var(--txt-3); font-family: var(--sans); }
.imp-modes { display: flex; gap: 7px; align-items: stretch; }
.imp-seg { flex: 1; }
.imp-seg button { font-size: 11px; padding: 7px 4px; }
.imp-ai { display: flex; align-items: center; gap: 5px; white-space: nowrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--txt-2); font-size: 11px; font-weight: 600; padding: 0 12px; transition: all .15s; }
.imp-ai:hover:not(:disabled) { border-color: rgba(201,163,71,0.5); color: var(--gold); }
.imp-ai.on { background: var(--gold-grad); color: var(--ink); border-color: transparent; }
.imp-ai:disabled { opacity: 0.4; cursor: not-allowed; }
.imp-hint { font-size: 10.5px; line-height: 1.45; color: var(--txt-3); }
.imp-note { font-size: 11px; line-height: 1.45; color: var(--gold-bright); background: rgba(201,163,71,0.08); border: 1px solid rgba(201,163,71,0.22); border-radius: 5px; padding: 7px 10px; }
.imp-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.imp-actions .btn { flex: 0 0 auto; }
.bullet-row, .ref-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.bullet-row .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.bullet-row input, .ref-row input { flex: 1; }

.add-block-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.add-block-bar button { font-size: 11px; color: var(--txt-2); background: var(--panel); border: 1px dashed var(--line); border-radius: 100px; padding: 6px 12px; display: flex; align-items: center; gap: 5px; transition: all .15s; }
.add-block-bar button:hover { border-style: solid; border-color: rgba(201,163,71,0.5); color: var(--gold); }
.add-block-bar svg { width: 12px; height: 12px; }

/* mini table editor */
.tbl-ed { border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.tbl-ed table { width: 100%; border-collapse: collapse; }
.tbl-ed th, .tbl-ed td { border: 1px solid var(--line-soft); padding: 0; }
.tbl-ed input { border: 0 !important; border-radius: 0 !important; background: transparent !important; font-size: 12px !important; padding: 7px 8px !important; }
.tbl-ed thead input { color: var(--gold) !important; font-weight: 600; }
.tbl-ed .tbl-ctl { display: flex; gap: 6px; padding: 7px; background: var(--bg-2); }
.tbl-ed .tbl-ctl button { font-size: 11px; color: var(--txt-2); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 4px 9px; }
.tbl-ed .tbl-ctl button:hover { color: var(--gold); }

.callout-pick { display: flex; gap: 4px; margin-bottom: 8px; }
.callout-pick button { font-size: 10px; padding: 4px 9px; border-radius: 100px; border: 1px solid var(--line); background: var(--panel); color: var(--txt-3); }
.callout-pick button.on { color: var(--ink); font-weight: 600; }

.add-section-btn { width: 100%; margin-top: 12px; padding: 11px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: transparent; color: var(--txt-2); font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all .16s; }
.add-section-btn:hover { border-color: rgba(201,163,71,0.5); color: var(--gold); border-style: solid; }

/* mobile editor tabs */
.ed-tabs { display: none; }

/* toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--panel-2); border: 1px solid rgba(201,163,71,0.4); color: var(--txt); padding: 13px 22px; border-radius: 100px; font-size: 13px; z-index: 100; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all .3s cubic-bezier(.2,.8,.3,1); display: flex; align-items: center; gap: 10px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .tk { width: 16px; height: 16px; color: var(--gold); }

/* fade-in util */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp .5s cubic-bezier(.2,.7,.3,1) both; }

/* ============================================================
   AI Modal
   ============================================================ */
.ai-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(8,7,6,0.72); backdrop-filter: blur(8px); display: flex; align-items: flex-start; justify-content: center; padding: 48px 20px; overflow-y: auto; animation: fadeUp .25s ease both; }
.ai-modal { position: relative; width: 100%; max-width: 720px; background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); max-height: calc(100vh - 96px); overflow-y: auto; }
.ai-close { position: absolute; top: 16px; right: 16px; z-index: 4; width: 34px; height: 34px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); color: var(--txt-2); display: grid; place-items: center; }
.ai-close:hover { color: var(--txt); border-color: rgba(201,163,71,0.5); }

.ai-head { display: flex; align-items: flex-start; gap: 16px; padding: 30px 32px 22px; border-bottom: 1px solid var(--line-soft); }
.ai-spark { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; color: var(--ink); background: var(--gold-grad); box-shadow: 0 6px 18px -6px rgba(201,163,71,0.6); }
.ai-head h2 { font-family: var(--brand); font-size: 26px; font-weight: 600; margin: 0; color: var(--txt); }
.ai-head p { font-size: 13.5px; color: var(--txt-2); margin: 5px 0 0; line-height: 1.5; }

.ai-body { padding: 24px 32px 28px; }
.ai-step { margin-bottom: 24px; }
.ai-step-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 12px; }
.ai-data { width: 100%; min-height: 130px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--txt); font-family: var(--sans); font-size: 13.5px; line-height: 1.55; padding: 14px; outline: none; resize: vertical; }
.ai-data:focus { border-color: rgba(201,163,71,0.6); box-shadow: 0 0 0 3px rgba(201,163,71,0.1); }
.ai-data::placeholder { color: var(--txt-3); }
.ai-upload-row { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.ai-upload-hint { font-size: 12px; color: var(--txt-3); }

.ai-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ai-type { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--txt-2); transition: all .16s; }
.ai-type:hover { border-color: rgba(201,163,71,0.4); color: var(--txt); transform: translateY(-2px); }
.ai-type.on { border-color: var(--gold); background: rgba(201,163,71,0.1); color: var(--txt); }
.ai-type-ico { width: 26px; height: 26px; color: var(--gold); }
.ai-type-ico svg { width: 100%; height: 100%; stroke-width: 1.3; }
.ai-type-name { font-size: 11px; text-align: center; letter-spacing: 0.01em; line-height: 1.2; }

.ai-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.ai-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.ai-grid2 .field, .ai-grid3 .field { margin: 0; }

.ai-err { background: rgba(179,64,47,0.12); border: 1px solid rgba(179,64,47,0.4); color: #e8a99c; font-size: 13px; padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 14px; }
.ai-foot-hint { font-size: 11.5px; color: var(--txt-3); line-height: 1.5; margin-bottom: 18px; display: flex; gap: 7px; }
.ai-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* progress */
.ai-progress { padding: 60px 40px 64px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.ai-prog-ring { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; color: var(--gold); background: conic-gradient(var(--gold) var(--pct, 0%), rgba(201,163,71,0.14) 0%); position: relative; transition: background .4s ease; }
.ai-prog-ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--bg-2); }
.ai-prog-ring svg { position: relative; z-index: 2; }
.ai-prog-label { font-size: 15px; color: var(--txt); font-family: var(--serif); font-style: italic; text-align: center; min-height: 22px; }
.ai-prog-bar { width: 100%; max-width: 360px; height: 4px; border-radius: 4px; background: rgba(201,163,71,0.16); overflow: hidden; }
.ai-prog-fill { height: 100%; background: var(--gold-grad); border-radius: 4px; transition: width .4s ease; }
.ai-prog-step { font-size: 12px; color: var(--txt-3); letter-spacing: 0.1em; }

@media (max-width: 620px) {
  .ai-types { grid-template-columns: repeat(2, 1fr); }
  .ai-grid3 { grid-template-columns: 1fr; }
  .ai-head, .ai-body { padding-left: 20px; padding-right: 20px; }
}


@media (max-width: 1100px) {
  .gallery, .lib-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .topbar { gap: 13px; padding: 0 18px; }
  .nav { margin-left: 2px; gap: 2px; }
  .nav a { padding: 8px 12px; }
  .brand-txt .sub { display: none; }
}
@media (max-width: 1180px) {
  .ai-topbtn .ai-label { display: none; }
  .ai-topbtn { padding: 8px 12px; }
  .session-id { display: none; }
  .mem-pill span { display: none; }
  .mem-pill { padding: 7px 10px; }
  .topbar { gap: 11px; }
  .brand-txt { display: none; }
  .nav a { padding: 8px 11px; font-size: 12.5px; }
}

/* ============================================================
   Clients workspace
   ============================================================ */
.cli-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.cli-h1 { font-family: var(--brand); font-weight: 500; font-size: clamp(34px, 4.4vw, 48px); margin: 10px 0 0; line-height: 1.05; }
.cli-lead { color: var(--txt-2); font-size: 15px; line-height: 1.6; margin: 14px 0 0; max-width: 620px; text-wrap: pretty; }
.cli-add { flex-shrink: 0; }

.cli-search {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 100px;
  padding: 10px 18px; margin-bottom: 22px; max-width: 380px; color: var(--txt-3);
}
.cli-search input { flex: 1; background: none; border: 0; outline: none; color: var(--txt); font-family: var(--sans); font-size: 14px; }
.cli-search input::placeholder { color: var(--txt-3); }

.cli-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cli-card {
  text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px; cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s; display: flex; flex-direction: column; gap: 12px;
}
.cli-card:hover { transform: translateY(-3px); border-color: rgba(201,163,71,0.4); box-shadow: var(--shadow); }
.cli-card-top { display: flex; align-items: center; justify-content: space-between; }
.cli-avatar {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(150deg, rgba(201,163,71,0.9), rgba(201,163,71,0.45));
  color: var(--ink); display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: 0.02em;
}
.cli-avatar.lg { width: 58px; height: 58px; border-radius: 15px; font-size: 22px; }
.cli-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600;
  color: var(--txt-3); background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft);
  border-radius: 100px; padding: 4px 10px;
}
.cli-tag.on { color: var(--gold-bright); background: rgba(201,163,71,0.12); border-color: rgba(201,163,71,0.3); }
.cli-name { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0; color: var(--txt); line-height: 1.15; }
.cli-sector { font-size: 12.5px; color: var(--txt-3); margin-top: -6px; }
.cli-stats { display: flex; gap: 16px; }
.cli-stats span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--txt-2); }
.cli-stats svg { color: var(--gold-deep); }
.cli-card-terms { display: flex; flex-wrap: wrap; gap: 6px; }
.cli-card-terms span { font-size: 11px; color: var(--txt-3); background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 100px; padding: 3px 9px; }

/* create dialog */
.cli-modal-back, .cli-drawer-back {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(8,7,6,0.62); backdrop-filter: blur(4px);
  display: flex; animation: cli-fade .18s ease;
}
@keyframes cli-fade { from { opacity: 0; } }
.cli-modal-back { align-items: center; justify-content: center; }
.cli-create {
  width: min(420px, 92vw); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow);
}
.cli-create h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 0 0 18px; color: var(--txt); }
.cli-create-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.cli-err { color: #e8a99c; font-size: 12.5px; margin-top: 9px; }

.cli-input, .cli-area {
  width: 100%; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--txt); font-family: var(--sans); font-size: 14px;
  padding: 12px 14px; outline: none; transition: border-color .16s, box-shadow .16s;
}
.cli-area { resize: vertical; line-height: 1.55; }
.cli-input:focus, .cli-area:focus { border-color: rgba(201,163,71,0.55); box-shadow: 0 0 0 3px rgba(201,163,71,0.1); }
.cli-input::placeholder, .cli-area::placeholder { color: var(--txt-3); }

/* drawer */
.cli-drawer-back { justify-content: flex-end; }
.cli-drawer {
  width: min(560px, 100vw); height: 100%; background: var(--bg-2);
  border-left: 1px solid var(--line); display: flex; flex-direction: column;
  animation: cli-slide .26s cubic-bezier(.2,.7,.3,1); box-shadow: -30px 0 60px -20px rgba(0,0,0,0.7);
}
@keyframes cli-slide { from { transform: translateX(40px); opacity: 0.4; } }
.cli-drawer-head {
  display: flex; align-items: center; gap: 16px; padding: 24px 26px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-2); z-index: 2;
}
.cli-drawer-id { flex: 1; min-width: 0; }
.cli-drawer-id h2 { font-family: var(--serif); font-size: 25px; font-weight: 600; margin: 0; color: var(--txt); }
.cli-drawer-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; font-size: 12.5px; color: var(--txt-3); }
.cli-drawer-meta i { color: var(--line); }
.cli-x { background: none; border: 0; color: var(--txt-3); padding: 8px; border-radius: 8px; transition: all .15s; }
.cli-x:hover { color: var(--txt); background: rgba(255,255,255,0.05); }

.cli-drawer-body { padding: 24px 26px 40px; overflow-y: auto; flex: 1; }
.cli-l { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-3); margin: 0 0 8px; }
.cli-drawer-body .cli-input, .cli-drawer-body .cli-area { margin-bottom: 6px; }
.cli-drawer-body > .cli-l:not(:first-child) { margin-top: 22px; }
.cli-hint { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--txt-3); margin: 2px 0 0; line-height: 1.5; }
.cli-hint svg { color: var(--gold); flex-shrink: 0; }
.cli-block { margin-top: 24px; }
.cli-muted { font-size: 13px; color: var(--txt-3); margin: 0; }
.cli-terms { display: flex; flex-wrap: wrap; gap: 7px; }
.cli-term { font-size: 12px; color: var(--txt); background: var(--bg); border: 1px solid var(--line); border-radius: 100px; padding: 5px 11px; }

.cli-import {
  margin-top: 26px; background: linear-gradient(180deg, rgba(201,163,71,0.05), transparent);
  border: 1px solid rgba(201,163,71,0.25); border-radius: var(--r-lg); padding: 18px 18px 20px;
}
.cli-import-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; color: var(--gold); }
.cli-import-head h4 { font-family: var(--serif); font-size: 17px; font-weight: 600; margin: 0; color: var(--txt); }
.cli-import .cli-input { margin-bottom: 10px; }
.cli-import-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.cli-upload {
  display: inline-flex; align-items: center; gap: 8px; background: none;
  border: 1px dashed var(--line); border-radius: 100px; color: var(--txt-2);
  font-size: 12.5px; padding: 8px 14px; transition: all .15s;
}
.cli-upload:hover { border-color: var(--gold); color: var(--gold); }

.cli-mats { display: flex; flex-direction: column; gap: 10px; }
.cli-mat { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 14px; }
.cli-mat-ico { width: 32px; height: 32px; border-radius: 8px; background: rgba(201,163,71,0.1); color: var(--gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cli-mat-body { flex: 1; min-width: 0; }
.cli-mat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cli-mat-title { font-size: 13.5px; font-weight: 600; color: var(--txt); }
.cli-mat-del { background: none; border: 0; color: var(--txt-3); padding: 4px; border-radius: 6px; transition: all .15s; flex-shrink: 0; }
.cli-mat-del:hover { color: #d9745f; background: rgba(179,64,47,0.12); }
.cli-mat-meta { font-size: 11px; color: var(--txt-3); margin: 3px 0 6px; }
.cli-mat-ex { font-size: 12px; color: var(--txt-2); line-height: 1.5; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cli-delc { margin-top: 30px; }

@media (max-width: 980px) { .cli-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) {
  .cli-grid { grid-template-columns: 1fr; }
  .cli-head { flex-direction: column; align-items: stretch; }
  .cli-drawer { width: 100vw; }
}
@media (max-width: 920px) {
  .editor { grid-template-columns: 1fr; height: calc(100vh - 66px); }
  .ed-form, .ed-preview { display: none; }
  .editor.tab-form .ed-form { display: block; }
  .editor.tab-preview .ed-preview { display: block; }
  .ed-tabs { display: flex; position: sticky; top: 0; z-index: 20; background: var(--bg-2); border-bottom: 1px solid var(--line); }
  .ed-tabs button { flex: 1; background: none; border: 0; color: var(--txt-3); padding: 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; border-bottom: 2px solid transparent; }
  .ed-tabs button.on { color: var(--gold); border-bottom-color: var(--gold); }
}
@media (max-width: 640px) {
  .gallery, .lib-grid { grid-template-columns: 1fr; }
  .topbar { gap: 14px; padding: 0 16px; }
  .brand-txt .sub { display: none; }
  .nav a { padding: 8px 11px; font-size: 12px; }
  .page-wrap { padding: 28px 16px 60px; }
  .hero h1 { font-size: 36px; }
  .mem-grid { grid-template-columns: 1fr; }
  .mem-hero { flex-wrap: wrap; }
}

/* ============================================================
   Studio Memory
   ============================================================ */
.mem-pill {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; flex-shrink: 0;
  background: rgba(201,163,71,0.1); border: 1px solid rgba(201,163,71,0.28);
  color: var(--gold-bright); border-radius: 100px;
  padding: 6px 13px 6px 11px; font-size: 12px; font-weight: 600; letter-spacing: 0.03em;
  transition: all .16s ease;
}
.mem-pill:hover { background: rgba(201,163,71,0.18); border-color: rgba(201,163,71,0.5); transform: translateY(-1px); }
.mem-pill svg { width: 13px; height: 13px; }

.mem-hero-head { text-align: center; padding: 18px 0 30px; max-width: 680px; margin: 0 auto; }
.mem-h1 { font-family: var(--brand); font-weight: 500; font-size: clamp(34px, 4.6vw, 50px); margin: 10px 0 0; line-height: 1.05; letter-spacing: 0.005em; }
.mem-lead { color: var(--txt-2); font-size: 15px; line-height: 1.6; margin: 16px auto 0; max-width: 580px; text-wrap: pretty; }

.mem-hero {
  display: flex; align-items: center; gap: 30px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 30px 34px; margin-bottom: 22px; position: relative; overflow: hidden;
}
.mem-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 200px at 100% 0%, rgba(201,163,71,0.08), transparent 60%); pointer-events: none; }

.mem-ring {
  width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(201,163,71,0.2) inset;
}
.mem-ring-core {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--bg); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
  box-shadow: 0 8px 22px -10px rgba(0,0,0,0.7);
}
.mem-ring-n { font-family: var(--brand); font-size: 34px; font-weight: 600; color: var(--gold); line-height: 1; }
.mem-ring-of { font-size: 10px; color: var(--txt-3); letter-spacing: 0.1em; }

.mem-hero-body { flex: 1; min-width: 180px; }
.mem-level-name { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--txt-2); }
.mem-level-name em { font-style: normal; color: var(--gold); font-weight: 600; }
.mem-learned { font-family: var(--brand); font-size: 24px; font-weight: 500; color: var(--txt); margin: 7px 0 12px; }
.mem-bar { height: 6px; border-radius: 100px; background: rgba(255,255,255,0.07); overflow: hidden; }
.mem-bar-fill { height: 100%; border-radius: 100px; background: var(--gold-grad); transition: width .5s cubic-bezier(.2,.7,.3,1); }
.mem-tonext { font-size: 12px; color: var(--txt-3); margin-top: 9px; }

.mem-switch {
  display: flex; flex-direction: column; align-items: flex-end; gap: 9px;
  background: none; border: 0; max-width: 150px; text-align: right;
}
.mem-switch-track { width: 46px; height: 26px; border-radius: 100px; background: rgba(255,255,255,0.1); border: 1px solid var(--line); position: relative; transition: background .18s; }
.mem-switch-knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--txt-3); transition: all .18s cubic-bezier(.2,.7,.3,1); }
.mem-switch.on .mem-switch-track { background: var(--gold-grad); border-color: transparent; }
.mem-switch.on .mem-switch-knob { left: 22px; background: var(--ink); }
.mem-switch-label { font-size: 11px; color: var(--txt-3); line-height: 1.4; }
.mem-switch.on .mem-switch-label { color: var(--gold-bright); }

.mem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mem-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; }
.mem-card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.mem-card-ico { width: 34px; height: 34px; border-radius: 9px; background: rgba(201,163,71,0.12); color: var(--gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mem-card-head h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 0; color: var(--txt); }
.mem-card-empty { font-size: 13px; color: var(--txt-3); line-height: 1.55; margin: 0; }

.mem-prefs { display: flex; flex-direction: column; gap: 1px; background: var(--line-soft); border-radius: var(--r-sm); overflow: hidden; }
.mem-pref { display: flex; justify-content: space-between; align-items: center; background: var(--bg-2); padding: 12px 14px; }
.mem-pref-k { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-3); }
.mem-pref-v { font-size: 14px; color: var(--txt); font-weight: 500; }

.mem-voice-label { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--gold); }
.mem-voice-meta { font-size: 12.5px; color: var(--txt-2); margin-top: 5px; }
.mem-voice-refs { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 11.5px; color: var(--txt-3); background: rgba(255,255,255,0.03); border: 1px solid var(--line-soft); border-radius: 100px; padding: 5px 11px; }
.mem-voice-refs svg { color: var(--gold); }

.mem-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.mem-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--txt); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 100px; padding: 6px 12px;
}
.mem-chip i { font-style: normal; font-size: 10px; font-weight: 700; color: var(--ink); background: var(--gold); border-radius: 100px; padding: 1px 6px; line-height: 1.4; }

.mem-clients { display: flex; flex-direction: column; gap: 2px; }
.mem-client { display: flex; align-items: center; justify-content: space-between; padding: 11px 2px; border-bottom: 1px solid var(--line-soft); }
.mem-client:last-child { border-bottom: 0; }
.mem-client-name { font-size: 14px; color: var(--txt); font-weight: 500; }
.mem-client-meta { display: flex; align-items: center; gap: 10px; }
.mem-client-period { font-size: 11.5px; color: var(--txt-3); }
.mem-client-count { font-size: 11px; font-weight: 700; color: var(--gold); background: rgba(201,163,71,0.12); border-radius: 100px; padding: 3px 9px; }

.mem-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-top: 22px; padding: 22px 24px; border: 1px dashed var(--line); border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent); }
.mem-foot-how h4 { font-family: var(--serif); font-size: 16px; font-weight: 600; margin: 0 0 7px; color: var(--txt); }
.mem-foot-how p { font-size: 12.5px; color: var(--txt-3); line-height: 1.6; margin: 0; max-width: 560px; }
.mem-reset { flex-shrink: 0; }

@media (max-width: 760px) {
  .mem-hero { flex-direction: column; align-items: stretch; text-align: left; }
  .mem-switch { align-items: flex-start; max-width: none; text-align: left; flex-direction: row; align-items: center; }
  .mem-foot { flex-direction: column; }
}
