*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Foundation — warm near-black + concrete cream */
  --ground-900: #211B14;
  --ground-800: #322A20;
  --ground-700: #5B5043;
  --ground-500: #8A8074;
  --ground-300: #C3BCB1;
  --ground-100: #ECE7DD;
  --ground-50:  #F6F2E9;

  /* Hi-Vis safety amber */
  --hivis-700:  #C46A1F;
  --hivis-500:  #ED9B3D;
  --hivis-300:  #F8C988;
  --hivis-100:  #FAE9CF;

  /* Status stamps */
  --stamp-go:   #2E8B57;
  --stamp-no:   #C0392B;
  --stamp-edit: #C46A1F;
  --stamp-rec:  #C0392B;

  /* Type */
  --font-display: "Heebo", system-ui, sans-serif;
  --font-body:    "Heebo", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* Geometry */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;
  --shadow-1: 0 1px 0 rgba(33,27,20,.04), 0 1px 3px rgba(33,27,20,.06);
  --shadow-2: 0 2px 4px rgba(33,27,20,.04), 0 12px 32px rgba(33,27,20,.08);
  --shadow-hi: 0 8px 24px rgba(237,155,61,.32);

  /* Legacy var mapping — DO NOT remove */
  --bg:        var(--ground-50);
  --surface:   #FFFFFF;
  --border:    rgba(91,80,67,.18);
  --blue:      var(--ground-900);
  --blue-l:    var(--hivis-500);
  --blue-dim:  var(--hivis-100);
  --red:       var(--stamp-rec);
  --red-dim:   rgba(192,57,43,.08);
  --green:     var(--stamp-go);
  --green-dim: rgba(46,139,87,.08);
  --amber:     var(--stamp-edit);
  --amber-dim: rgba(196,106,31,.08);
  --text:      var(--ground-900);
  --muted:     var(--ground-700);
  --subtle:    var(--ground-500);
  --tg:        var(--ground-900);
  --radius:    var(--r-md);
  --shadow:    var(--shadow-2);

  /* Safe areas */
  --nav-h:    64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

html, body { height: 100%; font-family: var(--font-body); background: var(--bg); color: var(--text); direction: rtl; -webkit-font-smoothing: antialiased; overflow: hidden; }

/* ── Screens ── */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; padding-top: var(--safe-top); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.screen.active { opacity: 1; pointer-events: auto; }

/* ════ LOGIN ════ */
#screen-login { background: var(--surface); align-items: center; justify-content: flex-end; }
.login-bg { position: absolute; inset: 0; background: var(--ground-900); background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0, rgba(255,255,255,.03) 1px, transparent 1px, transparent 20px), repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0, rgba(255,255,255,.03) 1px, transparent 1px, transparent 20px); z-index: 0; }
.login-card { position: relative; z-index: 1; width: 100%; background: var(--surface); border-radius: 28px 28px 0 0; padding: 32px 28px calc(32px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; }
.login-hero { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 28px 24px; gap: 12px; text-align: center; }
.brand-logo { display: none; }
.brand-wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 54px;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ground-50);
}
.brand-wordmark--dark { color: var(--ground-900); }
.brand-wordmark--sm   { font-size: 22px; letter-spacing: -0.03em; }
.brand-dot {
  display: inline-block;
  width: 0.13em;
  height: 0.13em;
  border-radius: 50%;
  background: var(--hivis-500);
  vertical-align: 0.65em;
  margin-right: -0.03em;
  box-shadow: 0 0 20px var(--hivis-500);
}
.brand-name { display: none; }
.brand-sub { font-size: 15px; color: var(--ground-300); line-height: 1.5; }
.login-title { font-size: 22px; font-weight: 800; color: var(--text); font-family: var(--font-display); }
.login-desc { font-size: 15px; color: var(--muted); line-height: 1.5; }
.login-legal { font-size: 11px; color: var(--subtle); text-align: center; }

/* SSO buttons */
.sso-buttons { display: flex; flex-direction: column; gap: 12px; }
.btn-sso { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 15px 20px; border-radius: var(--radius); font-size: 16px; font-weight: 600; text-decoration: none; transition: opacity .15s, transform .1s, box-shadow .15s; }
.btn-sso:active { opacity: .85; transform: scale(.98); }
.btn-google { background: #fff; color: #3c4043; border: 1.5px solid #dadce0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.btn-google:hover { box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.btn-microsoft { background: var(--ground-900); color: #fff; border: none; }
.btn-microsoft:hover { background: #1a1a1a; }

/* ════ ONBOARDING ════ */
#screen-onboarding { background: var(--bg); align-items: center; justify-content: center; padding: 24px; }
.onboarding-wrap { width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.onboarding-logo { display: none; }
.onboarding-title { font-size: 24px; font-weight: 800; color: var(--text); text-align: center; font-family: var(--font-display); }
.onboarding-sub { font-size: 15px; color: var(--muted); text-align: center; line-height: 1.5; }
.ob-form { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.ob-field { display: flex; flex-direction: column; gap: 6px; }
.ob-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.ob-input { width: 100%; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 12px; font-size: 16px; background: var(--surface); color: var(--text); transition: border-color .15s; }
.ob-input:focus { outline: none; border-color: var(--blue-l); }
.btn-ob-finish { width: 100%; padding: 16px; background: var(--hivis-500); color: var(--ground-900); border: none; border-radius: var(--radius); font-size: 17px; font-weight: 700; cursor: pointer; transition: opacity .15s, transform .1s; }
.btn-ob-finish:active { opacity: .85; transform: scale(.98); }
.btn-ob-finish:disabled { opacity: .6; cursor: default; }

/* ════ MAIN ════ */
#screen-main { background: var(--bg); }
.app-header { background: var(--ground-50); border-bottom: 1px solid var(--border); padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.header-brand { font-size: 22px; font-weight: 900; color: var(--ground-900); letter-spacing: -0.03em; }
.header-user { font-size: 13px; color: var(--muted); }
.btn-logout { background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 13px; padding: 6px 12px; cursor: pointer; transition: all .15s; }
.btn-logout:hover { border-color: var(--red); color: var(--red); }
.template-bar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px; flex-shrink: 0; }
.template-label { font-size: 11px; font-weight: 600; color: var(--subtle); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; }
.template-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-btn { padding: 7px 14px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--bg); color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; }
.tab-btn.active { background: var(--blue); border-color: var(--blue); color: white; font-weight: 600; }
.tab-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.tab-panel.hidden { display: none; }

/* ── Template carousel ── */
.template-carousel { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.template-carousel::-webkit-scrollbar { display: none; }
.tmpl-pill { flex-shrink: 0; background: var(--ground-100); color: var(--ground-700); border: none; padding: 7px 16px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all .15s; }
.tmpl-pill.active { background: var(--ground-900); border-color: var(--ground-900); color: var(--ground-50); font-weight: 700; box-shadow: none; }
.tmpl-pill:active { transform: scale(.95); }
.tmpl-add-btn { border-style: dashed; font-size: 18px; font-weight: 400; padding: 5px 14px; color: var(--subtle); }
.tmpl-add-btn:hover { border-color: var(--blue-l); color: var(--blue-l); }

/* ── PWA install banner ── */
.install-banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--ground-900); color: var(--ground-50); flex-shrink: 0; }
.install-banner.hidden { display: none; }
.install-banner-icon { font-size: 18px; flex-shrink: 0; }
.install-banner-text { flex: 1; font-size: 14px; font-weight: 500; }
.btn-install { background: var(--hivis-500); color: var(--ground-900); font-weight: 700; border: none; border-radius: 20px; font-size: 13px; padding: 6px 16px; cursor: pointer; flex-shrink: 0; transition: opacity .15s; }
.btn-install:active { opacity: .8; }
.install-banner-close { background: none; border: none; color: rgba(255,255,255,.7); font-size: 16px; cursor: pointer; padding: 4px; flex-shrink: 0; }

/* iOS install hint inside settings */
.ios-hint-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; }
.ios-hint-row.hidden { display: none; }
.ios-hint-icon { font-size: 22px; flex-shrink: 0; }
.ios-hint-text { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* Record stage */
.record-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 20px 120px; gap: 0; position: relative; }
.record-hint { font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ground-500); margin-bottom: 14px; transition: color .3s, opacity .3s; }
.record-hint.active { color: var(--red); }

