/* AcademicDude interactive tools.
   Uses the design tokens from style.css (surfaces, lines, ink, accent), so every
   tool follows the light and dark themes. Form controls, buttons, statuses and
   notices are styled in style.css; this file adds tool layout only. */

.tool-app { display: grid; gap: 22px; }
.tool-app > * { min-width: 0; }
.tool-panel {
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.tool-output:empty { display: none; }
.tool-result { background: var(--accent-softer); border-color: var(--accent-line); }
.tool-h { font-size: clamp(23px, 3.2vw, 30px); margin-bottom: 16px; }
.tool-h3 { font-size: 21px; margin: 26px 0 10px; }
.tool-h4 { font-family: var(--font-body); font-size: 16px; font-weight: 600; margin: 20px 0 6px; letter-spacing: 0; }
.tool-panel > .tool-h3:first-child { margin-top: 0; }
.tool-app .field-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.tool-app .field-hint { margin: 0; }
.tool-app p { overflow-wrap: anywhere; }
.tool-app .field-error { margin: 0; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; }
.tool-actions + .tool-actions { margin-top: 12px; }
.tool-actions .btn[disabled], .sec-rm[disabled], .eo-rm[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.copy-status { font-size: 14px; font-weight: 700; }
.copy-status:empty { display: none; }
.copy-status::before { content: "✓ "; color: var(--orange); }
.tool-copy-buffer { position: fixed; top: 0; left: -9999px; opacity: 0; }
.tool-summary { font-size: 16.5px; font-weight: 600; margin: 0 0 14px; }
.tool-status { font-size: 14.5px; font-weight: 700; margin: 0 0 10px; }
.tool-status:empty { display: none; }
.tool-counter { margin: 0; font-size: 13.5px; font-weight: 700; text-align: right; }
.tool-counter.is-warning { color: var(--charcoal); text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
.tool-list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 15.5px; line-height: 1.55; }
.tool-list li::marker { color: var(--orange); }
.tool-warnings, .tool-warning {
  margin: 0 0 16px; padding: 12px 16px 12px 34px; border-radius: 12px;
  background: var(--white); border: 1.5px solid var(--orange); font-size: 15px;
}
.tool-warning { padding-left: 16px; }
.tool-total { margin: 10px 0 0; font-size: 14.5px; font-weight: 700; }
.tool-total:empty { display: none; }
.tool-total.is-warning { padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--orange); background: var(--white); }
.tool-total.is-warning::before { content: "! "; color: var(--orange); font-weight: 700; }
.tool-empty { margin: 0; padding: 22px; text-align: center; border: 1.5px dashed var(--accent-line); border-radius: 14px; background: var(--paper, var(--o-06)); }

/* Stats */
.tool-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px; margin: 0 0 8px; }
.tool-stats > div { padding: 12px 14px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); }
.tool-stats dt { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.tool-stats dd { margin: 2px 0 0; font-family: var(--font-head); font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; border-radius: 14px; border: 1px solid var(--line); background: var(--white); }
.table-scroll:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; }
.tool-table th, .tool-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tool-table thead th { background: var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line-strong); }
.tool-table tbody th { font-weight: 700; }
.tool-table td { white-space: nowrap; }
.tool-table tbody tr:nth-child(even) { background: var(--o-06); }
.tool-table tfoot th, .tool-table tfoot td { font-weight: 700; border-top: 2px solid var(--orange); border-bottom: 0; }
.tool-table tr.is-buffer { background: var(--o-10); }
.lm-table { min-width: 980px; }
.lm-table td, .lm-table tbody th { min-width: 130px; max-width: 260px; white-space: pre-wrap; overflow-wrap: anywhere; }
.lm-actions { white-space: nowrap; min-width: 0 !important; }
.lm-actions .btn { margin: 0 6px 6px 0; }
.lm-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 6px 20px; }
.lm-head .tool-h { margin-bottom: 12px; }
.lm-filter { min-width: min(100%, 240px); margin-bottom: 12px; }

