/* assets/tools/habit-ideas.css — Habit Ideas Generator additions. Loads after reading-plan.css (shared shell,
   reading-* layout), reading-time.css (rt-guide) and tool-focus.css (the centred form that opens into a result).
   Every class is hig-* because the tower sprite's <style> reserves bare names page-wide. */
#hig-workspace [hidden],#hig-storey[hidden]{display:none!important}
.hig-trust{margin:18px 0 0;font-family:var(--mono);font-size:12px;letter-spacing:.06em;color:#a3edcc}

/* ── The three-step form ──────────────────────────────────────────── */
.hig-stepper{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;list-style:none;margin:0 0 20px;padding:0}
.hig-stepper button{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:0;border:0;background:none;color:var(--dim);font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;text-align:left;cursor:pointer}
.hig-stepper button::before{content:"";display:block;width:100%;height:3px;border-radius:3px;background:#ffffff14;transition:background .25s}
.hig-stepper button[aria-current="step"]{color:#a3edcc}
.hig-stepper button[aria-current="step"]::before,.hig-stepper button.is-done::before{background:#5CE1A6}
.hig-stepper button.is-done{color:var(--mist)}
.hig-stepper button:disabled{cursor:default;opacity:1}
.hig-stepper button:focus-visible{outline:2px solid var(--acc);outline-offset:4px;border-radius:4px}
.hig-step{border:0;margin:0;padding:0;min-width:0}
.hig-step legend{padding:0;margin:0 0 4px;font-family:var(--display);font-size:22px;line-height:1.2;letter-spacing:-.02em;color:var(--bright);font-weight:800}
.hig-step-n{display:block;font-family:var(--mono);font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--dim);margin-bottom:8px;font-weight:400}
.hig-step>.reading-help{margin:0 0 14px}
.hig-wizard .hig-step:not(.is-active){display:none}
.hig-wizard .hig-step.is-active{animation:hig-in .35s cubic-bezier(.2,.7,.2,1)}
@keyframes hig-in{from{opacity:0;transform:translateX(10px)}to{opacity:1;transform:none}}

/* Category chips: checkboxes, two columns. Time and challenge: radio rows. */
.hig-chips{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.hig-chips label,.hig-rows label{position:relative;cursor:pointer;min-width:0}
.hig-chips input,.hig-rows input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.hig-chips span{display:flex;align-items:center;gap:8px;min-height:44px;padding:8px 10px;border:1px solid var(--field-border);border-radius:9px;color:var(--mist);font-size:13px;line-height:1.25}
.hig-chips span::before{content:"";flex:none;width:14px;height:14px;border:1px solid #ffffff38;border-radius:4px;transition:background .15s,border-color .15s}
.hig-chips input:checked+span{background:#183229;color:#a3edcc;border-color:#5ce1a64d}
.hig-chips input:checked+span::before{background:#5CE1A6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 7.2l2.2 2.2 4.8-4.8' fill='none' stroke='%23052018' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;border-color:#5CE1A6}
.hig-rows{display:grid;gap:6px}
.hig-rows span{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:46px;padding:10px 14px;border:1px solid var(--field-border);border-radius:9px;color:var(--mist);font-size:14px}
.hig-rows span small{font-size:11.5px;color:var(--dim);text-align:right}
.hig-rows input:checked+span{background:#183229;color:#a3edcc;border-color:#5ce1a64d}
.hig-rows input:checked+span small{color:#7fd4ae}
.hig-chips input:focus-visible+span,.hig-rows input:focus-visible+span{outline:2px solid var(--acc);outline-offset:2px}
.hig-chips label:hover span,.hig-rows label:hover span{border-color:#5ce1a640}
.hig-picked{margin:10px 0 0;font-size:12px;color:var(--dim);min-height:18px}
.hig-nav{display:grid;grid-template-columns:auto 1fr;gap:8px;margin-top:22px}
.hig-nav .btn-primary{min-height:48px;font-size:14px;padding:14px 10px;box-shadow:none;border-radius:10px;white-space:normal;line-height:1.35}
.hig-nav>.btn-primary:only-child,.hig-nav>[hidden]+.btn-primary{grid-column:1/-1}
.hig-secondary{min-height:44px;padding:10px 18px;border:1px solid var(--field-border);border-radius:10px;background:transparent;color:var(--mist);font-size:13px;cursor:pointer}
.hig-secondary:hover{border-color:#5ce1a666;color:#a3edcc}
.hig-secondary:focus-visible{outline:2px solid var(--acc);outline-offset:2px}

/* ── Result ───────────────────────────────────────────────────────── */
.hig-head{padding:22px 24px}
.hig-head h2{margin:6px 0 8px;font-size:clamp(24px,3vw,30px)}
.hig-head h2:focus{outline:none}
#hig-detail{color:var(--mist);font-size:14px;line-height:1.7;margin:0}
#hig-detail a{text-decoration:underline;text-underline-offset:3px}
.hig-list{list-style:none;margin:14px 0 0;padding:0;display:grid;gap:10px}
.hig-card{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 64px;gap:4px 16px;padding:18px 18px 16px 20px;border:1px solid var(--card-border);border-radius:14px;background:#0d1116;animation:hig-up .5s cubic-bezier(.2,.7,.2,1) backwards}
.hig-card.is-saved{border-color:#5ce1a64d;background:linear-gradient(130deg,#132620,#0d1116 60%)}
.hig-card.is-new{animation:hig-swap .5s cubic-bezier(.2,.7,.2,1)}
.hig-list>.hig-card:nth-child(2){animation-delay:.06s}
.hig-list>.hig-card:nth-child(3){animation-delay:.12s}
.hig-list>.hig-card:nth-child(4){animation-delay:.18s}
.hig-list>.hig-card:nth-child(5){animation-delay:.24s}
@keyframes hig-up{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes hig-swap{from{opacity:0;transform:scale(.98)}to{opacity:1;transform:none}}
.hig-card>*{grid-column:1}
.hig-cat{font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:#7fd4ae;margin:0}
.hig-name{font-family:var(--display);font-size:20px;line-height:1.25;letter-spacing:-.02em;color:var(--bright);margin:2px 0 4px;font-weight:800}
.hig-desc{margin:0;font-size:13.5px;line-height:1.6;color:var(--muted)}
.hig-meta{display:flex;flex-wrap:wrap;gap:6px;list-style:none;margin:12px 0 0;padding:0}
.hig-meta li{display:inline-flex;align-items:center;gap:6px;padding:4px 9px;border-radius:99px;background:#ffffff0a;font-size:12px;color:var(--mist);line-height:1.3}
.hig-meta li.hig-week{background:#5ce1a614;color:#a3edcc}
.hig-dots{display:inline-flex;gap:2px}
.hig-dots i{width:5px;height:5px;border-radius:50%;background:#ffffff26}
.hig-dots i.on{background:#5CE1A6}
.hig-easier{margin:12px 0 0;font-size:13px;line-height:1.55;color:var(--mist)}
.hig-easier b{color:#a3edcc;font-weight:400}
.hig-stretch{margin:8px 0 0;font-size:12px;color:#f3c98b}
.hig-why{margin:6px 0 0}
.hig-why summary{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-size:12.5px;color:var(--dim);list-style:none;min-height:32px}
.hig-why summary::-webkit-details-marker{display:none}
.hig-why summary::after{content:"+";font-size:15px;line-height:1}
.hig-why[open] summary::after{content:"−"}
.hig-why summary:focus-visible{outline:2px solid var(--acc);outline-offset:2px;border-radius:4px}
.hig-why ul{margin:4px 0 0;padding-left:18px;font-size:13px;line-height:1.7;color:var(--muted)}
.hig-tower{grid-column:2;grid-row:1/span 6;align-self:center;justify-self:center;width:64px;height:90px;position:relative;overflow:hidden;opacity:.92;pointer-events:none}
.hig-tower img{position:absolute;left:50%;bottom:0;height:100%;width:auto;transform:translateX(-50%);filter:drop-shadow(0 6px 12px #0008)}
.hig-card-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:8px;margin-top:10px;padding-top:10px;border-top:1px dashed var(--card-border)}
.hig-card-actions button{display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:7px 12px;border:1px solid var(--field-border);border-radius:9px;background:transparent;color:var(--mist);font-size:12.5px;cursor:pointer}
.hig-card-actions button:hover{border-color:#5ce1a666;color:#a3edcc}
.hig-card-actions button:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
.hig-card-actions svg{width:15px;height:15px;flex:none}
.hig-save[aria-pressed="true"]{background:#183229;border-color:#5ce1a666;color:#a3edcc}
.hig-save[aria-pressed="true"] svg path{fill:currentColor}

.hig-tools{margin-top:16px;padding:18px;border:1px solid var(--card-border);border-radius:14px;background:#0b0e13}
.hig-tools-row{display:flex;flex-wrap:wrap;gap:8px}
#hig-again{background:#183229;border-color:#5ce1a64d;color:#a3edcc}
#hig-again:hover{background:#1d3d31}
.hig-scope{margin:12px 0 0;font-size:12.5px;color:var(--dim)}
#hig-action-status{margin:8px 0 0;font-size:12.5px;color:#a3edcc;min-height:18px}
#hig-action-status:empty{display:none}

.hig-saved{margin-top:16px;padding:18px;border:1px solid #5ce1a633;border-radius:14px;background:#5ce1a608}
.hig-saved-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.hig-saved h3{font-family:var(--display);font-size:18px;margin:0;letter-spacing:-.01em}
.hig-saved h3 span{font-family:var(--mono);font-size:12px;color:var(--dim);font-weight:400;margin-left:6px}
.hig-saved ul{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:6px}
.hig-saved li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 8px 8px 12px;border-radius:9px;background:#ffffff06}
.hig-saved li span{font-size:13.5px;color:var(--ink);min-width:0}
.hig-saved li small{display:block;font-size:11.5px;color:var(--dim);margin-top:2px}
.hig-saved li button{flex:none;min-height:34px;padding:4px 10px;border:0;border-radius:8px;background:transparent;color:var(--dim);font-size:12px;cursor:pointer}
.hig-saved li button:hover{color:#ffb4a6;background:#ffffff08}
.hig-saved .reading-help{margin:10px 0 0}
.hig-link-btn{border:0;background:none;padding:6px 0;color:var(--dim);font-size:12px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.hig-shared{margin:0 0 10px;padding:12px 14px;border-radius:10px;background:#6bc5ff12;border:1px solid #6bc5ff33;font-size:13px;color:var(--mist)}
.hig-shared button{margin-left:6px;border:0;background:none;color:#a3edcc;text-decoration:underline;text-underline-offset:3px;cursor:pointer;font-size:13px;padding:0}

/* ── Storey card ─────────────────────────────────────────────────── */
#hig-storey{margin:0 0 64px}
.hig-storey-start{font-size:14px;color:var(--mist)}
.hig-storey-start b{color:var(--bright);font-weight:700}
#hig-storey .btn-primary{margin:0 0 18px}

/* ── Habit library (server-rendered, built by scripts/build-habit-ideas-library.mjs) ─ */
.hig-library{border-top:1px solid var(--card-border);padding:56px 0 40px}
.hig-library>h2{font-family:var(--display);font-size:32px;letter-spacing:-.035em;line-height:1.15;font-weight:800;margin:0 0 12px}
.hig-library-lede{max-width:760px;font-size:14px;line-height:1.8;color:var(--muted);margin:0 0 22px}
.hig-library-nav{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 34px}
.hig-library-nav a{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:6px 12px;border:1px solid var(--field-border);border-radius:99px;font-size:12.5px;color:var(--mist)}
.hig-library-nav a:hover{border-color:#5ce1a666;color:#a3edcc}
.hig-library-nav span{font-family:var(--mono);font-size:10px;color:var(--dim)}
.hig-group{padding:26px 0;border-top:1px solid var(--card-border);scroll-margin-top:80px}
.hig-group h3{font-family:var(--display);font-size:22px;letter-spacing:-.02em;margin:0 0 6px;font-weight:800}
.hig-group>p{margin:0 0 16px;font-size:13.5px;color:var(--dim);max-width:720px}
.hig-group>p a{color:var(--mist);text-decoration:underline;text-underline-offset:3px}
.hig-ideas{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.hig-ideas li{padding:14px 16px;border:1px solid var(--card-border);border-radius:12px;background:#ffffff02}
.hig-ideas strong{display:block;font-size:14.5px;font-weight:700;color:var(--ink);line-height:1.35}
.hig-ideas span{display:block;margin-top:4px;font-family:var(--mono);font-size:10.5px;letter-spacing:.02em;color:#7fd4ae}
.hig-ideas p{margin:6px 0 0;font-size:12.5px;line-height:1.6;color:var(--muted)}
.hig-more-ideas{margin-top:10px}
.hig-more-ideas summary{display:inline-flex;align-items:center;gap:8px;min-height:40px;cursor:pointer;font-size:13px;color:var(--mist);list-style:none}
.hig-more-ideas summary::-webkit-details-marker{display:none}
.hig-more-ideas summary::after{content:"+";color:var(--acc)}
.hig-more-ideas[open] summary::after{content:"−"}
.hig-more-ideas summary:focus-visible{outline:2px solid var(--acc);outline-offset:2px;border-radius:4px}
.hig-more-ideas .hig-ideas{margin-top:8px}

.hig-sources{max-width:780px;margin:0 auto;padding:0 0 50px}
.hig-sources h2{font-family:var(--display);font-size:20px;font-weight:800;margin:0 0 12px}
.hig-sources ol{font-size:12.5px;line-height:1.7;color:var(--dim);padding-left:20px;margin:0}
.hig-sources li{margin-bottom:8px;scroll-margin-top:90px}
.hig-sources a{word-break:break-word}
.rt-guide p strong{color:var(--ink);font-weight:700}
.hig-related{grid-template-columns:repeat(3,1fr)}

@media(max-width:1050px){.hig-ideas{grid-template-columns:1fr 1fr}}
@media(max-width:860px){.hig-related{grid-template-columns:1fr 1fr}}
@media(max-width:600px){
  .hig-ideas{grid-template-columns:1fr}
  .hig-related{grid-template-columns:1fr}
  .hig-card{grid-template-columns:minmax(0,1fr) 48px;padding:16px 14px 14px 16px;gap:4px 10px}
  .hig-tower{width:48px;height:68px}
  .hig-name{font-size:18px}
  .hig-head{padding:20px 16px}
  .hig-library>h2{font-size:27px}
}
@media(max-width:380px){.hig-chips{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.hig-card,.hig-wizard .hig-step.is-active{animation:none!important}}
