:root {
  color-scheme: light;
  --paper: #f5f0e6;
  --paper-deep: #eae1d2;
  --ink: #171511;
  --muted: #716b61;
  --line: rgba(23, 21, 17, 0.14);
  --red: #8f1d2c;
  --red-dark: #68101d;
  --red-soft: #f0d8d8;
  --gold: #d7a94a;
  --green: #245f4b;
  --white: #fffdf8;
  --shadow: 0 28px 70px rgba(49, 33, 18, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 13% 4%, rgba(215, 169, 74, 0.13), transparent 24rem),
    linear-gradient(180deg, var(--paper) 0%, #f9f6ef 56%, var(--paper) 100%);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { color: inherit; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(143, 29, 44, 0.26);
  outline-offset: 3px;
}

.page-shell { width: min(1220px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.16);
}

.brand strong { display: block; font-size: 17px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

.api-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.34);
  font-size: 12px;
  font-weight: 650;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #d49a2e; box-shadow: 0 0 0 4px rgba(212,154,46,.12); }
.api-pill[data-state="ok"] .status-dot { background: #2d8864; box-shadow: 0 0 0 4px rgba(45,136,100,.12); }
.api-pill[data-state="error"] .status-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(143,29,44,.12); }

.hero {
  padding: 70px 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .78fr);
  gap: clamp(50px, 8vw, 120px);
  align-items: center;
}

.eyebrow, .section-kicker {
  margin: 0 0 18px;
  color: var(--red);
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .18em;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(60px, 7.4vw, 106px);
  line-height: .88;
  letter-spacing: -.062em;
  font-weight: 500;
}

.hero h1 em { color: var(--red); font-weight: 500; }

.hero-description {
  max-width: 570px;
  margin: 31px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.draw-card {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border-radius: var(--radius-lg);
  color: white;
  background:
    radial-gradient(circle at 88% 15%, rgba(215,169,74,.25), transparent 13rem),
    linear-gradient(145deg, #951b2c, #65101e);
  box-shadow: var(--shadow);
}

.draw-card::after {
  content: "79";
  position: absolute;
  right: -18px;
  bottom: -65px;
  color: rgba(255,255,255,.055);
  font-family: var(--font-serif);
  font-size: 220px;
  line-height: 1;
}

.card-head { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; }
.draw-card .section-kicker { margin-bottom: 8px; color: #f0ca7b; }
.draw-card h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: white;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.icon-button:hover { transform: rotate(16deg); background: rgba(255,255,255,.15); }
.icon-button:disabled { opacity: .55; cursor: wait; }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.draw-number {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 35px 0 18px;
}

.draw-number span {
  display: grid;
  place-items: center;
  aspect-ratio: .82;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 13px;
  background: rgba(255,255,255,.095);
  font-family: var(--font-serif);
  font-size: clamp(38px, 4vw, 54px);
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.draw-meta { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.66); font-size: 12px; }
.meta-separator { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

.tail-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 27px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.72);
  font-size: 13px;
}

.tail-row strong { color: #f5d58f; font-size: 30px; line-height: 1; letter-spacing: .08em; }

.manual-entry { position: relative; z-index: 2; margin-top: 18px; }
.manual-entry summary { color: rgba(255,255,255,.65); font-size: 12px; cursor: pointer; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.inline-form input { min-width: 0; border: 1px solid rgba(255,255,255,.23); border-radius: 10px; padding: 11px 12px; color: white; background: rgba(255,255,255,.1); }
.inline-form input::placeholder { color: rgba(255,255,255,.42); }
.inline-form button { border: 0; border-radius: 10px; padding: 0 14px; color: var(--red-dark); background: #f3d28d; font-size: 12px; font-weight: 800; cursor: pointer; }

.history-section {
  padding: 66px 0 70px;
  border-top: 1px solid var(--line);
}

.history-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.history-head .section-kicker { margin-bottom: 11px; }
.history-head h2 { margin: 0; font-family: var(--font-serif); font-size: clamp(36px, 4vw, 53px); font-weight: 500; letter-spacing: -.045em; }

.history-filters {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.45);
}

.history-filters button {
  min-width: 66px;
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.history-filters button[aria-pressed="true"] { color: white; background: var(--red); box-shadow: 0 6px 16px rgba(143,29,44,.18); }
.history-status { min-height: 17px; margin: 18px 0 12px; color: var(--muted); font-size: 11px; font-weight: 650; }

.history-list {
  max-height: 494px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,253,248,.78);
  box-shadow: 0 12px 36px rgba(49,33,18,.055);
}

.history-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(110px, 1fr) 80px;
  align-items: center;
  gap: 20px;
  min-height: 60px;
  padding: 0 22px;
  border-top: 1px solid var(--line);
}

.history-row:first-child { border-top: 0; }
.history-row time { color: var(--muted); font-size: 12px; }
.history-row strong { font-family: var(--font-serif); font-size: 25px; font-weight: 500; letter-spacing: .12em; }
.history-tail { justify-self: end; min-width: 46px; padding: 7px 9px; border-radius: 999px; color: var(--red); background: var(--red-soft); text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 850; }
.history-placeholder { margin: 0; padding: 28px 22px; color: var(--muted); font-size: 12px; }

.workspace {
  padding: 70px 0 75px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.workspace-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: end; margin-bottom: 32px; }
.workspace-intro .section-kicker { margin-bottom: 11px; }
.workspace-intro h2, .notes h2 { margin: 0; font-family: var(--font-serif); font-size: clamp(36px, 4vw, 53px); font-weight: 500; letter-spacing: -.045em; }
.workspace-intro > p { margin: 0; max-width: 560px; color: var(--muted); line-height: 1.7; font-size: 14px; }

.generator-grid {
  display: grid;
  grid-template-columns: minmax(310px, .72fr) minmax(0, 1.28fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255,255,255,.36);
  box-shadow: 0 14px 45px rgba(49,33,18,.06);
}

.rule-panel { padding: 30px; border-right: 1px solid var(--line); background: rgba(234,225,210,.55); }
.rule-title { margin: 0 0 14px; font-size: 14px; font-weight: 850; }
.rule-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rule-list li { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,248,.7); }
.rule-list strong, .rule-list small { display: block; }
.rule-list strong { font-size: 12px; }
.rule-list small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.rule-badge { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--red); font-family: var(--font-serif); font-size: 15px; }
.fixed-numbers { margin-top: 13px; }
.fixed-numbers summary { color: var(--red); font-size: 11px; font-weight: 800; cursor: pointer; }
#fixedRuleOutput { display: block; margin-top: 10px; padding: 12px; border-radius: 10px; color: var(--muted); background: rgba(255,253,248,.82); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; line-height: 1.7; overflow-wrap: anywhere; }

.count-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.count-strip > div { padding: 17px 9px 17px 0; }
.count-strip > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.count-strip span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.count-strip strong { font-family: var(--font-serif); font-size: 29px; font-weight: 500; }
.count-strip .total-count strong { color: var(--red); }
#generateButton[hidden] { display: none; }
.count-control { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; margin-top: 18px; }
.count-control label { font-size: 14px; font-weight: 800; }
.count-control select { min-width: 5em; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font: inherit; }
.count-control small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }

.primary-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 13px;
  padding: 16px 17px;
  color: white;
  background: var(--red);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(143,29,44,.17);
  transition: transform .18s ease, background .18s ease;
}
.primary-button:hover { transform: translateY(-2px); background: var(--red-dark); }
.primary-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.result-panel { min-width: 0; padding: 30px; background: rgba(255,253,248,.75); }
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.result-head .section-kicker { margin-bottom: 7px; }
.result-head h3 { margin: 0; font-family: var(--font-serif); font-size: 27px; font-weight: 500; }
.result-actions { display: flex; gap: 8px; }
.secondary-button, .copy-button { height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 13px; background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.copy-button { display: flex; align-items: center; gap: 7px; color: white; border-color: var(--ink); background: var(--ink); }
.copy-button svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.secondary-button:disabled, .copy-button:disabled { opacity: .38; cursor: not-allowed; }

.output-wrap {
  position: relative;
  min-height: 128px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

#outputText { width: 100%; min-height: 128px; resize: vertical; border: 0; padding: 16px; color: var(--ink); background: transparent; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.8; outline: 0; }
.empty-state { display: none; position: absolute; inset: 0; place-items: center; padding: 20px; margin: 0; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.6; }
.output-wrap[data-empty="true"] .empty-state { display: grid; }
.output-wrap[data-empty="true"] #outputText { visibility: hidden; }

.legend { display: flex; align-items: center; gap: 17px; margin: 13px 0 17px; color: var(--muted); font-size: 10px; font-weight: 650; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.seed { background: var(--red); }
.legend-dot.fill { background: #b9b0a2; }
.legend .validation { margin-left: auto; color: var(--green); font-weight: 800; }

.number-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.number-chip { display: grid; place-items: center; min-width: 0; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; background: #f1ede5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 750; }
.number-chip.seed { color: white; border-color: var(--red); background: var(--red); }
.result-search { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 14px 0; }
.result-search label { font-size: 13px; font-weight: 750; }
.result-search input { width: 5.5em; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); }
#searchStatus { flex-basis: 100%; margin: 0; color: var(--ink); font-size: 13px; }
#searchStatus:empty { display: none; }
#searchStatus[data-result="found"],
#searchStatus[data-result="missing"] {
  padding: 7px 10px;
  border: 1px solid;
  border-radius: 8px;
  font-weight: 750;
}
#resultSearch[data-result="found"],
#searchStatus[data-result="found"] { color: #0c2b17; border-color: #247442; background: #53ed81; }
#resultSearch[data-result="missing"],
#searchStatus[data-result="missing"] { color: #422700; border-color: #aa6900; background: #ffdf5a; }
.number-chip.search-match {
  color: #0c2b17;
  border-color: transparent;
  background: #53ed81;
  font-weight: 900;
}

.notes { padding: 76px 0 86px; }
.notes .section-kicker { margin-bottom: 11px; }
.note-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 34px; }
.note-grid p { margin: 0; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.7; }
.note-grid strong { display: block; margin-bottom: 5px; color: var(--ink); }

footer { display: flex; justify-content: space-between; padding: 25px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
footer a { color: var(--red); font-weight: 750; text-decoration: none; }
footer a:hover { text-decoration: underline; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  transform: translate(-50%, 18px);
  padding: 11px 16px;
  border-radius: 10px;
  color: white;
  background: var(--ink);
  box-shadow: 0 12px 35px rgba(0,0,0,.18);
  font-size: 12px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 52px; }
  .hero-copy { max-width: 800px; }
  .draw-card { max-width: 620px; }
  .workspace-intro { grid-template-columns: 1fr; gap: 18px; }
  .history-head { align-items: flex-start; }
  .generator-grid { grid-template-columns: 1fr; }
  .rule-panel { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .page-shell { width: min(100% - 24px, 1220px); }
  .topbar { height: 82px; }
  .brand small { display: none; }
  .api-pill { max-width: 165px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .hero { padding: 48px 0 60px; }
  .hero h1 { font-size: clamp(54px, 18vw, 78px); }
  .hero-description { font-size: 15px; }
  .draw-card, .rule-panel, .result-panel { padding: 22px; }
  .draw-number { gap: 5px; }
  .draw-number span { border-radius: 9px; font-size: 35px; }
  .history-section, .workspace { padding: 55px 0; }
  .history-head { flex-direction: column; gap: 22px; }
  .history-filters { width: 100%; }
  .history-filters button { flex: 1; }
  .history-row { grid-template-columns: 1fr 1fr 52px; gap: 10px; padding: 0 15px; }
  .history-row strong { font-size: 20px; }
  .result-head { align-items: flex-end; }
  .result-actions { flex-direction: column; }
  .secondary-button, .copy-button { height: 34px; }
  .number-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .note-grid { grid-template-columns: 1fr; gap: 21px; }
  footer { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Chạm Số: playful cards and a persistent support corner. */
:root { --paper:#f6f4ff; --paper-deep:#ebe6fa; --ink:#25213b; --muted:#746e88; --line:rgba(67,47,112,.13); --red:#7550e8; --red-dark:#5935c4; --red-soft:#ece5ff; --gold:#b6f17b; --white:#fff; --green:#337455; --shadow:0 24px 65px rgba(89,53,196,.17); --font-serif:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
body { background:radial-gradient(ellipse at 5% 5%,#ece3ff,transparent 38rem),radial-gradient(ellipse at 95% 22%,#e6f5e0,transparent 32rem),#f8f7fd; }
.brand-mark { border-radius:16px; font-size:30px; transform:rotate(-8deg); }
.hero { gap:64px; }
.hero h1 { font-size:clamp(50px,6.3vw,84px); font-weight:800; line-height:1.09; letter-spacing:-.065em; }
.hero h1 em { font-weight:800; font-style:normal; }
.hero-description { font-size:16px; }
.play-link { display:inline-flex; gap:24px; margin-top:25px; padding:15px 23px; border-radius:14px; color:white; background:var(--red); font-weight:750; text-decoration:none; box-shadow:0 8px 20px #7550e82b; }
.game-tags { display:flex; flex-wrap:wrap; gap:14px; margin-top:27px; color:var(--muted); font-size:11px; }
.draw-card { background:radial-gradient(circle at 100% 0%,#a583f5,transparent 22rem),linear-gradient(140deg,#7550e8,#442887); border:1px solid #fff8; }
.draw-card::after { content:"✦"; right:-8px; bottom:-55px; font-size:240px; }
.draw-card .section-kicker,.tail-row strong { color:#d5f7b1; }
.draw-number span { font-weight:750; border-radius:16px; background:#fff2; }
.inline-form button { background:#d5f7b1; color:#372260; }
.history-head h2,.workspace-intro h2,.notes h2 { font-size:clamp(30px,3.6vw,44px); font-weight:750; line-height:1.18; }
.history-row strong { font-weight:700; }
.rule-panel { background:#eee9fc; }
.rule-list li,.result-panel,.history-list { background:#ffffffc9; }
.rule-badge { border-radius:10px; }
.number-chip { background:#f0edf8; border-radius:10px; }
.result-head h3 { font-size:24px; font-weight:700; }
footer { margin-bottom:90px; }
.donate-widget { position:fixed; right:max(20px,env(safe-area-inset-right)); bottom:max(20px,env(safe-area-inset-bottom)); z-index:30; width:270px; }
.donate-popup { padding:22px; margin-bottom:10px; border:1px solid var(--line); border-radius:22px; background:#fff; box-shadow:0 12px 55px #37226026; max-height:calc(100dvh - 100px); overflow:auto; }
.donate-popup .section-kicker { font-size:9px; margin-bottom:10px; }
.donate-popup h2 { margin:0; font-size:18px; line-height:1.4; letter-spacing:-.03em; }
.donate-popup > p:not(.section-kicker) { font-size:12px; line-height:1.6; color:var(--muted); }
.donate-popup > small { display:block; text-align:center; color:var(--muted); font-size:10px; }
.donate-qr-wrap { display:grid; place-items:center; min-height:192px; margin:14px 0; border:1px dashed #d2c5f2; border-radius:15px; background:#faf8ff; padding:8px; }
.donate-qr-wrap img { max-width:100%; height:auto; object-fit:contain; background:white; }
#donatePlaceholder { text-align:center; color:var(--red); font-size:38px; margin:0; }
#donatePlaceholder small { display:block; margin-top:12px; font-size:12px; color:var(--muted); }
.donate-toggle { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; padding:14px 18px; border:1px solid #ffffff50; border-radius:15px; color:white; background:var(--red); box-shadow:0 8px 28px #5935c433; font-size:13px; font-weight:750; cursor:pointer; }
.donate-toggle span:first-child { font-size:23px; }
[hidden] { display:none !important; }
.toast { z-index:40; bottom:90px; max-width:calc(100% - 32px); }
:focus-visible { outline-color:#bda4ff; }
@media(max-width:640px) { .hero h1 { font-size:clamp(43px,12vw,70px); } .hero { gap:32px; } .donate-widget { right:12px; bottom:12px; width:230px; } .donate-popup { padding:16px; } .donate-qr-wrap { min-height:150px; margin:10px 0; } .donate-qr-wrap img { width:144px; } .donate-popup h2 { font-size:16px; } .draw-meta { flex-wrap:wrap; } .legend { flex-wrap:wrap; } footer { flex-wrap:wrap; } }
.personal-rules { display:grid; gap:12px; }
.rule-help,.personal-rules small { color:var(--muted); font-size:11px; line-height:1.6; }
.personal-rules fieldset { min-width:0; margin:0; padding:13px; border:1px solid var(--line); border-radius:12px; background:#ffffffa6; display:grid; gap:10px; }
.personal-rules legend { padding:0 5px; font-size:12px; font-weight:800; }
.personal-rules label { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12px; }
.personal-rules label.rule-switch { justify-content:flex-start; }
.personal-rules input[type=checkbox] { accent-color:var(--red); width:17px; height:17px; flex-shrink:0; }
.personal-rules input:not([type=checkbox]) { width:85px; min-width:0; padding:8px; border:1px solid var(--line); border-radius:8px; background:white; color:var(--ink); }
.personal-rules .custom-label { display:grid; gap:8px; }
.personal-rules textarea { width:100%; resize:vertical; padding:10px; border:1px solid var(--line); border-radius:10px; background:white; color:var(--ink); }
.rule-buttons { display:grid; gap:8px; }
.rule-buttons .primary-button { justify-content:center; padding:12px; }
#ruleSaveStatus { margin:0; font-size:11px; color:var(--green); line-height:1.6; }
.rule-preview { padding:12px; border-radius:10px; background:var(--red-soft); color:var(--red-dark); font-size:12px; line-height:1.6; }