/* ── Record mode toggle — inside float stack ── */
.record-mode-toggle {
  display: flex; background: var(--ground-900); border-radius: var(--r-pill);
  padding: 3px; gap: 2px; flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(33,27,20,.22);
}
.mode-btn {
  display: flex; align-items: center; gap: 5px; padding: 6px 12px;
  border: none; border-radius: var(--r-pill); background: none;
  color: var(--ground-500); font-family: var(--font-body); font-size: 12px;
  font-weight: 600; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.mode-btn.active {
  background: var(--hivis-500); color: var(--ground-900); box-shadow: var(--shadow-1);
}
.mode-btn:not(.active):hover { color: var(--ground-300); }

/* ── Video preview ── */
.video-preview {
  width: 200px; height: 150px; border-radius: var(--r-md);
  object-fit: cover; background: var(--ground-900);
  margin-top: 20px; flex-shrink: 0;
  border: 2px solid var(--stamp-rec);
  box-shadow: 0 0 0 4px rgba(192,57,43,.12), var(--shadow-2);
}

/* Hero recording button with rings */
.btn-record-wrap { position: relative; width: 256px; height: 256px; display: flex; align-items: center; justify-content: center; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--hivis-500); opacity: 0; }
.btn-record-wrap .ring-1 { animation: ring-out 2.8s ease-out infinite; }
.btn-record-wrap .ring-2 { animation: ring-out 2.8s ease-out 1s infinite; }
/* Faster red rings while recording */
.btn-record-wrap.recording .ring { border-color: var(--stamp-rec); }
.btn-record-wrap.recording .ring-1 { animation: ring-out 1.2s ease-out infinite; }
.btn-record-wrap.recording .ring-2 { animation: ring-out 1.2s ease-out .4s infinite; }
@keyframes ring-out { 0%{transform:scale(.72);opacity:.5} 100%{transform:scale(1.5);opacity:0} }

.btn-record { width: 186px; height: 186px; border-radius: 50%; border: none; background: var(--ground-900); color: var(--hivis-500); box-shadow: var(--shadow-1), 0 0 0 10px var(--ground-50), 0 12px 32px rgba(33,27,20,.25); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .12s, box-shadow .2s, background .2s; position: relative; z-index: 1; }
.btn-record:active { transform: scale(.94); }
.btn-record.recording { background: var(--stamp-rec); color: white; box-shadow: 0 8px 40px rgba(192,57,43,.30), 0 0 0 10px var(--ground-50), 0 0 0 12px rgba(192,57,43,.12); }
.rec-stop-icon { width: 36px; height: 36px; background: white; border-radius: 8px; }

/* Recording controls below hero button */
.recording-controls { display: flex; align-items: center; gap: 16px; margin-top: 24px; justify-content: center; }
.recording-controls.hidden { display: none; }

/* Secondary bar (camera during recording + upload buttons) */
.secondary-bar { background: var(--surface); border-top: 1px solid var(--border); padding: 12px 20px; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Timer + pause in hero area */
.record-timer { font-size: 30px; font-weight: 700; color: var(--stamp-rec); letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.btn-pause { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 20px; color: var(--ground-700); font-size: 13px; font-weight: 600; padding: 8px 18px; cursor: pointer; transition: all .15s; }
.btn-pause.paused { color: var(--stamp-rec); border-color: var(--stamp-rec); }

/* Upload mini */
.upload-btn-mini { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border: 1.5px dashed var(--border); border-radius: 10px; background: none; color: var(--muted); font-size: 13px; cursor: pointer; transition: border-color .15s, color .15s; white-space: nowrap; }
.upload-btn-mini:hover { border-color: var(--hivis-500); color: var(--hivis-700); }
.upload-btn-photos { margin-right: auto; }

/* Camera button during recording */
.btn-photo-during { position: relative; width: 44px; height: 44px; border-radius: 50%; background: white; border: 1.5px solid var(--border); color: var(--blue); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; flex-shrink: 0; }
.btn-photo-during:active { transform: scale(.9); }
.photo-during-count { position: absolute; top: -4px; right: -4px; background: var(--red); color: white; border-radius: 10px; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

/* Photo action sheet */
.action-sheet { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300; display: flex; align-items: flex-end; }
.action-sheet.hidden { display: none; }
.action-sheet-card { width: 100%; background: var(--surface); border-radius: 24px 24px 0 0; padding: 20px; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; }
.action-sheet-title { font-size: 15px; font-weight: 700; color: var(--text); text-align: center; margin-bottom: 4px; }
.action-sheet-btn { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--bg); color: var(--text); font-size: 16px; font-weight: 500; cursor: pointer; transition: border-color .15s; }
.action-sheet-btn:hover { border-color: var(--blue-l); }
.action-sheet-cancel { padding: 16px; background: none; border: none; color: var(--muted); font-size: 16px; font-weight: 600; cursor: pointer; text-align: center; }

/* Review choice sheet */
.review-choice-sheet { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300; display: flex; align-items: flex-end; }
.review-choice-card { width: 100%; background: var(--surface); border-radius: 24px 24px 0 0; padding: 28px 24px; padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
.review-choice-title { font-size: 22px; font-weight: 700; color: var(--text); text-align: center; }
.review-choice-sub { font-size: 14px; color: var(--muted); text-align: center; margin-bottom: 8px; }
.review-choice-btn { width: 100%; padding: 16px; border-radius: 14px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all .15s; border: none; }
.review-choice-btn.primary { background: var(--blue); color: white; }
.review-choice-btn.secondary { background: var(--bg); color: var(--muted); border: 1.5px solid var(--border); }

/* Photo thumbnail strip */
.photo-strip { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bg); border-top: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; }
.photo-strip.hidden { display: none; }
.photo-thumb-wrap { position: relative; flex-shrink: 0; }
.photo-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1.5px solid var(--border); display: block; }
.photo-thumb-del { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--red); color: white; border: none; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.photo-count-badge { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; padding: 0 4px; }

/* Bottom nav */
.bottom-nav { position: relative; width: 100%; flex-shrink: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); border-top: 1px solid var(--border); display: flex; z-index: 50; }
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: none; border: none; color: var(--ground-500); font-size: 12px; font-weight: 500; cursor: pointer; transition: color .15s; }
.nav-btn.active { color: var(--ground-900); }
.nav-btn.active svg { stroke: var(--hivis-700); }
.nav-btn span { font-size: 11px; font-weight: 600; }

/* History */
.history-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.history-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 15px; }
.history-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: box-shadow .15s; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.history-card:hover { box-shadow: var(--shadow); }
.history-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--hivis-100); display: flex; align-items: center; justify-content: center; color: var(--hivis-700); flex-shrink: 0; }
.history-info { flex: 1; min-width: 0; }
.history-title { font-size: 15px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.history-arrow { color: var(--subtle); font-size: 18px; flex-shrink: 0; }

/* Processing */
.processing-overlay { position: absolute; inset: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; z-index: 100; }
.progress-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px 32px; width: calc(100% - 48px); max-width: 340px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.progress-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 20px; text-align: center; }
.progress-steps { display: flex; flex-direction: column; gap: 10px; }
.prog-step { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--subtle); transition: color .3s; }
.prog-step.done { color: var(--text); }
.prog-step.active { color: var(--blue-l); font-weight: 600; }
.prog-icon { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; transition: all .3s; }
.prog-step.done .prog-icon { background: var(--stamp-go); border-color: var(--stamp-go); color: white; }
.prog-step.active .prog-icon { border-color: var(--hivis-500); animation: spin .8s linear infinite; border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.ps-photo-note { margin-top: 14px; font-size: 13px; color: var(--blue-l); text-align: center; font-weight: 500; }
.ps-photo-note.hidden { display: none; }

/* ════ REVIEW ════ */
#screen-review { background: var(--bg); }
.review-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.btn-text-small { background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 4px 8px; }
.review-progress { font-size: 15px; font-weight: 700; color: var(--text); }
.btn-vapi { display: flex; align-items: center; gap: 6px; background: var(--blue); border: none; border-radius: 20px; color: white; font-size: 13px; font-weight: 600; padding: 8px 14px; cursor: pointer; transition: opacity .15s; }
.btn-vapi.active { background: var(--red); animation: pulse-btn 1.5s ease-in-out infinite; }
@keyframes pulse-btn { 0%,100%{opacity:1} 50%{opacity:.7} }

/* Card stage */
.card-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 20px 10px; position: relative; overflow: hidden; }
.section-ctx { font-size: 12px; font-weight: 700; color: var(--hivis-700); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; background: var(--hivis-100); border-radius: 20px; padding: 5px 14px; }

.review-card { width: 100%; max-width: 400px; background: var(--ground-50); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 24px; position: relative; touch-action: pan-y; user-select: none; transition: transform .15s, box-shadow .15s; min-height: 200px; }
.review-card.swiping { transition: none; }

.swipe-hint { position: absolute; top: 20px; font-size: 18px; font-weight: 800; opacity: 0; transition: opacity .15s; pointer-events: none; padding: 6px 16px; border-radius: 20px; }
.swipe-hint.accept { left: 20px; color: var(--stamp-go); background: rgba(46,139,87,.08); border: 2px solid var(--stamp-go); }
.swipe-hint.reject { right: 20px; color: var(--stamp-no); background: rgba(192,57,43,.08); border: 2px solid var(--stamp-no); }

