:root {
  color-scheme: light;
  font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  line-height: 1.5;
  color: #132d40;
  background: #edf2f5;
  --ink: #132d40;
  --muted: #526573;
  --line: #d8e2e7;
  --action: #075a6a;
  --focus: #0b7a8c;
  --panel-padding: 25px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 1rem; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.025em; line-height: 1.22; }
h2 { font-size: clamp(1.28rem, 2.2vw, 1.5rem); }
a { color: var(--action); text-underline-offset: .18em; }
button, input, select { font: inherit; color: inherit; }
button, summary, select, input[type='radio'], input[type='checkbox'] { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.shell { width: min(100% - 64px, 1216px); margin-inline: auto; }

.masthead {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(ellipse at 89% 103%, #1c5d66 0%, transparent 60%), linear-gradient(128deg, #0b1f32 22%, #12384c 100%);
}
.masthead::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: '';
  background: repeating-linear-gradient(118deg, transparent 0 72px, #e8fbff1c 72px 73px, transparent 73px 147px);
  mask-image: linear-gradient(95deg, transparent 51%, #000 100%);
}
.brands { display: flex; align-items: center; justify-content: space-between; min-height: 108px; border-bottom: 1px solid #b8ccdb45; gap: 18px; }
.brands img { display: block; object-fit: contain; min-width: 0; }
.pmm { width: clamp(158px, 20vw, 239px); max-height: 65px; }
.pla { width: clamp(116px, 14vw, 171px); max-height: 60px; }
.intro { padding: 39px 0 77px; }
.intro h1 { font-size: clamp(2.42rem, 5.2vw, 4.1rem); font-weight: 740; letter-spacing: -.059em; }
.intro h1 span { color: #a3d8d3; white-space: nowrap; }
.intro p { color: #dfedf1; margin-top: 13px; max-width: 59ch; font-size: 1.1rem; text-wrap: pretty; }

.workspace { position: relative; display: grid; grid-template-columns: minmax(322px, 388px) minmax(0,1fr); align-items: start; gap: 24px; margin-top: -41px; }
.results-column { display: grid; gap: 24px; min-width: 0; }
.panel { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 9px 25px rgba(15, 42, 59, .08); }
.panel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 17px var(--panel-padding);
  background: linear-gradient(110deg, var(--heading-from, #142d45), var(--heading-to, #254d66));
  color: #fff;
}
.panel-body { padding: 19px var(--panel-padding) 23px; }
.input-fields { display: grid; gap: 19px; }
.result-panel { --heading-from: #08534f; --heading-to: #176e62; scroll-margin-top: 12px; }
.result-panel .panel-body, .forecast .panel-body { container-type: inline-size; }
.date-label { padding: 4px 9px; border-radius: 6px; color: #fff; background: #ffffff24; font-size: .85rem; font-variant-numeric: tabular-nums; }
.file-block { position: relative; min-width: 0; }
.upload { display: flex; align-items: center; gap: 13px; min-height: 91px; padding: 14px; cursor: pointer; border: 1px dashed #6ba2af; border-radius: 13px; background: linear-gradient(142deg, #edf8f9, #f2f8fb); color: #123c54; transition: border-color .16s, background .16s; }
.upload:hover, .upload.dragging { background: #e4f4f6; border-color: #177185; }
.file-block:has(#clear-file:not([hidden])) .upload { background: #eff8f4; border-color: #68a492; border-style: solid; }
.excel-icon { display: grid; flex: 0 0 43px; height: 43px; place-items: center; border-radius: 12px; background: #116578; color: #fff; }
.excel-icon span { width: 18px; height: 22px; border: 1px solid #e1f6f8; border-radius: 3px; background: repeating-linear-gradient(to bottom, transparent 0 4px, #e1f6f8b3 4px 5px, transparent 5px 6px), linear-gradient(to right, transparent 47%, #e1f6f8b3 48% 52%, transparent 53%); background-clip: content-box; padding: 3px; }
.upload-copy { display: grid; gap: 4px; min-width: 0; }
.upload-copy strong { font-size: 1rem; line-height: 1.26; }
.upload-copy > span { color: var(--muted); font-size: .875rem; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-block:focus-within:has(.file-input:focus-visible) .upload { outline: 3px solid var(--focus); outline-offset: 3px; }
.file-status { font-size: .9rem; margin-top: 8px; font-weight: 600; color: #165e44; }
.file-status.error-text { color: #a32330; }
.text-button { border: none; background: transparent; color: var(--action); padding: 7px 0 2px; text-decoration: underline; text-underline-offset: .16em; font-size: .88rem; }
.hint { color: var(--muted); font-size: .875rem; line-height: 1.45; margin-top: 8px; }

.field, .field-group legend { font-size: .91rem; font-weight: 650; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.field-group legend { padding: 0; margin-bottom: 8px; }
#weekend-days { color: var(--muted); font-weight: 550; }
input[type='number'], select { min-width: 0; width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid #b5c5d0; border-radius: 10px; background-color: #fff; font-size: 1rem; font-weight: 400; }
select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input::placeholder { color: #657481; opacity: 1; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.choice-three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.choices + .choices, .choices + .checkbox { margin-top: 8px; }
.choices label { display: flex; gap: 6px; align-items: center; justify-content: center; min-height: 45px; border-radius: 9px; border: 1px solid #b9cbd4; font-size: .91rem; font-weight: 550; padding: 5px; cursor: pointer; }
.choices label:has(:checked) { background: #e8f6f6; border-color: #3a8188; color: #073c4c; }
input[type='checkbox'], input[type='radio'] { accent-color: var(--action); flex: 0 0 auto; margin: 0; }
.checkbox { display: flex; align-items: center; gap: 7px; font-size: .875rem; }
.error-text { color: #a32330; font-size: .9rem; margin-top: 6px; }

.empty { padding: 17px 15px; border-radius: 10px; background: #f3f7f9; color: var(--muted); }
.result-prompt { color: var(--muted); max-width: 48ch; }
.result-content { display: grid; gap: 14px; }
.productivity-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.metric { min-width: 0; padding: 16px; display: grid; align-content: start; gap: 5px; background: #f3f7f9; border: 1px solid #e0eaee; border-radius: 13px; }
.metric span { font-size: .875rem; font-weight: 650; color: var(--muted); }
.metric strong { line-height: 1.22; font-size: clamp(1.35rem,2.1vw,1.85rem); font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.weekend-metric { background: #eaf5f5; border-color: #d2e7e7; }
.metric small { font-size: .83rem; color: var(--muted); }
.pay-card { border: 1px solid #d8e5e7; border-radius: 12px; background: #fafcfc; }
.pay-breakdown { margin: 0; padding: 3px 15px; }
.pay-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 5px 14px; }
.pay-breakdown .pay-line { padding: 11px 0; }
.pay-breakdown .pay-line + .pay-line { border-top: 1px solid var(--line); }
.pay-line dt { font-weight: 650; }
.pay-line dd { margin: 0; color: #175268; font-weight: 700; }
.pay-line small { display: block; margin-top: 3px; color: var(--muted); font-size: .875rem; font-weight: 400; }
.pay-line dd, .pay-total strong, .forecast-amount strong { font-variant-numeric: tabular-nums; }
.cap-note { margin: 0 15px 12px; color: #455e6c; font-size: .875rem; }
.pay-total { padding: 15px 17px; background: linear-gradient(115deg, #e2f3ea, #f3faf6); border: 1px solid #c3dfd2; border-left: 4px solid #397d69; border-radius: 12px; color: #104d42; }
.pay-total h3 { font-size: .95rem; letter-spacing: 0; }
.pay-total strong { display: block; margin-top: 5px; font-size: clamp(1.45rem, 6.25cqw, 2.6rem); line-height: 1.12; letter-spacing: -.04em; }
.pay-total p { color: #375e54; font-size: .875rem; margin-top: 7px; }
.objective-detail { border-top: 1px solid #d8e5e7; }
.objective-detail summary { min-height: 44px; padding: 10px 15px; }
.objective-detail p { padding: 0 15px; color: var(--muted); font-size: .875rem; }
.objective-detail dl { display: grid; gap: 4px; margin: 9px 15px 13px; font-size: .875rem; }
.objective-detail dl div { display: flex; justify-content: space-between; gap: 8px; }
.objective-detail dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.forecast { --heading-from: #713b22; --heading-to: #8a4d29; background: #fffbf5; border-color: #e8dccc; }
.forecast .support { margin-top: 0; color: #664c3b; }
.forecast-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; margin-top: 14px; }
.forecast-fields .field { grid-template-rows: 1fr auto; align-content: stretch; }
.forecast-result { display: grid; gap: 4px; margin-top: 16px; padding: 13px 15px; border: 1px solid #e8d3b7; border-radius: 12px; background: #f8eddd; color: #613719; }
.forecast-amount { display: grid; gap: 4px; margin-bottom: 3px; }
#forecast-pay-label { font-size: .91rem; font-weight: 700; }
.forecast-amount strong { font-size: clamp(1.35rem, 5.6cqw, 2.1rem); line-height: 1.16; letter-spacing: -.035em; }
#forecast-days { font-weight: 700; }
.forecast-result small { color: #684d38; font-size: .875rem; }
.forecast-guidance { display: grid; gap: 10px; margin-top: 14px; }
.forecast-stability { color: #634a38; font-size: .91rem; font-weight: 650; }
.forecast-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.forecast-card { display: grid; align-content: start; gap: 3px; min-width: 0; padding: 11px 12px; border: 1px solid #cfe4db; border-radius: 10px; background: #e8f4ef; }
.forecast-card h3 { font-size: .875rem; font-weight: 650; letter-spacing: 0; }
.forecast-card strong { color: #145748; font-size: 1.18rem; font-variant-numeric: tabular-nums; }
.forecast-card small { color: var(--muted); font-size: .875rem; }
.forecast-card small:empty { display: none; }
#forecast-decrease { background: #f9eee8; border-color: #ead6cb; }
#forecast-decrease strong { color: #843d28; }
.forecast-milestones:has(> [hidden]) { grid-template-columns: 1fr; }
summary { font-weight: 650; color: var(--action); }
.support { color: var(--muted); font-size: .95rem; margin-top: 8px; max-width: 65ch; }

.counters-panel { --heading-from: #32364f; --heading-to: #484e68; }
.counters-panel .panel-heading p { margin-top: 4px; color: #e8eaf3; font-size: .875rem; }
.carry { margin-bottom: 8px; padding: 10px 12px; background: #eff8f4; border-radius: 9px; color: #144e3d; font-size: .92rem; font-weight: 650; }
.balance { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: 5px 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.balance:last-child { border-bottom: 0; padding-bottom: 4px; }
.balance h3 { font-size: 1rem; letter-spacing: -.01em; }
.balance p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; grid-column: 1 / -1; font-size: .875rem; }
.balance .balance-value { grid-column: 2; grid-row: 1; color: #175268; font-variant-numeric: tabular-nums; font-size: 1rem; text-align: right; }
.balance .balance-expiry { color: var(--ink); font-weight: 750; }
.balance .dpo-status { padding: 1px 7px; border-radius: 5px; font-weight: 700; white-space: nowrap; }
.balance .yes { color: #0b5338; background: #def2e6; }
.balance .no { color: #862d29; background: #fbe8e5; }
.footer { color: var(--muted); font-size: .87rem; padding-block: 23px 32px; }
.footer ul { margin: 8px 0 0; padding-left: 20px; }
.footer li { margin-bottom: 4px; }

@container (max-width: 420px) {
  .productivity-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .weekend-metric { grid-column: 1 / -1; grid-template-columns: minmax(0,1fr) auto; gap: 1px 12px; }
  .weekend-metric strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}
@container (max-width: 350px) {
  .forecast-fields, .forecast-milestones { grid-template-columns: 1fr; }
}
@media (max-width: 895px) {
  :root { --panel-padding: 20px; }
  .workspace { grid-template-columns: minmax(285px,320px) minmax(0,1fr); gap: 15px; }
}
@media (max-width: 760px) {
  :root { --panel-padding: 16px; }
  .shell { width: calc(100% - 28px); }
  .brands { min-height: 82px; gap: 13px; }
  .pmm { width: clamp(136px, 43vw, 186px); max-height: 53px; }
  .pla { width: clamp(99px, 30vw, 133px); max-height: 46px; }
  .intro { padding-block: 26px 57px; }
  .intro h1 { font-size: clamp(2rem, 9vw, 3.15rem); }
  .intro p { font-size: 1rem; margin-top: 9px; }
  .workspace { grid-template-columns: minmax(0,1fr); gap: 22px; margin-top: -30px; }
  .results-column { gap: 22px; }
  .panel { border-radius: 15px; }
  .panel-heading { padding-block: 14px; }
  .panel-body { padding-block: 16px 18px; }
  .metric { padding: 12px; }
  .pay-total { padding: 13px 14px; }
}
@media (max-width: 365px) {
  .brands { gap: 9px; }
  .pmm { width: 140px; }
  .pla { width: 104px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
