:root {
  color-scheme: light;
  font-family: "SST Arabic", Tahoma, Arial, sans-serif;
  --ink: #162e27;
  --muted: #526c62;
  --green: #176c50;
  --line: #d8e6de;
  --page: #edf3ef;
  --dark: #0e3a31;
  --surface: #ffffff;
  --accent: #b67835;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; color: var(--ink); background: #eaf1ee; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: 0.56; cursor: wait; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #258368; outline-offset: 3px; }
h1, h2, p, dl, dd { margin: 0; }
.screen { width: 100%; margin-inline: auto; min-height: 34rem; height: 100dvh; padding: clamp(0.65rem,1.45vw,1.6rem); display: grid; grid-template-rows: auto auto minmax(0,1fr) auto auto; gap: clamp(0.48rem,1.18vh,1rem); }
.masthead { position: relative; isolation: isolate; overflow: hidden; border-radius: 0.95rem; color: #fff; background: linear-gradient(120deg,#18654d,#103c33 76%); display: flex; align-items: center; justify-content: space-between; gap: 0.85rem; padding: clamp(0.65rem,1.35vh,1.35rem) clamp(0.9rem,2vw,1.9rem); min-height: 4.8rem; }
.masthead::before { content:""; z-index: -1; position: absolute; inset: 0 0 0 auto; width: 55%; background: repeating-radial-gradient(ellipse at 70% 200%,transparent 0 25px,#c0e6ce26 26px,transparent 27px 37px); }
.head-title p { color: #c8e9d7; font-size: 0.84rem; font-weight: 700; }
.separator { margin-inline: 0.32rem; color: #acd5bd; }
h1 { line-height: 1.3; font-size: clamp(1.5rem,2.55vw,2.62rem); letter-spacing: -0.027em; }
.head-tools { display: flex; gap: 0.42rem; align-items: center; flex: none; }
.head-button { display: inline-grid; place-items: center; min-height: 2.75rem; padding: 0.3rem 0.68rem; border: 1px solid #709e89; border-radius: 0.6rem; color: #fff; background: #235746; white-space: nowrap; font-weight: 700; font-size: 0.84rem; }
.head-button:hover { background: #2f6e58; }
.time-detail { display: grid; gap: 0.15rem; margin-inline-end: 0.38rem; font-size: 0.82rem; color: #e1f3e9; line-height: 1.35; }
.snapshot { font-weight: 700; color: #e2efd4; font-size: 0.78rem; }
.metrics { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 0.55rem; }
.metric { position: relative; display: grid; min-width: 0; gap: 0.1rem; border: 1px solid var(--line); border-radius: 0.78rem; background: var(--surface); color: var(--ink); text-align: start; padding: clamp(0.54rem,1vh,0.86rem) 0.75rem; overflow: hidden; }
.metric::before { content: ""; display: block; position: absolute; inset-block: 0; inset-inline-start: 0; width: 0.23rem; background: #2e896d; }
.metric:nth-child(2)::before { background: #b78545; }
.metric:nth-child(3)::before { background: #53849d; }
.metric:nth-child(4)::before { background: #8473ac; }
.metric:hover { border-color: #9fbfaf; }
.metric-term { color: var(--muted); font-size: clamp(0.79rem,1.15vw,1rem); line-height: 1.28; font-weight: 700; }
.metric-number { display: block; color: var(--dark); font-weight: 800; font-size: clamp(1.32rem,2.44vw,2.56rem); line-height: 1.14; letter-spacing: -0.045em; }
.metric-source { color: var(--muted); font-size: 0.79rem; line-height: 1.3; }
.insights { display: grid; grid-template-columns: minmax(0,1.78fr) minmax(17rem,1fr); gap: 0.62rem; min-height: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 0.85rem; padding: clamp(0.6rem,1.28vh,1.1rem); min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.62rem; }
h2 { font-size: clamp(1.03rem,1.5vw,1.35rem); line-height: 1.3; }
.panel-head p { color: var(--muted); font-size: 0.83rem; margin-top: 0.14rem; line-height: 1.38; }
.period { display: flex; border: 1px solid var(--line); border-radius: 0.56rem; padding: 0.2rem; gap: 0.13rem; background: #f2f8f4; flex: none; }
.period button { min-height: 2.05rem; padding: 0.08rem 0.45rem; color: var(--dark); background: transparent; border: 0; border-radius: 0.39rem; font-weight: 700; font-size: 0.8rem; white-space: nowrap; }
.period button[aria-pressed="true"] { background: var(--dark); color: white; }
.chart { flex: 1; min-height: 0; display: grid; align-items: stretch; margin-top: 0.56rem; }
.chart:has(.bar-grid) { padding-inline: 0.6rem; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top,#e8f0eb 0px,#e8f0eb 1px,transparent 1px,transparent 23%); border-radius: 0.3rem; }
.bar-grid { min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 0.48rem; align-items: stretch; }
.bar-point { border: 0; background: transparent; color: var(--dark); display: grid; grid-template-rows: minmax(0,1fr) auto; min-width: 0; padding: 0; font-weight: 800; }
.bar-column { display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 0.2rem; min-height: 0; }
.bar-fill { display: block; width: min(65%,3.6rem); flex-shrink: 1; min-height: 2px; height: var(--bar); background: linear-gradient(150deg,#61b793,#187b5a 83%); border-radius: 0.35rem 0.35rem 0.1rem 0.1rem; }
.bar-point:hover .bar-fill, .bar-point:focus-visible .bar-fill { background: linear-gradient(140deg,#e3ba70,#ae752d); }
.bar-value { font-size: 0.81rem; }
.bar-date { color: var(--muted); font-size: 0.76rem; padding-block: 0.18rem; line-height: 1.22; min-height: 2.25rem; overflow-wrap: anywhere; }
.bar-grid.dense { gap: 0.21rem; }
.dense .bar-value, .dense .bar-date { font-size: 0; }
.dense .bar-fill { width: 85%; }
.follow-count { display: grid; place-items: center; width: 2.15rem; height: 2.15rem; border-radius: 0.55rem; background: #faeedc; color: #793f17; font-weight: 800; flex: none; }
.follow-list { display: grid; grid-auto-rows: minmax(0,1fr); flex: 1; min-height: 0; margin-top: 0.45rem; }
.follow-item { border: 0; border-top: 1px solid #e7eee9; background: white; text-align: start; padding: 0.15rem 0; color: var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 0.42rem; min-width: 0; }
.follow-item:hover .follow-label { color: var(--green); text-decoration: underline; }
.follow-label { display: block; font-size: 0.88rem; font-weight: 700; line-height: 1.35; }
.follow-source { display: block; color: var(--muted); font-size: 0.76rem; line-height: 1.3; }
.follow-value { flex: none; min-width: 2rem; border-radius: 0.38rem; padding: 0.14rem 0.39rem; text-align: center; color: #873c23; background: #f9e9dd; font-size: 0.88rem; font-weight: 800; }
.empty { display: grid; align-content: center; justify-items: center; gap: 0.47rem; color: var(--muted); text-align: center; font-size: 0.93rem; line-height: 1.5; padding: 0.38rem; }
.empty a { text-decoration: underline; color: var(--green); font-weight: 700; }
.systems { min-width: 0; }
.systems-head { display: flex; align-items: center; justify-content: space-between; gap: 0.65rem; margin-bottom: 0.35rem; }
.systems-head span { color: var(--muted); font-size: 0.79rem; }
.system-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 0.45rem; }
.system { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 0.38rem; border: 1px solid var(--line); border-radius: 0.65rem; background: white; color: var(--dark); text-align: start; padding: 0.45rem 0.55rem; }
.system:hover { border-color: #93bca6; }
.system-mark { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; flex: none; border-radius: 0.42rem; color: #205a48; background: #e4f0e8; }
.system-mark svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.system-title { display: block; font-weight: 800; font-size: clamp(0.76rem,1.1vw,0.93rem); line-height: 1.3; }
.health { display: block; color: #4f6258; font-size: 0.74rem; margin-top: 0.16rem; line-height: 1.2; font-weight: 700; }
.health.live { color: #146344; }
.health.stale { color: #7c5020; }
.health.unavailable { color: #8a443b; }
.screen-foot { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 0.79rem; line-height: 1.35; }
.text-button { border: 0; background: transparent; padding: 0.1rem 0.35rem; color: var(--green); font-weight: 800; text-decoration: underline; text-underline-offset: 0.19rem; }
.mobile-switch { display: none; }
dialog { color: var(--ink); border: 1px solid var(--line); border-radius: 0.85rem; padding: 1rem; width: min(31rem,calc(100% - 1.6rem)); max-height: calc(100dvh - 1.6rem); }
dialog::backdrop { background: #0d2c25aa; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 0.6rem; margin-bottom: 0.5rem; }
#source-state, #source-note, #group-value { color: var(--muted); font-size: 0.9rem; margin: 0.28rem 0; }
.close { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid var(--line); border-radius: 0.55rem; background: #f2f7f3; color: var(--dark); font-size: 1.4rem; }
#source-values > div { display: flex; justify-content: space-between; gap: 0.5rem; padding-block: 0.45rem; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
#source-values dd { color: var(--green); font-weight: 800; }
.open-program { display: inline-flex; align-items: center; padding: 0.45rem 0.7rem; border-radius: 0.5rem; background: var(--dark); color: #fff; font-size: 0.89rem; margin-top: 0.55rem; min-height: 2.75rem; }

@media (max-height: 680px) and (min-width: 62rem) {
  .screen { gap: 0.4rem; padding-block: 0.45rem; }
  .masthead { min-height: 4rem; padding-block: 0.32rem; }
  .metric { padding-block: 0.36rem; }
  .metric-number { font-size: min(2rem,4vh); }
  .panel { padding: 0.52rem; }
  .system { padding-block: 0.32rem; }
}
@media (max-width: 61.99rem) {
  .screen { grid-template-rows: auto auto auto minmax(0,1fr) auto; }
  .mobile-switch { display: flex; gap: 0.35rem; }
  .mobile-switch button { background: white; color: var(--dark); border: 1px solid var(--line); border-radius: 0.48rem; padding: 0.4rem 0.7rem; min-height: 2.5rem; font-weight: 700; }
  .mobile-switch button[aria-pressed="true"] { background: var(--dark); color: white; }
  .insights { display: contents; }
  body[data-panel="performance"] #attention, body[data-panel="performance"] #programs,
  body[data-panel="attention"] #performance, body[data-panel="attention"] #programs,
  body[data-panel="programs"] #performance, body[data-panel="programs"] #attention { display: none; }
  .systems { align-self: start; }
  .system-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 36rem) {
  .screen { padding: 0.42rem; min-height: 31rem; gap: 0.38rem; }
  .masthead { gap: 0.45rem; min-height: 3.95rem; padding: 0.5rem; }
  .head-title p { font-size: 0.64rem; }
  .time-detail, .head-button.return { display: none; }
  .head-button { padding-inline: 0.32rem; min-height: 2.45rem; font-size: 0.7rem; }
  h1 { font-size: 1.1rem; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0.33rem; }
  .metric { padding: 0.35rem 0.45rem; }
  .metric-source { display: none; }
  .metric-number { font-size: 1.12rem; }
  .metric-term { font-size: 0.73rem; }
  .systems-head { flex-wrap: wrap; gap: 0.12rem 0.4rem; }
  .systems-head span { font-size: 0.7rem; }
  .system-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0.32rem; }
  .system { padding: 0.29rem 0.32rem; }
  .system-mark { width: 1.43rem; height: 1.43rem; }
  .bar-grid { gap: 0.26rem; }
  .bar-value, .bar-date { font-size: 0.69rem; }
}

.weqaa-mark { display:block; width:clamp(7.8rem,11vw,10rem); height:auto; background:transparent; filter: brightness(0) invert(1); }
@media (max-width: 48rem) { .weqaa-mark { width: 6rem; } }
@media (max-width: 36rem) {
  .weqaa-mark { width: 5rem; }
  .head-tools:has(#show-login:not([hidden])) .weqaa-mark { display: none; }
}

.login-form { display: grid; gap: 0.55rem; }
.login-form label { display: grid; gap: 0.2rem; font-weight: 700; }
.login-form input { min-height: 2.65rem; border: 1px solid var(--line); padding: 0.35rem 0.58rem; border-radius: 0.48rem; font: inherit; background: #f8fbf8; }
.login-form .open-program { justify-content: center; border: 0; }
#login-dialog p { color: var(--muted); font-size: 0.88rem; }
#login-message:not(:empty) { color: #7b2e22; }

.metric:nth-child(5)::before { background: #289a77; }
.metric:nth-child(6)::before { background: #ab5c66; }
.metric-source.is-stale { color: #845418; font-weight: 700; }
.completion { display: flex; align-items: center; gap: 0.38rem; margin-inline-start: auto; font-size: 0.76rem; color: var(--dark); flex: none; }
.completion-ring { position: relative; isolation: isolate; display: grid; place-items: center; width: 3.05rem; height: 3.05rem; border-radius: 50%; background: conic-gradient(#218262 var(--rate, 0%), #e1ede6 0); }
.completion-ring::before { content: ""; position: absolute; z-index: -1; inset: 0.28rem; border-radius: 50%; background: white; }
.completion-ring strong { font-size: 0.78rem; }
.completion small { display: block; margin-top: 0.1rem; color: var(--muted); white-space: nowrap; font-size: 0.71rem; }
.chart-switch { display: flex; gap: 0.24rem; margin-top: 0.45rem; }
.chart-switch button { color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 0.42rem; min-height: 1.75rem; font-size: 0.78rem; font-weight: 700; padding: 0.15rem 0.48rem; }
.chart-switch button[aria-pressed="true"] { color: var(--green); border-color: var(--line); background: #edf6f0; }
.daily-chart { display: grid; grid-template-rows: minmax(0,1fr) auto; gap: 0.12rem; min-height: 0; border-bottom: 1px solid var(--line); }
.daily-chart svg { width: 100%; height: 100%; min-height: 0; overflow: visible; }
.daily-chart line { stroke: #e2ede6; stroke-width: 1; vector-effect: non-scaling-stroke; }
.daily-line { fill: none; stroke: #23896a; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.daily-dot { fill: #23896a; }
.daily-caption { display: flex; justify-content: space-between; gap: 0.3rem; color: var(--muted); font-size: 0.76rem; }
@media (max-width: 61.99rem) {
  .metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 36rem) {
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .completion { gap: 0.15rem; }
  .completion-ring { width: 2.15rem; height: 2.15rem; }
  .completion-ring::before { inset: 0.2rem; }
  .completion-ring strong { font-size: 0.66rem; }
  .completion > span:nth-child(2) { display: none; }
}

.phase-compare { display: flex; align-items: center; gap: .45rem; margin-block: .35rem .08rem; min-width: 0; }
.phase-compare p { color: var(--muted); min-width: 0; font-size: .76rem; line-height: 1.32; }
.phase-compare .text-button { margin-inline-start: auto; flex: none; font-size: .76rem; }
.phase-tools { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; row-gap: .12rem; }
.phase-tools button { font-size: .77rem; }
.alerts-active { color: #8b5029; }
.phase-source-time { display: block; color: var(--muted); font-size: .65rem; margin-top: .18rem; line-height: 1.2; }
.follow-importance { margin-inline-start: .3rem; color: #90501e; font-size: .7rem; }
.follow-all { align-self: flex-end; }
#feature-dialog { width: min(47rem,calc(100% - 1.2rem)); }
.feature-note { color: var(--muted); font-size: .82rem; line-height: 1.45; margin-top: .2rem; }
.feature-table { overflow-x: auto; margin-block: .45rem .7rem; }
.feature-table table { width: 100%; border-collapse: collapse; text-align: start; font-size: .85rem; }
.feature-table th, .feature-table td { padding: .45rem .55rem; border-bottom: 1px solid var(--line); text-align: start; }
.feature-table th { color: var(--dark); background: var(--page); }
.feature-subhead { margin: .85rem 0 .28rem; font-size: .99rem; }
.feature-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .4rem; margin-block: .45rem; }
.feature-total { border: 1px solid var(--line); border-radius: .5rem; padding: .45rem; display: grid; gap: .14rem; font-size: .8rem; color: var(--muted); }
.feature-total strong { color: var(--dark); font-size: 1.18rem; }
.feature-list { list-style: none; padding: 0; margin: .4rem 0; }
.feature-list li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-block: .55rem; border-bottom: 1px solid var(--line); }
.feature-list small { display: block; color: var(--muted); margin-top: .15rem; }
.feature-list a { flex: none; }
.weekly-report { display: none; }
.feature-filter { display: block; margin-block-start: .6rem; font-size: .83rem; font-weight: 700; }
.feature-filter select { margin-inline-start: .4rem; max-width: 100%; border: 1px solid var(--line); border-radius: .4rem; padding: .3rem; color: var(--dark); background: white; font: inherit; }
@media (max-width: 36rem) {
  .phase-source-time { font-size: .61rem; }
  .phase-compare p, .phase-compare .text-button { font-size: .69rem; }
  .phase-compare { gap: .25rem; align-items: flex-start; }
  .screen-foot { gap: .35rem; }
  .phase-tools button, .screen-foot > .text-button { font-size: .7rem; }
}
@media print {
  @page { size: A4 landscape; margin: 11mm; }
  html, body { width: auto; min-height: 0; margin: 0; background: white; color: #172e29; }
  body > :not(.weekly-report) { display: none !important; }
  .weekly-report { display: block; font-size: 10pt; line-height: 1.35; }
  .weekly-report[hidden] { display: none !important; }
  .weekly-report h1 { font-size: 21pt; margin: 0; }
  .weekly-report h2 { font-size: 12pt; margin: 3mm 0 1.4mm; }
  .weekly-report header { border-bottom: 1px solid #bdd4c9; padding-bottom: 2mm; display: flex; justify-content: space-between; gap: 5mm; align-items: start; }
  .weekly-report img { width: 44mm; height: auto; }
  .weekly-report p { margin: 1mm 0; }
  .weekly-report .feature-totals { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 2mm; margin: 2mm 0; }
  .weekly-report .feature-total { padding: 2mm; font-size: 8.4pt; break-inside: avoid; }
  .weekly-report .feature-total strong { font-size: 13pt; }
  .weekly-report .feature-table { margin-block: 1mm 2mm; }
  .weekly-report .feature-table table { font-size: 8.5pt; }
  .weekly-report .feature-table th, .weekly-report .feature-table td { padding: 1mm 1.6mm; }
  .weekly-report footer { margin-block-start: 2mm; border-top: 1px solid #bdd4c9; padding-top: 1.5mm; font-size: 8pt; }
}

.display-hint, .display-session-state, .display-page-status { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.display-sessions-heading { font-size: 1rem; margin: 1rem 0 .28rem; }
.display-sessions { list-style: none; margin: .35rem 0 0; padding: 0; }
.display-sessions li { border-top: 1px solid var(--line); padding-block: .56rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.display-session-name { font-weight: 700; overflow-wrap: anywhere; }
.display-session-state { display: block; }
.display-session-action { flex: none; min-height: 2.55rem; }
.display-footer-actions { display: flex; justify-content: center; flex-wrap: wrap; }
.display-page-status { position: fixed; inset-inline: .75rem; bottom: .6rem; width: fit-content; max-width: calc(100% - 1.5rem); margin: auto; background: white; padding: .35rem .65rem; border: 1px solid var(--line); border-radius: .6rem; }
.display-page-status:empty { display: none; }