.card-number { font-size: 11px; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.card-topic { font-size: 20px; font-weight: 900; color: var(--text); line-height: 1.4; margin-bottom: 14px; font-family: var(--font-display); letter-spacing: -0.02em; }
.card-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.card-badge { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 5px 10px; }
.badge-label { font-size: 10px; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: .3px; }
.card-notes { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); line-height: 1.5; }
.card-edit-mode { margin-top: 16px; }
.edit-input { width: 100%; border: 1.5px solid var(--blue-l); border-radius: 12px; padding: 12px; font-size: 16px; font-family: inherit; color: var(--text); resize: none; outline: none; background: var(--bg); }
.edit-actions { display: flex; gap: 10px; margin-top: 10px; }
.btn-edit-cancel { flex: 1; padding: 12px; border: 1.5px solid var(--border); border-radius: 12px; background: none; color: var(--muted); font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-edit-save   { flex: 2; padding: 12px; border: none; border-radius: 12px; background: var(--blue); color: white; font-size: 15px; font-weight: 700; cursor: pointer; }

/* Review action buttons — big for driving */
.review-actions { display: flex; gap: 12px; padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--border); flex-shrink: 0; }
.review-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px 0; border: none; border-radius: 18px; font-size: 15px; font-weight: 700; cursor: pointer; transition: opacity .12s, transform .1s; }
.review-btn:active { opacity: .8; transform: scale(.96); }
.review-btn.reject { background: rgba(192,57,43,.08); color: #922B21; }
.review-btn.edit   { background: var(--hivis-100); color: var(--hivis-700); }
.review-btn.accept { background: rgba(46,139,87,.10); color: #1E6B38; }
.review-btn.reject svg { stroke: #922B21; }
.review-btn.edit   svg { stroke: var(--hivis-700); }
.review-btn.accept svg { stroke: #1E6B38; }

/* Vapi overlay */
.vapi-overlay { position: absolute; inset: 0; background: rgba(15,23,42,.75); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 200; }
.vapi-card { background: var(--surface); border-radius: 24px; padding: 36px 28px; width: calc(100% - 48px); max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.vapi-pulse { width: 72px; height: 72px; border-radius: 50%; background: var(--blue); display: flex; align-items: center; justify-content: center; animation: vapi-pulse 1.5s ease-in-out infinite; }
@keyframes vapi-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(37,99,235,.5)} 50%{box-shadow:0 0 0 18px rgba(37,99,235,0)} }
.vapi-status { font-size: 16px; font-weight: 600; color: var(--text); }
.vapi-item { font-size: 15px; color: var(--muted); line-height: 1.5; min-height: 44px; }
.btn-vapi-end { background: var(--red-dim); border: 1.5px solid var(--red); border-radius: 20px; color: var(--red); font-size: 15px; font-weight: 700; padding: 12px 28px; cursor: pointer; }

/* ════ RESULTS ════ */
#screen-results { background: var(--bg); overflow-y: auto; overflow-x: hidden; }
.results-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 20px; display: flex; align-items: center; gap: 14px; flex-shrink: 0; position: sticky; top: 0; z-index: 10; }
.btn-back { background: none; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 18px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.result-title-text { flex: 1; font-size: 16px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); }
.btn-dl { background: var(--ground-900); color: var(--ground-50); border: none; border-radius: 10px; font-size: 13px; font-weight: 600; padding: 8px 14px; display: flex; align-items: center; gap: 6px; cursor: pointer; flex-shrink: 0; transition: opacity .15s; }
.btn-dl:hover { opacity: .88; }
.result-meta-strip { padding: 16px 16px 8px; display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.meta-pill { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.meta-pill b { color: var(--text); font-weight: 600; }

/* Review summary bar */
.review-summary-bar { padding: 10px 16px; display: flex; gap: 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
.rsb-chip { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 20px; }
.rsb-chip.accepted { background: var(--green-dim); color: var(--green); }
.rsb-chip.rejected { background: var(--red-dim); color: var(--red); text-decoration: line-through; }
.rsb-chip.edited   { background: var(--amber-dim); color: var(--amber); }

.result-section-header { padding: 16px 16px 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; flex-shrink: 0; }
.result-cards { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.transcript-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.transcript-label { font-size: 11px; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px; }
.transcript-text { font-size: 15px; line-height: 1.8; color: var(--text); white-space: pre-wrap; direction: rtl; font-family: var(--font-display); }
.action-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.action-card.is-section { background: var(--hivis-100); border-color: var(--hivis-300); }
.action-card.is-rejected { opacity: .45; }
.action-card.is-edited { border-color: var(--amber); }
.card-num { font-size: 11px; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.card-topic-result { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.4; margin-bottom: 10px; font-family: var(--font-display); letter-spacing: -0.01em; }
.section-title { font-size: 15px; font-weight: 700; color: var(--hivis-700); }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.card-badge-result { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 4px 10px; }
.notes-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); line-height: 1.5; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.accepted { background: var(--green); }
.status-dot.rejected { background: var(--red); }
.status-dot.edited   { background: var(--amber); }

/* Actions strip */
.actions-strip { padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 10px; flex-wrap: wrap; }
.btn-action { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 12px; background: var(--hivis-500); color: var(--ground-900); border: none; border-radius: 12px; font-size: 14px; font-weight: 700; font-family: var(--font-display); cursor: pointer; transition: opacity .15s, transform .1s; white-space: nowrap; }
.btn-action:active { opacity: .85; transform: scale(.97); }
.btn-action:disabled { opacity: .6; cursor: default; }
.btn-action-secondary { background: var(--ground-100); color: var(--ground-900); border: 1.5px solid var(--border); }
.btn-action-secondary:hover { border-color: var(--ground-900); color: var(--ground-900); }

/* Header icons */
.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-icon-header { background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); cursor: pointer; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.btn-icon-header:hover { border-color: var(--blue-l); color: var(--blue-l); }

/* Settings overlay */
.settings-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; display: flex; align-items: flex-end; }
.settings-overlay.hidden { display: none; }
.settings-card { width: 100%; background: var(--surface); border-radius: 24px 24px 0 0; padding: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); max-height: 80vh; overflow-y: auto; }
.settings-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.settings-title { font-size: 18px; font-weight: 800; color: var(--text); font-family: var(--font-display); }
.btn-icon-close { background: var(--bg); border: none; border-radius: 50%; width: 32px; height: 32px; font-size: 16px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.settings-section { margin-bottom: 24px; }
.settings-section-title { font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ground-500); margin-bottom: 12px; }
.integration-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.integration-row:last-child { border-bottom: none; }
.int-icon { font-size: 24px; width: 36px; text-align: center; }
.int-info { flex: 1; }
.int-name { font-size: 15px; font-weight: 600; color: var(--text); }
.int-status { font-size: 13px; color: var(--muted); margin-top: 2px; }
.btn-connect { background: var(--ground-900); color: var(--ground-50); padding: 8px 18px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; border: none; cursor: pointer; text-decoration: none; display: inline-block; }
.account-info { font-size: 14px; color: var(--muted); padding: 8px 0; }

/* Assistant overlay */
.assistant-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; z-index: 100; padding: 20px; }
.assistant-card { width: 100%; max-width: 480px; background: var(--surface); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.assistant-pulse { width: 48px; height: 48px; border-radius: 50%; background: var(--blue); margin: 0 auto; animation: pulse-ring 1.6s ease-in-out infinite; }
@keyframes pulse-ring { 0%,100%{box-shadow:0 0 0 0 rgba(27,79,145,.5)} 50%{box-shadow:0 0 0 16px rgba(27,79,145,0)} }
.assistant-status { text-align: center; font-size: 16px; font-weight: 600; color: var(--text); }
.assistant-transcript { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.transcript-line { padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.transcript-line.assistant { background: var(--blue-dim); color: var(--text); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 200; padding: 0; }
.modal-card { width: 100%; max-width: 520px; background: var(--surface); border-radius: 24px 24px 0 0; padding: 24px 24px calc(16px + env(safe-area-inset-bottom,0px)); max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-title { font-size: 20px; font-weight: 800; color: var(--text); font-family: var(--font-display); }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 0; }
.btn-modal-cancel { flex: 1; padding: 14px; border: 1.5px solid var(--border); border-radius: 12px; background: none; color: var(--muted); font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-modal-save { flex: 2; padding: 14px; background: var(--hivis-500); color: var(--ground-900); border: none; border-radius: 12px; font-size: 15px; font-weight: 700; font-family: var(--font-display); cursor: pointer; }
.btn-modal-save:disabled { opacity: .6; }
.tmpl-fmt-row { display: flex; gap: 16px; margin-top: 8px; }
.fmt-option { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--text); cursor: pointer; }

/* ── Template confirm sheet ── */
.template-confirm-sub { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 12px; }
.template-confirm-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.tmpl-confirm-option { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--bg); cursor: pointer; transition: border-color .15s; font-size: 15px; font-weight: 500; }
.tmpl-confirm-option.suggested { border-color: var(--ground-900); background: var(--ground-50); color: var(--ground-900); }
.tmpl-confirm-option.suggested::after { content: '✓ מומלץ'; font-size: 11px; font-weight: 700; margin-right: auto; color: var(--hivis-700); }
.tmpl-confirm-option.selected { border-color: var(--ground-900); background: var(--ground-900); color: var(--ground-50); }
.tmpl-confirm-option.selected::after { content: '✓'; font-size: 13px; font-weight: 700; margin-right: auto; }
.btn-tmpl-confirm { width: 100%; padding: 15px; background: var(--ground-900); color: var(--ground-50); border: none; border-radius: 14px; font-size: 16px; font-weight: 700; cursor: pointer; transition: opacity .15s, background .2s; }
.btn-tmpl-confirm:disabled { background: var(--ground-300); color: var(--ground-700); cursor: not-allowed; opacity: 1; }
.btn-tmpl-confirm:not(:disabled):active { opacity: .85; }
.btn-tmpl-confirm.hidden { display: none; }

/* ── Item photo attachment ── */

/* Attach photo button inside the review card */
.btn-attach-photo { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 16px; border: 1.5px dashed var(--border); border-radius: 12px; background: none; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .15s, color .15s; width: 100%; }
.btn-attach-photo:hover { border-color: var(--blue-l); color: var(--blue-l); }
.btn-attach-photo:active { opacity: .8; }

/* Mini photo thumbnails inside the review card */
.card-item-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.item-photo-mini-wrap { position: relative; }
.item-photo-mini { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; border: 1.5px solid var(--border); display: block; }

/* Session photos grid in the item-photo-sheet */
.session-photos-grid { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 4px; }
.session-photos-grid.hidden { display: none; }
.session-photo-wrap { position: relative; border-radius: 10px; overflow: hidden; border: 2.5px solid transparent; cursor: pointer; transition: border-color .15s; flex-shrink: 0; }
.session-photo-wrap.selected { border-color: var(--blue); }
.session-photo-wrap.selected::after { content: '✓'; position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--blue); color: white; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.session-photo-thumb { width: 72px; height: 72px; object-fit: cover; display: block; }

/* Item photos shown in the results cards */
.result-item-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.result-item-photo { width: 68px; height: 68px; object-fit: cover; border-radius: 10px; border: 1.5px solid var(--border); }

/* ── Edit responsible field ── */
.edit-input-line { width: 100%; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 16px; font-family: inherit; color: var(--text); background: var(--bg); outline: none; margin-top: 8px; transition: border-color .15s; }
.edit-input-line:focus { border-color: var(--blue-l); }

/* ── Settings template management ── */
.settings-templates-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.settings-tmpl-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.settings-tmpl-row:last-child { border-bottom: none; }
.settings-tmpl-info { flex: 1; }
.settings-tmpl-name { font-size: 15px; font-weight: 600; color: var(--text); }
.settings-tmpl-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.settings-tmpl-actions { display: flex; gap: 8px; }
.settings-tmpl-btn { background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.settings-tmpl-btn.edit:hover { border-color: var(--blue-l); color: var(--blue-l); }
.settings-tmpl-btn.del:hover  { border-color: var(--red); color: var(--red); }
.settings-add-tmpl-btn { width: 100%; padding: 10px; border: 1.5px dashed var(--border); border-radius: 10px; background: none; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; transition: all .15s; }
.settings-add-tmpl-btn:hover { border-color: var(--blue-l); color: var(--blue-l); }

/* ── Logo upload ── */
.logo-upload-row { display: flex; align-items: center; gap: 14px; padding: 8px 0; }
.logo-preview { width: 72px; height: 48px; border: 1.5px solid var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--bg); font-size: 11px; color: var(--subtle); overflow: hidden; flex-shrink: 0; }
.logo-hint { font-size: 12px; color: var(--subtle); margin-top: 4px; }

/* ── Template example upload in modal ── */
.tmpl-example-upload { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1.5px dashed var(--border); border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 13px; cursor: pointer; transition: border-color .15s, color .15s; width: 100%; margin-top: 4px; }
.tmpl-example-upload:hover { border-color: var(--blue-l); color: var(--blue-l); }

/* ── Item photo sheet confirm row ── */
.sheet-btn-row { display: flex; gap: 10px; align-items: center; }
.sheet-btn-row .action-sheet-cancel { flex: 1; }
.sheet-btn-row .btn-modal-save { flex: 2; padding: 14px; }

/* ── Video frame picker ── */
.video-frame-card { max-height: 88vh; overflow-y: auto; }
.frame-video { width: 100%; border-radius: 12px; background: #000; max-height: 38vh; object-fit: contain; display: block; }
.frame-scrubber-row { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.frame-time { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; min-width: 34px; text-align: center; }
.frame-scrubber { flex: 1; height: 6px; accent-color: var(--blue); cursor: pointer; border-radius: 3px; }

/* ── Cloud storage button ── */
.btn-cloud-storage { flex-shrink: 0; max-width: 140px; overflow: hidden; }
.btn-cloud-storage span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; display: inline-block; vertical-align: middle; }
.btn-cloud-storage.not-connected { border-color: var(--hivis-500); color: var(--hivis-700); }
.btn-cloud-storage.connected { border-color: var(--stamp-go); color: var(--stamp-go); }

/* ── Folder browser — bottom sheet ── */
.folder-sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 500; display: flex; align-items: flex-end;
}
.folder-sheet-backdrop.hidden { display: none; }

.folder-sheet {
  width: 100%; background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  max-height: 88vh; display: flex; flex-direction: column;
  animation: sheet-slide-up .28s cubic-bezier(.32,.72,0,1);
}
@keyframes sheet-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.folder-sheet-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 12px auto 0; flex-shrink: 0;
}

.folder-sheet-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px 10px; flex-shrink: 0;
}

.folder-sheet-close-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); flex-shrink: 0; transition: background .15s;
}
.folder-sheet-close-btn:hover { background: var(--border); }

.folder-sheet-title {
  flex: 1; display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 700; color: var(--text); overflow: hidden;
}

.folder-provider-icon { font-size: 22px; flex-shrink: 0; }

.folder-new-btn {
  display: flex; align-items: center; gap: 5px;
  background: var(--hivis-100); border: none; border-radius: 20px;
  color: var(--hivis-700); font-size: 13px; font-weight: 600;
  padding: 7px 12px; cursor: pointer; flex-shrink: 0;
  transition: background .15s; white-space: nowrap;
}
.folder-new-btn:hover { background: #dbeafe; }
.folder-new-btn:active { opacity: .8; }

/* Breadcrumb chips */
.folder-breadcrumb-chips {
  display: flex; align-items: center; gap: 4px;
  padding: 0 20px 12px; overflow-x: auto; flex-shrink: 0;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.folder-breadcrumb-chips::-webkit-scrollbar { display: none; }

.breadcrumb-chip {
  display: flex; align-items: center;
  font-size: 13px; color: var(--muted);
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  padding: 4px 6px; border-radius: 6px;
  transition: color .15s, background .15s;
}
.breadcrumb-chip.active { color: var(--text); font-weight: 600; cursor: default; background: var(--bg); }
.breadcrumb-chip:not(.active):hover { color: var(--hivis-700); background: var(--hivis-100); }
.breadcrumb-sep { color: var(--border); font-size: 14px; flex-shrink: 0; padding: 0 2px; }

/* Folder list */
.folder-browser-list {
  flex: 1; overflow-y: auto; padding: 4px 8px 8px;
  display: flex; flex-direction: column; min-height: 100px;
}

/* Folder item — button style, no borders, hover bg */
.folder-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 14px;
  background: none; border: none; cursor: pointer; width: 100%;
  text-align: right; transition: background .12s;
}
.folder-item:hover { background: var(--bg); }
.folder-item:active { background: var(--hivis-100); transform: scale(.98); }

.folder-item-icon {
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(145deg, #FFF3DC, #FFE0A3);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(217,119,6,.15);
}

.folder-item-name {
  flex: 1; font-size: 15px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.folder-item-chevron { color: var(--subtle); flex-shrink: 0; }

/* Skeleton loading */
.folder-skeleton { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.folder-skel-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 14px;
  animation: skel-shimmer 1.3s ease-in-out infinite;
}
.folder-skel-row:nth-child(2) { animation-delay: .15s; }
.folder-skel-row:nth-child(3) { animation-delay: .3s; }
.folder-skel-row:nth-child(4) { animation-delay: .45s; }
.folder-skel-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--border); flex-shrink: 0; }
.folder-skel-text { height: 14px; border-radius: 7px; background: var(--border); width: 55%; }
@keyframes skel-shimmer { 0%,100%{opacity:.5} 50%{opacity:1} }

.folder-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 40px 20px; color: var(--subtle); font-size: 14px; text-align: center;
  flex: 1;
}
.folder-empty-icon { font-size: 36px; }

/* Folder sheet footer */
.folder-sheet-footer {
  padding: 12px 16px 16px; flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.btn-select-location {
  width: 100%; padding: 16px;
  background: var(--ground-900); color: var(--ground-50);
  border: none; border-radius: 14px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .15s, transform .1s;
}
.btn-select-location:active { opacity: .85; transform: scale(.98); }

/* ── Storage setup provider options ── */
.storage-provider-option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 16px;
  background: var(--bg); border: 1.5px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.storage-provider-option:hover { border-color: var(--blue-l); background: var(--blue-dim); }
.storage-provider-option:active { opacity: .85; transform: scale(.99); }

.storage-provider-logo {
  width: 48px; height: 48px; border-radius: 12px;
  background: #f8f9fb; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}

.storage-provider-info { flex: 1; }
.storage-provider-name { font-size: 16px; font-weight: 600; color: var(--text); }
.storage-provider-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── Settings Cloud Storage section ── */
.cloud-no-provider { font-size: 14px; color: var(--subtle); padding: 8px 0; }

.cloud-storage-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.cloud-storage-row:last-child { border-bottom: none; }

.cloud-storage-provider-tag {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; padding: 5px 12px;
  border-radius: 20px; background: var(--blue-dim); color: var(--blue-l);
}
.cloud-storage-provider-tag.active-provider {
  background: var(--green-dim); color: var(--green);
}

.cloud-folder-info { flex: 1; min-width: 0; }
.cloud-folder-name { font-size: 15px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud-folder-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.btn-change-folder {
  background: none; border: 1.5px solid var(--border); border-radius: 10px;
  color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 7px 12px; cursor: pointer; white-space: nowrap;
  transition: all .15s; flex-shrink: 0;
}
.btn-change-folder:hover { border-color: var(--blue-l); color: var(--blue-l); }

#dev-version-badge { font-family: var(--font-mono) !important; }

.mono { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }

.hidden { display: none !important; }

/* ══ DRAWER ══════════════════════════════════════════════════════════════════ */
.app-drawer { position: fixed; inset: 0; z-index: 800; pointer-events: none; }
.app-drawer.open { pointer-events: auto; }

.drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(33,27,20,.55); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .3s ease;
}
.app-drawer.open .drawer-backdrop { opacity: 1; }

.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 280px;
  background: var(--surface);
  display: flex; flex-direction: column;
  padding-top: var(--safe-top);
  transform: translateX(105%);
  transition: transform .32s cubic-bezier(.32,.72,0,1);
  box-shadow: -6px 0 40px rgba(33,27,20,.18);
}
.app-drawer.open .drawer-panel { transform: translateX(0); }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.drawer-user {
  padding: 10px 20px 4px;
  font-size: 13px; color: var(--muted);
  min-height: 28px;
}

.drawer-nav {
  flex: 1; display: flex; flex-direction: column; padding: 10px 12px; gap: 2px;
}

.drawer-nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 12px; border-radius: var(--r-md);
  background: none; border: none; cursor: pointer;
  font-size: 16px; font-weight: 600; color: var(--text);
  font-family: var(--font-body);
  text-align: right;
  transition: background .15s, color .15s;
}
.drawer-nav-item:hover { background: var(--bg); }
.drawer-nav-item:active { background: var(--ground-100); transform: scale(.98); }
.drawer-nav-item svg { flex-shrink: 0; color: var(--ground-500); }

.drawer-footer {
  padding: 12px; border-top: 1px solid var(--border);
}
.drawer-logout { color: var(--stamp-no); }
.drawer-logout svg { color: var(--stamp-no); }
.drawer-logout:hover { background: var(--red-dim) !important; }

/* ── History tab header ── */
.history-tab-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.history-tab-title {
  flex: 1;
  font-size: 17px; font-weight: 800; color: var(--text); font-family: var(--font-display);
}

/* ── Collapsible search bar ── */
.history-search-wrap {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  max-height: 72px;
  opacity: 1;
  transition: max-height .26s ease, opacity .22s ease;
  flex-shrink: 0;
}
.history-search-wrap.collapsed {
  max-height: 0;
  opacity: 0;
  border-bottom: none;
}
.history-search-inner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
}
.history-search-input {
  flex: 1; border: none; background: var(--bg); outline: none;
  font-size: 16px; font-family: var(--font-body); color: var(--text);
  padding: 8px 12px; border-radius: var(--r-pill);
  border: 1.5px solid var(--border); transition: border-color .15s;
}
.history-search-input:focus { border-color: var(--hivis-500); }
.history-search-input::placeholder { color: var(--ground-500); }
.btn-history-search {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--ground-900); color: var(--hivis-500);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: opacity .15s, transform .1s;
}
.btn-history-search:active { opacity: .8; transform: scale(.92); }