/* Clarity checker */
.cc-highlight {
  white-space: pre-wrap; overflow-wrap: anywhere; padding: 18px; border-radius: 14px;
  background: var(--white); border: 1px solid var(--line); font-size: 16.5px; line-height: 1.9;
}
.cc-highlight mark, .cc-legend mark { color: var(--charcoal); border-radius: 3px; padding: 1px 0; }
mark.issue-long { background: transparent; box-shadow: inset 0 -3px 0 var(--o-50); padding: 0; }
mark.issue-long.is-very-long { box-shadow: inset 0 -3px 0 var(--orange); }
mark.issue-wordy { background: var(--o-30); text-decoration: underline solid var(--orange) 2px; text-underline-offset: 4px; }
mark.issue-vague { background: var(--o-18); text-decoration: underline dotted var(--charcoal) 2px; text-underline-offset: 4px; }
mark.issue-passive { background: var(--o-10); text-decoration: underline dashed var(--orange) 2px; text-underline-offset: 4px; }
mark.issue-informal { background: var(--o-50); text-decoration: underline wavy var(--charcoal) 1px; text-underline-offset: 4px; }
mark.issue-long mark { padding: 1px 0; }
.cc-legend { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; font-weight: 600; }
.cc-legend li { display: inline-flex; align-items: center; gap: 6px; }
.cc-legend mark { padding: 0 4px; font-weight: 700; }
.cc-notes .tool-list { margin-bottom: 4px; }
.tool-planned { border-style: dashed; background: var(--paper, var(--o-06)); }
.tool-planned-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.tool-planned-head .tool-h { margin: 0; }
.tool-planned p { margin: 0 0 10px; font-size: 15.5px; }
.tool-planned a, .tool-result a, .sa-links a { font-weight: 700; text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 3px; }

/* Progress (checklist) */
.tool-progress-wrap { margin: 4px 0 18px; }
.tool-progress { height: 12px; border-radius: 999px; background: var(--o-18); overflow: hidden; }
.tool-progress-bar { display: block; height: 100%; width: 0; background: var(--orange); border-radius: inherit; transition: width .35s var(--ease, ease); }
.sf-opt label:active, .sa-opt label:active { transform: scale(.98); }
.tool-progress-text { margin: 6px 0 0; font-size: 14.5px; font-weight: 700; }
.pc-groups { display: grid; gap: 14px; }
.pc-group { margin: 0; padding: 14px 16px 6px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.pc-group legend { padding: 0 6px; font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.pc-pass { display: inline-block; padding: 2px 8px; margin-right: 4px; border-radius: 999px; background: var(--charcoal); color: var(--white); font-size: 11.5px; letter-spacing: .04em; vertical-align: 2px; }
.pc-item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pc-item:last-child { border-bottom: 0; }
.pc-item input, .sa-opt input, .check-field input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--orange); cursor: pointer; }
.pc-item label { font-size: 15.5px; line-height: 1.5; cursor: pointer; }
.pc-item input:checked + label { text-decoration: line-through; text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
.tool-app .check-field { display: grid; align-self: center; margin-top: 20px; }

/* Section editors (word count, thesis, presentation) */
.sec-editor { display: grid; gap: 10px; }
.sec-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 130px auto; gap: 10px; align-items: start; }
.sec-row.has-note { grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1.2fr) 100px auto; }
.sec-head { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; padding: 0 2px; }
.sec-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sec-cell { min-width: 0; }
.sec-cell input {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--white); color: var(--charcoal); font: inherit; font-size: 16px;
}
.sec-cell input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sec-hint { display: block; font-size: 12.5px; margin-top: 3px; }
.sec-out { display: block; padding-top: 12px; font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.sec-actions .btn { min-height: 46px; }

/* Essay outline */
.eo-points { display: grid; gap: 14px; }
.eo-point { margin: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.eo-point legend { padding: 0 6px; font-family: var(--font-head); font-weight: 600; }
.eo-point .field { margin-bottom: 12px; }
.eo-point .field textarea { min-height: 80px; }
.outline { margin: 0 0 14px; padding-left: 1.4em; display: grid; gap: 14px; }
.outline > li::marker { font-family: var(--font-head); font-weight: 600; color: var(--orange); }
.outline > li > strong { font-family: var(--font-head); }
.outline-words { font-size: 14px; font-weight: 700; }
.outline ul { margin: 6px 0 0; padding-left: 1.1em; display: grid; gap: 4px; font-size: 15.5px; }
.outline ul li::marker { color: var(--orange); }
.tool-q { margin: 0 0 14px; }

/* Research questions */
.rq-list { margin: 0 0 10px; padding-left: 1.4em; display: grid; gap: 10px; }
.rq-list li { padding: 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; font-weight: 600; font-size: 16.5px; }
.rq-list li::marker { font-weight: 700; color: var(--orange); }
.rq-criteria { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rq-criteria li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 2px 12px; padding: 10px 12px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); font-size: 15px; }
.rq-criteria li > span:last-child { grid-column: 2; }
.rq-criteria li.is-check { border-color: var(--orange); }
.rq-flag { grid-row: span 2; align-self: start; justify-self: start; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line-strong); background: var(--o-10); }
.is-check .rq-flag { background: var(--orange); border-color: var(--orange); color: var(--charcoal); }

