/* Locked UI spec: extracted verbatim from spam_dashboard_mockup_v1.html (v1.22,
   Kenny approved 2026-08-24). Edit the mockup first, then re-extract — the
   mockup is the spec, this file is its build output. */
* { box-sizing: border-box; }
button, input, select, textarea { font-family: inherit; }
body { font-family: "Sukhumvit Set", "Prompt", -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif; margin: 0; background: #f5f6f8; color: #1f2937; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px 80px; }

/* ===== Header ===== */
.top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid #e5e7eb; }
.top-in { max-width: 960px; margin: 0 auto; padding: 10px 16px 12px; }
.brand { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.brand .logo { width: 26px; height: 26px; border-radius: 7px; background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.toolrow { display: flex; align-items: center; gap: 8px; margin-top: 9px; max-width: 480px; }
.toolrow > button { flex: 1 1 0; text-align: center; }
.credit-chip { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.credit-chip small { font-weight: 400; color: #3b82f6; margin-right: 5px; }
.nav-btn { border: 1px solid #d1d5db; background: #fff; border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: #374151; }
.nav-btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }
.nav-btn.line { border-color: #06c755; color: #06925f; font-weight: 600; }

h2 { font-size: 15px; margin: 26px 0 10px; color: #111827; }
h2 small { color: #9ca3af; font-weight: 400; margin-left: 6px; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }

/* ===== Page grid table ===== */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gridtb { min-width: 700px; }
.gridtb th, .gridtb td { white-space: nowrap; }
.gridtb th:first-child, .gridtb td:first-child { position: sticky; left: 0; z-index: 2; min-width: 158px; background: #fff; box-shadow: 2px 0 0 #f1f3f5; }
.gridtb th:first-child { background: #fafbfc; }
.gridtb tr.paused td { background: #fffbeb; }
.gridtb td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.gridtb td .sub { display: block; font-size: 11px; color: #9ca3af; font-weight: 400; margin-top: 2px; }
.pname { font-weight: 600; font-size: 13.5px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.pill.w1 { min-width: 76px; text-align: center; }   /* uniform width for pills in the same column */
.pill.active { background: #dcfce7; color: #166534; }
.pill.paused { background: #e5e7eb; color: #4b5563; }
.pill.plan { background: #eef2ff; color: #4338ca; }
.icobtn { border: none; background: none; cursor: pointer; padding: 2px; }
.pbtn { padding: 6px 12px; font-size: 12px; border-radius: 7px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; color: #374151; }
.pbtn.warn { border-color: #f59e0b; color: #b45309; font-weight: 600; }
.addpage { display: block; width: 100%; padding: 12px; border: 2px dashed #d1d5db; background: none; border-radius: 10px; color: #6b7280; font-size: 13px; cursor: pointer; margin-top: 10px; }
.addpage:hover { border-color: #2563eb; color: #2563eb; }

/* ===== Stat tiles ===== */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 13px 15px; }
.tile .lbl { font-size: 12px; color: #6b7280; }
.tile .val { font-size: 28px; font-weight: 600; margin-top: 3px; }
.tile .delta { font-size: 11px; margin-top: 2px; color: #6b7280; }
.tile .delta.up { color: #b45309; }

/* ===== Chart ===== */
.chart-card { padding: 14px 16px 8px; }
.chart-title { font-size: 13px; color: #374151; font-weight: 600; margin-bottom: 10px; }
.chart { position: relative; height: 130px; display: flex; align-items: flex-end; gap: 10px; padding: 0 4px; border-bottom: 1px solid #e5e7eb; }
.bcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; cursor: default; }
.bcol .bval { font-size: 11px; color: #374151; margin-bottom: 3px; visibility: hidden; }
.bcol.peak .bval, .bcol:hover .bval { visibility: visible; }
.bar { width: 100%; max-width: 22px; background: #2563eb; border-radius: 4px 4px 0 0; transition: background .15s; }
.bar.zero { height: 2px; background: #e5e7eb; border-radius: 1px; }
.bcol:hover .bar { background: #1d4ed8; }
.xlabels { display: flex; gap: 10px; padding: 5px 4px 10px; }
.xlabels span { flex: 1; text-align: center; font-size: 11px; color: #9ca3af; }
.chart.dense { gap: 3px; }
.chart.dense .bar { max-width: 12px; border-radius: 3px 3px 0 0; }
.chart.dense + .xlabels { gap: 3px; }
.chart.dense + .xlabels span { font-size: 10px; }
.chip { padding: 5px 13px; border: 1px solid #d1d5db; border-radius: 16px; background: #fff; font-size: 12px; cursor: pointer; color: #374151; }
.chip.sel { border-color: #2563eb; background: #eff6ff; color: #1e40af; font-weight: 600; }
.stat-mini { display: flex; gap: 8px; margin: 10px 0 14px; }
.stat-mini div { flex: 1; background: #f9fafb; border: 1px solid #f1f3f5; border-radius: 8px; padding: 8px 10px; }
.stat-mini .lbl { font-size: 11px; color: #6b7280; }
.stat-mini .v { font-size: 20px; font-weight: 600; margin-top: 1px; }

/* ===== Blocked list ===== */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; font-size: 13px; border-bottom: 1px solid #f1f3f5; }
th { background: #fafbfc; font-weight: 600; color: #374151; font-size: 11px; }
tr:last-child td { border-bottom: none; }
.pill.reason { background: #fee2e2; color: #991b1b; }
.pill.reason.ai { background: #ede9fe; color: #5b21b6; }
.pill.detect { background: #fef3c7; color: #92400e; }
.btn-unblock { padding: 4px 12px; font-size: 12px; border-radius: 6px; border: 1px solid #2563eb; color: #2563eb; background: #fff; cursor: pointer; }
.muted { color: #9ca3af; font-size: 12px; }
.filter-row { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; }
.filter-row select { padding: 6px 10px; font-size: 13px; border: 1px solid #d1d5db; border-radius: 7px; background: #fff; }

/* ===== Rules view ===== */
.backlink { display: inline-block; margin: 18px 0 0; font-size: 13px; color: #2563eb; cursor: pointer; }
.mode-seg { display: flex; border: 1px solid #d1d5db; border-radius: 9px; overflow: hidden; width: fit-content; }
.mode-seg button { padding: 8px 18px; font-size: 13px; border: none; background: #fff; cursor: pointer; color: #6b7280; }
.mode-seg button.on { background: #2563eb; color: #fff; font-weight: 600; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 12px; padding: 9px 13px; border-radius: 8px; margin-top: 10px; }
.rrow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f1f3f5; }
.rrow:last-child { border-bottom: none; }
.rname { flex: 1; font-size: 13.5px; }
.rname small { display: block; color: #9ca3af; font-size: 11.5px; margin-top: 2px; }
.adv { font-size: 12px; color: #2563eb; cursor: pointer; white-space: nowrap; }
.sw { position: relative; width: 40px; height: 23px; flex-shrink: 0; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw i { position: absolute; inset: 0; background: #d1d5db; border-radius: 12px; transition: .2s; cursor: pointer; }
.sw i:before { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.sw input:checked + i { background: #2563eb; }
.sw input:checked + i:before { transform: translateX(17px); }
.advbox { background: #f9fafb; border-top: 1px solid #f1f3f5; padding: 10px 16px 12px 60px; font-size: 12.5px; color: #374151; display: none; }
.advbox.open { display: block; }
.advbox input[type=number], .advbox input[type=text] { padding: 5px 9px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }
.advbox input[type=number] { width: 58px; text-align: center; }
.advbox input[type=text] { width: 220px; max-width: 100%; }
.savebar { position: sticky; bottom: 0; background: linear-gradient(transparent, #f5f6f8 30%); padding: 16px 0 10px; text-align: right; }
.savebar button { padding: 10px 26px; font-size: 14px; font-weight: 600; background: #2563eb; color: #fff; border: none; border-radius: 9px; cursor: pointer; }

/* ===== Payment ===== */
.credit-hero { text-align: center; padding: 26px 16px 22px; }
.credit-hero .lbl { font-size: 13px; color: #6b7280; }
.credit-hero .big { font-size: 48px; font-weight: 600; margin-top: 4px; }
.amounts { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px; justify-content: center; }
.amt { padding: 9px 16px; border: 1px solid #d1d5db; border-radius: 9px; background: #fff; font-size: 14px; cursor: pointer; }
.amt.sel { border-color: #2563eb; background: #eff6ff; color: #1e40af; font-weight: 600; }
.qrbox { margin: 18px auto 6px; width: 168px; height: 168px; border: 1px solid #e5e7eb; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; color: #9ca3af; font-size: 12px; background: #fafbfc; }
.qrbox .qr { font-size: 44px; }
.upload { display: block; margin: 12px auto 22px; padding: 9px 22px; border: 1px solid #2563eb; color: #2563eb; background: #fff; border-radius: 9px; font-size: 13px; cursor: pointer; }
.ledger td.pos { color: #166534; font-weight: 600; }
.ledger td.neg { color: #991b1b; font-weight: 600; }
.pill.wait { background: #fef3c7; color: #92400e; }
.pill.ok { background: #dcfce7; color: #166534; }

/* ===== Outlined form fields ===== */
.ff { border: 1px solid #d1d5db; border-radius: 10px; background: #f3f4f6; margin: 0; padding: 0 12px 8px; min-width: 0; }
.ff legend { font-size: 12px; color: #374151; padding: 0 6px; }
.ff input, .ff select, .ff textarea { border: none; background: transparent; width: 100%; font-size: 14px; font-family: inherit; padding: 3px 2px 2px; outline: none; color: #1f2937; }
.ff textarea { min-height: 64px; resize: vertical; }
.frow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fgap { margin-bottom: 12px; }
.fhelp { font-size: 12px; color: #6b7280; margin: 5px 0 12px 4px; }
@media (max-width: 560px) { .frow2 { grid-template-columns: 1fr; } }

/* ===== Modal ===== */
.overlay { position: fixed; inset: 0; background: rgba(17,24,39,.45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.overlay.open { display: flex; }
.modal { background: #fff; border-radius: 14px; max-width: 360px; width: 100%; padding: 22px; text-align: center; }
.modal.wide { max-width: 600px; text-align: left; max-height: 88vh; overflow-y: auto; }
.modal h3 { margin: 0 0 6px; font-size: 16px; }
.modal p { font-size: 13px; color: #6b7280; margin: 4px 0 12px; }
.codebox { font-family: ui-monospace, monospace; font-size: 26px; letter-spacing: 6px; background: #f3f4f6; border-radius: 9px; padding: 9px; margin: 10px 0; }
.steps { text-align: left; font-size: 12.5px; color: #374151; margin: 12px 0; padding-left: 18px; }
.steps li { margin-bottom: 5px; }
.modal .close { margin-top: 6px; }
.planopt { display: flex; gap: 10px; margin: 14px 0; }
.planopt button { flex: 1; padding: 12px 8px; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; cursor: pointer; font-size: 13px; }
.planopt button b { display: block; font-size: 17px; margin-top: 3px; }
.planopt button.sel { border-color: #2563eb; background: #eff6ff; }
.planopt small { color: #6b7280; }

.view { display: none; }
.view.on { display: block; }
.mock-tag { position: fixed; bottom: 10px; left: 10px; background: #111827; color: #fff; font-size: 11px; padding: 4px 10px; border-radius: 12px; opacity: .75; z-index: 60; }
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .tile .val { font-size: 22px; }
  .hide-sm { display: none; }
}

/* ── additions this app needs and a single-page mockup did not ───────────── */
.flash { background:#ecfdf5; border:1px solid #a7f3d0; color:#065f46; font-size:13px; padding:9px 13px; border-radius:8px; margin-top:12px; }
.errbox { background:#fef2f2; border:1px solid #fecaca; color:#991b1b; font-size:13px; padding:9px 13px; border-radius:8px; margin-top:12px; }
.mode-seg button[aria-pressed="true"] { background:#2563eb; color:#fff; font-weight:600; }
@media print { .top, .savebar, .backlink, .nav-btn { display:none !important; } body { background:#fff; } }