/* ── Floating new-folder button (history tab) ── */
.btn-float-history {
  position: fixed;
  bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  right: 16px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--ground-900); color: var(--hivis-500);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(33,27,20,.32);
  z-index: 80;
  transition: opacity .15s, transform .12s;
}
.btn-float-history:active { opacity: .8; transform: scale(.91); }
.left-handed .btn-float-history { right: auto; left: 16px; }

/* ── Search results panel ── */
#history-search-results {
  flex-shrink: 0; overflow-y: auto; max-height: 55vh;
  background: var(--bg);
  border-bottom: 2px solid var(--hivis-300);
}
#history-search-results.hidden { display: none; }

.search-answer-card {
  margin: 12px 14px 8px;
  background: var(--surface); border-radius: var(--r-md);
  border: 1px solid var(--border);
  padding: 14px 16px;
  box-shadow: var(--shadow-1);
}
.search-answer-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.search-answer-icon { font-size: 16px; }
.search-answer-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ground-500);
}
.search-answer-text {
  font-size: 14px; color: var(--text); line-height: 1.65; white-space: pre-wrap;
}

.search-hits-section {
  padding: 0 14px 12px;
}
.search-hits-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ground-500);
  padding: 8px 0 6px;
}
.search-hit-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 8px;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.search-hit-card:hover { border-color: var(--hivis-500); box-shadow: var(--shadow-hi); }
.search-hit-meta {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.search-hit-project { font-size: 13px; font-weight: 700; color: var(--text); }
.search-hit-date { font-size: 11px; color: var(--muted); }
.search-hit-items { display: flex; flex-direction: column; gap: 3px; }
.search-hit-item {
  font-size: 13px; color: var(--muted); line-height: 1.4;
  padding-right: 10px; border-right: 2px solid var(--hivis-300);
}
.search-hit-item strong { color: var(--text); }

.search-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 20px; color: var(--muted); font-size: 14px;
}
.search-spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--border); border-top-color: var(--hivis-500);
  animation: spin .7s linear infinite; flex-shrink: 0;
}
.search-empty {
  text-align: center; padding: 20px; color: var(--muted); font-size: 14px;
}

