/* Google / Material 3 inspired theme */
:root {
  --primary: #1a73e8;
  --primary-hover: #1765cc;
  --on-primary: #fff;
  --primary-container: #d3e3fd;
  --on-primary-container: #041e49;
  --surface: #ffffff;
  --bg: #f0f4f9;
  --surface-2: #f8fafd;
  --text: #1f1f1f;
  --text-2: #444746;
  --muted: #5f6368;
  --outline: #747775;
  --outline-v: #c4c7c5;
  --divider: #e3e3e3;
  --hover: rgba(68, 71, 70, .08);
  --danger: #b3261e;
  --danger-bg: #fce8e6;
  --ok: #146c2e;
  --ok-bg: #e6f4ea;
  --warn-bg: #fef7e0;
  --radius: 16px;
  --shadow-1: 0 1px 2px rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15);
  --shadow-2: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .15);
  --font: "Noto Sans Arabic", Roboto, "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font: 14px/1.6 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { font-weight: 500; margin: 0; }
h1 { font-size: 26px; line-height: 1.3; }
h2 { font-size: 18px; }
h3 { font-size: 15px; margin-top: 8px; color: var(--text-2); }
small { font-size: 12px; }
.muted { color: var(--muted); margin: 4px 0 0; }
.small { font-size: 12px; }
.grow { flex: 1; }
.hu { display: block; color: var(--muted); font-family: Roboto, sans-serif; font-size: 12px; font-weight: 400; text-align: start; }

