:root { color-scheme: light; font-family: Arial, Helvetica, sans-serif; color: #583423; background: #e9e3db; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
.page { position: relative; isolation: isolate; overflow: hidden; width: min(100%, 1080px); min-height: 100vh; margin: auto; padding: 56px 48px 32px; background: #f7f4ef; box-shadow: 0 14px 70px #48342618; }
.page::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: url('/static/watermark.png') repeat; background-size: 900px 1200px; opacity: .44; }
.page > :not(.sunset) { position: relative; z-index: 1; }
.sunset { position: absolute; z-index: 0; pointer-events: none; width: min(52%, 500px); right: -14%; top: 57%; opacity: .25; filter: saturate(.7); }
.header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; min-height: 135px; }
.header h1 { margin: 0; color: #5b2b1c; font-size: clamp(2.7rem, 6vw, 4.6rem); letter-spacing: -.055em; line-height: 1.05; }
.header > div { min-width: 0; margin-top: -24px; padding-bottom: 0; flex: 1; }
.header h1 { margin-left: -.065em; }
.countdown { margin: 12px 0 0; color: #5b2b1c; font-size: clamp(1rem, 2.3vw, 1.65rem); line-height: 1.4; font-variant-numeric: tabular-nums; }
.owner { margin: 24px 0 0; font-size: clamp(1.05rem, 2vw, 1.4rem); color: #7b4a3a; line-height: 1.15; }
.owner-name { display: inline-block; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; overflow-wrap: anywhere; }
.owner-name:hover { text-decoration: underline; text-underline-offset: 4px; }
.name-field { margin-top: 20px; }
.star { display: block; flex: 0 0 auto; width: clamp(92px, 15vw, 145px); aspect-ratio: 1; margin-top: -35px; background-color: #5b2b1c; -webkit-mask: url('/static/star.png') center / contain no-repeat; mask: url('/static/star.png') center / contain no-repeat; opacity: .8; }
.rule { height: 1px; background: #a49990; margin: 0 0 16px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; font-size: .88rem; }
.summary strong { font-size: 1.05rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.text-button { border: 0; background: transparent; color: #673424; text-decoration: underline; text-underline-offset: 3px; padding: 7px 4px; font-size: .875rem; }
.text-button:hover { color: #a56521; }
.days { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.days[hidden] { display: none; }
.past-toggle { margin-bottom: 8px; }
.past-collapsed .sunset { top: clamp(260px, 48vh, 520px); right: -5%; width: min(52%, 500px); }
.day { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 5px 0 7px; border: 0; border-radius: 5px; color: #58483f; background: transparent; touch-action: manipulation; }
.day:hover { background: #eee7dfb0; }
.single-focus .day:hover { background: transparent; }
.day:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #7d314a; outline-offset: 2px; }
.date { font-size: .8rem; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.circle { position: relative; display: block; width: clamp(38px, 5vw, 48px); aspect-ratio: 1; border: 1.5px solid #643324; border-radius: 50%; background: #f7f4ef; box-shadow: 0 0 0 2px #f7f4ef88; overflow: hidden; transition: transform .15s ease; }
.day:active .circle { transform: scale(.93); }
.single-focus .day:active .circle { transform: none; }
.sector-tick { position: absolute; z-index: 1; color: white; font-size: 12px; font-weight: 800; line-height: 1; transform: translate(-50%, -50%); text-shadow: 0 1px 2px #4b251955; }
.section { margin-top: 36px; padding-top: 22px; border-top: 1px solid #b8a99d; }
.section h2 { margin: 0 0 14px; font-size: 1rem; letter-spacing: .055em; color: #673424; }
.focus-list { margin: 0; padding: 0; list-style: none; max-width: 670px; }
.focus-list li { display: flex; align-items: baseline; gap: 24px; border-bottom: 1px solid #c7b7aa; padding: 9px 0; line-height: 1.35; }
.focus-number { min-width: 23px; color: #673424; font-size: .9rem; font-weight: 700; }
.focus-name { overflow-wrap: anywhere; }
.focus-color { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--focus-color); }
.progress-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.progress-card { min-width: 0; padding: 16px; border: 1px solid #d8c8bb; background: #fcf9f4e9; }
.progress-name { min-height: 2.5em; margin: 0 0 9px; color: var(--focus-color); font-size: .96rem; line-height: 1.3; font-weight: 700; overflow-wrap: anywhere; }
.progress-value { margin: 0 0 10px; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.meter-line { display: flex; align-items: center; gap: 8px; }
.meter-line progress { flex: 1; width: 100%; min-width: 0; height: 8px; border: 0; border-radius: 20px; overflow: hidden; accent-color: var(--focus-color); }
.meter-line progress::-webkit-progress-bar { background: #e7ddd4; border-radius: 20px; }
.meter-line progress::-webkit-progress-value { background: var(--focus-color); border-radius: 20px; }
.meter-line progress::-moz-progress-bar { background: var(--focus-color); border-radius: 20px; }
.meter-line span { min-width: 3em; color: var(--focus-color); text-align: right; font-size: .88rem; font-weight: 700; }
.muted { color: #6b5c53; font-size: .9rem; line-height: 1.45; }
.footer { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 42px; padding-top: 13px; border-top: 1px solid #d5c8bd; color: #77665c; font-size: .86rem; }
.footer .tag { color: #a08071; font-size: 1.3rem; }
.form-card { max-width: 620px; padding: 28px; background: #fffdf9ed; border: 1px solid #d8c8bb; }
.form-card h2 { margin: 0 0 10px; font-size: 1.5rem; }
.form-card p { margin: 0 0 20px; }
.field { display: grid; gap: 6px; margin: 0 0 15px; font-size: .92rem; font-weight: 700; }
.field input { width: 100%; padding: 12px 13px; border: 1px solid #b9a99b; border-radius: 4px; background: #fff; color: #362920; font-size: 1rem; }
.primary { display: inline-block; text-decoration: none; border: 0; border-radius: 4px; padding: 12px 18px; background: #653425; color: white; font-weight: 700; }
.primary:hover { background: #824936; }
.secondary { border: 1px solid #a68d7d; border-radius: 4px; padding: 10px 14px; background: #fffaf5; color: #653425; }
.secondary:hover { background: #f0e8df; }
.notice { margin: 14px 0 0; color: #8a2f32; font-size: .92rem; line-height: 1.4; }
.notice.success { color: #366a40; }
.setup-intro { margin-bottom: 20px; }
.focus-editor { display: grid; gap: 11px; margin-bottom: 18px; }
.focus-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 124px auto; align-items: end; gap: 10px; padding: 12px; border: 1px solid #dbcfc4; background: #fffdf9; }
.focus-row .field { margin: 0; }
.swatch { width: 19px; height: 19px; border-radius: 50%; background: var(--focus-color); align-self: center; }
.remove { align-self: center; border: 0; background: transparent; color: #7d314a; font-size: 1.5rem; line-height: 1; padding: 6px; }
.editor-actions { display: flex; gap: 10px; flex-wrap: wrap; }
dialog { width: min(calc(100% - 28px), 460px); padding: 24px; border: 1px solid #baa99c; border-radius: 8px; background: #f7f4ef; color: #382a22; box-shadow: 0 20px 70px #24150e40; }
dialog::backdrop { background: #21161086; }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.dialog-header h2 { margin: 0; font-size: 1.3rem; }
.close { border: 0; background: transparent; color: #653425; font-size: 1.8rem; line-height: 1; padding: 0 4px; }
.choices { display: grid; gap: 8px; margin: 17px 0 20px; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid #cdbeb2; border-radius: 5px; background: #fffdfa; color: #34261f; text-align: left; line-height: 1.35; }
.choice[aria-pressed="true"] { border-color: var(--focus-color); background: #fff; }
.choice-mark { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border: 2px solid var(--focus-color); border-radius: 50%; color: transparent; font-weight: 800; }
.choice[aria-pressed="true"] .choice-mark { color: #fff; background: var(--focus-color); }
.calendar-period { position: relative; }
.period-lock { position: absolute; right: -16px; top: 50%; transform: translateY(-50%); font-size: .75rem; }
.history-list { display: grid; gap: 14px; margin-top: 18px; }
.history-card { border: 1px solid #d8c8bb; background: #fcf9f4; padding: 16px; }
.history-card h3, .progress-card h3 { margin: 0 0 12px; overflow-wrap: anywhere; font-size: 1rem; color: #583423; }
.history-card .actions { flex-wrap: wrap; }
.archive-grid { margin-top: 18px; }
.archive-result { margin: 0 0 10px; font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.resume-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-left: auto; padding: 8px; border: 0; border-radius: 50%; background: transparent; color: #366a40; }
.resume-icon:hover { background: #e4eee2; }
.palette { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.palette button { width: 28px; height: 28px; border: 1px solid #583423; border-radius: 50%; }
.palette button:disabled { opacity: .3; cursor: not-allowed; }
.field textarea { font: inherit; font-weight: normal; resize: vertical; width: 100%; padding: 12px; border: 1px solid #b9a99b; border-radius: 4px; }
.conclusions { white-space: pre-wrap; overflow-wrap: anywhere; }
.sector-tick { text-shadow: none; }
.choice-mark { border-color: #58483f; }
.choice[aria-pressed="true"] .choice-mark { color: var(--tick-color, #241b16); border-color: #58483f; }
button:disabled { cursor: not-allowed; }
summary { cursor: pointer; font-weight: bold; }
.admin-list { display: grid; gap: 10px; margin: 18px 0; }
.admin-user { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid #c7b7aa; }
.admin-user .actions { justify-content: flex-end; }
.admin-user strong, .admin-user small { display: block; }
.admin-user small { margin-top: 4px; color: #6b5c53; }
.password-result { margin: 18px 0; padding: 17px; border: 1px solid #bcb09c; background: #fffdf8; }
.password-result code { display: block; margin: 9px 0; padding: 12px; overflow-wrap: anywhere; background: #eee6dd; color: #422820; font-size: 1rem; }
.loading { padding-top: 30vh; text-align: center; }
@media (max-width: 700px) {
  .page { padding: 28px 18px 28px; }
  .page::before { background-size: 600px 800px; }
  .header { min-height: 115px; gap: 5px; }
  .header h1 { font-size: clamp(2.1rem, 8vw, 3.6rem); }
  .header > div { margin-top: -12px; }
  .countdown { margin-top: 9px; font-size: clamp(.95rem, 3.3vw, 1.35rem); }
  .star { width: 80px; margin-top: -18px; }
  .days { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .circle { width: clamp(38px, 10vw, 48px); }
  .date { font-size: clamp(.64rem, 2.5vw, .78rem); }
  .sunset { width: 70%; right: -21%; top: 68%; }
  .focus-list li { gap: 14px; }
  .footer { flex-wrap: wrap; }
  .focus-row { grid-template-columns: 20px minmax(0, 1fr) 76px auto; gap: 6px; padding: 8px; }
  .focus-row .field { font-size: .78rem; }
  .focus-row input { padding: 10px 6px; }
  .admin-user { display: block; }
  .admin-user .actions { margin-top: 8px; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .circle { transition: none; } }