/* ══ FULLSCREEN VIDEO RECORDING OVERLAY ══════════════════════════════════════ */
.video-rec-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: #000;
  display: flex; align-items: center; justify-content: center;
}

.video-rec-monitor {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.video-rec-controls-pane {
  position: absolute;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 20px;
  background: rgba(33,27,20,.52);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-radius: 50px;
  padding: 14px 22px;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  touch-action: none; user-select: none;
  cursor: grab;
}
.video-rec-controls-pane:active { cursor: grabbing; }

.vrc-timer {
  font-family: var(--font-mono); font-size: 18px; font-weight: 700;
  color: var(--stamp-rec); letter-spacing: 2px; min-width: 52px; text-align: center;
}

.vrc-btn {
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16); color: white;
  transition: opacity .15s, transform .12s, background .15s;
  flex-shrink: 0;
}
.vrc-btn:active { opacity: .7; transform: scale(.88); }
.vrc-btn.vrc-stop { background: rgba(192,57,43,.85); }
.vrc-btn.vrc-stop:hover { background: rgba(192,57,43,1); }
.vrc-btn.vrc-discard { background: rgba(255,255,255,.1); color: rgba(255,120,100,.9); width: 46px; height: 46px; }
.vrc-btn.vrc-discard:hover { background: rgba(192,57,43,.4); color: #fff; }

.tmpl-focus-textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: var(--r-md); font-size: 16px; font-family: var(--font-display);
  color: var(--text); background: var(--bg); resize: vertical; line-height: 1.5;
  direction: rtl;
}
.tmpl-focus-textarea:focus { outline: none; border-color: var(--hivis-500); }

/* ── Splash overlay fade ──────────────────────────────────────────────────── */
#app-splash.fade { opacity: 0; pointer-events: none; }

