:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --green: #15803d;
  --green-soft: #f0fdf4;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --shadow: 0 12px 36px rgba(15, 23, 42, .07);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(37, 99, 235, .24); outline-offset: 2px; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 5px; color: #7c8ba1; font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.brand-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: #fff; background: linear-gradient(145deg, #2563eb, #1d4ed8); box-shadow: 0 10px 24px rgba(37, 99, 235, .25); font-size: 24px; font-weight: 900; }
.brand-mark.small { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
.loading-screen { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 10px; background: var(--bg); color: var(--muted); }
.loading-screen p { margin: 0; font-size: 14px; }

.auth-view { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; background: radial-gradient(circle at 50% 0%, #eaf1ff 0, transparent 38%), var(--bg); }
.auth-card { width: min(440px, 100%); padding: 34px; border: 1px solid rgba(226, 232, 240, .9); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: 0 24px 80px rgba(15, 23, 42, .11); }
.auth-brand { display: flex; align-items: center; gap: 16px; }
.auth-brand h1 { margin: 0; font-size: 25px; }
.auth-subtitle { margin: 22px 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.auth-form { display: grid; gap: 17px; }
label { display: grid; gap: 8px; color: #334155; font-size: 14px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--ink); }
input, select { min-height: 44px; padding: 0 13px; }
textarea { padding: 11px 13px; resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
.field-help { color: var(--muted); font-size: 13px; font-weight: 500; }
.form-error { min-height: 20px; margin: 14px 0 0; color: var(--red); font-size: 13px; }
.auth-footer { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 22px; color: var(--muted); font-size: 12px; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 4px rgba(148, 163, 184, .14); }
.status-dot.success { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .13); }

.button { min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 10px; font-weight: 750; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 6px 16px rgba(37, 99, 235, .18); }
.button.primary:hover { background: #1d4ed8; }
.button.secondary { border-color: var(--line); background: #fff; color: #334155; }
.button.secondary:hover { border-color: #b8c3d2; background: #f8fafc; }
.button.danger { color: #fff; background: var(--red); }
.button.ghost { color: var(--muted); background: transparent; }
.button.wide { width: 100%; }
.notice { display: flex; gap: 11px; padding: 12px 13px; border-radius: 10px; font-size: 13px; line-height: 1.55; }
.notice p { margin: 0; }
.notice.info { color: #1e40af; background: var(--blue-soft); }
.notice.warning { color: #92400e; background: var(--amber-soft); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 8; display: flex; flex-direction: column; width: 240px; padding: 23px 16px 16px; border-right: 1px solid var(--line); background: #fff; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 25px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 17px; }
.sidebar-brand span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.nav-list { display: grid; gap: 5px; }
.nav-item { display: grid; grid-template-columns: 30px 1fr; align-items: center; min-height: 45px; padding: 0 12px; border: 0; border-radius: 10px; color: #536176; background: transparent; text-align: left; }
.nav-item span { color: #8492a6; font-size: 18px; }
.nav-item b { font-size: 15px; }
.nav-item:hover { background: #f8fafc; }
.nav-item.active { color: #1d4ed8; background: #eff6ff; }
.nav-item.active span { color: var(--blue); }
.sidebar-bottom { display: grid; gap: 12px; margin-top: auto; }
.mini-health { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfdff; }
.mini-health b, .mini-health span { display: block; }
.mini-health b { font-size: 14px; }
.mini-health span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.account-button { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 9px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.account-button:hover { background: #f8fafc; }
.account-button b, .account-button small { display: block; }
.account-button b { font-size: 14px; }
.account-button small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #1e40af; background: #dbeafe; font-weight: 800; }
.avatar.large { width: 54px; height: 54px; margin: 0 auto; border-radius: 16px; font-size: 20px; }

.workspace { min-height: 100vh; margin-left: 240px; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(246, 248, 251, .88); backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 24px; }
.top-actions { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 13px; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #475569; font-size: 19px; }
.icon-button:hover { border-color: #bac6d5; color: var(--blue); }
.safety-banner { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; margin: 20px 30px 0; padding: 13px 16px; border: 1px solid #bbf7d0; border-radius: 12px; background: var(--green-soft); }
.safety-banner .shield { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: var(--green); font-weight: 900; }
.safety-banner strong { color: #166534; font-size: 15px; }
.safety-banner p { margin: 3px 0 0; color: #3f7050; font-size: 13px; }
.banner-pill { padding: 6px 9px; border: 1px solid #86efac; border-radius: 999px; color: #166534; background: #fff; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.content { max-width: 1480px; margin: 0 auto; padding: 24px 30px 48px; }
.page { display: none; }
.page.active { display: block; animation: page-in .18s ease; }
@keyframes page-in { from { opacity: .6; transform: translateY(3px); } }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 3px 12px rgba(15, 23, 42, .025); }
.metric-card { position: relative; min-height: 154px; padding: 19px; overflow: hidden; }
.metric-card p { margin: 17px 0 5px; color: var(--muted); font-size: 14px; font-weight: 700; }
.metric-card strong { display: block; font-size: 32px; letter-spacing: -.04em; }
.metric-card > span { color: #94a3b8; font-size: 13px; }
.metric-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; font-weight: 900; }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, .9fr); gap: 14px; margin: 14px 0; }
.panel { padding: 20px; }
.panel + .panel { margin-top: 14px; }
.overview-grid .panel + .panel, .settings-grid .panel + .panel { margin-top: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.panel-head h2, .page-intro h2, .section-head h3 { margin: 0; }
.panel-head h2 { font-size: 18px; }
.legend { display: flex; gap: 13px; color: var(--muted); font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 3px; }
.legend-total { background: #93c5fd; }
.legend-risk { background: #f87171; }
.trend-chart { height: 190px; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 14px; padding-top: 12px; border-bottom: 1px solid var(--line); }
.trend-day { height: 100%; display: grid; grid-template-rows: 1fr 22px; align-items: end; justify-items: center; gap: 6px; }
.trend-bars { height: 100%; display: flex; align-items: end; gap: 4px; }
.trend-bar { width: 13px; min-height: 3px; border-radius: 5px 5px 2px 2px; background: #93c5fd; }
.trend-bar.risk { width: 7px; background: #f87171; }
.trend-day small { color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 850; white-space: nowrap; }
.badge.neutral { color: #475569; background: #f1f5f9; }
.badge.safe, .badge.allowed { color: #166534; background: #dcfce7; }
.badge.high_risk { color: #991b1b; background: #fee2e2; }
.badge.suspicious { color: #92400e; background: #fef3c7; }
.badge.skipped { color: #475569; background: #e2e8f0; }
.status-list { display: grid; }
.status-list > div { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid #eef2f7; }
.status-list > div:first-child { border-top: 0; }
.status-list b, .status-list small { display: block; }
.status-list b { font-size: 14px; }
.status-list small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.status-list em { color: var(--green); font-size: 13px; font-style: normal; font-weight: 800; }
.status-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); }
.locked-text { color: var(--amber) !important; }
.text-button { border: 0; color: var(--blue); background: transparent; font-size: 13px; font-weight: 750; }
.recent-list { display: grid; }
.recent-item { display: grid; grid-template-columns: 34px 105px 1fr auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #eef2f7; }
.recent-item:first-child { border-top: 0; }
.recent-item .risk-score { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #1e40af; background: #eff6ff; font-size: 12px; font-weight: 900; }
.recent-item code { color: #475569; font-size: 12px; }
.recent-item .record-content { min-width: 0; }
.recent-item time { color: var(--muted); font-size: 12px; }
.empty-state { min-height: 100px; display: grid; place-items: center; color: var(--muted); font-size: 14px; }

.toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) 180px auto; gap: 10px; margin-bottom: 16px; }
.search-box { position: relative; display: block; }
.search-box span { position: absolute; left: 13px; top: 12px; color: #94a3b8; }
.search-box input { padding-left: 37px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 1120px; border-collapse: collapse; text-align: left; }
th { position: sticky; top: 0; padding: 12px; border-bottom: 1px solid var(--line); color: #64748b; background: #f8fafc; font-size: 12px; line-height: 1.4; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
td { max-width: 320px; padding: 15px 12px; border-bottom: 1px solid #eef2f7; color: #334155; font-size: 14px; line-height: 1.45; vertical-align: middle; }
td.preview { min-width: 240px; }
td code { color: #475569; font-size: 12px; }
.rule-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.rule-chip { padding: 4px 7px; border-radius: 6px; color: #475569; background: #f1f5f9; font-size: 12px; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; color: var(--muted); font-size: 13px; }
.pagination > div { display: flex; align-items: center; gap: 9px; }
.mobile-records { display: none; }

.learning-notice { margin: -4px 0 14px; }
.record-content { display: grid; gap: 6px; min-width: 0; }
.source-line { display: grid; grid-template-columns: 68px minmax(0, 1fr); align-items: start; gap: 8px; min-width: 0; }
.source-label { display: inline-flex; justify-content: center; padding: 2px 5px; border-radius: 5px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.source-label.text { color: #1e40af; background: #dbeafe; }
.source-label.ocr { color: #6b21a8; background: #f3e8ff; }
.source-label.qr { color: #92400e; background: #fef3c7; }
.source-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-empty, .learning-unavailable { color: var(--muted); font-size: 12px; }
.learning-cell { min-width: 220px; }
.learning-actions { display: grid; gap: 7px; }
.learning-state { width: max-content; padding: 3px 7px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.learning-state.allow { color: #166534; background: #dcfce7; }
.learning-state.block { color: #991b1b; background: #fee2e2; }
.learning-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.learning-button { min-height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: #475569; background: #fff; font-size: 12px; font-weight: 750; }
.learning-button:hover { border-color: #94a3b8; background: #f8fafc; }
.learning-button.allow.active { border-color: #86efac; color: #166534; background: #f0fdf4; }
.learning-button.block.active { border-color: #fca5a5; color: #991b1b; background: #fef2f2; }
.learning-button.remove { color: var(--muted); }
.learning-button:disabled { cursor: wait; opacity: .58; }

.learning-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 28px; margin-bottom: 14px; }
.learning-summary h2 { margin: 0; font-size: 18px; }
.learning-summary p:not(.eyebrow) { max-width: 760px; margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.learning-counts { display: flex; gap: 12px; }
.learning-counts span { display: grid; min-width: 70px; padding: 10px; border-radius: 10px; color: var(--muted); background: #f8fafc; font-size: 12px; text-align: center; }
.learning-counts b { color: var(--ink); font-size: 20px; }
.learning-counts .allow b { color: var(--green); }
.learning-counts .block b { color: var(--red); }

.page-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-intro h2 { font-size: 24px; }
.page-intro p { max-width: 820px; margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.version-chip { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-family: ui-monospace, monospace; font-size: 12px; }
.score-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; }
.score-field { grid-template-columns: 1fr 65px; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafcff; }
.score-field span { color: #334155; font-size: 14px; }
.score-field input { min-height: 38px; text-align: center; }
.keyword-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

.whitelist-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.whitelist-grid section { min-width: 0; }
.section-head h3 { font-size: 17px; }
.section-head p { margin: 5px 0 13px; color: var(--muted); font-size: 13px; }
.tag-list { min-height: 112px; max-height: 210px; margin-bottom: 12px; padding: 9px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #fafcff; }
.tag { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 5px 0; padding: 7px 9px; border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .06); }
.tag code { color: #475569; font-size: 12px; }
.tag button { width: 24px; height: 24px; border: 0; border-radius: 6px; color: #94a3b8; background: transparent; }
.tag button:hover { color: var(--red); background: var(--red-soft); }
.add-field input { margin-top: 2px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-form { display: grid; gap: 17px; }
.settings-form label > span { margin-left: auto; color: var(--blue); }
input[type="range"] { min-height: 30px; padding: 0; border: 0; accent-color: var(--blue); }
.locked-settings { display: grid; }
.locked-settings > div { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 0; border-top: 1px solid #eef2f7; }
.locked-settings > div:first-child { border-top: 0; }
.locked-settings b, .locked-settings small { display: block; }
.locked-settings b { font-size: 14px; }
.locked-settings small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.switch { position: relative; flex: 0 0 auto; width: 40px; height: 22px; border-radius: 99px; background: #cbd5e1; opacity: .72; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.2); }
.switch.on { background: #22c55e; }
.switch.on::after { left: 21px; }
.danger-zone { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-color: #fecaca; }
.danger-zone h2 { margin: 2px 0 7px; font-size: 18px; }
.danger-zone p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; }

.audit-list { display: grid; }
.audit-item { display: grid; grid-template-columns: 120px 120px 90px 1fr auto; gap: 13px; align-items: center; padding: 12px 0; border-top: 1px solid #eef2f7; font-size: 13px; }
.audit-item:first-child { border-top: 0; }
.audit-item code { color: #475569; }
.audit-item time, .audit-item .source { color: var(--muted); }

.mobile-nav { display: none; }
.dialog { width: min(420px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 30px 100px rgba(15,23,42,.25); }
.dialog::backdrop { background: rgba(15, 23, 42, .42); backdrop-filter: blur(3px); }
.dialog form { position: relative; display: grid; gap: 14px; padding: 28px; text-align: center; }
.dialog h2 { margin: 0; font-size: 19px; }
.dialog p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.dialog-icon { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto; border-radius: 14px; color: var(--amber); background: var(--amber-soft); font-size: 20px; font-weight: 900; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.dialog-close { position: absolute; right: 13px; top: 13px; width: 32px; height: 32px; border: 0; border-radius: 8px; color: var(--muted); background: #f1f5f9; font-size: 20px; }
.account-dialog form { text-align: left; }
.account-dialog h2, .account-dialog .dialog-subtitle { text-align: center; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 30; display: grid; gap: 10px; }
.toast { min-width: 260px; max-width: 420px; padding: 13px 15px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 10px; background: #fff; box-shadow: var(--shadow); color: #334155; font-size: 14px; animation: toast-in .2s ease; }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: repeat(3, 1fr); }
  .whitelist-grid { grid-template-columns: 1fr; }
  .learning-summary { grid-template-columns: 1fr auto; }
  .learning-summary .button { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .button { min-height: 44px; }
  .icon-button { width: 44px; height: 44px; }
  .text-button { min-height: 44px; padding: 0 8px; }
  .score-field input { min-height: 44px; }
  .tag button { width: 44px; height: 44px; }
  input[type="range"] { min-height: 44px; }
  .dialog-close { width: 44px; height: 44px; }
  .sidebar { display: none; }
  .workspace { margin-left: 0; }
  .topbar { height: 68px; padding: 0 17px; }
  .topbar h1 { font-size: 20px; }
  .top-actions > span { display: none; }
  .safety-banner { grid-template-columns: 32px 1fr; margin: 12px 14px 0; padding: 12px; }
  .safety-banner .banner-pill { display: none; }
  .safety-banner p { line-height: 1.45; }
  .content { padding: 16px 14px 30px; }
  .metric-grid { gap: 10px; }
  .metric-card { min-height: 144px; padding: 15px; }
  .panel { padding: 16px; }
  .trend-chart { gap: 6px; }
  .trend-bar { width: 10px; }
  .recent-item { grid-template-columns: 32px 88px 1fr auto; gap: 8px; }
  .recent-item time { display: none; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .table-wrap { display: none; }
  .mobile-records { display: grid; gap: 10px; }
  .mobile-record { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
  .mobile-record header { display: flex; justify-content: space-between; gap: 10px; }
  .mobile-record code, .mobile-record time { color: var(--muted); font-size: 12px; }
  .mobile-record .record-content { margin: 12px 0; }
  .mobile-record .source-line { grid-template-columns: 72px minmax(0, 1fr); }
  .mobile-record .source-text { font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
  .mobile-record footer { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .mobile-record .learning-actions { padding-top: 12px; border-top: 1px solid #eef2f7; }
  .learning-button { min-height: 44px; font-size: 13px; }
  .score-grid { grid-template-columns: repeat(2, 1fr); }
  .keyword-grid, .settings-grid { grid-template-columns: 1fr; }
  .danger-zone { display: grid; }
  .page-intro { display: grid; }
  .form-actions { position: sticky; bottom: 82px; z-index: 4; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.94); box-shadow: 0 10px 30px rgba(15,23,42,.12); }
  .audit-item { grid-template-columns: 100px 1fr auto; }
  .audit-item .source, .audit-item time { display: none; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(68px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
  .mobile-nav button { display: grid; place-content: center; gap: 2px; border: 0; color: #7c8ba1; background: transparent; font-size: 12px; }
  .mobile-nav button span { font-size: 20px; }
  .mobile-nav button.active { color: var(--blue); }
  .toast-region { right: 14px; bottom: 84px; left: 14px; }
  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 430px) {
  .auth-card { padding: 25px 20px; border-radius: 18px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 144px; }
  .metric-card strong { font-size: 25px; }
  .score-grid { grid-template-columns: 1fr; }
  .legend { display: none; }
  .toolbar { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  input, select, textarea { font-size: 16px; }
  .learning-summary { grid-template-columns: 1fr; gap: 16px; }
  .learning-summary .button { grid-column: auto; }
  .learning-counts { display: grid; grid-template-columns: repeat(3, 1fr); }
  .learning-counts span { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
