/* The dashboard (lib/dashboard.ts). Uses the tokens in styles.css; nothing
   here redefines them. Quiet by design: one band of colour for the flow, small
   tinted tags for kinds and stages, everything else ink on paper. */

.d { padding: 8px 0 40px; }
.d-h { font-size: 1.15rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 700; display: flex; align-items: center; gap: 8px; margin: 0; }
.d-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--sun); color: var(--ink); font-size: 13px; font-weight: 700; }
.d-sample { margin: 4px 0 0; padding: 10px 14px; border-radius: var(--r-ctl); background: var(--sun-soft); color: #5c4400; font-size: 14.5px; }
.d-sample a { font-weight: 600; }

/* header */
.d-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 20px 0 22px; flex-wrap: wrap; }
.d-head h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.8rem); }
.d-head p { margin: 6px 0 0; }

/* needs you */
.d-needs { border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px 20px 8px; background: var(--paper); box-shadow: var(--shadow-card); }
.d-needs.calm { padding-bottom: 20px; box-shadow: none; background: var(--mist); border-color: transparent; }
.d-calm { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; color: var(--ink-2); font-size: 15.5px; }
.d-ok { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--pine); color: #fff; }
.d-ok svg { width: 15px; height: 15px; }
.d-need-list { list-style: none; margin: 10px 0 0; padding: 0; }
.d-need { display: grid; grid-template-columns: 74px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.d-need:first-child { border-top: 0; }
.d-need-what { min-width: 0; display: grid; gap: 1px; }
.d-need-what b { font-weight: 650; font-size: 16.5px; }
.d-need-what span { color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; }
.d-need-what .d-when { font-size: 14px; color: var(--ink); }
.d-need.urgent .d-when { color: var(--err); font-weight: 600; }
.d-need.urgent .d-when .muted { font-weight: 400; }
.d-act { white-space: nowrap; }
.d-act svg { width: 14px; height: 14px; }
.d-more { border-top: 1px solid var(--line); }
.d-more summary { cursor: pointer; padding: 12px 0; font-size: 15px; font-weight: 600; color: var(--pine); list-style: none; }
.d-more summary::-webkit-details-marker { display: none; }
.d-more[open] summary { display: none; }
.d-more .d-need-list { margin: 0; }
.d-more .d-need:first-child { border-top: 0; }
@media (max-width: 600px) {
  .d-needs { padding: 16px 16px 4px; }
  .d-need { grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; padding: 12px 0; }
  .d-need .d-kind { margin-top: 2px; }
  .d-need .d-act { grid-column: 2; justify-self: start; min-height: 36px; padding: 6px 12px; font-size: 14px; margin-top: 6px; }
  .d-need-what b { font-size: 16px; }
  .d-need-what span { font-size: 14.5px; }
}

/* kinds and stages: small tinted tags */
.d-kind, .d-stage { display: inline-block; justify-self: start; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 1.35; white-space: nowrap; background: var(--mist); color: var(--ink-2); }
.k-oa, .s-oa, .s-oa_done { background: #efe8fd; color: var(--oa); }
.k-reply, .k-recruiter { background: #fdecc8; color: #7a5200; }
.k-interview, .s-interview { background: #e3eefc; color: var(--interview); }
.k-offer, .s-offer { background: var(--sun); color: var(--ink); }
.k-rejected, .s-rejected { background: var(--err-soft); color: var(--err); }
.k-send { background: var(--pine); color: #fff; }
.k-setup, .k-form { background: var(--mint); color: var(--pine); }
.k-applied, .s-waiting { background: var(--mint); color: var(--pine); }
.s-no_reply { background: var(--mist); color: var(--slate); }

/* the flow: five steps over one band */
.d-flow { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px 12px 16px; }
.d-steps { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.d-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; padding: 6px 10px 132px; border-radius: 14px; text-decoration: none; color: var(--ink); transition: background-color .15s ease; }
.d-step:hover { background: rgba(14, 74, 59, .05); text-decoration: none; }
.d-step:hover .d-step-l { color: var(--pine); text-decoration: underline; text-underline-offset: 3px; }
.d-step-l { font-size: 14.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.d-step-n { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.d-step-s { font-size: 13px; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.d-band { position: absolute; left: 0; right: 0; bottom: 6px; width: 100%; height: 120px; pointer-events: none; }
.d-rest { margin: 12px 10px 0; font-size: 14.5px; color: var(--slate); display: flex; flex-wrap: wrap; gap: 4px 0; }
.d-rest a { color: var(--ink-2); }
.d-dot { margin: 0 8px; color: var(--line-2); }
@media (max-width: 600px) {
  .d-flow { padding: 14px 4px 12px; }
  .d-step { padding: 4px 4px 92px; }
  .d-band { height: 84px; bottom: 4px; }
  .d-step-l { font-size: 11.5px; letter-spacing: -0.01em; }
  .d-step-n { font-size: 1.55rem; }
  .d-step-s { font-size: 11px; }
}

/* latest + next */
.d-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 18px; }
.d-card { border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px 20px 10px; min-width: 0; }
.d-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.d-card-head a { display: inline-flex; align-items: center; gap: 4px; font-size: 14.5px; color: var(--ink-2); white-space: nowrap; }
.d-card-head svg { width: 14px; height: 14px; }
.d-sending { margin: 8px 0 0; font-size: 14.5px; color: var(--pine); font-weight: 600; }
.d-li { list-style: none; margin: 8px 0 0; padding: 0; }
.d-li li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.d-li li:first-child { border-top: 0; }
.d-li.plain li { grid-template-columns: minmax(0, 1fr) auto; }
.d-li-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.d-li-what b { color: var(--ink); font-weight: 650; }
.d-li-when { font-size: 13.5px; white-space: nowrap; }

/* sub-pages */
.d-subhead { padding: 18px 0 14px; }
.d-subhead h1 { font-size: clamp(1.9rem, 1.5rem + 1.5vw, 2.6rem); margin-top: 10px; }
.d-subhead p { margin: 6px 0 0; }
.d-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--slate); text-decoration: none; }
.d-back:hover { color: var(--ink); }
.d-back svg { width: 14px; height: 14px; }
.d-tools { margin: 4px 0 18px; }
.d-tools a:not(.btn) { color: var(--pine); }
.d .d-h + .d-rows { margin-top: 10px; }
.d-rows + .d-h { margin-top: 28px; }
.d-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.d-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.d-row:first-child { border-top: 0; }
.d-row.past { color: var(--slate); }
.d-row.past b { color: var(--ink-2); font-weight: 600; }
.d-row-main { display: grid; gap: 1px; min-width: 0; }
.d-row-main b { font-weight: 650; }
.d-row-main span { font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; }
.d-row.past .d-row-main span { color: var(--slate); }
.d-meta { font-size: 13.5px !important; color: var(--slate) !important; }
.d-row-side { display: flex; align-items: center; gap: 14px; font-size: 14.5px; text-align: right; flex-wrap: wrap; justify-content: flex-end; }
.d-soon { color: var(--err); }
.d-go { display: inline-flex; align-items: center; gap: 5px; color: var(--pine); font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.d-go svg { width: 13px; height: 13px; }
.d-go.small { font-size: 13px; font-weight: 500; margin-left: 8px; }
.d-empty { margin: 14px 0; padding: 22px; border-radius: var(--r-card); background: var(--mist); color: var(--ink-2); }
@media (max-width: 600px) {
  .d-row { grid-template-columns: 1fr; gap: 6px; padding: 12px 14px; }
  .d-row-side { justify-content: flex-start; text-align: left; }
}

/* applications */
.d-filters { display: grid; gap: 12px; margin: 4px 0 16px; }
.d-filters .chip { text-decoration: none; }
.d-search { width: 100%; max-width: 360px; font: 400 16px/1.3 var(--font); padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--paper); color: var(--ink); }
.d-apps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.d-app { border-top: 1px solid var(--line); }
.d-app:first-child, .d-app[hidden] + .d-app:not([hidden]) { border-top-color: var(--line); }
.d-app summary { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 13px 18px; cursor: pointer; list-style: none; }
.d-app summary::-webkit-details-marker { display: none; }
.d-app summary:hover { background: var(--mist); }
.d-app details[open] summary { background: var(--mist); }
.d-app-main { display: grid; min-width: 0; }
.d-app-main b { font-weight: 650; }
.d-app-main span { font-size: 15px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-app-side { display: grid; justify-items: end; gap: 4px; }
.d-app-more { padding: 6px 18px 16px; background: var(--mist); }
.d-tl { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; font-size: 14.5px; }
.d-tl li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.d-tl .d-kind { min-width: 72px; text-align: center; }
@media (max-width: 600px) { .d-app summary { padding: 12px 14px; } .d-app-more { padding: 6px 14px 14px; } }
