/* Planning workflow: Curriculum → Year Plan → Weekly Plan → Worksheets */
.thaana, [dir="rtl"] { font-family: var(--thaana); }
.thaana { line-height: 1.7; }
.dv-sub { font-size: .55em; color: var(--muted); font-weight: 600; margin-inline-start: 8px; letter-spacing: 0; }
.nav a span small { display: block; font-size: 11px; color: #7fa7ae; line-height: 1.3; }
.nav a.active span small { color: #bfe0e4; }
.print-only { display: none; }
.notice { background: var(--sun-soft); border-color: #f3dca3; margin-bottom: 14px; padding: 12px 16px; font-size: 14px; }
.notice.good { background: var(--lagoon-soft); border-color: #a7e3da; }
code { background: var(--sand-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.en { display: block; font-family: var(--font); font-size: 10.5px; font-weight: 500; color: var(--muted); letter-spacing: .02em; text-transform: none; }

/* stepper */
.stepper { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 20px; }
.stepper .step { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none !important; line-height: 1.2; }
.stepper .step .n { width: 28px; height: 28px; border-radius: 50%; background: var(--sand-2); display: grid; place-items: center; font: 800 13px var(--display); flex: none; }
.stepper .step b { font-size: 13.5px; display: block; }
.stepper .step small { font-size: 11.5px; color: var(--muted); }
.stepper .step.on { border-color: var(--lagoon); box-shadow: 0 0 0 3px var(--lagoon-soft); }
.stepper .step.on .n { background: var(--lagoon); color: #fff; }
.stepper .arrow { color: var(--line-2); font-weight: 700; }

/* dashboard flow */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.flow-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none !important; transition: transform .15s, box-shadow .15s; position: relative; }
.flow-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.flow-card b { font-family: var(--display); font-size: 18px; margin-top: 8px; }
.flow-card .dv { color: var(--muted); font-size: 13px; margin-top: -4px; }
.flow-card .desc { font-size: 13px; color: var(--muted); flex: 1; line-height: 1.4; }
.flow-card .chip { align-self: flex-start; }
.flow-n { font: 800 34px var(--display); color: var(--sand-2); line-height: 1; }
.flow-card:not(:last-child)::after { content: "\2192"; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); color: var(--line-2); font-weight: 800; z-index: 1; }

/* curriculum */
details.subj { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; overflow: hidden; background: #fff; }
details.subj > summary { list-style: none; cursor: pointer; }
details.subj > summary::-webkit-details-marker { display: none; }
.subj-h .nm { font-weight: 700; background: transparent; border-color: transparent; max-width: 260px; font-size: 16px; }
.subj-h .nm-en { background: transparent; border-color: transparent; max-width: 200px; color: var(--muted); }
.subj-h .nm:hover, .subj-h .nm-en:hover { border-color: var(--line-2); background: #fff; }
.oc-table td { vertical-align: top; padding: 6px 8px; }
.oc-table input, .oc-table textarea { border-color: transparent; background: transparent; padding: 6px 8px; min-height: 0; font-size: 14px; }
.oc-table input:hover, .oc-table textarea:hover { border-color: var(--line-2); background: #fff; }
.oc-table th { text-align: right; }

/* year plan */
.yp-week { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.yp-week > summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.yp-week > summary::-webkit-details-marker { display: none; }
.yp-week[open] > summary { border-bottom: 1px solid var(--line); }
.yp-week .wk { font: 800 14px var(--display); background: var(--sea-900); color: #fff; padding: 4px 10px; border-radius: 9px; }
.yp-theme { font-family: var(--thaana-head); font-size: 18px; }
.yp-body { padding: 14px 16px 16px; }
.yp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.yp-entry { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.yp-entry textarea { min-height: 0; font-size: 14px; }
.pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.pick { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.pick:has(input:checked) { border-color: var(--lagoon); background: var(--lagoon-soft); }
.pick input { margin-top: 6px; }

/* weekly plan list */
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.week-tile { display: flex; flex-direction: column; gap: 6px; min-height: 132px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none !important; text-align: start; font: inherit; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.week-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.week-tile .wk { font: 800 13px var(--display); color: var(--sea-700); text-transform: uppercase; letter-spacing: .08em; }
.week-tile .theme { font-family: var(--thaana-head); font-size: 18px; flex: 1; }
.week-tile.empty { border-style: dashed; background: transparent; color: var(--muted); }
.week-tile.empty .plus { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
.week-tile.empty .plus svg { width: 22px; height: 22px; }
.week-tile.now { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.ws-dots { display: flex; gap: 4px; align-items: center; }
.ws-dots i { width: 10px; height: 10px; border-radius: 3px; background: var(--sand-2); }
.ws-dots i.on { background: var(--coral); }
.ws-dots .small { margin-inline-start: 6px; color: var(--muted); }

/* weekly plan editor */
.gen-progress { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--sea-900); color: #fff; margin-bottom: 10px; font-weight: 600; }
.mini-waves { display: inline-flex; gap: 3px; }
.mini-waves i { width: 4px; height: 16px; border-radius: 3px; background: var(--lagoon); animation: wave 1s ease-in-out infinite; }
.mini-waves i:nth-child(2) { animation-delay: .15s; background: var(--coral); }
.mini-waves i:nth-child(3) { animation-delay: .3s; background: var(--sun); }
.plan-scroll { overflow-x: auto; padding-bottom: 8px; }
.plan-paper { max-width: none; min-width: 1100px; padding: 28px 30px; }
.plan-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 3px solid var(--sea-900); padding-bottom: 10px; margin-bottom: 10px; }
.plan-title { font: 400 26px var(--thaana-head); }
.plan-school { color: var(--muted); font-size: 14px; min-width: 200px; text-align: left; }
table.plan { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13.5px; }
table.plan col.c-lbl { width: 170px; }
table.plan col.c-tm { width: 52px; }
table.plan th, table.plan td { border: 1px solid #cbd5d9; padding: 6px 8px; vertical-align: top; text-align: right; }
table.plan th { background: #f6f0e6; font-weight: 700; font-size: 13px; }
table.plan th.lbl { background: #eef6f5; color: var(--sea-800); }
table.plan thead tr.days th { background: var(--sea-900); color: #fff; text-align: center; font-size: 15px; font-family: var(--thaana-head); font-weight: 400; }
table.plan thead tr.days th .en { color: #9cc3c9; }
table.plan thead tr.meta td, table.plan thead tr.meta th { background: #fff; }
table.plan tr.theme td { font-family: var(--thaana-head); font-size: 20px; color: var(--sea-800); }
table.plan tr.subj-head th { background: #dcefef; text-align: center; }
table.plan th.sname { background: #fbf8f2; text-align: center; }
table.plan td.tm { text-align: center; color: var(--muted); }
table.plan .cv { min-height: 1.6em; white-space: pre-wrap; line-height: 1.75; }
table.plan .cprompt { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
table.plan .row-inline { display: flex; gap: 6px; align-items: baseline; }
table.plan .row-inline .cv { min-width: 30px; }
.day-actions { display: flex; gap: 4px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.day-actions .btn { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 8px; background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.day-actions .btn:hover { background: rgba(255,255,255,.22); }
.day-actions .btn.lagoon { background: var(--lagoon); border-color: var(--lagoon); }

/* worksheets */
.ws-week { margin-bottom: 14px; }
.ws-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; direction: rtl; }
.ws-day { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--ink); text-decoration: none !important; min-height: 96px; }
.ws-day.done { border: 1px solid var(--line); background: #fff; }
.ws-day.done:hover { border-color: var(--coral); }
.ws-day b { font-family: var(--thaana-head); font-weight: 400; font-size: 17px; }
.ws-day .ai-badge { align-self: flex-start; margin-top: auto; font-size: 10.5px; padding: 2px 8px; }
.seg a.off { color: var(--line-2); cursor: default; }
.ws-paper .ws-prompt { font-family: var(--thaana); }
.ws-paper .paper-head h1, .ws-paper .kind, .plan-paper .plan-title { font-family: var(--thaana-head); font-weight: 400; letter-spacing: 0; }
.flow-card .dv, .stepper .step small, .dv-sub { font-family: var(--thaana-head); }
.ws-paper .ws-match .r span, .ws-paper .ws-match .l span { font-family: var(--thaana), var(--font); }
.ws-foot { display: flex; justify-content: space-between; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; color: var(--muted); }
.add-section { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ws-trace .tr[dir="rtl"] { font-family: 'Faruma', var(--thaana); font-size: 70px; }

/* import */
.import-summary { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-align: center; margin-bottom: 10px; }
.import-summary div { padding: 12px 6px; border-inline-end: 1px solid var(--line); }
.import-summary div:last-child { border: 0; }
.import-summary b { display: block; font: 800 24px var(--display); }
.import-summary span { font-size: 12px; color: var(--muted); }

.yp-print td, .yp-print th { font-size: 11.5px; }

@media (max-width: 1100px) {
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-card::after { display: none; }
}
@media (max-width: 680px) {
  .flow { grid-template-columns: 1fr; }
  .ws-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .import-summary { grid-template-columns: repeat(3, 1fr); }
  .stepper .arrow { display: none; }
}
@media print {
  .print-only { display: block !important; }
  .stepper, .notice, .gen-progress { display: none !important; }
  @page landscape { size: A4 landscape; margin: 8mm; }
  .plan-paper { min-width: 0; padding: 0; page: landscape; }
  table.plan { font-size: 9.5px; }
  table.plan col.c-lbl { width: 105px; }
  table.plan col.c-tm { width: 30px; }
  table.plan th, table.plan td { padding: 3px 4px; }
  table.plan .cv { line-height: 1.45; }
  table.plan thead tr.days th, table.plan th, table.plan th.lbl { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .paper.landscape { page: landscape; }
}
