@charset "utf-8";

:root {
	--wd-ink: #26343b;
	--wd-muted: #607079;
	--wd-border: #d5e0e5;
	--wd-soft: #edf5f6;
	--wd-accent: #e36d54;
	--wd-danger: #a33b32;
}

.workdays-main { padding-bottom: clamp(4rem, 8vw, 7rem); }
.workdays-layout { width: min(100%, 1040px); }
#workdays-root { min-height: 640px; }

.workdays-shell,
.workdays-dashboard {
	background: #fff;
	border: 1px solid var(--wd-border);
	border-top: 5px solid var(--primary-color);
	border-radius: 8px;
	padding: clamp(1.25rem, 4vw, 3.25rem);
}

.workdays-stepper {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.5rem;
	margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.workdays-step {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	border-bottom: 3px solid var(--wd-border);
	padding: 0.25rem 0.15rem 0.65rem;
	color: #77858c;
	font-size: 0.82rem;
}

.workdays-step.is-current,
.workdays-step.is-complete { border-color: var(--primary-color); color: var(--wd-ink); }

.step-number {
	display: inline-grid;
	place-items: center;
	width: 1.75rem;
	height: 1.75rem;
	border: 1px solid currentColor;
	border-radius: 50%;
	font-weight: 700;
}

.workdays-step.is-current .step-number,
.workdays-step.is-complete .step-number { background: var(--primary-color); color: #fff; }

.setup-heading-row,
.dashboard-header,
.trial-controls,
.setup-controls,
.dashboard-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.setup-heading,
.dashboard-title {
	margin: 0;
	font-size: clamp(1.65rem, 3.2vw, 2.55rem);
	line-height: 1.4;
	letter-spacing: 0;
}

.setup-heading:focus,
.dashboard-title:focus { outline: none; }

.dashboard-title { font-size: clamp(1.65rem, 3vw, 2.2rem); }

.setup-description,
.dashboard-description {
	margin: 0.7rem 0 0;
	color: var(--wd-muted);
	line-height: 1.8;
}

.setup-intro {
	margin-top: 1.25rem;
	border-left: 4px solid var(--primary-color);
	padding: 0.85rem 1rem;
	background: var(--wd-soft);
}

.setup-intro p { margin: 0.3rem 0 0; }
.load-warning { color: var(--wd-danger); }

.workdays-form { margin-top: 1.75rem; }
.setting-group { margin: 0; border: 0; padding: 0; }
.setting-group + .setting-group { margin-top: 2rem; border-top: 1px solid var(--wd-border); padding-top: 1.5rem; }
.setting-title { margin: 0 0 1rem; font-size: 1.12rem; font-weight: 700; }

.preset-choices { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-bottom: 1rem; }
.radio-choice,
.toggle-choice {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	min-height: 48px;
	border: 1px solid var(--wd-border);
	border-radius: 5px;
	padding: 0.65rem 0.85rem;
	cursor: pointer;
}

.toggle-choice { margin-bottom: 0.65rem; }
.radio-choice:has(input:checked),
.toggle-choice:has(input:checked) { border-color: var(--primary-color); background: var(--wd-soft); }

.radio-choice input,
.toggle-choice input,
.weekday-choice input { position: absolute; opacity: 0; pointer-events: none; }

.radio-dot,
.toggle-box {
	display: inline-block;
	flex: 0 0 auto;
	width: 1.2rem;
	height: 1.2rem;
	border: 1px solid #91a1a9;
	background: #fff;
}

.radio-dot { border-radius: 50%; }
.toggle-box { border-radius: 4px; }
.radio-choice input:checked + .radio-dot { border: 5px solid var(--primary-color); }
.toggle-choice input:checked + .toggle-box { border-color: var(--primary-color); background: var(--primary-color); box-shadow: inset 0 0 0 3px #fff; }

.weekday-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.45rem; max-width: 600px; }
.weekday-choice { cursor: pointer; }
.weekday-box {
	display: grid;
	place-items: center;
	min-height: 48px;
	border: 1px solid var(--wd-border);
	border-radius: 5px;
	background: #fff;
	font-weight: 700;
}
.weekday-choice input:checked + .weekday-box { border-color: var(--primary-color); background: var(--primary-color); color: #fff; }

.setting-note { margin: 0.8rem 0 0; color: var(--wd-muted); font-size: 0.8rem; line-height: 1.7; }
.form-error { min-height: 1.5em; margin: 0.75rem 0 0; color: var(--wd-danger); font-size: 0.85rem; }

.workdays-button {
	min-height: 48px;
	border: 1px solid var(--primary-color);
	border-radius: 5px;
	padding: 0.72rem 1.25rem;
	background: #fff;
	color: var(--primary-color);
	font: inherit;
	font-weight: 700;
	line-height: 1.35;
	cursor: pointer;
}

.workdays-button.primary { background: var(--primary-color); color: var(--primary-inverse-color); }
.workdays-button.text { min-height: 40px; border-color: transparent; padding-inline: 0.45rem; }
.workdays-button.danger { color: var(--wd-danger); }
.workdays-button:hover { border-color: #17485f; background: #17485f; color: #fff; }

.workdays-button:focus-visible,
.radio-choice:has(input:focus-visible),
.toggle-choice:has(input:focus-visible),
.weekday-choice:has(input:focus-visible),
.field-wrap input:focus-visible,
.field-wrap select:focus-visible,
.trial-actions input:focus-visible,
.completed-goals summary:focus-visible {
	outline: 3px solid var(--wd-accent);
	outline-offset: 3px;
}

.setup-controls { margin-top: 2rem; border-top: 1px solid var(--wd-border); padding-top: 1.25rem; }
.control-spacer { display: block; }

.range-list,
.goal-list { display: grid; gap: 0.85rem; }
.empty-note { margin: 0; border: 1px dashed #aebbc1; padding: 1rem; color: var(--wd-muted); text-align: center; }

.range-row {
	display: grid;
	grid-template-columns: minmax(170px, 1fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto;
	gap: 0.75rem;
	align-items: end;
	border-bottom: 1px solid var(--wd-border);
	padding-bottom: 0.85rem;
}

.field-wrap { display: block; min-width: 0; }
.field-label { display: block; margin-bottom: 0.4rem; font-size: 0.82rem; font-weight: 700; }
.field-wrap input,
.field-wrap select,
.trial-actions input {
	width: 100%;
	min-height: 48px;
	border: 1px solid #aebbc1;
	border-radius: 5px;
	padding: 0.7rem 0.75rem;
	background: #fff;
	color: var(--wd-ink);
	font: inherit;
}

.add-button { margin-top: 1rem; }

.goal-row {
	display: grid;
	grid-template-columns: minmax(130px, 0.7fr) minmax(190px, 1fr) minmax(155px, 0.75fr) minmax(190px, 1fr) auto;
	gap: 0.75rem;
	align-items: end;
	margin: 0;
	border: 1px solid var(--wd-border);
	border-radius: 6px;
	padding: 1rem;
}

.goal-row-title { grid-column: 1 / -1; padding: 0 0.25rem; font-size: 0.82rem; font-weight: 700; color: var(--primary-color); }

.dashboard-header { align-items: flex-start; flex-direction: column; border-bottom: 1px solid var(--wd-border); padding-bottom: 1.25rem; }
.dashboard-eyebrow { margin: 0 0 0.5rem; color: var(--primary-color); font-size: 0.75rem; font-weight: 700; }
.saved-label { margin: 0; color: var(--wd-muted); font-size: 0.76rem; white-space: nowrap; }

.trial-controls { margin: 1rem 0; border: 1px solid var(--wd-border); border-radius: 6px; padding: 0.75rem 1rem; background: #f8fafb; }
.trial-heading strong,
.trial-heading span { display: block; }
.trial-heading span { margin-top: 0.15rem; color: var(--wd-muted); font-size: 0.78rem; }
.trial-actions { display: flex; gap: 0.6rem; align-items: center; }
.trial-actions input { min-width: 170px; }

.goal-focus-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 1rem; }
.primary-goal,
.secondary-goal {
	border: 1px solid var(--wd-border);
	border-radius: 7px;
	padding: clamp(1.25rem, 3vw, 2rem);
}
.primary-goal { border-top: 5px solid var(--primary-color); background: var(--wd-soft); }
.secondary-goal { border-top: 5px solid #8da3ad; }
.goal-kicker { margin: 0 0 0.8rem; color: var(--primary-color); font-size: 0.78rem; font-weight: 700; }
.goal-date { margin: 0; color: var(--wd-muted); font-size: 0.88rem; }
.goal-name { margin: 0.25rem 0; font-size: clamp(1.35rem, 2.6vw, 2rem); letter-spacing: 0; }
.today-badge { display: inline-block; margin: 0.5rem 0 0; border: 1px solid var(--primary-color); padding: 0.2rem 0.55rem; color: var(--primary-color); font-size: 0.75rem; font-weight: 700; }

.primary-count { display: flex; align-items: baseline; gap: 0.45rem; margin: 1.25rem 0 0; }
.count-prefix,
.count-unit { font-weight: 700; }
.count-number { color: var(--primary-color); font-family: var(--accent-font), sans-serif; font-size: clamp(4.5rem, 10vw, 7.5rem); line-height: 0.95; letter-spacing: 0; }
.calendar-days { margin: 0.75rem 0 0; color: var(--wd-muted); font-size: 0.82rem; }
.goal-memo { margin: 1rem 0 0; border-top: 1px solid var(--wd-border); padding-top: 0.8rem; }
.secondary-total { margin: 1.25rem 0 0; font-size: 1.08rem; font-weight: 700; }
.additional-count { margin: 0.7rem 0 0; border-left: 4px solid var(--wd-accent); padding: 0.7rem 0.8rem; background: #fff7f4; font-weight: 700; }

.last-workday-note { margin-top: 1rem; border-top: 1px solid var(--wd-border); padding-top: 0.85rem; }
.last-workday-note p { margin: 0.3rem 0 0; color: var(--wd-muted); font-size: 0.75rem; line-height: 1.65; }

.timeline-section { margin-top: 1.25rem; }
.section-title { margin: 0 0 1rem; font-size: 1.18rem; }
.goal-timeline { margin: 0; padding: 0; list-style: none; }
.timeline-item { position: relative; display: grid; grid-template-columns: 2rem 1fr; gap: 0.85rem; padding-bottom: 1rem; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; top: 2rem; bottom: 0; left: 0.95rem; width: 2px; background: var(--wd-border); }
.timeline-marker { position: relative; z-index: 1; display: grid; place-items: center; width: 2rem; height: 2rem; border: 2px solid var(--wd-border); border-radius: 50%; background: #fff; color: var(--wd-muted); font-size: 0.76rem; font-weight: 700; }
.timeline-item.is-primary .timeline-marker { border-color: var(--primary-color); background: var(--primary-color); color: #fff; }
.timeline-content { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 1rem; border: 1px solid var(--wd-border); border-radius: 6px; padding: 0.9rem 1rem; }
.timeline-top { grid-column: 1; display: flex; flex-wrap: wrap; gap: 0.5rem; color: var(--wd-muted); font-size: 0.75rem; }
.goal-type { color: var(--primary-color); font-weight: 700; }
.timeline-name { grid-column: 1; }
.timeline-total { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--primary-color); font-weight: 700; white-space: nowrap; }
.timeline-additional,
.timeline-last { grid-column: 1 / -1; color: var(--wd-muted); font-size: 0.78rem; }
.timeline-additional { font-weight: 700; }

.completed-goals { margin-top: 1rem; border: 1px solid var(--wd-border); border-radius: 6px; padding: 0.85rem 1rem; }
.completed-goals summary { cursor: pointer; font-weight: 700; }
.completed-list { margin: 0.8rem 0 0; padding: 0; list-style: none; }
.completed-list li { display: grid; grid-template-columns: 7rem 1fr auto; gap: 0.75rem; border-top: 1px solid var(--wd-border); padding: 0.7rem 0; }
.completed-date,
.completed-status { color: var(--wd-muted); font-size: 0.78rem; }
.completed-status { font-weight: 700; }

.legal-note { margin: 1rem 0 0; color: var(--wd-muted); font-size: 0.78rem; }
.dashboard-actions { justify-content: flex-start; margin-top: 1.5rem; border-top: 1px solid var(--wd-border); padding-top: 1.25rem; }
.no-upcoming { margin-top: 1rem; border: 1px dashed #aebbc1; padding: 1.5rem; text-align: center; }
.no-upcoming h2 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.no-upcoming p { margin: 0; color: var(--wd-muted); }

@media screen and (max-width: 900px) {
	.range-row { grid-template-columns: 1fr 1fr; }
	.range-row .field-wrap:first-child { grid-column: 1 / -1; }
	.goal-row { grid-template-columns: 1fr 1fr; }
	.goal-row .field-wrap:nth-of-type(4) { grid-column: 1 / -1; }
	.goal-focus-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 700px) {
	.setup-heading-row,
	.dashboard-header,
	.trial-controls { align-items: stretch; flex-direction: column; }
	.saved-label { white-space: normal; }
	.trial-actions { width: 100%; }
	.trial-actions input { min-width: 0; }
	.range-row,
	.goal-row { grid-template-columns: 1fr; }
	.range-row .field-wrap:first-child,
	.goal-row .field-wrap:nth-of-type(4) { grid-column: auto; }
	.timeline-content { grid-template-columns: 1fr; }
	.timeline-total { grid-column: 1; grid-row: auto; }
	.completed-list li { grid-template-columns: 1fr auto; }
	.completed-date { grid-column: 1 / -1; }
}

@media screen and (max-width: 430px) {
	.workdays-main { padding-inline: 12px; }
	.workdays-shell,
	.workdays-dashboard { padding: 1.1rem; }
	.workdays-step { flex-direction: column; gap: 0.2rem; font-size: 0.7rem; }
	.step-number { width: 1.5rem; height: 1.5rem; }
	.weekday-grid { gap: 0.3rem; }
	.weekday-box { min-height: 44px; }
	.preset-choices { display: grid; grid-template-columns: 1fr 1fr; }
	.setup-controls,
	.dashboard-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
	.setup-controls .workdays-button,
	.dashboard-actions .workdays-button { width: 100%; padding-inline: 0.55rem; }
	.trial-actions { display: grid; grid-template-columns: 1fr; }
	.trial-actions .workdays-button { width: 100%; }
	.primary-goal,
	.secondary-goal { padding: 1rem; }
	.count-number { font-size: 4.6rem; }
	.timeline-item { grid-template-columns: 1.7rem 1fr; gap: 0.6rem; }
	.timeline-marker { width: 1.7rem; height: 1.7rem; }
	.timeline-item:not(:last-child)::before { left: 0.8rem; }
}
