/* =====================================================================
   NoticeFix — IRS notice library + notice detail pages
   Uses the :root tokens from css/style.css only.
   ===================================================================== */

/* ===== Notice hero ===== */
.nh { position: relative; padding: 130px 0 70px; overflow: hidden; }
.nh-404 { padding: 180px 0 120px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); margin-bottom: 26px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--action-color); }
.crumbs svg { width: 14px; height: 14px; opacity: .6; }
.crumbs span { color: var(--secondary-color); font-weight: 600; }
.nh-title { font-size: clamp(2.1rem, 3.8vw, 3.3rem); font-weight: 700; line-height: 1.08; letter-spacing: -.034em; margin: 20px 0 22px; }
.quick-answer { border-radius: 20px; padding: 20px 22px; background: linear-gradient(180deg, rgba(var(--primary-rgb), .07), rgba(var(--primary-rgb), .02)); border-color: rgba(var(--primary-rgb), .18); }
.qa-label { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--action-color); }
.qa-label svg { width: 16px; height: 16px; }
.qa-text { margin: 0; color: var(--secondary-color); font-size: 1.04rem; }
.nh-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.meta-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); background: var(--white); border: 1px solid var(--line); font-size: .8rem; font-weight: 500; color: var(--secondary-color); }
.meta-pill svg { width: 15px; height: 15px; color: var(--action-color); }
.meta-pill b { color: var(--accent-color); }
.nh .hero-ctas { margin: 26px 0 16px; }
.reviewed { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .82rem; color: var(--muted); }
.reviewed svg { width: 16px; height: 16px; color: var(--accent-color); }

/* Severity / level badges (shared with home lookup) */
.lvl { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.lvl svg { width: 14px; height: 14px; }

/* Seriousness meter */
.meter { display: inline-flex; gap: 3px; align-items: flex-end; vertical-align: middle; }
.meter i { width: 6px; border-radius: 2px; background: var(--line); transition: background .3s, transform .4s var(--ease-out); }
.meter i:nth-child(1) { height: 8px; } .meter i:nth-child(2) { height: 11px; } .meter i:nth-child(3) { height: 14px; } .meter i:nth-child(4) { height: 17px; } .meter i:nth-child(5) { height: 20px; }
.meter-1 i.on, .meter-2 i.on { background: var(--accent-color); }
.meter-3 i.on { background: var(--warning); }
.meter-4 i.on, .meter-5 i.on { background: var(--danger); }

/* Anatomy card */
.anatomy { border-radius: 26px; padding: 26px; rotate: 1.5deg; transition: rotate .6s var(--ease-out); }
.anatomy:hover { rotate: 0deg; }
.an-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.an-small { margin: 0; font-size: .75rem; color: var(--muted); }
.an-code { position: relative; text-align: right; padding: 8px 12px; border-radius: 12px; border: 2px dashed rgba(var(--primary-rgb), .5); background: var(--primary-tint); }
.an-code strong { display: block; font-size: 1.15rem; color: var(--action-color); }
.an-ping { position: absolute; top: -6px; right: -6px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary-color); }
.an-ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--primary-color); animation: pinPulse 2s var(--ease-out) infinite; }
.an-pointer { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: 8px 0 14px; font-size: .75rem; font-weight: 600; color: var(--action-color); }
.an-pointer svg { width: 14px; height: 14px; transform: scaleX(-1); }
.an-lines span { display: block; height: 7px; border-radius: 4px; background: rgba(var(--navy-rgb), .07); margin-bottom: 9px; }
.glance { margin: 18px 0 0; border-top: 1px dashed var(--line); padding-top: 8px; }
.glance div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(var(--navy-rgb), .05); font-size: .88rem; }
.glance div:last-child { border-bottom: 0; }
.glance dt { color: var(--muted); font-weight: 400; }
.glance dd { margin: 0; text-align: right; font-weight: 600; color: var(--secondary-color); }
.glance .fee { color: var(--accent-color); }

/* ===== Article layout ===== */
.nd { padding: 30px 0 90px; }
.nd-block { padding: 34px 0; border-bottom: 1px solid var(--line); }
.nd-block:first-child { padding-top: 10px; }
.nd-block:last-child { border-bottom: 0; }
.nd-block h2 { font-size: clamp(1.45rem, 2.2vw, 1.85rem); font-weight: 700; letter-spacing: -.024em; margin-bottom: 16px; }
.lead-p { font-size: 1.1rem; color: var(--secondary-color); }

