/* GoPlan smart suggestions: planner header buttons, the preview dialog, the exchange line in "Suggested", the Undo toast.
   Colours come from the tokens in styles.css (:root), so light, dark and high-contrast modes all work. */

/* Header buttons: next to Export, top right of the planner (list view and flowchart view) */
.sg-tools{display:flex;flex-wrap:wrap;gap:8px;align-self:flex-start;margin-top:6px;margin-inline-start:auto}
.sg-tools svg{width:18px;height:18px;flex:none}
.page-head .sg-tools+.io-tools{margin-inline-start:0}
@media (max-width:640px){
  .sg-tools{width:100%;margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .sg-tools .btn{min-height:44px;justify-content:center;text-align:center;line-height:1.15;padding:4px 10px;white-space:normal}
}

/* Preview dialog */
.fc-modal.sg-dlg{width:min(720px,100%)}
.sg-body{display:grid;gap:12px}
.sg-lead{color:var(--ink)}
.sg-lead b{white-space:nowrap}
.sg-ex{background:var(--surface-2);border-radius:12px;padding:10px 12px;font-weight:700}
.sg-term{border:1px solid var(--line);border-radius:14px;padding:12px 14px;background:var(--surface)}
.sg-term-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:4px 12px}
.sg-term-head h3{font-size:1.02rem}
.sg-total{font-weight:700;font-size:.92rem;color:var(--ink)}
.sg-total small{color:var(--muted);font-weight:400;font-size:.85rem}
.sg-total.low{color:var(--rose)}
.sg-meter{margin:8px 0 2px}
.sg-list{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:6px}
.sg-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:baseline;gap:2px 10px;padding:8px 12px;border-radius:10px;background:var(--surface-2);border-inline-start:4px solid var(--c,var(--teal))}
.sg-code{font-weight:900;white-space:nowrap}
.sg-name{min-width:0;overflow-wrap:anywhere}
.sg-cr{color:var(--muted);font-size:.88rem;white-space:nowrap}
.sg-why{grid-column:1/-1;color:var(--muted);font-size:.88rem;line-height:1.35}
.sg-row.kept{background:transparent;border:1px dashed var(--line);border-inline-start:4px solid var(--c,var(--line))}
.sg-grad{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;background:var(--surface-2);border-radius:12px;padding:10px 12px}
.sg-grad b{font-weight:900}
.sg-change{color:var(--muted)}
.sg-grad.good .sg-change{color:var(--ok);font-weight:700}
.sg-grad.bad .sg-change{color:var(--rose);font-weight:700}
.sg-notes{border:1px solid var(--line);border-radius:14px;padding:12px 14px}
.sg-notes h3{font-size:1rem;margin-bottom:6px}
.sg-notes ul{margin:0;padding-inline-start:20px;display:grid;gap:6px}
.sg-notes li{line-height:1.4}
.sg-dlg .fc-actions .btn{min-height:44px}
/* Apply / Cancel stay in view at the bottom of a long preview */
.sg-dlg .fc-actions{position:sticky;bottom:-20px;z-index:1;background:var(--surface);margin:12px -22px -20px;padding:12px 22px 16px;border-top:1px solid var(--line)}
@media (max-width:640px){
  .sg-row{grid-template-columns:minmax(0,1fr) auto;padding:8px 10px}
  .sg-code{grid-column:1}
  .sg-cr{grid-column:2;grid-row:1}
  .sg-name{grid-column:1/-1}
  .sg-dlg .fc-actions .btn{flex:1;justify-content:center}
}

/* "Suggested" in the course catalog: the exchange line and its link to the approved courses */
.sg-sughint{margin-top:-2px}
.sg-link{background:none;border:0;padding:0 2px;color:var(--teal);font:inherit;font-weight:700;text-decoration:underline;cursor:pointer;min-height:44px}

/* Undo toast after Apply */
.sg-toast{position:fixed;inset-inline-start:50%;bottom:calc(22px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:70;display:flex;align-items:center;gap:14px;
  background:var(--dark);color:var(--on-dark);border-radius:999px;padding:6px 8px 6px 18px;box-shadow:0 10px 30px rgba(0,0,0,.3);max-width:calc(100vw - 32px)}
:root[dir=rtl] .sg-toast{transform:translateX(50%);padding:6px 18px 6px 8px}
.sg-toast button{background:none;border:2px solid currentColor;color:inherit;border-radius:999px;font:inherit;font-weight:900;min-height:44px;padding:0 16px;cursor:pointer}
@media (max-width:640px){
  .sg-toast{bottom:calc(84px + env(safe-area-inset-bottom,0px));width:calc(100vw - 32px);justify-content:space-between;border-radius:16px;font-size:.9rem}
}
.sg-gradwhy{flex-basis:100%;color:var(--muted);font-size:.86rem;line-height:1.35}
