/* PC study-plan workspace: sampled from the approved StudyFetch plan reference. */
body[data-active-tab="plan"] { --plan-canvas: #f7f6ef; --plan-card: #faf9f5; --plan-muted-card: #f2f0e8; }
body[data-active-tab="plan"] .main { background: var(--plan-canvas); }
#plan.tab-panel.active { padding: 0; background: var(--plan-canvas); }
body[data-active-tab="plan"] .topbar { width: 100%; background: var(--plan-canvas); }
body[data-active-tab="plan"] .topbar-actions { right: 24px; }

#plan .plan-page-grid { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100%; }
#plan .new-plan-workspace { width: min(100%, 1320px); max-width: none; margin-inline: auto; padding: 21px clamp(28px, 5.5vw, 106px) 80px clamp(28px, 5vw, 90px); }
#plan .new-plan-header { align-items: center; justify-content: flex-start; gap: 16px; margin: 0 0 32px; }
#plan .new-plan-header .study-set-mark { width: 80px; height: 80px; flex: none; border-radius: 14px; font-size: 41px; }
#plan .new-plan-heading { min-width: 0; }
#plan .new-plan-header h3 { margin: 0 0 8px; font: 400 30px/1.25 var(--font-reading); overflow-wrap: anywhere; }
#plan .plan-status:empty { display: none; }
#plan .plan-status { min-height: 0; margin: 0 0 18px; }
#plan .plan-status.error { padding: 12px 16px; border: 1px solid #f3c7c7; border-radius: 8px; background: var(--danger-soft); }

#plan .new-plan-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; }
#plan .new-plan-main { gap: 24px; }
#plan .new-plan-aside { gap: 16px; }
#plan .new-plan-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 10px 16px; border-radius: 16px; background: var(--plan-muted-card); }
#plan .new-plan-toolbar > span { color: var(--muted); font: 15px/1.4 var(--font-reading); }
#plan .new-plan-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex-shrink: 0; }
#plan .new-plan-toolbar-actions label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
#plan .new-plan-toolbar-actions .select {
  box-sizing: border-box;
  width: 128px;
  min-width: 128px;
  height: 34px;
  min-height: 34px;
  padding: 0 36px 0 14px;
  border: 1px solid #e5e2dd;
  border-radius: 999px;
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%236b6861' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
  color: var(--ink);
  font-size: 13px;
}
#plan .new-plan-toolbar-actions .btn { min-height: 34px; border-radius: 999px; }
#plan .new-plan-card { border: 1px solid #e5e2dd; border-radius: 16px; background: #fff; box-shadow: none; }
#plan #newPlanCreation { padding: 24px; background: var(--plan-muted-card); }
#plan #newPlanCreation h4 { font: 500 23px/1.4 var(--font-reading); }
#plan #newPlanCreationHint { margin: 10px 0 0; line-height: 1.6; }
#plan #newPlanBasis[hidden] + #newPlanCreationHint { margin-top: 0; }
#plan #newPlanCreation label { margin-top: 16px; font-size: 13px; }
#plan #newPlanCreation .textarea { min-height: 92px; border-radius: 10px; background: #fff; }
#plan #newPlanCreation [hidden] { display: none; }
#plan #newPlanDraft { padding: 24px; }
#plan #newPlanActive { padding: 0; border: 0; background: transparent; }

