/* 16-week interview plan tracker. Builds on css/style.css tokens. */
.ip {
  --ok: #15803d;
  --ok-soft: #e8f6ed;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --accent-soft: #eaf1fe;
}
@media (prefers-color-scheme: dark) {
  .ip {
    --ok: #4ade80;
    --ok-soft: #13261a;
    --warn: #fbbf24;
    --warn-soft: #2a2110;
    --accent-soft: #16223a;
  }
}

.ip-wrap { max-width: 880px; padding-bottom: 3rem; }
.ip .back { margin: 1.5rem 0 0.5rem; font-size: 0.9rem; }
.ip .back a { color: var(--muted); text-decoration: none; }
.ip .back a:hover { color: var(--accent); }
.ip h1 { margin-bottom: 0.25rem; }
.ip-muted { color: var(--muted); }

.ip-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
  margin: 1rem 0;
}
.ip-card h2 { font-size: 1.1rem; margin: 0 0 0.6rem; }
.ip-card ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.ip-card li { margin: 0.3rem 0; }
.ip-gate { text-align: center; padding: 2.25rem 1.4rem; }
.ip-gate p { max-width: 34rem; margin: 0.5rem auto 1.25rem; color: var(--muted); }
.ip-gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.ip .btn-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.ip .btn-google:hover { border-color: #b5b9be; }
.ip .btn-google svg { width: 18px; height: 18px; }
.ip .btn[disabled] { opacity: 0.6; cursor: default; transform: none; }

/* Sync status */
.ip-sync { font-size: 0.85rem; color: var(--muted); min-height: 1.2em; margin: 0.25rem 0 0; }
.ip-sync.err { color: var(--warn); }

/* Today */
.ip-today { border-color: var(--accent); background: var(--accent-soft); }
.ip-today .eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.35rem; }
.ip-today .task { font-size: 1.02rem; margin: 0 0 0.9rem; }
.ip-today.is-done { border-color: var(--ok); background: var(--ok-soft); }
.ip-today.is-done .eyebrow { color: var(--ok); }

/* Stats */
.ip-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin: 1rem 0; }
.ip-stat { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 0.85rem 1rem; }
.ip-stat b { display: block; font-size: 1.5rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ip-stat span { font-size: 0.82rem; color: var(--muted); }
.ip-stat.warn b { color: var(--warn); }
@media (max-width: 640px) { .ip-stats { grid-template-columns: repeat(2, 1fr); } }

.bar { height: 8px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--border); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.25s ease; }
.bar.ok > i { background: var(--ok); }