/* Citation formatter */
.cf-note { margin-bottom: 20px; }
.cf-ref { margin: 0 0 6px; padding: 16px 18px; background: var(--white); border-radius: 12px; border-left: 4px solid var(--orange); font-size: 16.5px; line-height: 1.7; overflow-wrap: anywhere; padding-left: 18px; text-indent: 0; }
.cf-intext { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; font-size: 15.5px; }

/* Thesis planner */
.tool-details { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.tool-details summary { cursor: pointer; padding: 12px 16px; font-weight: 700; }
.tool-details summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 12px; }
.tool-weeks { margin: 0; padding: 0 16px 14px 2.4em; display: grid; gap: 6px; font-size: 14.5px; }
.tool-weeks li::marker { color: var(--orange); }

/* Self-assessment */
.sa-list { display: grid; gap: 12px; margin-top: 14px; }
.sa-item { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.sa-item.is-missing { border-color: var(--charcoal); border-width: 2px; }
.sa-item legend { padding: 0 6px; font-weight: 700; font-size: 15.5px; line-height: 1.45; float: left; width: 100%; margin-bottom: 10px; }
.sa-item legend + * { clear: both; }
.sa-num { font-family: var(--font-head); font-weight: 600; color: var(--charcoal); }
.sa-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sa-opt { position: relative; }
.sa-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sa-opt label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; padding: 8px 4px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--white); font-size: 13px; font-weight: 600; text-align: center; cursor: pointer;
  transition: transform .2s var(--ease, ease);
}
.sa-v { font-family: var(--font-head); font-weight: 600; font-size: 18px; line-height: 1; }
.sa-opt label:hover { border-color: var(--orange); background: var(--o-06); }
.sa-opt input:checked + label { background: var(--orange); border-color: var(--orange); color: var(--charcoal); font-weight: 700; }
.sa-opt input:focus-visible + label { outline: 3px solid var(--charcoal); outline-offset: 2px; }
.sa-bars { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.sa-bars li { display: grid; grid-template-columns: 96px minmax(0, 1fr) 96px; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.sa-bar { height: 12px; border-radius: 999px; background: var(--o-18); overflow: hidden; }
.sa-bar span { display: block; height: 100%; background: var(--orange); border-radius: inherit; }
.sa-priorities { margin: 0 0 14px; padding-left: 1.4em; display: grid; gap: 12px; }
.sa-priorities li { padding: 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.sa-priorities li::marker { font-weight: 700; color: var(--orange); }
.sa-priorities p { margin: 6px 0 0; font-size: 15px; }
.sa-yours { font-size: 14px; }
.tool-result h2[tabindex="-1"]:focus { outline: none; }

@media (max-width: 640px) {
  .sec-row, .sec-row.has-note { grid-template-columns: minmax(0, 1fr) 84px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
  .sec-head { display: none; }
  .sec-row .sec-label { position: static; width: auto; height: auto; margin: 0 0 4px; overflow: visible; clip: auto; white-space: normal; display: block; font-size: 12.5px; font-weight: 700; }
  .sec-row, .sec-row.has-note { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sec-name, .sec-note { grid-column: 1 / -1; }
  .sec-val { grid-column: 1 / 2; }
  .sec-result { grid-column: 2 / 3; align-self: end; }
  .sec-out { padding: 0 0 12px; }
  .sec-actions { grid-column: 1 / -1; justify-self: end; }
  .sa-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-bars li { grid-template-columns: 82px minmax(0, 1fr) 82px; font-size: 13px; }
  .rq-criteria li { grid-template-columns: minmax(0, 1fr); }
  .rq-criteria li > span:last-child { grid-column: 1; }
  .rq-flag { grid-row: auto; }
  .tool-actions .btn { flex: 1 1 auto; }
  .tool-app .check-field { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tool-progress-bar, .sa-opt label, .sec-cell input { transition: none; }
}

/* Academic support finder */
.sf-progress { margin: 0 0 18px; }
.sf-progress .tool-progress-text { margin: 0 0 8px; }
.sf-q { margin: 0; padding: 0; border: 0; min-width: 0; }
.sf-legend { padding: 0; float: left; width: 100%; font-family: var(--font-head); font-weight: 500; letter-spacing: -.01em; line-height: 1.2; }
.sf-legend + * { clear: both; }
.sf-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.sf-opt { position: relative; min-width: 0; }
.sf-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sf-opt label {
  display: flex; align-items: center; gap: 12px; min-height: 56px; height: 100%; padding: 12px 16px;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--white); color: var(--charcoal);
  font-size: 15.5px; font-weight: 700; line-height: 1.35; cursor: pointer; transition: transform .2s var(--ease, ease);
}
.sf-opt label::before {
  content: ""; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--charcoal); background: var(--white); box-shadow: inset 0 0 0 3px var(--white);
}
.sf-opt label:hover { border-color: var(--orange); background: var(--o-06); }
.sf-opt input:checked + label { border-color: var(--orange); border-width: 2px; background: var(--o-18); }
.sf-opt input:checked + label::before { background: var(--orange); border-color: var(--charcoal); }
.sf-opt input:focus-visible + label { outline: 3px solid var(--charcoal); outline-offset: 2px; }
.sf-nav { justify-content: space-between; }
.sf-nav .btn { min-height: 48px; }
.sf-nav [data-action="back"][hidden] + .btn { margin-left: auto; }
#sf-error { margin: 14px 0 0; }
.sf-privacy { margin-top: 14px !important; }
.sf-answers { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; font-size: 15px; }
.sf-answers span { font-weight: 600; }
.sf-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.sf-card { display: grid; gap: 4px; align-content: start; padding: 14px 16px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); min-width: 0; }
.sf-kind { font-size: 12.5px; font-weight: 600; color: var(--accent-text); }
.sf-link { display: inline-block; padding: 4px 0; font-family: var(--font-head); font-size: 19px; font-weight: 500; line-height: 1.3; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.sf-why { font-size: 13.5px; line-height: 1.45; }
.sf-ask { margin: 22px 0 0; font-size: 15.5px; }
.sf-how p { margin: 0; padding: 0 16px 14px; font-size: 14.5px; }
.sf-result .tool-actions .btn { min-height: 48px; }

/* Academic project planner */
.ap-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ap-stage {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) 104px auto; gap: 10px; align-items: end;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--white);
}
.ap-num { align-self: center; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--charcoal); color: var(--white); font-family: var(--font-head); font-weight: 600; font-size: 14px; }
.tool-app .ap-cell { margin: 0; gap: 4px; }
.tool-app .ap-cell > label { font-size: 13px; }
.ap-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ap-btns .btn, .ap-save .btn, .ap-stages ~ .tool-actions .btn { min-height: 44px; }
.ap-btns .btn { padding: 0 12px; }
.ap-btns .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.ap-stage .field-error { grid-column: 1 / -1; }
.ap-save { margin-top: 24px; padding: 14px 16px; border: 1.5px dashed var(--accent-line); border-radius: 14px; background: var(--paper, var(--o-06)); }
.ap-save .tool-actions { margin-top: 10px; }
.ap-save .tool-status { margin: 10px 0 0; }
.ap-check { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.ap-check input { width: 24px; height: 24px; margin: 0; accent-color: var(--orange); cursor: pointer; flex: none; }
.ap-check label { font-weight: 700; cursor: pointer; padding: 8px 0; }
#ap-error { margin: 18px 0 0; }
.ap-today-line { margin: 0 0 14px; padding: 10px 14px; border-left: 4px solid var(--orange); background: var(--white); border-radius: 0 12px 12px 0; font-weight: 700; font-size: 15px; }
.ap-timeline { margin: 0 0 18px; padding-left: 1.6em; display: grid; gap: 8px; }
.ap-timeline li { padding: 10px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.ap-timeline li::marker { font-family: var(--font-head); font-weight: 600; color: var(--charcoal); }
.ap-timeline li.is-current { border-color: var(--orange); border-width: 2px; }
.ap-timeline strong { font-family: var(--font-head); }
.ap-dates { display: block; font-size: 14.5px; margin-top: 2px; }
.ap-badge { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px; background: var(--orange); color: var(--charcoal); font-size: 12px; font-weight: 700; vertical-align: 2px; }
.ap-gantt { display: grid; gap: 6px; margin: 0 0 8px; padding: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.ap-g-row { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr); gap: 10px; align-items: center; font-size: 13px; font-weight: 700; }
.ap-g-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-g-track { position: relative; height: 16px; border-radius: 999px; background: var(--o-10); }
.ap-g-bar { position: absolute; top: 0; bottom: 0; min-width: 4px; border-radius: 999px; background: var(--o-50); }
.ap-g-row.is-current .ap-g-bar { background: var(--orange); }
.ap-g-today { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--charcoal); }
.ap-g-axis { display: flex; justify-content: space-between; gap: 10px; margin-left: calc(min(170px, 40%) + 10px); font-size: 12px; font-weight: 700; }
.ap-g-today-key::before { content: ""; display: inline-block; width: 2px; height: 10px; margin-right: 5px; background: var(--charcoal); vertical-align: -1px; }
.ap-milestones { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.ap-milestones li { padding-left: 18px; position: relative; }
.ap-milestones li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 8px; height: 8px; transform: rotate(45deg); background: var(--orange); }
.ap-result .tool-actions .btn { min-height: 48px; }

@media (max-width: 640px) {
  .ap-stage { grid-template-columns: 30px minmax(0, 1fr); align-items: start; }
  .ap-num { margin-top: 26px; }
  .ap-weight, .ap-btns { grid-column: 2 / -1; }
  .ap-btns .btn { flex: 1 1 0; }
  .ap-g-row { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .ap-g-axis { margin-left: 0; }
  .sf-nav .btn { flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sf-opt label { transition: none; }
}

@media print {
  html.ap-printing body * { visibility: hidden; }
  html.ap-printing #ap-output, html.ap-printing #ap-output * { visibility: visible; }
  html.ap-printing #ap-output { position: absolute; left: 0; top: 0; width: 100%; }
  html.ap-printing #ap-output .tool-actions, html.ap-printing .ap-stale { display: none; }
  html.ap-printing .ap-result { border: 0; padding: 0; background: var(--white); }
  html.ap-printing .ap-gantt, html.ap-printing .ap-g-bar, html.ap-printing .ap-g-track, html.ap-printing .ap-g-today, html.ap-printing .ap-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html.ap-printing .ap-timeline li { break-inside: avoid; }
}

/* Citation learning guide */
.cite-learn { margin-top: 40px; padding-top: 28px; border-top: 1.5px dashed var(--line-strong); }
.cite-learn > p { max-width: 720px; }
.cl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.cl-card { padding: 18px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.cl-card h3 { font-size: 17px; margin-bottom: 8px; }
.cl-card p { font-size: 15px; line-height: 1.55; }
.cl-ex { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--orange); background: var(--white); border-radius: 0 10px 10px 0; }
.cl-note { font-size: 14.5px; }
.cl-note a { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 3px; font-weight: 700; }
@media (max-width: 900px) { .cl-grid { grid-template-columns: minmax(0, 1fr); } }