/* Material Symbols */
.ms { font-family: "Material Symbols Outlined"; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr; -webkit-font-feature-settings: "liga"; font-feature-settings: "liga"; user-select: none; flex-shrink: 0; }
.ms.big { font-size: 56px; color: var(--outline-v); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 24px; border-radius: 20px; border: 0; font: 500 14px var(--font); cursor: pointer; transition: background .15s, box-shadow .15s; white-space: nowrap; }
.btn .ms { font-size: 20px; margin-inline-start: -8px; }
.btn.filled { background: var(--primary); color: var(--on-primary); }
.btn.filled:hover { background: var(--primary-hover); box-shadow: var(--shadow-1); }
.btn.tonal { background: var(--primary-container); color: var(--on-primary-container); }
.btn.tonal:hover { box-shadow: var(--shadow-1); }
.btn.text { background: transparent; color: var(--primary); padding: 0 12px; }
.btn.text:hover { background: rgba(26, 115, 232, .08); }
.btn.block { width: 100%; margin-top: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--hover); }
.link-btn { background: none; border: 0; color: var(--primary); font: 500 12px var(--font); cursor: pointer; padding: 4px 0; margin-top: 4px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--bg); }
.topbar.scrolled { box-shadow: 0 1px 2px rgba(60, 64, 67, .15); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-2); min-width: 232px; }
.brand-logo { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.brand-name { font-size: 20px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { flex: 1; max-width: 720px; height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: 24px; background: #e9eef6; transition: background .15s, box-shadow .15s; }
.search:focus-within { background: #fff; box-shadow: var(--shadow-1); }
.search .ms { color: var(--text-2); }
.search input { flex: 1; border: 0; background: transparent; font: 16px var(--font); outline: none; color: var(--text); min-width: 0; }
.top-actions { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.account { position: relative; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #7b1fa2; color: #fff; font: 500 16px Roboto, var(--font); display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.avatar.big { width: 48px; height: 48px; font-size: 20px; }
.avatar.soft { background: var(--primary-container); color: var(--on-primary-container); cursor: default; }

/* Shell */
.shell { display: flex; align-items: flex-start; }
.drawer { position: sticky; top: 64px; width: 256px; flex-shrink: 0; padding: 8px 12px 24px; height: calc(100vh - 64px); overflow: auto; }
.fab-new { display: inline-flex; align-items: center; gap: 12px; height: 56px; padding: 0 20px 0 24px; margin: 4px 0 16px; border-radius: 16px; background: #c2e7ff; color: #001d35; font-weight: 500; box-shadow: var(--shadow-1); transition: box-shadow .15s; }
.fab-new:hover { box-shadow: var(--shadow-2); }
.nav { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 16px; border-radius: 20px; color: var(--text-2); font-weight: 500; margin-bottom: 2px; }
.nav:hover { background: var(--hover); }
.nav.on { background: var(--primary-container); color: var(--on-primary-container); }
.main { flex: 1; min-width: 0; padding: 8px 24px 120px 24px; max-width: 1080px; }
.scrim { display: none; }
.only-mobile { display: none; }

/* Cards & lists */
.card { background: var(--surface); border-radius: var(--radius); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 20px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 16px 20px; display: flex; align-items: center; gap: 14px; }
.stat .ms { width: 44px; height: 44px; border-radius: 50%; background: var(--primary-container); color: var(--primary); display: grid; place-items: center; }
.stat b { display: block; font: 500 24px Roboto, var(--font); }
.stat small { color: var(--muted); }
.list { overflow: visible; }
.list-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--divider); }
.list-row:last-child { border-bottom: 0; }
.list-row:not(.list-head):hover { background: var(--surface-2); }
.list-row.disabled { opacity: .55; }
.list-head { color: var(--muted); font-size: 12px; font-weight: 500; padding: 14px 16px 10px; }
.list-row small { display: block; color: var(--muted); }
.who { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.who b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who > span:last-child { min-width: 0; }
.actions { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }
.empty { text-align: center; padding: 56px 24px; }
.empty h2 { margin: 12px 0 4px; }
.empty .btn { margin-top: 16px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.chip { display: inline-block; padding: 2px 12px; border-radius: 8px; border: 1px solid var(--outline-v); font-size: 12px; font-weight: 500; color: var(--text-2); }
.chip.blue { background: var(--primary-container); border-color: transparent; color: var(--on-primary-container); }
.chip.red { background: var(--danger-bg); border-color: transparent; color: var(--danger); }

/* Menus */
.dd { position: relative; }
.menu { display: none; position: absolute; top: calc(100% + 4px); inset-inline-end: 0; z-index: 40; min-width: 200px; padding: 8px 0; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-2); }
.menu.wide { min-width: 260px; }
.dd.up .menu { top: auto; bottom: calc(100% + 6px); }
.menu.open { display: block; animation: pop .12s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu a, .menu button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 44px; padding: 6px 16px; border: 0; background: none; color: var(--text); font: 14px var(--font); text-align: start; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--hover); }
.menu .ms { color: var(--text-2); font-size: 20px; }
.menu small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.menu .danger, .menu .danger .ms { color: var(--danger); }
.menu form { margin: 0; }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px 16px; border-bottom: 1px solid var(--divider); margin-bottom: 8px; min-width: 260px; }

/* Form layout */
.form-wrap { max-width: 800px; margin: 0 auto; }
.form-hero { overflow: hidden; margin-bottom: 12px; }
.hero-bar { height: 10px; background: var(--primary); }
.hero-body { padding: 20px 24px 24px; display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.tip { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; color: var(--text-2); }
.tip .ms { font-size: 18px; color: var(--primary); }
.toc { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; position: sticky; top: 64px; z-index: 5; background: var(--bg); }
.toc a { flex-shrink: 0; padding: 6px 14px; border: 1px solid var(--outline-v); border-radius: 8px; color: var(--text-2); font-size: 13px; font-weight: 500; background: var(--surface); }
.toc a:hover { background: var(--surface-2); }
.section { padding: 20px 24px 12px; margin-bottom: 12px; border: 1px solid transparent; transition: border-color .2s; }
.section:focus-within { border-inline-start: 6px solid var(--primary); padding-inline-start: 18px; }
.section > header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.sec-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-container); color: var(--primary); display: grid; place-items: center; }
.section.narrow { max-width: 560px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px 16px; }
.grid > * { grid-column: span 12; }
.col-1 { grid-column: span 1; } .col-2 { grid-column: span 2; } .col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
.end { display: flex; justify-content: flex-end; }
[data-show-if].is-hidden { display: none; }

/* Outlined text field with floating label */
.field { position: relative; display: block; margin: 8px 0 0; }
.field input, .field textarea { width: 100%; height: 56px; padding: 18px 16px 6px; border: 1px solid var(--outline); border-radius: 4px; background: transparent; font: 16px var(--font); color: var(--text); outline: none; transition: border-color .15s; }
.field textarea { height: auto; min-height: 72px; padding-top: 24px; resize: vertical; line-height: 1.5; }
.field input[dir="ltr"], .field textarea[dir="ltr"] { text-align: left; }
.field input:hover, .field textarea:hover { border-color: var(--text); }
.field input:focus, .field textarea:focus { border: 2px solid var(--primary); padding-inline: 15px; }
.field > span { position: absolute; top: 17px; inset-inline-start: 12px; padding: 0 4px; color: var(--muted); font-size: 16px; pointer-events: none; transition: all .15s ease; background: var(--surface); max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.field input:focus + span, .field input:not(:placeholder-shown) + span,
.field textarea:focus + span, .field textarea:not(:placeholder-shown) + span,
.field input[type="date"] + span { top: -9px; font-size: 12px; }
.field input:focus + span, .field textarea:focus + span { color: var(--primary); }
.field input:disabled { color: var(--muted); border-style: dashed; }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.field.invalid > span { color: var(--danger); }
.field ::placeholder { color: transparent; }
.field input:focus::placeholder, .field textarea:focus::placeholder { color: #9aa0a6; }
.field.pw input { padding-inline-end: 52px; }
.field.pw .icon-btn { position: absolute; top: 8px; inset-inline-end: 6px; }
.help { min-height: 22px; padding: 2px 16px 6px; font-size: 12px; }
.help .hu { font-size: 11.5px; }
.err-txt { color: var(--danger); font-weight: 500; }

/* Radios */
.choice { border: 0; margin: 4px 0 14px; padding: 0; min-width: 0; }
.choice legend { font-weight: 500; padding: 0; margin-bottom: 6px; color: var(--text); }
.choice .opts { display: flex; flex-direction: column; gap: 2px; }
.choice.inline .opts { flex-direction: row; flex-wrap: wrap; gap: 2px 8px; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.opt:hover { background: var(--hover); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .dot { width: 20px; height: 20px; margin-top: 2px; border: 2px solid var(--text-2); border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; transition: border-color .15s; }
.opt .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); transform: scale(0); transition: transform .15s; }
.opt input:checked + .dot { border-color: var(--primary); }
.opt input:checked + .dot::after { transform: scale(1); }
.opt input:focus-visible + .dot { box-shadow: 0 0 0 6px rgba(26, 115, 232, .2); }
.opt .txt small { display: block; color: var(--muted); font-family: Roboto, sans-serif; line-height: 1.4; text-align: start; }

/* Save bar */
.savebar { position: sticky; bottom: 16px; display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 16px; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow-2); z-index: 10; }
.split { display: flex; align-items: center; }
.split > .btn { border-start-end-radius: 0; border-end-end-radius: 0; }
.split .split-arrow { border-start-start-radius: 0; border-end-start-radius: 0; padding: 0 8px; margin-inline-start: 1px; }
.split .split-arrow .ms { margin: 0; }

/* Notes & snackbars */
.note { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px; margin: 12px 0; }
.note.err { background: var(--danger-bg); color: var(--danger); }
.note.warn { background: var(--warn-bg); color: #7a4f01; }
.snackbar { position: fixed; bottom: 24px; inset-inline-start: 24px; z-index: 100; display: flex; align-items: center; gap: 12px; max-width: 560px; padding: 14px 20px; border-radius: 8px; background: #303030; color: #f2f2f2; box-shadow: var(--shadow-2); animation: snack 4.5s ease forwards; }
.snackbar.ok .ms { color: #81c995; }
.snackbar.err .ms { color: #f28b82; }
@keyframes snack { 0% { opacity: 0; transform: translateY(20px); } 6%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(20px); visibility: hidden; } }

/* Dialog */
dialog { border: 0; border-radius: 28px; padding: 24px; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-2); }
dialog::backdrop { background: rgba(0, 0, 0, .32); }
dialog h2 { margin-bottom: 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Auth pages */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 448px; background: var(--surface); border-radius: 28px; padding: 40px 36px 36px; }
.auth-card.wide { max-width: 600px; }
.auth-card h1 { margin-top: 16px; font-size: 28px; font-weight: 400; }
.auth-card > .muted { margin-bottom: 20px; }
.auth-card .field { margin-bottom: 16px; }
.auth-logo { width: 48px; height: 48px; border-radius: 14px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.checks { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.checks li { display: flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 8px; font-size: 12px; }
.checks li .ms { font-size: 16px; }
.checks .ok { background: var(--ok-bg); color: var(--ok); }
.checks .bad { background: var(--danger-bg); color: var(--danger); }

/* Responsive */
@media (max-width: 900px) {
  .only-mobile { display: inline-grid; }
  .brand { min-width: 0; }
  .brand-name { display: none; }
  .drawer { position: fixed; top: 0; inset-inline-start: 0; z-index: 50; height: 100vh; background: var(--surface); padding-top: 16px; transform: translateX(100%); transition: transform .2s; box-shadow: var(--shadow-2); }
  body.ltr .drawer { transform: translateX(-100%); }
  body.drawer-open .drawer { transform: none; }
  body.drawer-open .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, .32); }
  .main { padding: 8px 12px 120px; }
}
@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; flex-direction: column; text-align: center; gap: 6px; }
  .list-row { grid-template-columns: minmax(0, 1fr) auto; }
  .hide-sm { display: none; }
  .section { padding: 16px 14px 8px; }
  .section:focus-within { padding-inline-start: 10px; }
  .grid > [class*="col-"] { grid-column: span 12; }
  .grid > .col-2, .grid > .col-1, .grid > .col-3 { grid-column: span 6; }
  .auth-card { padding: 32px 22px; }
  .savebar { border-radius: 20px; }
  .search { height: 44px; }
  .snackbar { inset-inline: 12px; }
}

/* Language */
body.ltr { --font: Roboto, "Noto Sans Arabic", "Segoe UI", sans-serif; }
body.rtl .ms.flip { transform: scaleX(-1); }
.menu a.sel { color: var(--primary); font-weight: 500; }
.menu a.sel .ms { color: var(--primary); }
.lang-dd .menu { min-width: 170px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.lang-pills { display: flex; gap: 4px; }
.lang-pills a { padding: 4px 10px; border-radius: 8px; font-size: 12px; color: var(--text-2); border: 1px solid var(--outline-v); }
.lang-pills a.on { background: var(--primary-container); border-color: transparent; color: var(--on-primary-container); }

/* AI card */
.ai-card { padding: 20px 24px; margin-bottom: 12px; position: relative; overflow: hidden; }
.ai-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, #4285f4, #9b72cb, #d96570, #f9ab00); }
.ai-card > header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.ai-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #4285f4, #9b72cb 60%, #d96570); }
.drop { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 2px dashed var(--outline-v); border-radius: 16px; background: var(--surface-2); transition: border-color .15s, background .15s; flex-wrap: wrap; outline: none; }
.drop:focus, .drop.over { border-color: var(--primary); background: #e8f0fe; }
.drop > .ms { font-size: 36px; color: var(--primary); }
.drop > div { flex: 1; min-width: 180px; }
.drop b { display: block; font-weight: 500; }
.drop small { color: var(--muted); }
.drop .btn { position: relative; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 96px; }
.thumb img, .thumb > .ms { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--divider); display: grid; place-items: center; font-size: 36px; color: var(--danger); background: #fff; }
.thumb small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb .x { position: absolute; top: -8px; inset-inline-end: -8px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #3c4043; color: #fff; cursor: pointer; display: grid; place-items: center; }
.thumb .x .ms { font-size: 16px; }
.ai-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none !important; }
.seg { display: inline-flex; border: 1px solid var(--outline); border-radius: 20px; overflow: hidden; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label > span { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; font-weight: 500; font-size: 13px; color: var(--text-2); }
.seg label + label > span { border-inline-start: 1px solid var(--outline); }
.seg .ms { font-size: 18px; }
.seg input:checked + span { background: var(--primary-container); color: var(--on-primary-container); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -2px; }
.ai-status { margin-top: 12px; font-size: 13px; color: var(--text-2); }
.ai-status.err { color: var(--danger); }
.ai-status .bar { height: 4px; border-radius: 2px; background: var(--primary-container); overflow: hidden; margin-bottom: 6px; }
.ai-status .bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.ai-status .bar.indet i { width: 40% !important; animation: indet 1.2s infinite ease-in-out; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
body.rtl .ai-status .bar.indet i { animation-name: indet-rtl; }
@keyframes indet-rtl { from { transform: translateX(100%); } to { transform: translateX(-250%); } }
.ms.sm { font-size: 16px; vertical-align: -3px; }
.ai-filled input, .ai-filled textarea { background: #e8f0fe; border-color: var(--primary); }
fieldset.ai-filled { background: #e8f0fe; border-radius: 12px; padding: 6px 8px; }

/* Review dialog */
dialog.wide-dialog { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
dialog.wide-dialog h2 { display: flex; align-items: center; gap: 8px; }
dialog.wide-dialog h2 .ms { color: #9b72cb; }
.review-list { display: flex; flex-direction: column; gap: 2px; max-height: 55vh; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.review-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.3fr); gap: 4px 12px; align-items: center; padding: 8px; border-radius: 8px; }
.review-row:hover { background: var(--surface-2); }
.review-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }
.review-row .r-label { font-size: 13px; color: var(--text-2); }
.review-row .r-value { height: 40px; padding: 0 12px; border: 1px solid var(--outline-v); border-radius: 8px; font: 14px var(--font); background: #fff; min-width: 0; }
.review-row .r-value:focus { outline: 2px solid var(--primary); border-color: transparent; }
.review-row .r-old { grid-column: 3; color: var(--muted); font-size: 11.5px; }
.raw { margin-top: 10px; }
.raw summary { cursor: pointer; color: var(--primary); font-weight: 500; font-size: 13px; }
.raw pre { max-height: 180px; overflow: auto; background: var(--surface-2); padding: 10px; border-radius: 8px; font-size: 12px; white-space: pre-wrap; direction: ltr; text-align: left; }

/* Switch */
.switch { display: flex; align-items: center; gap: 12px; margin: 12px 0; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 52px; height: 32px; border-radius: 16px; border: 2px solid var(--outline); background: #e1e3e1; flex-shrink: 0; transition: background .15s, border-color .15s; }
.switch .track::after { content: ""; position: absolute; top: 6px; inset-inline-start: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--outline); transition: all .15s; }
.switch input:checked + .track { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .track::after { width: 24px; height: 24px; top: 2px; inset-inline-start: 22px; background: #fff; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(26, 115, 232, .25); }

.row-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 4px; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.ok-txt { color: var(--ok); font-weight: 500; }
.section > header.mt { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--divider); }
@media (max-width: 640px) {
  .review-row { grid-template-columns: auto minmax(0, 1fr); }
  .review-row .r-value, .review-row .r-old { grid-column: 2; }
  .ai-card { padding: 16px 14px; }
  .ai-actions .btn.filled { width: 100%; }
}
