.home-plan-actions{display:flex;gap:8px;flex-shrink:0}.home-daily-plan .dashboard-panel-head{align-items:flex-start}.home-daily-plan h2 span{font-weight:400;white-space:nowrap}.home-plan-counts{display:flex;justify-content:space-between;gap:12px;margin:20px 0 12px}.home-plan-counts strong{font-size:30px;line-height:1.2;color:var(--primary)}.home-plan-counts span{font-size:13px}.home-plan-status{margin-bottom:0;color:var(--muted)}.home-preparation-items{display:grid;gap:6px;max-height:160px;overflow:auto}.preparation-row{width:100%;display:flex;justify-content:space-between;gap:14px;text-align:left;border:0;border-top:1px solid var(--border);padding:9px 2px;background:transparent;color:inherit;cursor:pointer}.preparation-row small{display:block;font-size:11px;color:var(--muted)}.preparation-row>span:last-child{font-size:12px;text-align:right;flex-shrink:0}.study-plan-manager-modal{width:min(1120px,96vw)}.study-plan-manager>.workspace-tabs{position:sticky;top:0;background:var(--surface);z-index:2;display:flex;gap:8px;flex-wrap:wrap;padding-bottom:14px}.study-plan-manager .view{padding:0}.study-plan-manager .plan-filter{flex-wrap:wrap}.plan-include-today{display:flex;align-items:center;gap:8px;padding:14px 20px 0;font-weight:600}.merge-plan-choice{display:flex;align-items:center;gap:12px;padding:14px;border-bottom:1px solid var(--border)}.merge-plan-choice small{display:block;color:var(--muted)}.plan-calendar .weekday-loads{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px}.plan-calendar .override-row{display:flex;gap:16px;padding:8px}.plan-calendar .override-row button{margin-left:auto}.scope-excluded{color:var(--muted);font-size:13px}@media(max-width:700px){.home-daily-plan .dashboard-panel-head{flex-wrap:wrap}.home-plan-counts strong{font-size:24px}.home-plan-counts{gap:6px}.study-plan-manager>.workspace-tabs{position:static}}

.study-plan-manager-modal{max-width:1120px}.study-plan-manager .view-header{margin-bottom:16px}.study-plan-manager .view-header h1{font-size:25px}.study-plan-manager .plan-purpose-grid{gap:12px;margin:12px 0 20px}.study-plan-manager .plan-purpose-card{min-height:110px;padding:16px;box-shadow:none}.study-plan-manager .plan-purpose-copy p{display:none}.study-plan-manager .plan-purpose-copy strong{font-size:17px}.study-plan-manager .plan-purpose-icon{width:44px;height:44px}.study-plan-manager .today-hero h2{font-size:25px}

/* Aligned Home widgets with readable headings and intentional empty states. */
.home-study-row{align-items:stretch;gap:24px}.home-study-row>.dashboard-panel{display:flex;flex-direction:column;padding:24px;min-width:0;min-height:220px}.home-study-row .dashboard-panel-head{margin:0 0 18px;gap:16px}.home-study-row h2{font-size:19px;line-height:1.4;margin:0;font-weight:700;letter-spacing:-.02em}.home-daily-plan h2 span{display:block;font-size:13px;font-weight:500;color:var(--muted);margin-top:5px;white-space:normal}.home-plan-status,.home-preparation>p{font-size:13px;line-height:1.5}.home-plan-counts{margin:2px 0 14px}.home-preparation-items{max-height:190px}.home-plan-actions{flex-wrap:wrap}@media(max-width:700px){.home-study-row>.dashboard-panel{padding:20px;min-height:190px}}