#plan .plan-route-start { display: flex; align-items: center; gap: 14px; min-height: 42px; padding: 0 32px; font-size: 14px; }
#plan .plan-route-start > span { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--lavender-soft); color: #202020; }
#plan .plan-route-start .icon { width: 19px; height: 19px; }
#plan .plan-path-group { margin-top: 34px; }
#plan .plan-path-group + .plan-path-group { margin-top: 24px; }
#plan .plan-topic-wrap { position: relative; }
#plan .plan-topic-wrap + .plan-topic-wrap { margin-top: 24px; }
#plan .plan-path { min-height: 46px; padding: 0 20px; border: 1px solid #e5e5e5; border-radius: 16px; background: var(--plan-card); }
#plan .plan-path[open] { padding-bottom: 20px; }
#plan .plan-path-summary { display: flex; align-items: center; gap: 12px; min-height: 46px; padding-right: 42px; cursor: pointer; list-style: none; }
#plan .plan-path-summary::-webkit-details-marker { display: none; }
#plan .plan-path-summary::before { content: ""; flex: none; width: 8px; height: 8px; border-right: 1.5px solid #67645e; border-bottom: 1.5px solid #67645e; transform: rotate(-45deg); }
#plan .plan-path[open] .plan-path-summary::before { transform: rotate(45deg); }
#plan .plan-path-summary strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
#plan .plan-path-summary small { display: none; }
#plan .plan-path-summary .plan-topic-dot { position: relative; width: 20px; height: 20px; border: 0; background: conic-gradient(#b41cd1 0 var(--topic-progress-angle), #dfdce2 var(--topic-progress-angle) 360deg); }
#plan .plan-path-summary .plan-topic-dot::after { position: absolute; inset: 4px; border-radius: 50%; background: var(--plan-card); content: ""; }
#plan .plan-path-summary .plan-topic-dot[aria-valuenow="0"] { border: 1px dashed #c7c4bf; background: #fff; }
#plan .plan-path-summary .plan-topic-dot[aria-valuenow="0"]::after { display: none; }
#plan .plan-path-empty { padding: 15px 20px; }
#plan .plan-path-empty p { margin-top: 8px; }
#plan .plan-card-menu { position: absolute; top: 7px; right: 12px; z-index: 3; }
#plan .plan-card-menu > summary { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; list-style: none; font-size: 21px; line-height: 1; }
#plan .plan-card-menu > summary::-webkit-details-marker { display: none; }
#plan .plan-card-menu > summary:hover { background: #eceae0; }
#plan .plan-card-menu-popover { position: absolute; top: 36px; right: 0; display: grid; gap: 6px; width: 210px; padding: 12px; border: 1px solid #e5e5e5; border-radius: 12px; background: var(--plan-card); box-shadow: var(--shadow-popover); }
#plan .plan-card-menu-popover p { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
#plan .plan-card-menu-popover small { margin-bottom: 4px; color: var(--muted); }
#plan .plan-card-menu-popover .btn { justify-content: flex-start; background: transparent; text-align: left; }
#plan .plan-path-topic { padding: 0; border: 0; border-top: 1px solid #e6e5e2; border-radius: 0; }
#plan .plan-path-topic summary { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; list-style: none; }
#plan .plan-path-topic summary::-webkit-details-marker { display: none; }
#plan .plan-path-topic summary::before { content: ""; flex: none; width: 8px; height: 8px; border-right: 1.5px solid #67645e; border-bottom: 1.5px solid #67645e; transform: rotate(-45deg); }
#plan .plan-path-topic[open] summary::before { transform: rotate(45deg); }
#plan .plan-topic-dot, #plan .plan-activity-dot { width: 17px; height: 17px; flex: none; border: 1px dashed #c7c4bf; border-radius: 50%; background: #fff; }
#plan .plan-path-topic summary strong { min-width: 0; flex: 1; font-size: 14px; }
#plan .plan-path-topic summary small { margin-left: auto; color: var(--muted); }
#plan .plan-path-activities { margin: 8px 0 6px 31px; padding-left: 17px; border-left: 1px solid #e7e4e0; }
#plan .plan-path-activity { min-height: 54px; margin: 0 0 5px; padding: 7px 10px; border: 1px solid transparent; border-radius: 12px; background: transparent; }
#plan .plan-path-activity.focused { border-color: #f0d4fb; background: #fcf8ff; }
#plan .plan-path-activity.done .plan-activity-dot { position: relative; border: 0; background: #b41cd1; }
#plan .plan-path-activity.done .plan-activity-dot::after { position: absolute; inset: 4px; border-radius: 50%; background: var(--plan-card); content: ""; }
#plan .plan-activity-copy { display: grid; min-width: 0; flex: 1; gap: 2px; }
#plan .plan-activity-copy strong { overflow-wrap: anywhere; font-size: 13px; }
#plan .plan-activity-copy small { color: var(--muted); font-size: 11px; }
#plan .plan-path-activity > div { justify-content: flex-end; }
#plan .plan-path-activity:not(.focused) .plan-activity-copy small { display: none; }
#plan .plan-path-activity:not(.focused) > div { opacity: 0; }
#plan .plan-path-activity:not(.focused):hover > div, #plan .plan-path-activity:not(.focused):focus-within > div { opacity: 1; }

#plan .new-plan-aside .new-plan-card { position: relative; padding: 20px; border: 0; border-radius: 16px; background: var(--plan-muted-card); }
#plan .new-plan-aside .new-plan-card h4 { font: 500 18px/1.4 var(--font-reading); }
#plan #newPlanExams .plan-exam { padding: 10px 0; border-bottom-color: #e6e3db; }
#plan #newPlanOpenCalendar { width: 100%; min-height: 34px; margin-top: 12px; border-radius: 999px; }

