:root {
  color-scheme: light;
  --blue-50: #f3faff;
  --blue-100: #e3f3ff;
  --blue-200: #c9e8ff;
  --blue-500: #2f8ecb;
  --blue-700: #166694;
  --ink: #20303c;
  --muted: #62727e;
  --line: #d8e5ed;
  --white: #fff;
  --shadow: 0 14px 38px rgba(47, 112, 151, .10);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; overflow-x: hidden; color: var(--ink); background: #f8fcff; font-size: 16px; line-height: 1.65; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.sky { position: fixed; inset: 0 0 auto; height: 340px; z-index: -1; background: linear-gradient(180deg, #dff2ff 0%, #f8fcff 92%); }
.sky::after { content: ""; position: absolute; width: 330px; height: 330px; right: -120px; top: -140px; border-radius: 50%; border: 70px solid rgba(255,255,255,.42); }

.site-header { max-width: 1080px; margin: 0 auto; padding: 22px 24px 0; display: flex; justify-content: space-between; align-items: center; }
.brand { border: 0; background: transparent; display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; cursor: pointer; padding: 0; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: white; background: var(--blue-700); border-radius: 11px 11px 11px 3px; }
.header-home { border: 1px solid rgba(22,102,148,.2); background: rgba(255,255,255,.72); border-radius: 999px; padding: 8px 15px; color: var(--blue-700); cursor: pointer; font-weight: 700; }
.app { width: min(100% - 36px, 1010px); margin: 0 auto; padding: 50px 0 56px; outline: none; }
.view { animation: rise .28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.intro { max-width: 720px; margin-bottom: 46px; }
.eyebrow, .step-label { display: inline-flex; color: var(--blue-700); background: rgba(255,255,255,.72); border: 1px solid var(--blue-200); border-radius: 999px; padding: 5px 12px; font-weight: 800; font-size: .83rem; letter-spacing: .04em; }
.intro h1 { margin: 15px 0 15px; color: var(--blue-700); font-size: clamp(2.7rem, 7vw, 4.7rem); line-height: 1.12; letter-spacing: -.045em; }
.intro h1 span { color: var(--blue-700); }
.intro p { margin: 0; max-width: 570px; color: #506775; font-size: clamp(1.05rem, 2vw, 1.25rem); }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; gap: 16px; }
.section-heading h2 { margin: 9px 0 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.tap-tip { color: var(--muted); font-size: .9rem; }
.compact-heading { margin-bottom: 12px; }
.section-note, .privacy-note { color: var(--muted); font-size: .92rem; }

.quick-search { margin: 0 0 42px; padding: 22px; border: 1px solid var(--blue-200); border-radius: 22px; background: rgba(255,255,255,.78); }
.search-box { display: flex; gap: 10px; }
.search-box input { min-width: 0; width: 100%; min-height: 52px; padding: 12px 15px; border: 1px solid #b8cedb; border-radius: 13px; background: white; color: var(--ink); }
.search-box input:focus { border-color: var(--blue-500); outline: 3px solid rgba(47,142,203,.12); }
.search-clear { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; background: white; color: var(--blue-700); font-weight: 800; cursor: pointer; }
.quick-search .privacy-note { margin: 8px 0 0; }
.search-results { margin-top: 14px; }
.search-match-list { display: grid; gap: 8px; }
.search-match { width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; }
.search-match strong, .search-match small { max-width: 100%; overflow-wrap: anywhere; }
.search-match small { color: var(--muted); }
.search-empty { padding: 16px; border-radius: 14px; background: var(--blue-50); }
.search-empty p { margin: 4px 0 12px; color: var(--muted); }

.category-groups { display: grid; gap: 28px; }
.category-group { min-width: 0; }
.group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.group-heading h3 { margin: 0; font-size: 1.18rem; }
.group-heading p { margin: 0; color: var(--muted); font-size: .88rem; text-align: right; }

.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.category-card { position: relative; min-height: 196px; text-align: left; border: 1px solid rgba(114,163,191,.3); border-radius: 24px; padding: 25px; background: rgba(255,255,255,.94); box-shadow: 0 6px 20px rgba(63,117,149,.06); cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.category-card:hover, .category-card:focus-visible { transform: translateY(-3px); border-color: var(--blue-500); box-shadow: var(--shadow); outline: none; }
.card-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 13px; background: var(--blue-100); color: var(--blue-700); font-weight: 900; }
.category-card strong { display: block; font-size: 1.24rem; margin-bottom: 7px; }
.category-card small { display: block; color: var(--muted); font-size: .98rem; line-height: 1.5; padding-right: 18px; }
.arrow { font-size: 1.8rem; color: var(--blue-500); line-height: 1; }
.category-card .arrow { position: absolute; right: 20px; bottom: 18px; }
.unsure-card { width: 100%; margin-top: 18px; border: 1px dashed var(--blue-500); border-radius: 18px; padding: 18px 20px; display: flex; gap: 14px; align-items: center; text-align: left; background: var(--blue-50); cursor: pointer; }
.unsure-icon { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-700); color: white; font-weight: 900; }
.unsure-card strong, .unsure-card small { display: block; }
.unsure-card small { color: var(--muted); margin-top: 2px; }
.unsure-card .arrow { margin-left: auto; }

.tool-section { margin-top: 46px; padding-top: 34px; border-top: 1px solid var(--line); }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.tool-card { min-width: 0; min-height: 132px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 19px; text-align: left; border: 1px solid var(--line); border-radius: 18px; background: white; cursor: pointer; }
.tool-card:hover, .tool-card:focus-visible { border-color: var(--blue-500); outline: 3px solid rgba(47,142,203,.12); }
.tool-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--blue-700); background: var(--blue-100); font-weight: 900; }
.tool-card strong, .tool-card small { display: block; overflow-wrap: anywhere; }
.tool-card small { margin-top: 4px; color: var(--muted); line-height: 1.45; }

.policy-entry-section { margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--line); }
.policy-entry-card { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 11px 24px; padding: clamp(22px, 4vw, 31px); border: 1px solid #b9ddd0; border-radius: 22px; background: linear-gradient(135deg, #effbf6 0%, #fff 72%); color: var(--ink); text-decoration: none; box-shadow: 0 8px 24px rgba(36,115,86,.07); }
.policy-entry-card:hover, .policy-entry-card:focus-visible { border-color: #278461; outline: 3px solid rgba(39,132,97,.12); }
.policy-entry-tag { width: fit-content; display: inline-flex; padding: 5px 11px; border-radius: 999px; background: #e6f7ef; color: #176a4b; border: 1px solid #b9dfcf; font-size: .82rem; font-weight: 850; }
.policy-entry-copy { min-width: 0; display: block; grid-column: 1; }
.policy-entry-copy strong, .policy-entry-copy small { display: block; overflow-wrap: anywhere; }
.policy-entry-copy strong { margin-bottom: 5px; color: #176a4b; font-size: clamp(1.2rem, 2.5vw, 1.55rem); }
.policy-entry-copy small { color: var(--muted); font-size: .98rem; }
.policy-entry-link { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: #176a4b; font-weight: 850; white-space: nowrap; }

.ai-entry-section { margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--line); }
.ai-entry-card { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 11px 24px; padding: clamp(22px, 4vw, 31px); border: 1px solid #b9d8ea; border-radius: 22px; background: linear-gradient(135deg, #f1f9ff 0%, #fff 72%); color: var(--ink); text-decoration: none; box-shadow: 0 8px 24px rgba(47,112,151,.07); }
.ai-entry-card:hover, .ai-entry-card:focus-visible { border-color: var(--blue-500); outline: 3px solid rgba(47,142,203,.12); }
.ai-entry-tag { width: fit-content; display: inline-flex; padding: 5px 11px; border-radius: 999px; background: #fff5df; color: #76520d; border: 1px solid #f0d79e; font-size: .82rem; font-weight: 850; }
.ai-entry-copy { min-width: 0; display: block; grid-column: 1; }
.ai-entry-copy strong, .ai-entry-copy small { display: block; overflow-wrap: anywhere; }
.ai-entry-copy strong { margin-bottom: 5px; color: var(--blue-700); font-size: clamp(1.2rem, 2.5vw, 1.55rem); }
.ai-entry-copy small { color: var(--muted); font-size: .98rem; }
.ai-entry-link { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--blue-700); font-weight: 850; white-space: nowrap; }
.ai-inline-entry { margin: 22px 0; padding: 20px; border: 1px solid #b9d8ea; border-radius: 17px; background: #f3faff; }
.ai-inline-entry h3 { margin: 12px 0 5px; color: var(--blue-700); font-size: 1.16rem; }
.ai-inline-entry p { margin: 0 0 10px; color: var(--muted); }
.ai-inline-entry a { color: var(--blue-700); font-weight: 850; text-underline-offset: 3px; }
.footer-links { padding-top: 42px; display: flex; justify-content: center; gap: 12px; color: var(--muted); }
.footer-links button, .footer-links a { border: 0; background: none; padding: 4px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }

#choice-view, #result-view, #wizard-view, #static-view, #tool-view { max-width: 720px; margin: 10px auto 0; }
.crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; margin-bottom: 28px; }
.crumb span + span::before { content: "›"; margin-right: 8px; color: #9aacb7; }
.panel-heading h1, #result-view > h1 { margin: 13px 0 8px; font-size: clamp(2.15rem, 6vw, 3.35rem); line-height: 1.18; letter-spacing: -.035em; }
.result-action { margin: 22px 0 8px; color: var(--blue-700); font-size: clamp(1.45rem, 4.5vw, 2rem); line-height: 1.3; }
.result-stage { margin: 18px 0 -5px; color: var(--muted); }
.subheading { margin: 28px 0 -15px; font-size: 1.15rem; }
.panel-heading p, .result-lead { color: var(--muted); font-size: 1.05rem; margin: 0; }
.choice-list { display: grid; gap: 12px; margin-top: 30px; }
.choice-button { width: 100%; min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: left; border: 1px solid var(--line); border-radius: 16px; padding: 15px 18px; background: var(--white); font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: border-color .16s, transform .16s; }
.choice-button:hover, .choice-button:focus-visible { border-color: var(--blue-500); transform: translateX(3px); outline: 3px solid rgba(47,142,203,.12); }
.choice-number { flex: 0 0 auto; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: var(--blue-100); color: var(--blue-700); font-size: .88rem; }
.choice-text { flex: 1; }

.result-badge { display: inline-flex; align-items: center; gap: 8px; background: #e4f6ee; color: #176a4b; border-radius: 999px; padding: 6px 13px; font-size: .86rem; font-weight: 900; }
.result-badge::before { content: "✓"; width: 18px; height: 18px; display: grid; place-items: center; background: #278461; color: #fff; border-radius: 50%; font-size: .7rem; }
.steps { display: grid; gap: 13px; margin: 30px 0 18px; }
.step-card { display: grid; grid-template-columns: auto 1fr; gap: 15px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 18px; }
.step-num { width: 42px; height: 42px; display: grid; place-items: center; background: var(--blue-700); color: white; border-radius: 13px; font-weight: 900; }
.step-card strong { display: block; font-size: 1.04rem; margin-bottom: 4px; }
.step-card p { margin: 0; color: var(--muted); }
.notice { padding: 16px 18px; border-left: 4px solid #e3aa43; border-radius: 4px 14px 14px 4px; background: #fff9ed; color: #6d552b; }
.notice strong { margin-right: 4px; }
.result-feedback { margin-top: 18px; padding: 18px; border: 1px solid var(--blue-200); border-radius: 16px; background: var(--blue-50); }
.result-feedback > p { margin: 0; color: #425865; }
.feedback-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.feedback-actions button { min-height: 46px; border: 1px solid var(--blue-200); border-radius: 12px; background: white; color: var(--blue-700); font-weight: 800; cursor: pointer; }
.feedback-actions button:hover, .feedback-actions button:focus-visible { border-color: var(--blue-500); outline: 3px solid rgba(47,142,203,.12); }
.feedback-actions button:disabled { cursor: default; opacity: .58; }
.result-feedback-note { min-height: 1.5em; margin-top: 9px !important; color: #27664d !important; font-size: .9rem; }
.primary, .assist { min-height: 58px; border-radius: 15px; padding: 13px 18px; cursor: pointer; font-weight: 800; border: 0; }
.primary { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--blue-700); color: white; box-shadow: 0 9px 22px rgba(22,102,148,.2); }
.assist { background: var(--blue-100); color: var(--blue-700); }
.nav-actions { display: flex; gap: 10px; margin-top: 22px; }
.secondary { flex: 1; min-height: 48px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--muted); cursor: pointer; }
.continue-action { width: 100%; min-height: 64px; margin-top: 26px; font-size: 1.06rem; }
.assist-area { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; }
.assist-area p { margin: 0 0 10px; color: var(--muted); font-size: .92rem; }
.assist-area .assist { width: 100%; background: #eef7fd; }

.copy-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 18px; }
.copy-actions .secondary { min-width: 0; padding: 10px 8px; }
.inline-status { min-height: 1.4em; margin: 9px 0 0; color: #27664d; font-size: .9rem; }
.inline-status.error { color: #a33a3a; }
.result-details { display: grid; gap: 10px; margin-top: 22px; }
.result-details details, .tool-scope { border: 1px solid var(--line); border-radius: 14px; background: white; overflow: hidden; }
.result-details summary, .tool-scope summary { padding: 14px 16px; color: var(--blue-700); font-weight: 850; cursor: pointer; }
.result-details details > p, .result-details details > ul, .result-details details > div, .tool-scope > p, .tool-scope > ul { margin: 0; padding: 0 18px 17px; }
.result-details ul, .source-list { padding-left: 36px !important; }
.source-list a { color: var(--blue-700); overflow-wrap: anywhere; }
.update-line { color: var(--muted); font-size: .88rem; }
.business-note + .business-note { border-top: 1px solid #edf2f5; }
.business-note { padding: 12px 0; }
.business-note h4 { margin: 0 0 4px; }
.business-note p { margin: 0; color: var(--muted); }

.static-card { padding: clamp(22px, 5vw, 38px); background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.static-card h1 { margin: 0 0 18px; font-size: 2rem; }
.static-card p { color: #4f606b; }
.static-card label { display: block; margin: 16px 0 6px; font-weight: 800; }
.static-card input, .static-card textarea { width: 100%; padding: 14px 15px; border: 1px solid #bfced8; border-radius: 12px; background: #fbfdff; color: var(--ink); }
.static-card textarea { min-height: 120px; resize: vertical; }
.static-card .primary { width: 100%; margin-top: 20px; }
.form-note { display: none; margin: 14px 0 0; padding: 13px; border-radius: 12px; background: #edf8f2; color: #27664d; }
.local-only-note { margin: 15px 0; padding: 13px 14px; border-radius: 12px; color: #37596c; background: var(--blue-50); border: 1px solid var(--blue-200); }
.full-width { width: 100%; margin-top: 10px; }
.feedback-output { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.feedback-output pre { max-width: 100%; padding: 15px; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 12px; background: #f6f9fb; color: var(--ink); font-family: inherit; }
.assist-steps { padding-left: 24px; }
.assist-steps li { margin-bottom: 14px; }
.assist-steps p { margin: 2px 0 0; }
.configured-help { display: grid; gap: 12px; margin-top: 20px; }
.configured-help:empty { display: none; }
.configured-help-item { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdff; }
.configured-help-item h2 { margin: 0 0 5px; font-size: 1.05rem; }
.configured-help-item p { margin: 0; }
.configured-qr { display: block; width: min(220px, 100%); height: auto; margin-top: 12px; border-radius: 12px; }

.tool-page { padding: clamp(22px, 5vw, 38px); background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.tool-page > h1 { margin: 10px 0 8px; font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.2; }
.tool-intro { margin: 0; color: var(--muted); }
.tool-form { margin-top: 24px; }
.tool-form label { display: block; margin: 15px 0 6px; font-weight: 800; }
.tool-form input, .tool-form select { width: 100%; min-width: 0; padding: 13px 14px; border: 1px solid #bfced8; border-radius: 12px; background: #fbfdff; color: var(--ink); }
.tool-form input:focus, .tool-form select:focus { border-color: var(--blue-500); outline: 3px solid rgba(47,142,203,.12); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.field-grid.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-subtitle { margin: 25px 0 -4px; font-size: 1.05rem; }
.form-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 23px; }
.form-actions .primary { margin: 0; }
.tool-result { margin-top: 25px; padding: 20px; border-radius: 17px; background: #edf8f2; border: 1px solid #cce7d9; }
.tool-result h2 { margin: 0 0 13px; }
.calculation-output { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; margin: 0; }
.calculation-output dt { color: #47606e; }
.calculation-output dd { margin: 0; text-align: right; font-weight: 850; }
.result-caution { margin: 14px 0 0; color: #5e583f; }
.tool-result .primary { width: 100%; margin-top: 16px; }
.tool-scope { margin-top: 22px; background: #fbfdff; }
.checklist-fields { margin: 18px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.checklist-fields legend { padding: 0 6px; font-weight: 850; }
.check-row { display: grid !important; grid-template-columns: auto 1fr; gap: 10px; align-items: start; margin: 8px 0 !important; font-weight: 500 !important; }
.check-row input { width: 20px !important; height: 20px; margin-top: 3px; }

dialog { width: min(90vw, 430px); border: 0; border-radius: 23px; padding: 31px; color: var(--ink); box-shadow: 0 24px 80px rgba(28,62,82,.28); }
dialog::backdrop { background: rgba(23,45,59,.42); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; right: 13px; top: 9px; border: 0; background: none; font-size: 1.7rem; color: var(--muted); cursor: pointer; }
.dialog-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: var(--blue-100); color: var(--blue-700); font-weight: 900; }
dialog h2 { margin: 17px 0 8px; font-size: 1.45rem; }
dialog p { color: var(--muted); margin: 0 0 22px; }
.dialog-ok { width: 100%; }

@media (max-width: 760px) {
  .site-header { padding: 17px 18px 0; }
  .app { width: min(100% - 28px, 1010px); padding-top: 38px; }
  .intro { margin-bottom: 34px; }
  .intro h1 { font-size: clamp(2.4rem, 13vw, 3.4rem); }
  .category-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .category-card { min-height: 180px; padding: 20px; border-radius: 20px; }
  .card-icon { margin-bottom: 17px; }
  .category-card small { font-size: .86rem; }
  .tap-tip { display: none; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .field-grid.three-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 440px) {
  .category-grid { grid-template-columns: 1fr; }
  .category-card { min-height: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; }
  .card-icon { margin: 0; }
  .category-card strong { margin: 0 0 2px; }
  .category-card small { padding-right: 0; }
  .category-card .arrow { position: static; }
  .unsure-card { padding: 15px; }
  .nav-actions { flex-direction: column; }
  .step-card { padding: 17px; }
  .quick-search { padding: 17px; }
  .group-heading { display: block; }
  .group-heading p { margin-top: 3px; text-align: left; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 0; }
  .copy-actions, .field-grid, .field-grid.three-cols, .form-actions { grid-template-columns: 1fr; }
  .calculation-output { grid-template-columns: 1fr; gap: 1px; }
  .calculation-output dd { margin-bottom: 9px; text-align: left; }
  .search-box { align-items: stretch; }
  .search-clear { padding: 0 12px; }
  .policy-entry-card { grid-template-columns: 1fr; }
  .policy-entry-link { grid-column: 1; grid-row: auto; white-space: normal; }
  .ai-entry-card { grid-template-columns: 1fr; }
  .ai-entry-link { grid-column: 1; grid-row: auto; white-space: normal; }
}

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