/* First visit: paired introductions with clear, full-size entry points. */
.home-dashboard .home-onboarding-row { grid-template-columns:minmax(0,1.22fr) minmax(0,1fr); gap:22px; }
.home-dashboard .home-study-row > .home-widget-intro {
  padding:22px; min-height:232px; gap:18px; position:relative; isolation:isolate;
  background:linear-gradient(135deg,var(--ui-panel-top,var(--surface)),var(--ui-panel,var(--surface)));
}
.home-intro-heading { display:grid; grid-template-columns:48px minmax(0,1fr); align-items:start; gap:15px; }
.home-intro-icon {
  display:grid; place-items:center; width:48px; height:48px; border-radius:12px;
  color:var(--primary); background:color-mix(in srgb,var(--primary) 12%,var(--surface));
  border:1px solid color-mix(in srgb,var(--primary) 16%,var(--border));
}
.home-dashboard .home-study-row .home-widget-intro h2 { font-size:18px; line-height:1.3; letter-spacing:-.015em; margin:2px 0 7px; }
.home-dashboard .home-study-row .home-intro-heading p { font-size:13px; line-height:1.6; color:var(--muted); margin:0; max-width:44ch; }
.home-intro-actions { display:grid; gap:10px; margin-top:auto; }
.home-dashboard .home-study-row .home-intro-action {
  display:grid; grid-template-columns:32px minmax(0,1fr) 18px; gap:12px; align-items:center;
  width:100%; min-height:52px; padding:8px 13px; text-align:left; font-size:13px; line-height:1.4;
  color:var(--text); background:color-mix(in srgb,var(--primary) 5%,var(--surface));
}
.home-dashboard .home-study-row .home-intro-action-icon { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; color:var(--primary); background:color-mix(in srgb,var(--primary) 14%,var(--surface)); }
.home-dashboard .home-study-row .home-intro-action-label { display:block; white-space:normal; min-width:0; font-weight:700; }
.home-dashboard .home-study-row .home-intro-action > svg { color:var(--primary); }
.home-dashboard .home-study-row .home-intro-upload { background:color-mix(in srgb,var(--ui-blue,#5b7f95) 5%,var(--surface)); }
.home-dashboard .home-study-row .home-intro-upload .home-intro-action-icon,.home-preparation .home-intro-icon { color:color-mix(in srgb,var(--ui-blue,#5b7f95) 72%,var(--text)); background:color-mix(in srgb,var(--ui-blue,#5b7f95) 13%,var(--surface)); }
.home-intro-preparation-footer { display:flex; align-items:flex-end; justify-content:flex-end; min-height:82px; margin-top:auto; position:relative; }
.home-intro-paper-detail { position:absolute; left:10px; bottom:-1px; z-index:-1; pointer-events:none; color:var(--primary); opacity:.075; transform:rotate(-12deg); }
.home-dashboard .home-study-row .home-intro-preparation-action { display:flex; gap:10px; align-items:center; min-height:42px; padding:9px 14px; font-size:13px; white-space:normal; }
.home-dashboard .home-study-row .home-intro-action:hover { background:color-mix(in srgb,var(--primary) 10%,var(--surface)); }
.home-dashboard .home-study-row .home-widget-intro button:focus-visible { outline:3px solid var(--primary); outline-offset:3px; }
@media(max-width:1100px) {
  .home-dashboard .home-onboarding-row { grid-template-columns:minmax(0,1fr); gap:18px; }
  .home-dashboard .home-study-row > .home-widget-intro { min-height:0; }
  .home-intro-preparation-footer { min-height:52px; }
}
@media(max-width:520px) {
  .home-dashboard .home-study-row > .home-widget-intro { padding:20px; gap:18px; }
  .home-intro-heading { grid-template-columns:42px minmax(0,1fr); gap:12px; }
  .home-intro-icon { width:42px; height:42px; border-radius:10px; }
  .home-dashboard .home-study-row .home-widget-intro h2 { font-size:17px; }
  .home-dashboard .home-study-row .home-intro-action { gap:9px; padding:10px; }
  .home-dashboard .home-study-row .home-intro-preparation-action { min-height:46px; }
}

/* Exam timing stays inside the existing Home widgets. */
/* The countdown is part of the header; its full course context remains in its accessible name and tooltip. */
.home-next-exam { display:grid; align-content:center; justify-items:start; gap:4px; min-width:0; padding:4px 0; margin:0; text-align:left; font:inherit; border:0; border-radius:4px; background:transparent; cursor:pointer; }
.home-next-exam strong { color:var(--exam-countdown-color,var(--primary)); font-size:17px; line-height:1.35; font-weight:750; }
.home-next-exam time { color:var(--muted); font-size:12px; line-height:1.4; }
.home-next-exam:hover strong { text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:3px; }
.home-next-exam:focus-visible { outline:2px solid var(--primary); outline-offset:5px; }
.preparation-topic-row .preparation-deadline { display:block; margin-top:5px; font-size:13px; font-weight:650; color:var(--primary); line-height:1.5; }

/* Syllabus entry points reuse the existing study-plan and semester dialogs. */
.syllabus-file-slots { display: grid; gap: 12px; }
.syllabus-file-slot { display: flex; align-items: end; gap: 12px; }
.syllabus-file-slot .field { flex: 1; min-width: 0; margin: 0; }
.syllabus-file-slot input { width: 100%; min-width: 0; }
.syllabus-file-slot > button { flex-shrink: 0; }
.exam-syllabus-option { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin-bottom: 20px; }
.exam-syllabus-option p { margin: 6px 0 0; }
.exam-syllabus-option .field { margin: 0; }
.exam-syllabus-option > button { justify-self: start; }

/* Compact daily widgets: matching, understated stat tiles rather than heavy boxes. */
.home-study-row > .home-widget:not(.home-widget-intro) { container-type:inline-size; container-name:study-widget; min-height:216px; padding:22px; }
.home-study-row > .home-widget:not(.home-widget-intro) h2 { font-size:26px; line-height:1.2; letter-spacing:-.025em; }
.home-study-row .home-daily-plan h2 span { font-size:14px; line-height:1.4; margin-top:6px; letter-spacing:0; }
.home-daily-plan:not(.home-widget-intro) .dashboard-panel-head { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr) auto; align-items:start; gap:16px; margin:0 0 18px; }
.home-daily-plan .home-plan-actions { grid-column:3; grid-row:1; justify-content:flex-end; }
.home-daily-plan .home-next-exam { grid-column:2; grid-row:1; }
.home-plan-counts,.home-preparation-summary { display:grid; gap:12px; margin:0; }
.home-plan-counts { grid-template-columns:repeat(4,minmax(0,1fr)); }
.home-preparation-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
.home-study-row .home-study-stat { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-width:0; min-height:94px; margin:0; padding:14px 10px; text-align:center; border:1px solid color-mix(in srgb,var(--primary) 10%,var(--border)); border-radius:10px; background:color-mix(in srgb,var(--primary) 2%,var(--surface)); box-shadow:none; }
.home-study-row .home-study-stat strong { font-size:30px; line-height:1.15; font-weight:750; color:var(--text); font-variant-numeric:tabular-nums; }
.home-study-row .home-study-stat span { font-size:13px; line-height:1.35; font-weight:500; color:var(--muted); }
.home-study-row .home-study-time strong { font-size:21px; line-height:1.3; }
.home-study-row button.home-study-stat:hover { background:color-mix(in srgb,var(--primary) 5%,var(--surface)); }
.home-study-row button.home-study-stat:focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
.home-preparation:not(.home-widget-intro) .dashboard-panel-head { align-items:flex-start; flex-wrap:wrap; gap:8px 16px; }
.home-preparation:not(.home-widget-intro) h2 { flex:1; min-width:180px; }
.home-preparation-summary { margin-top:auto; }
.home-study-row .home-plan-status { margin:12px 0 0; }
@container study-widget (max-width:620px) {
  .home-daily-plan:not(.home-widget-intro) .dashboard-panel-head { grid-template-columns:minmax(0,1fr) auto; gap:10px 14px; }
  .home-daily-plan .home-plan-actions { grid-column:2; }
  .home-daily-plan .home-next-exam { grid-column:1 / -1; grid-row:2; display:flex; flex-wrap:wrap; align-items:baseline; column-gap:12px; }
}
@container study-widget (max-width:450px) {
  .home-plan-counts { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .home-study-row > .home-widget h2 { font-size:23px; }
  .home-study-row .home-study-stat strong { font-size:27px; }
  .home-study-row .home-study-time strong { font-size:20px; }
  .home-daily-plan .home-plan-actions { gap:6px; }
}
@container study-widget (max-width:340px) {
  .home-daily-plan:not(.home-widget-intro) .dashboard-panel-head { grid-template-columns:1fr; }
  .home-daily-plan .home-plan-actions { grid-column:1; grid-row:3; justify-content:flex-start; }
}

/* Topic names are placeholders until entered; attachments use the Library picker. */
.plan-topic-rows { display: grid; gap: 14px; margin: 12px 0 22px; }
.plan-topic-rows .plan-topic-row { display: block; min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.plan-topic-fields { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.plan-topic-fields .field { flex: 1 1 130px; min-width: 0; }
.plan-topic-fields .field:first-child { flex: 3 1 210px; }
.plan-topic-fields input { width: 100%; }
.plan-topic-fields input::placeholder { color: var(--muted); opacity: .7; font-style: italic; }
.plan-topic-row .plan-scope-chips { margin-bottom: 12px; }

/* The shortage warning explains itself only after an explicit click. */
button.home-material-warning { width:100%; border:0; font-family:inherit; cursor:pointer; }
button.home-material-warning:focus-visible { outline:2px solid currentColor; outline-offset:3px; }
.home-calculation-toast { position:fixed; inset:auto; z-index:1000; box-sizing:border-box; width:min(460px,calc(100vw - 16px)); max-height:calc(100vh - 16px); margin:0; padding:14px 16px; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--text); box-shadow:0 5px 20px #0002; pointer-events:none; overflow:auto; }
.home-calculation-toast .home-material-calculation { margin:0; padding:0; text-align:left; }

.planner-detail-actions { justify-content:space-between; flex-wrap:wrap; margin:0 0 20px; }

.planner-editor-back { justify-self:start; margin:0 0 18px; }

.plan-topic-date-hint { margin:0 0 12px; color:var(--muted); font-size:13px; }
.preparation-topic-status.overdue { color:var(--danger); font-weight:650; }