.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.why-item { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 18px; transition: transform .35s var(--ease-out), box-shadow .35s; }
.why-item:hover { transform: translateY(-3px); box-shadow: var(--sh-high); }
.why-num { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: .8rem; font-weight: 600; background: var(--primary-tint); color: var(--action-color); }
.why-item p { margin: 0; font-size: .95rem; }

/* Deadline calculator */
.calc { display: grid; grid-template-columns: 1.2fr 1fr; gap: 26px; padding: 26px; border-radius: 24px; margin-top: 8px; }
.calc-inputs { display: flex; flex-direction: column; gap: 16px; }
.calc-inputs label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--secondary-color); }
.calc-inputs input[type="date"], .stepper { height: 50px; border-radius: 14px; border: 1px solid var(--line); background: var(--white); font: inherit; font-family: var(--font-mono); font-size: .95rem; color: var(--secondary-color); padding: 0 14px; transition: border-color .25s, box-shadow .25s; }
.calc-inputs input[type="date"]:focus, .stepper:focus-within { outline: 0; border-color: var(--primary-color); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .15); }
.stepper { display: flex; align-items: center; padding: 0 6px; }
.stepper input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; text-align: center; font: inherit; font-family: var(--font-mono); color: var(--secondary-color); -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button { width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--primary-tint); color: var(--action-color); display: grid; place-items: center; transition: background .2s, transform .2s; }
.stepper button:hover { background: var(--action-color); color: var(--on-primary); }
.stepper button:active { transform: scale(.9); }
.stepper svg { width: 16px; height: 16px; }
.calc-hint { display: flex; gap: 8px; margin: 0; font-size: .8rem; color: var(--muted); }
.calc-hint svg { flex: none; width: 16px; height: 16px; color: var(--primary-color); margin-top: 2px; }
.calc-out { --c: var(--accent-color); position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.calc-out.soon { --c: var(--warning); }
.calc-out.late { --c: var(--danger); }
.calc-ring { width: 150px; height: 150px; transform: rotate(-90deg); }
.cr-track { fill: none; stroke: var(--line); stroke-width: 9; }
.cr-bar { fill: none; stroke: var(--c); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset .9s var(--ease-out), stroke .4s; }
.calc-center { position: absolute; top: 0; left: 0; right: 0; height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.calc-center strong { font-size: 2.4rem; line-height: 1; color: var(--c); transition: color .4s; }
.calc-center span { font-size: .78rem; color: var(--muted); }
.calc-due { margin: 0; font-size: .92rem; color: var(--muted); }
.calc-due b { color: var(--secondary-color); font-family: var(--font-mono); }
.calc-note { display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px; border-radius: 20px; }
.calc-note svg { flex: none; width: 26px; height: 26px; color: var(--primary-color); }
.calc-note p { margin: 0; color: var(--secondary-color); }
.bump { animation: bump .45s var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.12); } }

/* Step checklist */
.todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.todo-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); transition: border-color .3s, background .3s, transform .3s var(--ease-out); }
.todo-item:hover { border-color: rgba(var(--primary-rgb), .4); transform: translateX(4px); }
.todo-item p { margin: 0; flex: 1; transition: color .3s; }
.todo-num { flex: none; font-size: .8rem; font-weight: 600; color: var(--muted); margin-top: 3px; }
.todo-check { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); background: var(--white); display: grid; place-items: center; padding: 0; transition: background .25s, border-color .25s, transform .25s var(--ease-out); }
.todo-check:hover { border-color: var(--primary-color); }
.todo-check:active { transform: scale(.88); }
.todo-check svg { width: 16px; height: 16px; fill: none; stroke: var(--on-primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .35s var(--ease-out); }
.todo-item.done { background: var(--accent-tint); border-color: rgba(var(--accent-rgb), .3); }
.todo-item.done p { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(var(--accent-rgb), .5); }
.todo-item.done .todo-check { background: var(--accent-color); border-color: var(--accent-color); }
.todo-item.done .todo-check svg { stroke-dashoffset: 0; }
.todo-progress { margin: 14px 0 0; font-size: .85rem; color: var(--muted); }
.todo-progress span { font-weight: 600; color: var(--action-color); }
.todo-progress.all span { color: var(--accent-color); }

/* Options */
.opt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.opt-card { position: relative; overflow: hidden; padding: 22px; border-radius: 20px; transition: transform .4s var(--ease-out), box-shadow .4s; }
.opt-card:hover { transform: translateY(-4px); box-shadow: var(--sh-high); }
.opt-ix { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--secondary-color); color: var(--on-secondary); font-weight: 600; margin-bottom: 12px; }
.opt-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.opt-card p { margin: 0; font-size: .92rem; color: var(--muted); }