/* Phases */
.ip-phases { display: grid; gap: 0.7rem; }
.ip-phase { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 0.75rem; align-items: baseline; }
.ip-phase .name { font-weight: 600; font-size: 0.93rem; }
.ip-phase .name small { font-weight: 400; color: var(--muted); }
.ip-phase .count { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ip-phase .bar { grid-column: 1 / -1; }
.ip-phase .outcome { grid-column: 1 / -1; font-size: 0.82rem; color: var(--muted); }

/* Toolbar */
.ip-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1.75rem 0 0.75rem; }
.ip-toolbar h2 { font-size: 1.2rem; margin: 0 auto 0 0; }
.chip-btn {
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  padding: 0.35rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text);
}
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Weeks */
.ip-week { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); margin: 0.6rem 0; overflow: hidden; }
.ip-week.current { border-color: var(--accent); }
.ip-week > summary {
  list-style: none; cursor: pointer; padding: 0.85rem 1.1rem;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.75rem; align-items: center;
}
.ip-week > summary::-webkit-details-marker { display: none; }
.ip-week > summary:hover { background: var(--bg-soft); }
.ip-week .wk-title { font-weight: 600; }
.ip-week .wk-title::before { content: "▸"; display: inline-block; width: 1em; color: var(--muted); transition: transform 0.15s ease; }
.ip-week[open] .wk-title::before { transform: rotate(90deg); }
.ip-week .wk-meta { grid-column: 1; font-size: 0.82rem; color: var(--muted); padding-left: 1em; }
.ip-week .wk-count { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ip-week .wk-count .bar { width: 64px; }
.ip-week.complete .wk-count { color: var(--ok); font-weight: 600; }
@media (max-width: 520px) { .ip-week .wk-count .bar { display: none; } }

.ip-days { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.ip-day {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.85rem;
  padding: 0.8rem 1.1rem; border-top: 1px solid var(--border);
}
.ip-day:first-child { border-top: 0; }
.ip-day.today { background: var(--accent-soft); }
.ip-day.missed { box-shadow: inset 3px 0 0 var(--warn); }
.ip-day .when { font-size: 0.82rem; font-weight: 600; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.ip-day .text { margin: 0.15rem 0 0.35rem; }
.ip-day.done .text { color: var(--muted); }
.ip-day .tags { display: flex; flex-wrap: wrap; gap: 0.35rem; font-size: 0.76rem; }
.tag { padding: 0.08rem 0.5rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.tag.today { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.tag.missed { border-color: var(--warn); color: var(--warn); font-weight: 600; }
.tag.done { border-color: var(--ok); color: var(--ok); }

/* Mark-complete toggle */
.check {
  width: 30px; height: 30px; padding: 0; margin-top: 0.1rem; flex: none; align-self: start;
  display: grid; place-items: center; cursor: pointer;
  border-radius: 50%; border: 2px solid var(--border); background: var(--card-bg); color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.check:hover { border-color: var(--ok); color: var(--ok); }
.check[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.check svg { width: 16px; height: 16px; }
.check[disabled] { cursor: not-allowed; opacity: 0.5; }
.btn-ok { background: var(--ok); color: #fff; }

.ip-hidden-done .ip-day.done { display: none; }
.ip-hidden-done .ip-week.complete { display: none; }

/* Appendix */
.ip-checklist { list-style: none; padding: 0 !important; }
.ip-checklist li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.75rem; align-items: start; margin: 0.6rem 0 !important; }
.ip-checklist li.done span { color: var(--muted); }
.ip dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.4rem 1rem; }
.ip dt { font-weight: 600; }
.ip dd { margin: 0; color: var(--muted); }
@media (max-width: 520px) { .ip dl { grid-template-columns: 1fr; } .ip dd { margin-bottom: 0.4rem; } }

.ip-leave { margin-top: 2rem; font-size: 0.85rem; color: var(--muted); }
.ip-leave button { font: inherit; color: var(--muted); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.ip-leave button:hover { color: var(--warn); }

@media (prefers-reduced-motion: reduce) { .ip * { transition: none !important; } }

/* ---------- Views: tabs ---------- */
.ip-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin: 1.25rem 0 1.25rem; overflow-x: auto; }
.ip-tab { padding: 0.6rem 0.9rem; font-weight: 600; font-size: 0.95rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ip-tab:hover { color: var(--text); }
.ip-tab[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Day view ---------- */
.ip-dayhead { margin-bottom: 0.75rem; }
.ip-dayhead h2 { margin: 0.1rem 0 0.15rem; font-size: 1.6rem; }
.ip-dayhead .eyebrow, .ip-upnext .eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); margin: 0; }
.ip-dayhead .ip-muted { margin: 0; font-size: 0.92rem; }
.ip-daynav { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.ip-daynav a { text-decoration: none; }

.ip-strip { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font-size: 0.88rem; color: var(--muted); padding: 0.6rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.ip-strip b { color: var(--text); font-variant-numeric: tabular-nums; }
.ip-strip a { color: var(--warn); text-decoration: none; font-weight: 600; }
.ip-strip a b { color: inherit; }
.ip-strip a:hover { text-decoration: underline; }

.ip-card h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.ip-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.ip-card-head .count { font-size: 0.9rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ip-objectives { border-color: var(--accent); }
.ip-objectives.is-done { border-color: var(--ok); }
.ip-objectives .bar { margin: 0.2rem 0 0.8rem; }
.ip-goal { font-size: 1.02rem; margin: 0 0 0.6rem; }
.ip-obj li > div { display: grid; gap: 0.15rem; padding-top: 0.25rem; }
.ip-obj small { color: var(--muted); font-size: 0.84rem; line-height: 1.45; }
.ip-obj li.done span { color: var(--muted); }
.ip-daydone { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.ip-daydone small { color: var(--muted); font-size: 0.82rem; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.ip-objectives > .tags { display: flex; flex-wrap: wrap; gap: 0.35rem; font-size: 0.76rem; }

.ip-section { font-size: 1.1rem; margin: 1.5rem 0 0.25rem; }
.ip-fold { padding: 0; }
.ip-fold > summary { cursor: pointer; padding: 0.9rem 1.2rem; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
.ip-fold > summary::-webkit-details-marker { display: none; }
.ip-fold > summary::before { content: "▸"; color: var(--muted); transition: transform 0.15s ease; }
.ip-fold[open] > summary::before { transform: rotate(90deg); }
.ip-fold > summary .tag { margin-left: auto; font-weight: 500; }
.ip-prose { padding: 0 1.2rem 1rem; }
.ip-prose p { margin: 0 0 0.6rem; }
.ip-prose ul, .ip-prose ol { margin: 0 0 0.6rem; padding-left: 1.2rem; }
.ip-prose li { margin: 0.3rem 0; }
.ip code { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 0.88em; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 5px; padding: 0.05em 0.3em; }

.ip-codewrap { display: flex; flex-direction: column; padding: 0 1.2rem 1.1rem; }
.ip-codewrap pre { margin: 0; max-width: 100%; overflow-x: auto; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem 1rem; line-height: 1.5; }
.ip-codewrap pre code { background: none; border: 0; padding: 0; font-size: 0.8rem; white-space: pre; }
.ip-copy { align-self: flex-end; margin-bottom: 0.4rem; font-size: 0.75rem; padding: 0.2rem 0.7rem; }

.ip-lc { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 0.6rem; }
.ip-lc li { margin: 0 !important; }
.ip-lc details { margin-top: 0.2rem; font-size: 0.88rem; }
.ip-lc summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
.ip-lc details p { margin: 0.3rem 0 0; color: var(--muted); }
.ip-small { font-size: 0.82rem; margin: 0.75rem 0 0; }
.ip-links li { margin: 0.35rem 0; }
:where(.ip-prose, .ip-links, .ip-lc, .ip-note, .ip-callout) a { color: var(--accent); }

.ip-callout { border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; padding: 0.75rem 1rem; margin: 1rem 0; }
.ip-callout.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.ip-callout p { margin: 0.2rem 0 0; }
.ip-note { font-size: 0.9rem; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 0.9rem; margin: 0.75rem 0; }

.ip-upnext { display: grid; gap: 0.2rem; margin: 1.5rem 0 0; padding: 0.9rem 1.1rem; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.ip-upnext:hover { border-color: var(--accent); }

.tag.link { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.tag.link:hover { background: var(--accent-soft); }

/* Phones: keep today's objectives near the top */
@media (max-width: 640px) {
  .ip h1 { font-size: 1.6rem; }
  .ip .lede { font-size: 0.92rem; margin-bottom: 0.25rem; }
  .ip .back { margin-top: 1rem; }
  .ip-tabs { margin: 0.75rem 0 1rem; gap: 0; }
  .ip-tab { padding: 0.55rem 0.55rem; font-size: 0.9rem; }
  .ip-dayhead h2 { font-size: 1.35rem; }
  .ip-card { padding: 1rem 1.05rem; }
  .ip-fold > summary { padding: 0.85rem 1.05rem; }
  .ip-prose, .ip-codewrap { padding-left: 1.05rem; padding-right: 1.05rem; }
}

/* Icons inside buttons (e.g. Mark day complete) */
.ip .btn > svg { width: 18px; height: 18px; flex: none; }
.ip-daydone .btn { white-space: nowrap; }

/* ---------- Job tracker tab (jobs.js) ---------- */
.ip .link-btn, .jb-dialog .link-btn { font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.jb-sync { margin-top: 0; }
.jb-pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; margin: 0.25rem 0 1rem; }
.jb-stage { background: var(--card-bg); border: 1px solid var(--border); border-top: 3px solid var(--muted); border-radius: 10px; padding: 0.55rem 0.75rem; }
.jb-stage b { display: block; font-size: 1.35rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.jb-stage span { font-size: 0.8rem; color: var(--muted); }
.jb-stage.s-applied { border-top-color: var(--accent); }
.jb-stage.s-interviewing { border-top-color: #7c3aed; }
.jb-stage.s-offer { border-top-color: var(--ok); }
.jb-stage.s-rejected { border-top-color: var(--border); }
@media (max-width: 640px) { .jb-pipeline { grid-template-columns: repeat(3, 1fr); } }
.jb-due { color: var(--warn); font-weight: 600; }
.jb-due b { color: inherit !important; }

.jb-toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.5rem 0 0.75rem; }
.jb-toolbar .btn { padding: 0.5rem 1rem; }
.jb-search { flex: 1 1 220px; min-width: 0; font: inherit; font-size: 0.92rem; padding: 0.5rem 0.75rem; border-radius: 10px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); }
.jb-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.jb-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.jb-filters .chip-btn span { font-weight: 500; opacity: 0.75; margin-left: 0.15rem; }

.jb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.jb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem; align-items: start; background: var(--card-bg); border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 12px; padding: 0.85rem 1rem; }
.jb-row.s-applied { border-left-color: var(--accent); }
.jb-row.s-interviewing { border-left-color: #7c3aed; }
.jb-row.s-offer { border-left-color: var(--ok); }
.jb-row.s-rejected, .jb-row.s-withdrawn { border-left-color: var(--border); opacity: 0.75; }
.jb-title { overflow-wrap: anywhere; }
.jb-title span { color: var(--muted); }
.jb-link { font-size: 0.85rem; color: var(--accent); white-space: nowrap; }
.jb-meta { font-size: 0.84rem; color: var(--muted); margin-top: 0.15rem; }
.jb-next { font-size: 0.88rem; margin-top: 0.35rem; }
.jb-next.overdue { color: var(--warn); font-weight: 600; }
.jb-notes { font-size: 0.84rem; color: var(--muted); margin-top: 0.35rem; white-space: pre-line; overflow-wrap: anywhere; }
.jb-actions { display: flex; gap: 0.4rem; align-items: center; }
.jb-actions select { font: inherit; font-size: 0.85rem; padding: 0.3rem 0.4rem; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); }
@media (max-width: 520px) {
  .jb-row { grid-template-columns: 1fr; }
  .jb-actions { flex-direction: row; }
  .jb-actions select { flex: 1; }
}

/* Add / edit dialog (appended to <body>, so it can't use .ip-scoped tokens) */
.jb-dialog {
  --ok: #15803d; --warn: #b45309;
  width: min(640px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card-bg); color: var(--text); box-shadow: var(--shadow-hover);
}
@media (prefers-color-scheme: dark) { .jb-dialog { --warn: #fbbf24; } }
.jb-dialog::backdrop { background: rgba(15, 17, 21, 0.55); }
.jb-form { padding: 1.25rem 1.4rem; }
.jb-form h2 { font-size: 1.2rem; margin: 0 0 1rem; }
.jb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; }
.jb-field { display: grid; gap: 0.25rem; font-size: 0.85rem; font-weight: 600; min-width: 0; }
.jb-field.wide { grid-column: 1 / -1; }
.jb-field input, .jb-field select, .jb-field textarea {
  font: inherit; font-weight: 400; font-size: 0.95rem; width: 100%; padding: 0.5rem 0.65rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.jb-field input:focus, .jb-field select:focus, .jb-field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.jb-field textarea { resize: vertical; }
@media (max-width: 520px) { .jb-grid { grid-template-columns: 1fr; } }
.jb-error { color: var(--warn); font-size: 0.9rem; margin: 0.75rem 0 0; }
.jb-buttons { display: flex; gap: 0.6rem; align-items: center; margin-top: 1.1rem; }
.jb-buttons > span { flex: 1; }
.jb-buttons .btn { padding: 0.55rem 1.1rem; }
.jb-delete { font: inherit; font-size: 0.9rem; color: var(--warn); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; align-self: center; }
