@font-face {
  font-family: Forest;
  src: url('fonts/arabic-regular.woff') format('woff');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Forest;
  src: url('fonts/arabic-bold.woff') format('woff');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #1b3027;
  --green: #205642;
  --pine: #133527;
  --paper: #f6f7f0;
  --card: #fefff9;
  --muted: #55665a;
  --line: #d6ded1;
  --gold: #79541d;
  --pad: clamp(16px, 3.5vw, 54px);
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.65 Forest, Tahoma, sans-serif;
}
button, input { font: inherit; }
button { color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible { outline: 3px solid #c08a2d; outline-offset: 3px; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
svg { display: block; flex: none; width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sprites { position: absolute; width: 0; height: 0; overflow: hidden; }

.nav { background: #132c23; border-bottom: 1px solid #213c30; color: #f1f4e8; }
.nav-inner, main { width: min(1220px, calc(100% - 2 * var(--pad))); margin-inline: auto; }
.nav-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand, .nav-actions, .settings-btn, .local-clock, .date, .hero-time,
.hero-time > span, .section-head, .section-head h2, .panel h2,
.break-toggle, .stats dt, .dialog-head, .done, .now-panel { display: flex; align-items: center; }
.brand { gap: 11px; font-size: 1.31rem; font-weight: 700; white-space: nowrap; }
.brandmark { display: grid; place-items: center; width: 36px; height: 36px; color: #d4e2b9; background: #29493a; border: 1px solid #496650; border-radius: 10px; }
.brandmark svg { width: 27px; height: 27px; }
.nav-actions { gap: 24px; }
.local-clock { gap: 7px; color: #c1cebe; font-size: .92rem; }
.local-clock svg { width: 17px; height: 17px; }
.local-clock b { color: #f1f4e8; white-space: nowrap; margin-inline-start: 1px; font-variant-numeric: tabular-nums; }
.settings-btn { gap: 8px; justify-content: center; min-height: 40px; padding: 5px 13px; background: #213e30; border: 1px solid #57735d; border-radius: 8px; font-size: .91rem; color: #f4f5ea; }
.settings-btn:hover { background: #304c38; border-color: #96a78c; }
.settings-btn svg { width: 17px; height: 17px; }

main { padding-block: 24px 56px; }
.hero {
  background: #102820 url('forest.webp') left center / cover no-repeat;
  border: 1px solid #314c3c;
  color: #f8f7e7;
  border-radius: 16px;
  display: flex;
  align-items: center;
  position: relative;
  min-height: 229px;
  box-shadow: 0 4px 15px #173b2110;
  overflow: hidden;
  isolation: isolate;
}
.hero-copy { max-width: 62%; padding: 24px clamp(23px, 3.4vw, 53px); }
.date { gap: 9px; font-size: .93rem; color: #d5e1ce; }
.date svg { width: 17px; height: 17px; color: #bbcfac; }
h1 { font-size: clamp(2.75rem, 4.3vw, 3.65rem); line-height: 1.47; margin-block: 1px 4px; }
.hero-time { gap: 12px; flex-wrap: wrap; color: #edf3e3; }
.hero-time > span { gap: 7px; }
.hero-time svg { width: 19px; height: 19px; color: #caddbf; }
.hero-time .sun { color: #f0ce89; }
.hero-time i { width: 22px; height: 1px; background: #8eaa90; }
.hero-time b { font-size: 1.12rem; font-variant-numeric: tabular-nums; }
#hero-summary { font-size: .91rem; color: #c0d4c0; margin-top: 8px; }

.week-countdown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: 14px;
  padding: 14px clamp(16px, 2vw, 26px);
  background: var(--card);
  border: 1px solid var(--line);
  border-inline-start: 4px solid #497450;
  border-radius: 13px;
}
.week-copy h2 { margin-bottom: 3px; color: var(--pine); font-size: 1.22rem; }
.week-copy p { font-size: .92rem; color: var(--muted); }
.week-digits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.week-digits > div { display: grid; align-content: center; justify-items: center; min-width: 4.2rem; padding: 5px 10px; border-radius: 7px; background: #edf3e6; }
.week-digits b { color: var(--green); font-size: 1.65rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.week-digits span { color: var(--muted); font-size: .89rem; }
@media (max-width: 720px) {
  .week-countdown { gap: 9px; }
  .week-digits { flex: 1 1 100%; }
  .week-digits > div { min-width: 0; }
}

.body-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 29%); gap: clamp(22px, 3vw, 40px); align-items: start; margin-top: 27px; }
.agenda, .body-grid aside { min-width: 0; }
.body-grid aside { display: grid; gap: 14px; position: sticky; top: 18px; }
.section-head { justify-content: space-between; gap: 12px; margin-bottom: 16px; }
h2 { font-size: 1.35rem; line-height: 1.5; }
.section-head h2, .panel h2 { gap: 9px; }
.section-head h2 svg, .panel h2 svg { color: #416849; width: 21px; height: 21px; }
.break-toggle { background: #fcfdf7; border: 1px solid #c9d4c6; color: #324f3f; min-height: 40px; border-radius: 999px; padding: 4px 12px; gap: 8px; font-size: .89rem; white-space: nowrap; }
.break-toggle:hover { border-color: #819b82; }
.switch { width: 30px; height: 18px; border-radius: 999px; background: #397256; padding: 3px; display: flex; align-items: center; }
.switch::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: #fff; transform: translateX(-12px); transition: transform .18s ease; }
.break-toggle[aria-checked=false] .switch { background: #78847b; }
.break-toggle[aria-checked=false] .switch::before { transform: none; }

#sessions { display: flex; flex-direction: column; }
.day-group { margin-block: 19px 9px; min-height: 26px; display: flex; align-items: center; gap: 8px; color: #314e3c; font-size: 1rem; font-weight: 700; }
.day-group:first-child { margin-top: 0; }
.day-group > svg { width: 17px; height: 17px; color: #92703a; }
.day-group::after { content: ''; height: 1px; flex: 1; min-width: 12px; margin-inline-start: 4px; background: #cdd7c9; }
.group-count { font-weight: 400; font-size: .86rem; color: var(--muted); white-space: nowrap; }

.session {
  display: grid;
  grid-template-columns: auto minmax(108px, 1fr) auto auto;
  align-items: center;
  gap: clamp(12px, 1.6vw, 27px);
  min-height: 79px;
  padding: 13px clamp(13px, 1.65vw, 22px);
  background: var(--card);
  border: 1px solid #cbd7c8;
  border-radius: 11px;
  box-shadow: 0 2px 3px #16382006;
}
.session + .session, .rest[hidden] + .session { margin-top: 8px; }
.num { width: 42px; height: 44px; border-radius: 8px; background: #e9f0e2; border: 1px solid #cfddc9; color: #305d3e; display: grid; place-content: center; font-size: 1.2rem; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.session-info { min-width: 0; }
.session-info :is(h3, h4) { font-size: 1.05rem; line-height: 1.45; }
.session-info p { color: var(--muted); font-size: .91rem; line-height: 1.6; }
.session-status { display: inline-block; margin-inline-start: 5px; padding: 1px 6px; border-radius: 4px; background: #dcebd2; color: #245f40; font-size: .81rem; line-height: 1.35; font-weight: 700; }
.session-status:empty { display: none; }
.range { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: clamp(1.07rem, 1.55vw, 1.27rem); line-height: 1.45; font-weight: 700; color: #183b2a; white-space: nowrap; font-variant-numeric: tabular-nums; }
.range bdi { white-space: nowrap; }
.range i { width: 16px; height: 1px; flex: none; background: #8c9f8d; }
.done { min-height: 39px; gap: 5px; justify-content: center; padding: 4px 10px; border-radius: 8px; border: 1px solid #aec2ae; background: #f8fbf3; color: #365d42; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.done svg { border: 1.25px solid #829b81; border-radius: 50%; width: 18px; height: 18px; padding: 2px; stroke-width: 2; color: #5b765c; }
.done:hover { background: #e2eddc; border-color: #688e70; }
.complete .num { background: #dcebd6; border-color: #c2d7bd; }
.complete .done { color: #205238; background: #e4f0de; border-color: #a2c099; }
.complete .done svg { background: #33674b; border-color: #33674b; color: white; }
.session.active { border-color: #477a54; background: #f2f8e7; box-shadow: inset -3px 0 #3d7652; }
.rest { display: flex; align-items: center; gap: 8px; min-height: 39px; padding: 5px 36px 5px 13px; position: relative; color: var(--gold); font-size: .89rem; }
.rest::before { content: ''; position: absolute; inset-block: 5px; inset-inline-start: 20px; border-inline-start: 1px dashed #b6a47c; }
.rest svg { width: 16px; height: 16px; }
.rest-name { font-weight: 700; }
.rest-duration { color: #675b44; }
.rest-duration::before { content: '·'; padding-inline-end: 7px; }
.rest .range, .rest-time { margin-inline-start: auto; color: #675b45; font-size: .94rem; font-weight: 400; gap: 7px; }
.rest .range i { width: 12px; background: #b2a58b; }
.rest.long { background: #f2eedf; border-radius: 6px; }
.rest.active { border-radius: 7px; outline: 1px solid #b99751; outline-offset: -1px; background: #fbefcc; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 13px; }
.now-panel { gap: 13px; min-height: 78px; padding: 14px 18px; color: #f3f7e8; background: #234937; border-color: #244733; }
.now-symbol { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #355940; color: #d0e1b9; flex: none; }
.now-panel h3 { font-size: 1.02rem; line-height: 1.5; }
.now-panel p { color: #dce7d4; font-size: .91rem; }
.progress-panel { padding: 19px clamp(16px, 1.8vw, 25px) 12px; }
.panel h2 { font-size: 1.17rem; }
.progress-circle { --progress: 0deg; width: 113px; height: 113px; border-radius: 50%; margin: 18px auto 10px; padding: 7px; background: conic-gradient(#387447 0deg var(--progress), #dfe8d8 var(--progress) 360deg); }
.progress-circle > div { display: flex; align-items: center; justify-content: center; flex-direction: column; width: 100%; height: 100%; border-radius: 50%; background: var(--card); }
#percent { font-size: 2rem; line-height: 1.25; color: var(--pine); font-variant-numeric: tabular-nums; }
.progress-circle small { font-size: .86rem; color: var(--muted); }
.count { color: #415945; font-size: .94rem; text-align: center; }
.strip-caption { color: #4c614f; font-size: .88rem; margin: 16px 0 5px; }
.day-strip { display: flex; gap: 2px; width: 100%; height: 7px; border-radius: 3px; overflow: hidden; background: #f7f7ef; }
.strip-focus { background: #517d58; }
.strip-rest { background: #d9b96e; }
.strip-free { background: #9fadc1; }
.rest.free-time { color: #43556a; background: #edf1f4; border-radius: 6px; }
.rest.free-time .range { color: #415366; }
@media (max-width: 780px) {
  html[data-plan-hours="15"] .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
}
.stats { margin-top: 17px; padding-top: 6px; border-top: 1px solid var(--line); }
.stats > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 36px; font-size: .93rem; }
.stats dt { gap: 7px; color: var(--muted); }
.stats dt svg { width: 17px; height: 17px; color: #59785b; }
.stats > div:nth-child(2) dt svg { color: #8c692c; }
.stats dd { font-weight: 700; text-align: end; }
.stats > div:last-child { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 5px; }

dialog { width: min(437px, calc(100% - 28px)); max-height: calc(100dvh - 28px); background: #fcfdf6; color: var(--ink); border: 1px solid #a8bba6; border-radius: 16px; box-shadow: 0 22px 80px #0f2a2060; padding: 23px; }
dialog::backdrop { background: #0b211bc9; }
.dialog-head { justify-content: space-between; gap: 9px; margin-bottom: 15px; }
.dialog-head h2 { font-size: 1.3rem; }
.dismiss { width: 41px; height: 41px; display: grid; place-items: center; background: #f3f6ec; border: 1px solid #c6d2c1; border-radius: 9px; color: #486349; }
.dismiss svg { width: 17px; height: 17px; }
.dismiss:hover { background: #e2ebdb; }
fieldset { border: none; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 1rem; color: var(--muted); margin-bottom: 9px; }
.choice { display: flex; align-items: center; gap: 11px; border: 1px solid #cad6c7; border-radius: 10px; padding: 12px; margin-bottom: 9px; cursor: pointer; }
.choice:has(input:checked) { background: #edf5e5; border-color: #648b65; }
.choice input { width: 17px; height: 17px; margin: 0; accent-color: #32634a; flex: none; }
.choice strong, .choice small { display: block; }
.choice small { font-size: .9rem; color: var(--muted); }
.apply { width: 100%; border: 0; border-radius: 9px; background: #29563c; color: #fff; font-weight: 700; min-height: 44px; margin-top: 7px; }
.apply:hover { background: #1f4630; }

@media (min-width: 1450px) {
  main { padding-top: 29px; }
  .hero { min-height: 244px; }
}
@media (max-width: 960px) {
  .body-grid { gap: 17px; grid-template-columns: minmax(0, 1fr) 228px; }
  .session { gap: 11px; grid-template-columns: auto minmax(92px, 1fr) auto auto; padding-inline: 11px; }
  .num { width: 35px; height: 39px; }
  .range { font-size: 1.07rem; gap: 7px; }
  .range i { width: 12px; }
  .done { padding-inline: 7px; }
  .progress-panel { padding-inline: 14px; }
}
@media (max-width: 780px) {
  .body-grid { display: flex; flex-direction: column; gap: 15px; margin-top: 17px; }
  .body-grid aside { position: static; align-self: stretch; order: -1; grid-template-columns: minmax(175px, .75fr) minmax(0, 1.8fr); gap: 12px; align-items: stretch; }
  .agenda { width: 100%; }
  .progress-panel { display: grid; grid-template-columns: auto 1fr; gap: 0 13px; align-content: center; padding: 13px 15px; }
  .progress-circle { grid-column: 1; grid-row: 1 / 3; align-self: center; width: 46px; height: 46px; padding: 4px; margin: 0; }
  #percent { font-size: 1rem; }
  .progress-circle small { display: none; }
  .progress-panel h2 { grid-column: 2; grid-row: 1; align-self: end; font-size: 1rem; }
  .progress-panel h2 svg { display: none; }
  .count { grid-column: 2; grid-row: 2; text-align: start; align-self: start; font-size: .88rem; }
  .strip-caption { grid-column: 1 / -1; margin: 7px 0 4px; font-size: .82rem; }
  .day-strip { grid-column: 1 / -1; height: 5px; }
  .stats { grid-column: 1 / -1; margin-top: 9px; padding-top: 6px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats > div, .stats > div:last-child { flex-direction: column; align-items: flex-start; gap: 0; justify-content: flex-start; min-height: 0; margin: 0; padding: 0 6px; border: 0; border-inline-start: 1px solid var(--line); font-size: .88rem; }
  .stats > div:first-child { padding-inline-start: 0; border: none; }
  .stats dt { font-size: .82rem; }
  .stats dt svg { display: none; }
  .stats dd { text-align: start; }
  .now-panel { flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; }
}
@media (max-width: 570px) {
  :root { --pad: 13px; }
  .nav-inner { min-height: 57px; gap: 10px; }
  .brand { gap: 7px; font-size: 1.13rem; }
  .brandmark { width: 31px; height: 31px; border-radius: 8px; }
  .brandmark svg { width: 23px; height: 23px; }
  .local-clock { display: none; }
  .settings-btn { min-height: 38px; padding-inline: 9px; font-size: .86rem; }
  main { padding-top: 12px; }
  .hero { min-height: 164px; border-radius: 12px; background-size: auto 100%; background-position: 29% center; }
  .hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(270deg, #102820f8 0%, #102820ea 18%, #10282099 49%, transparent 87%); }
  .hero-copy { max-width: 100%; padding: 15px; }
  .date { font-size: .85rem; }
  .date svg { width: 15px; height: 15px; }
  h1 { font-size: 2.55rem; line-height: 1.43; }
  .hero-time { gap: 6px; }
  .hero-time b { font-size: .99rem; }
  .hero-time > span { gap: 4px; }
  .hero-time svg { width: 15px; height: 15px; }
  .hero-time i { width: 11px; }
  #hero-summary { margin-top: 4px; font-size: .86rem; }
  .body-grid { gap: 16px; margin-top: 12px; }
  .body-grid aside { grid-template-columns: 1fr; gap: 8px; }
  .now-panel { flex-direction: row; align-items: center; justify-content: flex-start; min-height: 50px; gap: 9px; padding: 8px 12px; }
  .now-symbol { width: 31px; height: 31px; border-radius: 8px; }
  .now-panel > div:last-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 9px; }
  .now-panel h3 { font-size: .96rem; }
  .now-panel p { font-size: .86rem; }
  .progress-panel { padding: 10px 12px; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; }
  .progress-panel h2 { font-size: .97rem; }
  .progress-circle { width: 42px; height: 42px; }
  .strip-caption { margin-top: 5px; }
  .day-strip { height: 5px; }
  .stats { margin-top: 7px; padding-top: 5px; }
  .stats > div, .stats > div:last-child { font-size: .89rem; }
  .section-head { margin-bottom: 13px; gap: 6px; }
  .section-head h2 { font-size: 1.14rem; gap: 6px; }
  .section-head h2 svg { width: 19px; height: 19px; }
  .break-toggle { min-height: 39px; gap: 5px; padding-inline: 8px; font-size: .84rem; }
  .switch { width: 26px; height: 16px; padding: 2px; }
  .switch::before { transform: translateX(-10px); }
  .day-group { margin: 13px 0 7px; }
  .session { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'number info done' 'number time done'; gap: 3px 10px; min-height: 76px; padding: 10px; }
  .num { grid-area: number; width: 33px; height: 41px; font-size: 1.08rem; }
  .session-info { grid-area: info; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
  .session-info :is(h3, h4) { font-size: .99rem; }
  .session-info p { font-size: .83rem; }
  .session > .range { grid-area: time; justify-self: start; font-size: 1.13rem; gap: 7px; }
  .done { grid-area: done; min-height: 42px; padding-inline: 7px; font-size: .84rem; }
  .done svg { width: 16px; height: 16px; }
  .rest { min-height: 38px; padding: 5px 17px 5px 6px; gap: 5px; font-size: .83rem; }
  .rest::before { inset-inline-start: 6px; }
  .rest svg { width: 14px; height: 14px; }
  .rest-duration::before { padding-inline-end: 4px; }
  .rest .range { font-size: .89rem; gap: 4px; }
  .rest .range i { width: 7px; }
}
@media (max-width: 359px) {
  :root { --pad: 10px; }
  .hero-copy { padding-inline: 12px; }
  .hero-time b { font-size: .92rem; }
  .session { gap: 2px 6px; padding-inline: 7px; }
  .num { width: 29px; height: 37px; }
  .session > .range { font-size: 1.06rem; gap: 5px; }
  .section-head h2 { font-size: 1.05rem; }
  .break-toggle { font-size: .81rem; }
  .rest { flex-wrap: wrap; column-gap: 5px; padding-inline-start: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
[hidden] { display: none !important; }

.attendance-panel { margin-top: 14px; padding: 15px clamp(16px, 2vw, 26px); min-width: 0; }
.attendance-head, .attendance-head > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.attendance-head { justify-content: space-between; }
.attendance-head h2 { color: var(--pine); font-size: 1.22rem; }
#attendance-count { background: #e9f1e2; color: #33553a; border-radius: 999px; padding: 1px 9px; font-size: .89rem; white-space: nowrap; }
#attendance-count:empty, #attendance-note:empty, #attendance-board-note:empty { display: none; }
#attendance-form { margin-top: 9px; max-width: 39rem; }
#attendance-form label { display: block; margin-bottom: 4px; font-weight: 700; font-size: .94rem; }
.attendance-fields { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; }
#attendance-name, #share-url { min-width: 0; padding: 6px 10px; border: 1px solid #a9bda3; border-radius: 8px; background: #fff; color: var(--ink); }
#attendance-name { flex: 1 1 9rem; min-height: 44px; font-size: 1rem; }
#attendance-submit, .share-schedule { min-height: 44px; padding: 5px 14px; border-radius: 8px; font-weight: 700; }
#attendance-submit { background: #315c42; color: #fff; border: 1px solid #315c42; }
#attendance-submit:hover { background: #244b34; }
.share-schedule { background: transparent; color: #365b40; border: 1px solid #b3c5ad; font-size: .9rem; }
.share-schedule:hover { background: #edf4e7; border-color: #8da88b; }
#attendance-submit:disabled, .share-schedule:disabled { opacity: .65; cursor: wait; }
#attendance-hint, #attendance-board-note, #share-status { margin-top: 5px; font-size: .9rem; color: var(--muted); }
#attendance-note { margin-top: 8px; font-size: .95rem; font-weight: 700; color: var(--green); }
#attendance-note.attendance-error, #attendance-board-note.attendance-error { color: #854922; }
#share-url { display: block; margin-block: 6px; width: min(100%, 36rem); font: 1rem/1.6 system-ui, sans-serif; }
#attendance-members { display: flex; flex-wrap: wrap; gap: 6px; max-height: 10rem; overflow: auto; }
#attendance-members:not(:empty) { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.attendance-member { display: flex; align-items: baseline; gap: 8px; max-width: 100%; padding: 3px 9px; background: #edf4e7; border-radius: 6px; }
.attendance-member bdi { overflow-wrap: anywhere; font-size: .94rem; font-weight: 700; }
.attendance-member time { color: #4c6652; white-space: nowrap; font-size: .89rem; }