/* Ignore warning */
.warn-box { display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px; border-radius: 18px; background: var(--danger-tint); border: 1px solid rgba(var(--white-rgb), .9); }
.warn-box svg { flex: none; width: 26px; height: 26px; color: var(--danger); }
.warn-box p { margin: 0; color: var(--secondary-color); }

/* Collection ladder */
.ladder { --pos: 0; position: relative; list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ladder-line { position: absolute; left: 10%; right: 10%; top: 21px; height: 3px; border-radius: 3px; background: var(--line); }
.ladder-line span { display: block; height: 100%; width: calc(var(--pos) * 25%); border-radius: 3px; background: linear-gradient(90deg, var(--accent-color), var(--warning), var(--danger)); transform-origin: left; animation: growX 1.2s var(--ease-out) .3s both; }
@keyframes growX { from { transform: scaleX(0); } }
.rung a { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 0 4px; color: var(--muted); }
.rung-dot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--white); border: 2px solid var(--line); font-family: var(--font-mono); font-weight: 600; font-size: .9rem; transition: transform .35s var(--ease-out); }
.rung-dot svg { width: 18px; height: 18px; }
.rung a:hover .rung-dot { transform: scale(1.1); }
.rung strong { font-size: .9rem; color: var(--secondary-color); }
.rung small { font-size: .75rem; line-height: 1.3; }
.rung em { font-style: normal; font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); background: var(--action-color); color: var(--on-primary); }
.rung.past .rung-dot { background: var(--accent-color); border-color: var(--accent-color); color: var(--on-primary); }
.rung.now .rung-dot { background: var(--action-color); border-color: var(--action-color); color: var(--on-primary); box-shadow: 0 0 0 6px rgba(var(--primary-rgb), .18); animation: dotPulse 2s infinite; }
.rung.next { opacity: .7; }

/* How we help */
.help-card { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; padding: 28px; border-radius: 24px; }
.help-list p { display: flex; gap: 10px; margin: 0 0 12px; }
.help-list svg { flex: none; width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-color); margin-top: 1px; }
.help-price { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 18px; background: var(--secondary-color); color: var(--on-secondary); }
.help-price span { font-size: .85rem; opacity: .75; }
.help-price strong { font-size: 2rem; letter-spacing: -.02em; }
.help-price small { font-size: .75rem; opacity: .65; text-align: center; }

/* Is it real */
.real-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.real-list li { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); font-size: .92rem; }
.real-list svg { flex: none; width: 20px; height: 20px; color: var(--action-color); margin-top: 2px; }

/* Sidebar */
.nd-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 18px; }
.toc { position: relative; display: flex; flex-direction: column; padding: 20px 20px 20px 24px; border-radius: 20px; }
.toc .overline { margin-bottom: 10px; }
.toc a { position: relative; padding: 7px 0 7px 14px; font-size: .9rem; color: var(--muted); border-left: 2px solid var(--line); transition: color .25s, border-color .25s, padding-left .3s var(--ease-out); }
.toc a:hover { color: var(--secondary-color); padding-left: 18px; }
.toc a.on { color: var(--action-color); font-weight: 600; border-left-color: var(--primary-color); }
.toc-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 0 0 20px 20px; overflow: hidden; }
.toc-progress span { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--primary-color), var(--accent-color)); }
.side-help { padding: 22px; border-radius: 20px; text-align: center; }
.code-pill.big { font-size: 1rem; padding: 6px 14px; }
.side-title { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--secondary-color); margin: 12px 0 4px; }
.side-sub { font-size: .9rem; color: var(--muted); }
.side-links { display: flex; justify-content: center; gap: 18px; margin-top: 14px; }
.side-links a { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--secondary-color); }
.side-links svg { width: 16px; height: 16px; color: var(--action-color); }

/* ===== Notice cards (hub + related) ===== */
.notice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.n-card { --mx: 50%; --my: 50%; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 22px; color: var(--body); transition: transform .4s var(--ease-out), box-shadow .4s, opacity .35s, scale .35s; }
.n-card:hover { transform: translateY(-5px); box-shadow: var(--sh-high); color: var(--body); }
.n-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.n-code { font-size: 1.05rem; font-weight: 600; color: var(--secondary-color); }
.n-card h3 { font-size: 1.02rem; margin: 4px 0 0; line-height: 1.3; }
.n-card p { margin: 0; flex: 1; font-size: .86rem; color: var(--muted); }
.n-card-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.n-fee { font-size: .8rem; font-weight: 600; color: var(--accent-color); }
.n-go { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-tint); color: var(--action-color); transition: background .3s, color .3s, transform .4s var(--ease-out); }
.n-go svg { width: 16px; height: 16px; }
.n-card:hover .n-go { background: var(--action-color); color: var(--on-primary); transform: rotate(-45deg); }
.n-card .lvl { padding: 3px 9px; font-size: .75rem; }
.n-card.hidden-card { display: none; }
.n-card.pop { animation: pop .45s var(--ease-out); }
@keyframes pop { from { opacity: 0; scale: .94; } to { opacity: 1; scale: 1; } }