#plan .new-plan-dialog { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 30px; background: rgba(23, 21, 20, .36); }
#plan .new-plan-dialog[hidden] { display: none; }
#plan .new-plan-dialog-card { display: flex; flex-direction: column; width: min(780px, calc(100vw - 60px)); max-height: min(800px, calc(100vh - 60px)); min-height: 420px; overflow: hidden; border-radius: 22px; background: #fff; box-shadow: 0 28px 90px rgba(0, 0, 0, .2); }
#plan .new-plan-dialog-head { display: flex; justify-content: space-between; gap: 20px; padding: 25px 30px 20px; border-bottom: 1px solid #eeeae4; }
#plan .new-plan-dialog-head small { color: #9856b4; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
#plan .new-plan-dialog-head h4 { margin: 7px 0 5px; font: 400 30px/1.25 var(--font-reading); }
#plan .new-plan-dialog-head p { margin: 0; color: #77736d; font-size: 13px; }
#plan #newPlanDialogClose { width: 34px; height: 34px; flex: none; border: 0; border-radius: 50%; background: #f3f1ec; color: #77736d; font-size: 22px; cursor: pointer; }
#plan .new-plan-dialog-body, #plan #newPlanDraft { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 24px 30px; }
#plan .new-plan-dialog-body[hidden], #plan #newPlanDraft[hidden] { display: none; }
#plan #newPlanDraft { border: 0; border-radius: 0; box-shadow: none; }
#plan .new-plan-dialog-foot { flex: none; padding: 14px 30px 16px; border-top: 1px solid #eeeae4; background: #fff; text-align: center; }
#plan #newPlanDialogActions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
#plan #newPlanDialogActions:not(:empty) { margin-bottom: 10px; }
#plan .new-plan-dialog-foot p { margin: 0; color: #a6a19a; font-size: 11px; }
#plan .plan-generation-goal { display: grid; gap: 5px; padding: 16px 18px; border: 1px solid #ece7df; border-radius: 12px; background: var(--plan-canvas); }
#plan .plan-generation-goal small { color: #88847c; }
#plan .plan-generation-goal strong { line-height: 1.5; }
#plan .plan-generation-stages { margin: 24px 0 0 15px; padding: 0 0 0 25px; border-left: 1px solid #e3dce7; list-style: none; }
#plan .plan-generation-stages li { position: relative; display: flex; gap: 14px; padding: 0 0 28px; animation: plan-stage-enter .4s both; }
#plan .plan-generation-stages li:nth-child(2) { animation-delay: .12s; }
#plan .plan-generation-stages li:nth-child(3) { animation-delay: .24s; }
#plan .plan-generation-stages li:nth-child(4) { animation-delay: .36s; }
#plan .plan-generation-stages li > span { position: absolute; left: -40px; top: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #f1e6f8; color: #8b29b3; font-size: 11px; font-weight: 700; }
#plan .plan-generation-stages li.active > span { background: #c449e9; color: #fff; box-shadow: 0 0 0 5px #f3defb; }
#plan .plan-generation-stages li.waiting { opacity: .48; }
#plan .plan-generation-stages li div { display: grid; gap: 6px; }
#plan .plan-generation-stages li strong { font-size: 15px; }
#plan .plan-generation-stages li small { color: #807b75; font-size: 12px; }
#plan .plan-scope-choice { margin-top: 22px; padding: 20px; border: 1px solid #eaddeb; border-radius: 14px; background: #fdf8ff; }
#plan .plan-scope-choice h5 { margin: 0 0 10px; font-size: 19px; }
#plan .plan-scope-choice p { color: #5d5854; line-height: 1.6; }
#plan .plan-scope-choice > div { display: flex; flex-wrap: wrap; gap: 8px; }
#plan .plan-scope-choice .plan-scope-actions { align-items: center; gap: 12px; margin-top: 18px; }
#plan .plan-excluded-details { margin-top: 10px; }
#plan .plan-excluded-details summary { cursor: pointer; color: #5d5854; }
#plan .plan-excluded-details ul { margin-top: 10px; }
#plan .plan-excluded-details li { overflow-wrap: anywhere; }
@keyframes plan-stage-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { #plan .plan-generation-stages li { animation: none; } }

@media (max-width: 1240px) and (min-width: 961px) {
  #plan .new-plan-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; }
}
@media (max-width: 960px) {
  #plan .plan-page-grid { grid-template-columns: minmax(0, 1fr); }
  body[data-active-tab="plan"] .topbar { width: 100%; }
  body[data-active-tab="plan"] .topbar-actions { right: 24px; }
  #plan .new-plan-layout { grid-template-columns: minmax(0, 1fr); }
  #plan .new-plan-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
