/* assets/tools/habit-formation.css — habit formation calculator with the existing Storey shell, tokens, and typography. */
    /* ── Self-hosted fonts (latin subset), shared with the landing page ── */
    @font-face{font-family:'Bricolage Grotesque';font-style:normal;font-weight:800;font-display:swap;src:url('/assets/fonts/bricolage-grotesque-latin-800-normal.woff2') format('woff2')}
    @font-face{font-family:'Space Grotesk';font-style:normal;font-weight:400;font-display:swap;src:url('/assets/fonts/space-grotesk-latin-400-normal.woff2') format('woff2')}
    @font-face{font-family:'Space Grotesk';font-style:normal;font-weight:700;font-display:swap;src:url('/assets/fonts/space-grotesk-latin-700-normal.woff2') format('woff2')}
    @font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:400;font-display:swap;src:url('/assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2')}

    /* ── Night-city design tokens, shared with the landing page ───────── */
    :root{
      --bg:#07080C; --sheet:#090A10; --card:rgba(255,255,255,.03);
      --card-border:rgba(255,255,255,.09); --field-border:rgba(255,255,255,.12); --field:rgba(255,255,255,.04);
      --ink:#EDEFF5; --bright:#F6F8FF; --mist:#B3BCCA; --muted:#A7B0C0; --dim:#8A94A4;
      --soft:#6B7686; --faint:#5F6B7D;
      --mint:#7FE3C4; --mint-ink:#062A20; --teal:#6BC5FF; --violet:#A78BFA;
      --indigo:#A78BFA; --coral:#FF8A6B; --acc:#5CE1A6; --acc-ink:#052018; --sky:#6BC5FF;
      --brand-grad:linear-gradient(180deg,#A8F0D4,#5CE1A6);
      --display:'Bricolage Grotesque',sans-serif;
      --mono:'JetBrains Mono',monospace;
      --font:'Space Grotesk',system-ui,sans-serif;
      --w:1180px;
    }
    *,*::before,*::after{box-sizing:border-box}
    html{scroll-behavior:smooth}
    body{
      margin:0;background:var(--bg);color:var(--ink);
      font-family:var(--font);font-size:16px;line-height:1.6;
      -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
      text-wrap:pretty;overflow-x:hidden;
    }
    img{display:block;max-width:100%;height:auto}
    a{color:var(--acc);text-decoration:none}
    a:hover{color:#8CEDC4}
    ::selection{background:var(--acc);color:var(--bg)}
    .wrap{max-width:var(--w);margin:0 auto;padding:0 22px}

    /* ── Buttons ─────────────────────────────────────────────────────── */
    .btn{
      display:inline-flex;align-items:center;justify-content:center;gap:10px;
      font-family:var(--font);font-size:16px;font-weight:700;line-height:1;
      border-radius:14px;padding:15px 26px;cursor:pointer;border:1px solid transparent;
      transition:transform .18s ease,box-shadow .18s ease,background .18s ease;
      white-space:nowrap;
    }
    .btn-primary{background:var(--acc);color:var(--acc-ink);box-shadow:0 14px 44px rgba(92,225,166,.28)}
    .btn-primary:hover{background:#8CEDC4;color:var(--acc-ink);transform:translateY(-2px);box-shadow:0 18px 54px rgba(92,225,166,.38)}

    /* ── Nav ─────────────────────────────────────────────────────────── */
    header.site{
      position:sticky;top:0;z-index:60;
      background:rgba(7,8,12,.72);backdrop-filter:blur(14px);
      -webkit-backdrop-filter:blur(14px);
      border-bottom:1px solid rgba(255,255,255,.07);
    }
    .nav{display:flex;align-items:center;gap:22px;height:64px}
    .brand{display:flex;align-items:center;gap:10px;color:var(--ink);font-family:var(--display);font-weight:800;font-size:19px;letter-spacing:-.02em}
    .brand:hover{color:var(--bright)}
    .brand-mark{width:28px;height:28px;border-radius:8px;overflow:hidden;display:grid;place-items:center;box-shadow:0 0 0 1px rgba(255,255,255,.12),0 6px 18px rgba(92,225,166,.18)}
    .brand-mark img{width:100%;height:100%;display:block}
    .nav-links{display:flex;gap:20px;margin-left:auto}
    .nav-links a{color:#9AA3B2;font-size:14px;transition:color .15s}
    .nav-links a:hover{color:var(--ink)}
    .nav-links a[aria-current]{color:var(--ink)}
    .nav .btn{padding:9px 16px;font-size:14px;border-radius:999px;box-shadow:0 6px 24px rgba(92,225,166,.25)}
    @media(max-width:760px){.nav-links{display:none}}

    /* footer */
    footer{border-top:1px solid rgba(255,255,255,.07);padding:30px 0 36px;background:var(--bg)}
    .foot{display:flex;align-items:center;gap:24px;flex-wrap:wrap}
    .foot .brand{font-size:17px}
    .foot .brand-mark{width:24px;height:24px;border-radius:7px;box-shadow:none}
    .foot nav{display:flex;gap:20px;margin-left:auto;flex-wrap:wrap}
    .foot a{color:var(--dim);font-size:14px}
    .foot a:hover{color:var(--ink)}
    .foot .copy{width:100%;font-family:var(--mono);font-size:11.5px;color:var(--faint);margin-top:10px}

    @media(prefers-reduced-motion:reduce){
      *,*::before,*::after{animation:none!important;transition:none!important}
      html{scroll-behavior:auto}
    }
:root{color-scheme:dark}
body{overflow-x:visible}
[hidden]{display:none!important}
button,input,select{font:inherit}
button{cursor:pointer}
button:disabled{cursor:default;opacity:.4}
:focus-visible{outline:2px solid var(--acc);outline-offset:4px}
.pht-skip{position:fixed;top:8px;left:16px;z-index:100;transform:translateY(-150%);padding:10px 18px;background:var(--acc);color:var(--acc-ink);border-radius:8px}
.pht-skip:focus{transform:translateY(0)}
.pht-hero{padding:34px 0 32px;background:radial-gradient(ellipse at 74% 0%,rgba(92,225,166,.05),transparent 60%)}
.pht-crumbs{display:flex;gap:10px;list-style:none;padding:0;margin:0 0 30px;color:var(--dim);font-size:12px}
.pht-crumbs a{color:var(--dim)}
.pht-crumbs li+li::before{content:'/';margin-right:10px;color:var(--soft)}
.pht-kicker{font-family:var(--mono);font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:var(--acc);margin:0 0 13px}
.pht-hero h1{font-family:var(--display);font-size:clamp(36px,4.5vw,57px);font-weight:800;letter-spacing:-.045em;line-height:1.07;max-width:850px;margin:0 0 16px;color:var(--bright)}
.pht-hero h1 span{color:var(--acc)}
.pht-lede{max-width:650px;color:var(--muted);font-size:17px;line-height:1.6;margin:0}
.pht-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.pht-section-heading h2{font-family:var(--display);font-size:20px;line-height:1.3;letter-spacing:-.025em;margin:0;color:var(--bright)}
.pht-section-heading span{font-family:var(--mono);font-size:10px;color:var(--dim)}
.pht-error{font-size:12px;line-height:1.45;color:#FFAF9B;margin:6px 0 0}
.pht-error:empty{display:none}
.pht-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.pht-faq{max-width:800px;margin:0 auto;padding:0 0 60px}
.pht-faq h2{font-family:var(--display);font-size:30px;letter-spacing:-.03em;margin:0 0 23px}
.pht-faq details{border-top:1px solid var(--card-border);padding:19px 0}
.pht-faq details:last-child{border-bottom:1px solid var(--card-border)}
.pht-faq summary{font-size:15px;font-weight:400;cursor:pointer;list-style:none;display:flex;justify-content:space-between;gap:20px}
.pht-faq summary::-webkit-details-marker{display:none}
.pht-faq summary::after{content:'+';color:var(--dim);font-size:19px;line-height:1.2}
.pht-faq details[open] summary::after{content:'−'}
.pht-faq details p{font-size:14px;line-height:1.75;color:var(--muted);margin:12px 30px 0 0}
:root{--w:1180px}
.pht-faq h2{font-weight:800}
.nav .btn{font-weight:700}
@media(max-width:760px){.foot nav{margin-left:0}}
@media(max-width:400px){.wrap{padding-inline:16px}.pht-hero h1{font-size:34px}}
html{scroll-padding-top:80px}
.foot .copy{color:var(--dim)}
/* ── Habit Formation Calculator ──────────────────────────────────────── */
.hf-hero{padding:28px 0 30px}
.hf-hero .pht-crumbs{margin-bottom:24px;flex-wrap:wrap;gap:5px 10px}
.hf-hero h1{max-width:none;font-size:clamp(34px,4.3vw,58px)}
.hf-hero .pht-lede{max-width:740px;font-size:16px}
.hf-workspace{display:grid;grid-template-columns:minmax(0,430px) minmax(0,1fr);gap:32px;align-items:start;margin-bottom:68px}
.hf-form{border:1px solid var(--card-border);border-radius:18px;background:#0d1016;padding:24px;min-width:0}
.hf-form .pht-section-heading{margin-bottom:22px;gap:6px}
.hf-form .pht-section-heading h2{font-size:21px}
.hf-form .pht-section-heading>span{white-space:nowrap;flex:none}
.hf-controls{border:0;margin:0;padding:0;min-width:0}
.hf-field label,.hf-group legend{font-size:13px;color:var(--mist);display:block;margin-bottom:8px;padding:0}
.hf-field label span{color:var(--dim)}
.hf-field input{width:100%;height:48px;padding:10px 12px;border:1px solid #ffffff24;border-radius:9px;background:#161b23;color:var(--bright);font-size:16px}
.hf-field input:focus{outline:2px solid var(--acc);outline-offset:2px}
.hf-field input[aria-invalid=true]{border-color:#ffaf9b}
.hf-field input::placeholder{color:var(--dim)}
.hf-presets{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.hf-presets button{min-height:34px;padding:6px 11px;border:1px solid var(--field-border);border-radius:999px;background:transparent;color:var(--muted);font-size:12px}
.hf-presets button:hover{border-color:#5ce1a654;color:var(--ink)}
.hf-group{border:0;padding:0;margin:22px 0 0;min-width:0}
.hf-cards,.hf-pills{display:grid;gap:6px}
.hf-pills{grid-template-columns:repeat(3,1fr)}
.hf-days{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}
.hf-cards label,.hf-pills label,.hf-days label{position:relative;cursor:pointer;min-width:0}
.hf-cards input,.hf-pills input,.hf-days input{position:absolute;inset:0;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}
.hf-cards span,.hf-pills span,.hf-days span{display:block;border:1px solid var(--field-border);border-radius:9px;color:var(--muted);transition:background .15s,border-color .15s}
.hf-cards span{padding:10px 12px}
.hf-cards strong{display:block;font-size:14px;font-weight:700;color:var(--ink)}
.hf-cards small{display:block;font-size:12px;line-height:1.5;color:var(--dim)}
.hf-pills span{display:grid;place-items:center;min-height:52px;padding:6px 8px;font-size:12px;line-height:1.35;text-align:center}
.hf-days span{display:grid;place-items:center;min-height:44px;font-size:14px}
.hf-cards input:checked+span,.hf-pills input:checked+span,.hf-days input:checked+span{background:#183229;border-color:#5ce1a64d;color:#a3edcc}
.hf-cards input:checked+span small{color:#8fcab0}
.hf-cards input:focus-visible+span,.hf-pills input:focus-visible+span,.hf-days input:focus-visible+span{outline:2px solid var(--acc);outline-offset:3px}
.hf-start{margin-top:22px}
.hf-privacy{color:var(--dim);font-size:11px;line-height:1.7;margin:16px 0 0;text-align:center}
.hf-output{min-width:0}
.hf-output-label{display:flex;justify-content:space-between;gap:12px;font-family:var(--mono);font-size:10px;color:var(--dim);padding:0 0 15px;letter-spacing:.04em}
.hf-output-label span:first-child{color:var(--mist)}
.hf-result-card{background:linear-gradient(130deg,#13291f,#11191c);border:1px solid #5ce1a638;border-radius:15px;padding:25px}
.hf-result-card .pht-kicker{overflow-wrap:anywhere}
.hf-result-card h2{font-family:var(--display);font-size:clamp(28px,3vw,40px);font-weight:800;line-height:1.1;letter-spacing:-.035em;margin:0 0 12px;color:var(--bright)}
#hf-detail{color:var(--mist);font-size:14px;line-height:1.7;margin:0}
.hf-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;border-top:1px solid #ffffff15;padding-top:18px;margin:20px 0 0}
.hf-metrics div{display:flex;flex-direction:column-reverse;gap:4px;min-width:0}
.hf-metrics dt{font-size:11px;color:var(--muted)}
.hf-metrics dd{font-size:22px;line-height:1.2;font-family:var(--display);font-weight:800;margin:0;overflow-wrap:anywhere}
.hf-notice{padding:12px 14px;border:1px solid #ebc47f66;background:#2c2516;border-radius:10px;color:#f1d6a5;font-size:13px;line-height:1.6;margin:14px 0 0}
.hf-chart{margin:22px 0 0;padding:16px 16px 8px;border:1px solid var(--card-border);border-radius:14px;background:#0b0e13}
.hf-chart figcaption{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;font-size:12px;color:var(--mist);margin-bottom:8px}
.hf-chart-key{display:flex;align-items:center;gap:6px;color:var(--dim);font-size:11px}
.hf-key-line{display:inline-block;width:16px;height:2px;background:var(--acc);border-radius:2px}
.hf-key-band{display:inline-block;width:14px;height:10px;background:#5ce1a62e;border-radius:3px;margin-left:8px}
.hf-chart-box{position:relative}
#hf-chart{display:block;width:100%;height:auto;touch-action:pan-y}
#hf-chart .hf-grid{stroke:#ffffff12;stroke-width:1}
#hf-chart .hf-axis{fill:var(--dim);font-size:11px;font-family:var(--font)}
#hf-chart .hf-myth{stroke:#ffffff38;stroke-width:1;stroke-dasharray:3 4}
#hf-chart .hf-band{fill:#5ce1a62e}
#hf-chart .hf-line{fill:none;stroke:var(--acc);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
#hf-chart .hf-marker{fill:var(--acc);stroke:#0b0e13;stroke-width:2}
#hf-chart .hf-marker-line{stroke:#5ce1a666;stroke-width:1;stroke-dasharray:2 3}
#hf-chart .hf-marker-label{fill:var(--ink);font-size:12px;font-weight:700;font-family:var(--font)}
#hf-chart .hf-hover{stroke:#ffffff55;stroke-width:1}
#hf-chart .hf-hover-dot{fill:var(--bright);stroke:#0b0e13;stroke-width:2}
#hf-chart .hf-hit{fill:transparent;cursor:crosshair}
.hf-tip{position:absolute;top:0;transform:translateX(-50%);margin:0;padding:6px 10px;border-radius:8px;background:#1b212b;border:1px solid var(--card-border);color:var(--ink);font-size:12px;white-space:nowrap;pointer-events:none}
.hf-block{margin-top:24px}
.hf-block h3{font-size:14px;font-weight:400;color:var(--mist);margin:0 0 10px}
.hf-milestones{list-style:none;margin:0;padding:0;border:1px solid var(--card-border);border-radius:12px;overflow:hidden}
.hf-milestones li{display:grid;grid-template-columns:minmax(150px,auto) 1fr;gap:2px 16px;padding:13px 16px;border-bottom:1px solid var(--card-border)}
.hf-milestones li:last-child{border-bottom:0}
.hf-milestones li.is-typical{background:#5ce1a60d}
.hf-when{grid-row:span 2;font-family:var(--mono);font-size:11px;color:var(--dim);padding-top:2px}
.hf-milestones li.is-typical .hf-when{color:var(--acc)}
.hf-milestones strong{font-size:14px;font-weight:700;color:var(--ink)}
.hf-milestones p{margin:0;font-size:13px;line-height:1.6;color:var(--muted)}
.hf-levers{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.hf-levers li{padding:14px 16px;border:1px solid var(--card-border);border-radius:12px;background:#ffffff03}
.hf-levers strong{font-size:14px;font-weight:700;color:var(--ink);margin-right:8px}
.hf-saving{font-size:12px;color:var(--acc)}
.hf-levers p{margin:4px 0 0;font-size:13px;line-height:1.6;color:var(--muted)}
.hf-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-top:22px}
.hf-ics{background:var(--ink);color:var(--bg);font-size:13px;min-height:44px;padding:13px 18px;border-radius:9px}
.hf-ics:hover{background:var(--bright)}
.hf-actions p{font-size:11px;color:var(--dim);margin:0;flex:1 1 200px}
.hf-app-link{font-size:13px;margin:22px 0 0;padding-top:18px;border-top:1px solid var(--card-border);line-height:1.8}
.hf-app-link>span{color:var(--dim);font-size:12px}
.hf-editorial{border-top:1px solid var(--card-border);padding:56px 0 30px}
.hf-prose{max-width:780px;margin:0 auto}
.hf-prose h2{font-family:var(--display);font-size:clamp(26px,3vw,32px);letter-spacing:-.035em;line-height:1.15;font-weight:800;margin:44px 0 16px;color:var(--bright)}
.hf-prose .pht-kicker+h2{margin-top:0}
.hf-prose p{font-size:15px;line-height:1.8;color:var(--muted);margin:0 0 16px}
.hf-prose p strong{color:var(--ink)}
.hf-prose a{text-decoration:underline;text-underline-offset:3px}
.hf-prose sup{line-height:0;font-family:var(--mono);font-size:10px}
.hf-table-scroll{max-width:100%;overflow-x:auto;border:1px solid var(--card-border);border-radius:12px;margin:0 0 18px}
.hf-table-scroll table{width:100%;border-collapse:collapse;font-size:13px;text-align:left;font-variant-numeric:tabular-nums}
.hf-table-scroll th,.hf-table-scroll td{padding:12px 14px;border-bottom:1px solid var(--card-border);line-height:1.5;color:var(--mist);vertical-align:top}
.hf-table-scroll thead th{font-size:11px;font-weight:400;color:var(--dim);background:#11161c;white-space:nowrap}
.hf-table-scroll tbody th{font-weight:700;color:var(--ink);min-width:130px}
.hf-table-scroll tbody tr:last-child>*{border-bottom:0}
.hf-table-scroll small{display:block;font-weight:400;font-size:11px;color:var(--dim)}
.hf-num td{white-space:nowrap}
.hf-num td small{display:inline}
.hf-faq{max-width:780px;padding-top:15px}
.hf-faq summary{min-height:44px;align-items:center}
.hf-faq details{padding:10px 0}
.hf-sources{max-width:780px;margin:0 auto;padding:0 0 50px}
.hf-sources h2{font-family:var(--display);font-size:20px;font-weight:800;margin:0 0 12px}
.hf-sources ol{font-size:12.5px;line-height:1.7;color:var(--dim);padding-left:20px;margin:0}
.hf-sources li{margin-bottom:8px;scroll-margin-top:90px}
.hf-sources a{word-break:break-word}
.hf-related{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;border-top:1px solid var(--card-border);padding:32px 0 60px}
.hf-related>div{grid-column:1/-1;margin-bottom:6px}
.hf-related h2{font-family:var(--display);font-size:27px;letter-spacing:-.035em;line-height:1.15;font-weight:800;margin:0}
.hf-related>a{display:grid;grid-template-columns:1fr auto;padding:22px;border:1px solid var(--card-border);border-radius:12px;color:var(--ink);background:#ffffff02}
.hf-related>a:hover{border-color:#5ce1a654;background:#5ce1a606}
.hf-related>a>span:first-child{font-size:15px;grid-column:1}
.hf-related p{font-size:13px;line-height:1.7;color:var(--muted);margin:8px 0 0;grid-column:1}
.hf-related>a>span:last-child{grid-column:2;grid-row:1;color:var(--acc);margin-left:12px}
.nav .btn{min-height:44px}
@media(max-width:1050px){.hf-workspace{grid-template-columns:minmax(0,390px) minmax(0,1fr);gap:24px}.hf-form{padding:20px}.nav-links{gap:12px}}
@media(max-width:860px){.hf-workspace{grid-template-columns:1fr}.nav-links{display:none}.nav .btn{margin-left:auto}.hf-related{grid-template-columns:1fr}}
@media(max-width:520px){.hf-milestones li{grid-template-columns:1fr}.hf-when{grid-row:auto}.hf-pills{grid-template-columns:1fr}.hf-pills span{min-height:44px}}
@media(max-width:400px){.hf-form{padding:18px 16px}.hf-form .pht-section-heading>span{font-size:8px}.hf-output-label{font-size:8px;gap:8px}.hf-result-card{padding:20px 16px}.hf-metrics{gap:8px}.hf-metrics dd{font-size:18px}.hf-hero .pht-crumbs{font-size:10px}.hf-hero .pht-lede{font-size:15px}.hf-days{gap:4px}}
@media print{.hf-form,.hf-chart-box .hf-tip,header.site,footer,.hf-actions,.pht-skip{display:none!important}.hf-workspace{display:block}}