/* ===== Hub page ===== */
.hub-hero { position: relative; padding: 140px 0 60px; overflow: hidden; text-align: center; }
.hub-hero .hero-sub { margin: 0 auto; }
.hub-search { position: relative; max-width: 640px; margin: 30px auto 0; }
.hub-search .lookup-form { margin-top: 0; }
.hub-count { margin: 14px 0 0; font-size: .85rem; color: var(--muted); }
.hub-count b { color: var(--action-color); font-family: var(--font-mono); }
.filters { position: sticky; top: 84px; z-index: 20; display: flex; flex-wrap: nowrap; gap: 4px; padding: 8px; margin: 0 auto 34px; border-radius: var(--r-pill); width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter-btn { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; border: 0; padding: 9px 16px; border-radius: var(--r-pill); background: transparent; color: var(--secondary-color); font-size: .87rem; font-weight: 500; transition: background .25s, color .25s; }
.filter-btn svg { width: 16px; height: 16px; }
.filter-btn:hover { background: rgba(var(--primary-rgb), .08); }
.filter-btn.on { background: var(--action-color); color: var(--on-primary); box-shadow: var(--glow); }
.filter-btn .cnt { font-family: var(--font-mono); font-size: .75rem; opacity: .7; }
.empty-state { display: none; text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state.show { display: block; animation: resultIn .4s var(--ease-out); }
.empty-state svg { width: 40px; height: 40px; color: var(--primary-color); }
.find-code { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.ladder-wide { margin-top: 30px; }

/* ===== Responsive ===== */
/* ===== Notice photos ===== */
.nd-photo { margin: 24px 0 8px; aspect-ratio: 16 / 9; }
.nd-photo-wide { aspect-ratio: 21 / 9; margin: 4px 0 24px; }

/* ===== Deadline calculator: input warning + overdue help ===== */
.calc-warn { margin: 6px 0 0; font-size: .85rem; font-weight: 600; color: var(--danger); min-height: 0; }
.calc-warn:empty { display: none; }
.calc-inputs label.invalid input { border-color: var(--danger); }
.calc-late { grid-column: 1 / -1; display: flex; gap: 14px; align-items: flex-start; margin-top: 6px; padding: 16px 18px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); }
.calc-late[hidden] { display: none; }
.calc-late > svg { flex: none; width: 24px; height: 24px; color: var(--action-color); margin-top: 2px; }
.calc-late p { margin: 0 0 12px; font-size: .95rem; color: var(--body); }
.calc-late b { color: var(--secondary-color); }
.calc-late-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 1199.98px) {
    .notice-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991.98px) {
    .nh { padding: 120px 0 50px; }
    .nd-side { position: static; }
    .toc { display: none; }
    .notice-grid { grid-template-columns: repeat(2, 1fr); }
    .find-code { grid-template-columns: 1fr; }
    .filters { top: 76px; }
}
@media (max-width: 767.98px) {
    .why-grid, .opt-grid, .real-list { grid-template-columns: 1fr; }
    .calc, .help-card { grid-template-columns: 1fr; }
    .ladder { grid-template-columns: 1fr; gap: 14px; }
    .ladder-line { left: 21px; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }
    .ladder-line span { width: 100%; height: calc(var(--pos) * 25%); }
    .rung a { flex-direction: row; text-align: left; gap: 12px; }
    .rung small { flex: 1; }
}
@media (max-width: 575.98px) {
    .notice-grid { grid-template-columns: 1fr; }
    .filters { position: static; }
    .anatomy { rotate: 0deg; }
}

/* Keyboard hint in hub search */
.kbd { font-family: var(--font-mono); font-size: .75rem; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); background: var(--white); }
@media (max-width: 767.98px) { .kbd { display: none; } }
@media (max-width: 1399.98px) {
    .filter-btn { padding: 8px 12px; font-size: .84rem; gap: 6px; }
    .filter-btn svg { width: 15px; height: 15px; }
}