/* ── Template describe-and-generate ──────────────────────────────────────── */
.btn-suggest {
  width: 100%; margin-top: 10px; padding: 10px; border-radius: var(--r-md);
  background: var(--hivis-500); color: var(--ground-900);
  font-weight: 700; font-size: 14px; border: none; cursor: pointer;
  transition: opacity .15s;
}
.btn-suggest:hover { opacity: .88; }
.btn-suggest:disabled { opacity: .5; cursor: default; }
.modal-divider {
  text-align: center; color: var(--muted); font-size: 12px;
  margin: 14px 0; border-top: 1px solid var(--border); padding-top: 12px;
}
.category-chip {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  margin-bottom: 8px;
}
.cat-label { font-weight: 700; font-size: 13px; color: var(--hivis-500); }
.cat-desc  { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ── Audio player ─────────────────────────────────────────────────────────── */
.audio-player-wrap {
  margin: 12px 16px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.audio-player-prominent {
  margin: 8px 16px 4px; border-color: var(--hivis-500,#b45309);
  background: linear-gradient(135deg, var(--surface) 0%, #fef9f2 100%);
}
.audio-player-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
#result-audio-player { width: 100%; height: 40px; }

/* ── Version stack ────────────────────────────────────────────────────────── */
.version-stack { margin: 0 16px 8px; }
.version-stack-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0 6px; border-top: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--muted);
}
#version-list { padding-bottom: 8px; }
.version-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.version-item.current { color: var(--hivis-500); }
.version-label { flex: 1; font-weight: 500; }
.version-date  { color: var(--muted); font-size: 11px; white-space: nowrap; }
.link-btn {
  background: none; border: none; color: var(--hivis-500);
  font-size: 13px; cursor: pointer; padding: 0; font-family: inherit;
  text-decoration: underline; text-underline-offset: 2px;
}

/* ── Feedback trigger button ──────────────────────────────────────────────── */
.btn-feedback-trigger { color: var(--text); }

/* ── Feedback bottom sheet ────────────────────────────────────────────────── */
.bottom-sheet-backdrop {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,.45); display: flex; align-items: flex-end;
}
.bottom-sheet-backdrop.hidden { display: none; }
.bottom-sheet {
  width: 100%; max-width: 560px; margin: 0 auto;
  background: var(--surface-card, #2A2218); border-radius: 20px 20px 0 0;
  padding: 0 0 max(20px, env(safe-area-inset-bottom)) 0;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle {
  width: 40px; height: 4px; background: var(--border);
  border-radius: 2px; margin: 10px auto 0;
}
.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 0;
}
.sheet-title { font-weight: 700; font-size: 16px; }
.sheet-close-x {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--muted); padding: 4px;
}
.sheet-body { padding: 12px 20px 0; }
.sheet-hint { font-size: 13px; color: var(--muted); margin-bottom: 10px; line-height: 1.5; }
.feedback-status-msg {
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 12px 0; animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:.7} 50%{opacity:1} }

/* ══════════════════════════════════════════════════════
   ADMIN PANEL
══════════════════════════════════════════════════════ */

/* top bar */
.admin-topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky; top: 0; z-index: 100;
}
.admin-back-btn {
  background: none; border: none; color: var(--muted);
  font: 500 14px var(--font); cursor: pointer; padding: 4px 0;
}
.admin-back-btn:hover { color: var(--text); }
.admin-title { font-weight: 700; font-size: 16px; color: var(--text); }

/* tab bar */
.admin-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.admin-tab {
  flex: 1; background: none; border: none; border-bottom: 3px solid transparent;
  color: var(--muted); font: 500 14px var(--font); cursor: pointer;
  padding: 12px 0; transition: color .15s, border-color .15s;
}
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-tab-pane { display: none; padding: 18px 16px 80px; }
.admin-tab-pane.active { display: block; }

/* stat cards */
.admin-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 500px) { .admin-cards { grid-template-columns: repeat(2, 1fr); } }
.admin-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 12px; text-align: center;
}
.admin-card-cost { border-color: var(--accent); }
.admin-card-val {
  font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1;
}
.admin-card-cost .admin-card-val { color: var(--accent); }
.admin-card-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* sections */
.admin-section { margin-bottom: 28px; }
.admin-section-title {
  font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 12px;
}

/* action bars */
.admin-action-bars { display: flex; flex-direction: column; gap: 8px; }
.admin-bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.admin-bar-label { width: 130px; color: var(--text); flex-shrink: 0; text-align: right; }
.admin-bar-track {
  flex: 1; background: var(--bg-input); border-radius: 4px;
  height: 8px; overflow: hidden;
}
.admin-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s; }
.admin-bar-val { width: 60px; color: var(--muted); font-size: 12px; text-align: left; }

/* chart */
.admin-chart { width: 100%; max-width: 100%; border-radius: 8px; }

/* tables */
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: var(--bg-card); border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
}
.admin-table th {
  padding: 10px 12px; text-align: right; background: var(--bg-input);
  color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 9px 12px; border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text); vertical-align: top;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(237,155,61,.04); }
.admin-cost-chip {
  display: inline-block; background: rgba(237,155,61,.15);
  color: var(--accent); border-radius: 6px; padding: 1px 7px; font-size: 12px;
}

/* filter */
.admin-filter-row { margin-bottom: 10px; }
.admin-input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; color: var(--text);
  font: 400 16px var(--font); outline: none; box-sizing: border-box;
}
.admin-input:focus { border-color: var(--accent); }

/* expandable job row */
.adm-job-detail { display: none; background: var(--bg-input); padding: 10px 12px; }
.adm-job-detail.open { display: table-row; }
.adm-job-detail-inner { font-size: 12px; color: var(--muted); line-height: 1.8; }
.adm-expand-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted); font-size: 11px; cursor: pointer; padding: 2px 8px;
}
.adm-expand-btn:hover { color: var(--text); }

/* ── Studio ─────────────────────────────────────── */
.studio-layout {
  display: flex; gap: 16px; align-items: flex-start; min-height: calc(100vh - 120px);
}
@media (max-width: 620px) { .studio-layout { flex-direction: column; } }

.studio-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.studio-sidebar-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13px; color: var(--muted);
}
.studio-new-btn {
  background: none; border: 1px solid var(--accent); color: var(--accent);
  border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer;
}
.studio-new-btn:hover { background: rgba(237,155,61,.12); }
.studio-tmpl-list { display: flex; flex-direction: column; }
.studio-tmpl-item {
  padding: 12px 14px; cursor: pointer; font-size: 14px; color: var(--text);
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.studio-tmpl-item:last-child { border-bottom: none; }
.studio-tmpl-item:hover { background: rgba(237,155,61,.07); }
.studio-tmpl-item.active { background: rgba(237,155,61,.14); color: var(--accent); font-weight: 600; }
.studio-tmpl-badge { font-size: 11px; color: var(--muted); margin-top: 2px; }

.studio-editor-wrap { flex: 1; }
.studio-placeholder {
  text-align: center; color: var(--muted); font-size: 15px;
  padding: 60px 20px;
}
.studio-editor {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.studio-editor-header {
  display: flex; gap: 10px; align-items: center; margin-bottom: 18px;
  flex-wrap: wrap;
}
.studio-big-input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; color: var(--text);
  font: 600 16px var(--font); outline: none; min-width: 120px;
}
.studio-big-input:focus { border-color: var(--accent); }
.btn-primary-sm {
  background: var(--accent); color: #1a1410; font-weight: 700;
  border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px;
  cursor: pointer;
}
.btn-primary-sm:hover { opacity: .88; }
.btn-danger-sm {
  background: rgba(220,50,50,.15); color: #e06060; font-weight: 600;
  border: 1px solid rgba(220,50,50,.3); border-radius: 8px;
  padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.btn-danger-sm:hover { background: rgba(220,50,50,.25); }

.studio-fields-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px;
}
@media (max-width: 500px) { .studio-fields-grid { grid-template-columns: 1fr; } }
.studio-fields-grid label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.studio-label-block { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.admin-textarea {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; color: var(--text);
  font: 400 13px var(--font); outline: none; resize: vertical; box-sizing: border-box;
}
.admin-textarea:focus { border-color: var(--accent); }
.admin-textarea-tall { min-height: 160px; }

.studio-section-title { font-weight: 700; font-size: 13px; color: var(--muted); text-transform: uppercase; }
.studio-cats-header {
  display: flex; justify-content: space-between; align-items: center;
  margin: 18px 0 10px;
}
.studio-add-cat-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.studio-add-cat-btn:hover { border-color: var(--accent); color: var(--accent); }
.studio-cats-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.studio-cat-row {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.studio-cat-row .admin-input { flex: 1; min-width: 60px; }
.studio-cat-del {
  background: none; border: none; color: var(--muted); font-size: 16px;
  cursor: pointer; padding: 0 4px; flex-shrink: 0;
}
.studio-cat-del:hover { color: #e06060; }

/* Studio examples */
.studio-examples-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.studio-example-row {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; position: relative;
}
.studio-example-row label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 3px; }
.studio-example-row textarea { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
.studio-example-del {
  position: absolute; top: 8px; left: 8px;
  background: none; border: none; color: var(--muted); font-size: 15px; cursor: pointer; padding: 2px;
}
.studio-example-del:hover { color: #e06060; }
.cat-review-mode { flex: 0 0 100px; font-size: 12px; }

/* Studio test section */
.studio-test-section {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border);
}
.studio-test-input-tabs {
  display: flex; gap: 4px; margin-bottom: 10px;
}
.studio-test-tab {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; font-size: 12px; cursor: pointer;
  color: var(--muted); transition: all .15s;
}
.studio-test-tab.active { background: var(--accent); color: #1a1410; border-color: var(--accent); font-weight: 700; }
.studio-input-pane { margin-bottom: 4px; }
.studio-input-pane.hidden { display: none; }
.studio-file-drop {
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--border); border-radius: 10px; padding: 24px;
  cursor: pointer; color: var(--muted); font-size: 13px; text-align: center;
  transition: border-color .2s;
}
.studio-file-drop:hover, .studio-file-drop.dragover { border-color: var(--accent); color: var(--accent); }
.studio-test-controls {
  display: flex; gap: 14px; align-items: center; margin: 10px 0;
}

/* Progress chips */
.studio-progress { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.prog-chip {
  background: rgba(237,155,61,.12); color: var(--accent);
  border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 600;
  animation: pulse 1.5s infinite;
}
.prog-chip.done { background: rgba(40,180,80,.12); color: #28b450; animation: none; }
.prog-chip.hidden { display: none; }

/* Score panel */
.studio-score-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; margin: 12px 0;
}
.studio-score-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.studio-score-num {
  font-size: 28px; font-weight: 800; color: var(--accent);
}
.studio-score-bar-wrap { flex: 1; background: var(--bg-input); border-radius: 4px; height: 8px; overflow: hidden; }
.studio-score-bar { height: 100%; border-radius: 4px; background: var(--accent); transition: width .6s ease; }
.studio-score-summary { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.studio-score-breakdown { display: flex; flex-direction: column; gap: 6px; }
.score-criterion {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
}
.score-criterion-name { flex: 0 0 120px; color: var(--muted); text-align: right; }
.score-criterion-bar-wrap { flex: 1; background: var(--bg-input); border-radius: 3px; height: 5px; }
.score-criterion-bar { height: 100%; border-radius: 3px; background: #28b450; }
.score-criterion-val { flex: 0 0 36px; text-align: left; font-size: 11px; color: var(--muted); }
.score-criterion-note { color: var(--muted); font-size: 11px; font-style: italic; }

/* Studio result cards */
.studio-result-cards {
  display: flex; flex-direction: column; gap: 8px; margin: 12px 0;
  max-height: 480px; overflow-y: auto;
}
.studio-result-cards.hidden { display: none; }
.studio-result-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.studio-result-card.is-section-card {
  background: var(--bg-input); border-style: dashed;
}
.studio-result-card-num { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.studio-result-card-topic { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.studio-result-card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.studio-result-card-badge {
  background: var(--bg-input); border-radius: 6px; padding: 2px 8px;
  font-size: 11px; color: var(--muted);
}
.studio-result-card-notes { font-size: 12px; color: var(--muted); line-height: 1.5; }
.studio-check-label {
  display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer;
}
.studio-test-status {
  padding: 10px; background: rgba(237,155,61,.1); border-radius: 8px;
  font-size: 13px; color: var(--accent); margin-top: 8px; text-align: center;
  animation: pulse 1.5s infinite;
}
.studio-test-meta {
  font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.8;
}
.studio-test-result {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; font: 12px/1.7 var(--font-mono);
  color: var(--text); overflow-x: auto; white-space: pre-wrap;
  word-break: break-all; margin-top: 8px; max-height: 400px; overflow-y: auto;
  direction: ltr;
}

/* ── Inline card editing ──────────────────────────────────────────────────── */
.card-editable { outline: none; border-radius: 4px; cursor: text; -webkit-user-select: text; user-select: text; min-height: 1.2em; }
.card-editable:focus {
  background: rgba(180,83,9,.06); box-shadow: 0 0 0 2px rgba(180,83,9,.25);
  padding: 2px 4px; margin: -2px -4px;
}
/* Placeholder text for empty editable fields */
.card-editable:empty::before {
  content: attr(data-placeholder);
  color: var(--muted,#9c9185); pointer-events: none; font-style: italic;
}

/* ── Feedback processing bar ─────────────────────────────────────────────── */
.processing-progress-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: 3px 3px 0 0; overflow: hidden;
  background: var(--bg-input);
}
.processing-progress-bar::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--hivis-500,#b45309), transparent);
  animation: progress-sweep 1.4s ease-in-out infinite;
}
@keyframes progress-sweep {
  0%   { left: -60%; }
  100% { left: 110%; }
}
.processing-progress-bar.hidden { display: none; }
.bottom-sheet { position: relative; }

/* ── History — folder button ──────────────────────────────────────────────── */
.history-tab-header { display: flex; align-items: center; gap: 8px; }
.btn-new-folder-sm {
  margin-right: auto; display: flex; align-items: center; gap: 5px;
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer;
  transition: all .15s;
}
.btn-new-folder-sm:hover { border-color: var(--accent); color: var(--accent); }

/* ── History — folder tree ────────────────────────────────────────────────── */
.history-folder { margin-bottom: 6px; }
.history-folder-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px;
  cursor: pointer; user-select: none; border-radius: 10px;
  transition: background .12s;
  touch-action: manipulation;
}
.history-folder-header:hover { background: var(--ground-100,#f5f0eb); }
.history-folder-chevron {
  display: flex; align-items: center; color: var(--muted);
  transition: transform .2s; flex-shrink: 0;
}
.history-folder.open .history-folder-chevron { transform: rotate(-90deg); }
.history-folder-icon {
  display: flex; align-items: center; color: var(--hivis-500); flex-shrink: 0;
}
.history-folder-name { flex: 1; font-weight: 600; font-size: 14px; color: var(--text); }
.history-folder-count {
  background: var(--bg-input); color: var(--muted); border-radius: 10px;
  padding: 1px 7px; font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.history-folder-del {
  background: none; border: none; color: var(--muted); font-size: 15px; cursor: pointer;
  padding: 2px 4px; opacity: 0; transition: opacity .15s; flex-shrink: 0;
}
.history-folder-header:hover .history-folder-del { opacity: 1; }
.history-folder-del:hover { color: #e06060; }

.history-folder-body { padding: 0 8px 4px 28px; }
.history-folder-body.hidden { display: none; }

/* Template sub-group within a folder */
.history-tmpl-group { margin-bottom: 8px; }
.history-tmpl-label {
  font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .4px;
  text-transform: uppercase; padding: 2px 8px 4px; display: flex; align-items: center; gap: 4px;
}
.history-tmpl-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Move-to-folder button on each card */
.history-move-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  padding: 4px 6px; border-radius: 6px; display: flex; align-items: center;
  flex-shrink: 0; opacity: 0; transition: opacity .15s, color .15s;
}
.history-card:hover .history-move-btn { opacity: 1; }
.history-move-btn:hover { color: var(--accent); }

/* On touch devices always show the move button (no hover) */
@media (hover: none) {
  .history-move-btn { opacity: 0.5; }
}

/* Folder picker sheet rows */
.fpi-folder-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; cursor: pointer; text-align: right;
  padding: 12px 20px; font-size: 15px; color: var(--text);
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.fpi-folder-row:last-child { border-bottom: none; }
.fpi-folder-row:hover { background: var(--ground-100); }
.fpi-folder-row.fpi-current { color: var(--accent); font-weight: 600; }
.fpi-folder-row.fpi-new-folder { color: var(--accent); font-style: italic; }

/* Inline new folder form in tab header */
.history-new-folder-form {
  display: flex; align-items: center; gap: 4px; flex: 1;
}
.history-new-folder-input {
  flex: 1; border: 1px solid var(--hivis-500); border-radius: 8px;
  background: var(--bg-input,var(--ground-50)); color: var(--text);
  font-size: 16px; padding: 5px 10px; outline: none;
}
.history-new-folder-ok, .history-new-folder-cancel {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 8px; font-size: 13px; cursor: pointer; color: var(--text);
}
.history-new-folder-ok { border-color: var(--stamp-go); color: var(--stamp-go); }
.history-new-folder-cancel { border-color: var(--muted); color: var(--muted); }

/* Drag-and-drop (desktop) */
.history-card.dragging { opacity: .35; pointer-events: none; }
.history-card-ghost {
  position: fixed; pointer-events: none; z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  border-radius: 12px; opacity: .9; transform: rotate(-1.5deg) scale(1.03);
  transition: none;
}
.history-folder.drag-over > .history-folder-header {
  background: rgba(180,83,9,.12); outline: 2px solid var(--hivis-500,#b45309);
  outline-offset: -2px;
}

/* ── Floating recording buttons ──────────────────────────────────────────── */
.rec-float-btns {
  position: fixed;
  bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* RTL: flex-start = physical right ✓ */
  gap: 10px;
  z-index: 80;
}
.left-handed .rec-float-btns {
  right: auto;
  left: 16px;
  align-items: flex-end;   /* RTL: flex-end = physical left ✓ */
}

.rec-float-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--ground-900);
  color: var(--hivis-500);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(33,27,20,.28);
  position: relative;
  transition: opacity .15s, transform .12s;
  flex-shrink: 0;
}
.rec-float-btn:active { opacity: .8; transform: scale(.91); }

/* discard (trash) button — shown during recording */
.rec-float-discard {
  background: rgba(192,57,43,.15);
  color: var(--stamp-rec);
  border: 1.5px solid rgba(192,57,43,.25);
}
.rec-float-discard:hover { background: rgba(192,57,43,.28); }

/* pause button slightly larger */
.rec-float-pause {
  width: 56px; height: 56px;
  background: var(--hivis-500);
  color: var(--ground-900);
}
.rec-float-pause.paused {
  background: var(--stamp-rec);
  color: white;
}

/* Mode toggle positioned in float stack */
.record-mode-toggle-float {
  display: flex;
  background: var(--ground-900);
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 2px;
  box-shadow: 0 2px 12px rgba(33,27,20,.22);
  flex-shrink: 0;
}

/* Left-hand toggle switch button */
.toggle-switch-btn {
  width: 44px; height: 26px;
  border-radius: 13px;
  background: var(--ground-300);
  border: none;
  cursor: pointer;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle-switch-btn::after {
  content: '';
  position: absolute;
  top: 3px; right: 3px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch-btn.active { background: var(--hivis-500); }
.toggle-switch-btn.active::after { transform: translateX(-18px); }

/* Delete button in results header */
.btn-delete-job { color: var(--muted); }
.btn-delete-job:hover { border-color: var(--stamp-no); color: var(--stamp-no); }

/* Templates screen list */
.templates-screen-list {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0;
}

/* Processing overlay — template and folder pickers */
.proc-tmpl-picker, .proc-folder-picker {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.proc-tmpl-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px;
}
.proc-tmpl-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.proc-folder-select {
  flex: 1; padding: 8px 10px; border: 1.5px solid var(--border);
  border-radius: 10px; background: var(--bg); color: var(--text);
  font-size: 14px; font-family: var(--font-body); outline: none;
}
.proc-folder-select:focus { border-color: var(--hivis-500); }
.proc-folder-new-btn {
  padding: 8px 12px; background: var(--hivis-100); border: none;
  border-radius: 10px; color: var(--hivis-700); font-size: 13px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.proc-folder-new-input {
  flex: 1; padding: 7px 10px; border: 1.5px solid var(--hivis-500);
  border-radius: 8px; background: var(--bg); color: var(--text);
  font-size: 16px; font-family: var(--font-body); outline: none;
}
.proc-folder-new-ok, .proc-folder-new-cancel {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; font-size: 13px; cursor: pointer; color: var(--text);
}
.proc-folder-new-ok { border-color: var(--stamp-go); color: var(--stamp-go); }
.proc-folder-new-cancel { color: var(--muted); }

/* ── Admin scroll fix ────────────────────────────────────────────────────── */
#screen-admin { overflow-y: auto; }
.admin-tab-pane.active {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 120px);
}

/* ── Feedback 2-tab sheet ─────────────────────────────────────────────────── */
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 0 20px 12px; }
.fb-tabs { display: flex; gap: 4px; background: var(--ground-100,#f5f0eb); border-radius: 20px; padding: 3px; }
.fb-tab { border: none; background: transparent; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 16px; cursor: pointer; transition: background .15s; line-height: 1; display: flex; align-items: center; gap: 5px; color: var(--ground-700); }
.fb-tab.active { background: var(--surface,#fff); box-shadow: 0 1px 4px rgba(0,0,0,.12); color: var(--ground-900); }
.fb-close-btn { color: var(--ground-300); font-size: 18px; transition: color .15s; }
.fb-close-btn:hover { color: var(--hivis-500); }
.fb-textarea { color: var(--text); background: var(--surface); border-color: var(--border); }
.fb-textarea:focus { border-color: var(--hivis-500); }
.btn-feedback-submit-styled {
  background: var(--hivis-500);
  color: var(--ground-900);
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: opacity .15s;
  font-family: var(--font-body);
}
.btn-feedback-submit-styled:hover { opacity: .88; }
.btn-feedback-submit-styled:disabled { opacity: .5; cursor: default; }
.fb-pane { padding: 0 20px 20px; }
.fb-pane.hidden { display: none; }

/* Mini Toffi record button inside feedback sheet */
.fb-rec-wrap { position: relative; width: 110px; height: 110px; display: flex; align-items: center; justify-content: center; }
.fb-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--hivis-500,#b45309); opacity: 0; }
.fb-rec-wrap .fb-ring-1 { animation: ring-out 2.8s ease-out infinite; }
.fb-rec-wrap .fb-ring-2 { animation: ring-out 2.8s ease-out 1s infinite; }
.fb-rec-wrap.recording .fb-ring { border-color: var(--stamp-rec,#c0392b); }
.fb-rec-wrap.recording .fb-ring-1 { animation: ring-out 1.2s ease-out infinite; }
.fb-rec-wrap.recording .fb-ring-2 { animation: ring-out 1.2s ease-out .4s infinite; }
.fb-rec-wrap.paused .fb-ring-1,
.fb-rec-wrap.paused .fb-ring-2 { animation: none; opacity: 0; }
.fb-rec-btn {
  width: 76px; height: 76px; border-radius: 50%; border: none;
  background: var(--ground-900,#1c1208); color: var(--hivis-500,#b45309);
  box-shadow: 0 2px 8px rgba(0,0,0,.2), 0 0 0 6px var(--ground-50,#faf8f5), 0 8px 20px rgba(33,27,20,.2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .12s, background .2s, color .2s; position: relative; z-index: 1;
}
.fb-rec-btn:active { transform: scale(.93); }
.fb-rec-btn.recording { background: var(--stamp-rec,#c0392b); color: #fff; }
.fb-rec-btn.paused { background: var(--ground-700,#4a3b2a); color: var(--hivis-300,#d97706); }

/* ── Templates screen overlay ─────────────────────────────────────────────── */
.screen-templates-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.screen-templates-overlay.hidden { display: none; }
/* Action sheet and modal launched from within the templates screen must appear above it */
#sheet-template-actions { z-index: 700; }
#modal-template { z-index: 700; }
.screen-templates-inner { display: flex; flex-direction: column; min-height: 100%; padding-bottom: env(safe-area-inset-bottom,0px); }
.screen-templates-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.screen-templates-title { flex: 1; font-size: 17px; font-weight: 700; color: var(--text); }
.screen-templates-hint { font-size: 13px; color: var(--muted); padding: 10px 20px 4px; }
.btn-back-sm {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ground-100); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); flex-shrink: 0;
}
.btn-tmpl-new-top {
  display: flex; align-items: center; gap: 6px;
  background: var(--hivis-500); color: var(--ground-900);
  border: none; border-radius: 20px; padding: 8px 16px;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.templates-screen-list { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 24px; }
.tmpl-screen-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px;
  cursor: pointer; transition: border-color .15s;
}
.tmpl-screen-card.active { border-color: var(--hivis-500); background: var(--hivis-100); }
.tmpl-screen-card.is-system { opacity: .9; }
.tmpl-sc-main { flex: 1; min-width: 0; }
.tmpl-sc-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.tmpl-sc-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tmpl-sc-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--ground-100); color: var(--muted); font-weight: 500;
}
.tmpl-sc-badge-system { background: var(--hivis-100); color: var(--hivis-700); }
.tmpl-sc-actions { display: flex; gap: 4px; flex-shrink: 0; }
.tmpl-sc-btn {
  width: 36px; height: 36px; border-radius: 8px; border: none;
  background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: background .12s, color .12s;
}
.tmpl-sc-btn:hover { background: var(--ground-100); color: var(--text); }
.tmpl-sc-del:hover { background: var(--red-dim); color: var(--red); }

/* ── Mandatory folder picker sheet ────────────────────────────────────────── */
.mandatory-sheet {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(33,27,20,.72); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.mandatory-sheet.hidden { display: none; }
.mandatory-sheet-card {
  width: 100%; max-width: 520px;
  background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 28px 24px calc(28px + env(safe-area-inset-bottom,0px));
}
.mandatory-sheet-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.mandatory-sheet-sub { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.folder-picker-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; max-height: 40vh; overflow-y: auto; }
.folder-pick-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  border: 2px solid var(--border); background: var(--bg);
  font-size: 15px; color: var(--text); cursor: pointer; text-align: right; width: 100%;
  transition: border-color .12s, background .12s;
}
.folder-pick-item.selected { border-color: var(--hivis-500); background: var(--hivis-100); color: var(--text); }
.folder-picker-new-row { margin-top: 4px; }
.btn-folder-picker-new {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; border: 2px dashed var(--border);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; width: 100%;
}
.btn-folder-picker-new:hover { border-color: var(--hivis-500); color: var(--hivis-500); }
#btn-folder-picker-confirm:not(:disabled) { opacity: 1; cursor: pointer; }
#btn-folder-picker-confirm:disabled { opacity: .45; cursor: not-allowed; }
