:root {
  color-scheme: light;
  --cream: #f3eee4;
  --paper: #fffaf0;
  --black: #191917;
  --red: #e53228;
  --action: #cb2c23;
  --muted: #68635b;
  --line: #d8d1c5;
  --sans: 'Golos Text', Arial, sans-serif;
  --display: 'Unbounded', Arial, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html { scroll-padding-bottom: 110px; }
body { margin: 0; background: var(--black); color: var(--black); font: 16px/1.55 var(--sans); -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
[hidden] { display: none !important; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
img { max-width: 100%; display: block; }
button, h1, h2, h3, p { overflow-wrap: anywhere; }

.app-shell { width: 100%; max-width: 560px; min-height: 100dvh; margin: auto; padding: env(safe-area-inset-top, 0px) 24px calc(116px + env(safe-area-inset-bottom, 0px)); position: relative; background: var(--cream); }
.app-header { height: 100px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.app-brand { width: 46px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; position: relative; transform: rotate(-7deg); background: var(--red); color: var(--paper); font: 800 31px/1 var(--display); border-radius: 9px; box-shadow: 3px 4px 0 var(--black); }
.app-brand > span { position: absolute; right: 3px; bottom: 7px; font-size: 24px; }
.app-title { font: 700 12px/1.45 var(--display); letter-spacing: -.03em; }
.app-title small { display: block; margin-top: 6px; font: 500 9px/1.35 var(--sans); letter-spacing: .08em; color: var(--muted); }
.icon-button { margin-left: auto; width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--black); border-radius: 50%; background: transparent; color: var(--black); transition: transform .18s var(--ease), background .18s; }
.icon-button:active { transform: rotate(10deg); }
.icon-button svg { width: 21px; height: 21px; }
.screen { padding-top: 24px; animation: screen-in .3s var(--ease) both; }
.date-label { margin: 0 0 18px; color: var(--muted); font-size: 10px; line-height: 1.5; font-weight: 600; text-transform: uppercase; letter-spacing: .075em; }
h1, h2, h3 { font-family: var(--display); }
h1 { font-size: clamp(25px, 6vw, 33px); line-height: 1.22; font-weight: 600; letter-spacing: -.055em; margin: 0 0 24px; }
em { color: var(--red); font-style: normal; font-weight: inherit; }
.greeting { min-height: 276px; position: relative; isolation: isolate; margin-bottom: 18px; }
.greeting > .date-label { position: relative; z-index: 2; padding-right: 15px; }
.greeting-copy { width: 57%; position: relative; z-index: 2; }
.greeting h1 { font-size: clamp(23px, 5.6vw, 31px); margin-bottom: 17px; line-height: 1.15; }
.greeting h1 em { display: inline-block; margin-top: 5px; font-size: 1.3em; line-height: 1.11; letter-spacing: -.055em; }
.greeting-caption { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.greeting-portrait { width: 47%; max-width: 235px; height: 260px; position: absolute; right: -13px; bottom: -1px; z-index: 1; pointer-events: none; overflow: hidden; border-radius: 45% 45% 12px 12px; }
.greeting-portrait img { width: 150%; max-width: none; height: auto; position: absolute; left: -25%; top: 10px; z-index: 1; animation: professor-in .65s var(--ease) both; }
.portrait-orbit { position: absolute; width: 90%; aspect-ratio: 1; right: 2px; bottom: 28px; border-radius: 50%; border: 1px dashed var(--red); transform: rotate(-10deg); background: #e532280b; }
.portrait-stamp { position: absolute; z-index: 2; right: 5px; bottom: 4px; padding: 6px 8px; border: 1px solid var(--red); border-radius: 4px; transform: rotate(-9deg); color: var(--action); background: var(--cream); font-size: 8px; line-height: 1.35; font-weight: 700; text-align: center; letter-spacing: .05em; }
.week-section { margin: 0 0 24px; padding: 0 0 19px; border-bottom: 1px solid var(--line); }
.week-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.week-heading > span { font-size: 13px; font-weight: 600; }
.week-heading small { color: var(--muted); font-size: 11px; }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.week-day { text-align: center; color: var(--muted); font-size: 11px; min-width: 0; }
.day-number { display: grid; place-items: center; position: relative; width: 36px; height: 39px; margin: 5px auto 0; font-size: 14px; font-weight: 500; color: var(--black); border: 1px solid transparent; border-radius: 11px; }
.week-day.today .day-number { background: var(--action); color: var(--paper); transform: rotate(-6deg); box-shadow: 2px 3px 0 var(--black); }
.week-day.has-action .day-number { border-color: var(--black); }
.week-day.has-action .day-number::after { content: ''; position: absolute; width: 5px; height: 5px; bottom: 3px; background: var(--red); border-radius: 50%; }
.week-day.today.has-action .day-number::after { background: var(--paper); }

.plan-card { position: relative; color: var(--cream); background: var(--black); padding: 24px; border-radius: 18px; margin-bottom: 25px; box-shadow: 4px 5px 0 #d5cebf; }
.card-top { position: relative; display: flex; align-items: center; min-height: 78px; padding-right: 83px; margin-bottom: 13px; gap: 12px; }
.card-label { font-size: 10px; line-height: 1.6; letter-spacing: .09em; font-weight: 600; color: #ded7c9; max-width: 180px; }
.card-label::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 8px; background: var(--red); vertical-align: 1px; }
.card-symbol { position: absolute; top: -6px; right: -2px; display: block; width: 74px; height: 79px; transform: rotate(11deg); border: 2px solid var(--cream); background: var(--cream); border-radius: 13px; overflow: hidden; }
.card-symbol img { width: 100%; height: 100%; object-fit: contain; }
.plan-card h2 { font-size: clamp(22px, 5.2vw, 29px); line-height: 1.25; font-weight: 600; letter-spacing: -.045em; margin: 0 0 18px; }
.plan-card p { font-size: 15px; color: #d1cabe; margin: 0 0 23px; line-height: 1.65; }
.button { min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 15px; padding: 14px 20px; border: 1px solid transparent; border-radius: 10px; font-size: 15px; line-height: 1.4; font-weight: 600; transition: transform .16s var(--ease), background .16s, box-shadow .16s; }
.button:active { transform: translateY(2px); }
.red { background: var(--action); color: #fffaf0; }
.red > span { font-size: 23px; line-height: 1; }
.soft { background: var(--paper); color: var(--black); border-color: var(--black); box-shadow: 2px 3px 0 #d8d1c5; }
.plan-card .button { width: 100%; }
.plan-card .obstacle-summary { font-size: 13px; line-height: 1.6; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid #f3eee42e; }
.task-button { display: flex; align-items: flex-start; gap: 13px; border: 0; background: transparent; color: var(--cream); width: 100%; min-height: 56px; padding: 8px 0 20px; text-align: left; font-size: 16px; line-height: 1.6; }
.task-button > span:last-child { min-width: 0; padding-top: 2px; }
.check-ring { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #d1cabe; border-radius: 8px; transition: background .18s, border-color .18s; }
.check-ring svg { display: none; width: 20px; height: 20px; stroke-width: 2.2; }
.task-button.done .check-ring { background: var(--red); border-color: var(--red); color: #fff; }
.task-button.done .check-ring svg { display: block; }
.task-button.done > span:last-child { color: #c3bcae; text-decoration: line-through; }
.plan-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 13px; border-top: 1px solid #f3eee42e; font-size: 12px; line-height: 1.45; color: #d1cabe; }
.plan-card-footer > span { min-width: 0; }
.inline-button { border: 0; background: transparent; color: inherit; min-height: 44px; padding: 10px 4px; font-size: 13px; line-height: 1.4; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.plan-card .inline-button { color: var(--cream); flex: 0 0 auto; }
.plan-card :focus-visible { outline-color: var(--cream); }
.professor-note { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0 22px; border-bottom: 1px solid var(--line); }
.note-mark { flex: 0 0 auto; color: var(--red); font: 700 64px/.8 var(--display); padding-top: 6px; }
.small-label { font-size: 10px; line-height: 1.5; letter-spacing: .075em; font-weight: 600; color: var(--muted); }
.professor-note p { margin: 8px 0 0; color: var(--black); font-size: 16px; line-height: 1.55; font-weight: 500; }
.signal-link { width: 100%; min-height: 88px; display: flex; align-items: center; gap: 12px; text-align: left; background: transparent; color: var(--black); border: 0; padding: 19px 0; font-size: 16px; font-weight: 600; }
.signal-link > span:nth-child(2) { min-width: 0; }
.signal-link small { display: block; font-size: 12px; line-height: 1.45; font-weight: 400; color: var(--muted); margin-top: 3px; }
.signal-icon { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--black); border-radius: 50%; color: var(--red); }
.signal-dot { margin-left: auto; font-size: 25px; flex: 0 0 auto; font-weight: 400; }
.share-button { background: transparent; border: 1px solid var(--black); color: var(--black); border-radius: 10px; min-height: 50px; padding: 12px 16px; font-size: 14px; font-weight: 500; width: 100%; margin: 0 0 17px; }
.local-note { color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; max-width: 390px; margin: 2px auto; }
.bottom-nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 5; width: min(100%, 560px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--cream); border-top: 1px solid var(--black); padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
.nav-tab { min-width: 0; min-height: 62px; padding: 7px 5px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 12px; line-height: 1.3; font-weight: 500; transition: background .2s, color .2s; }
.nav-tab svg { width: 22px; height: 22px; }
.nav-tab.active { color: var(--cream); background: var(--black); }
.nav-tab.active svg { color: #ff675d; }

.screen-description { color: var(--muted); font-size: 16px; line-height: 1.6; margin: -6px 0 27px; }
.state-card { position: relative; background: var(--black); color: var(--cream); padding: 24px; border-radius: 18px; margin-bottom: 29px; }
.state-card > label { font-size: 16px; font-weight: 500; }
.energy-reading { display: flex; align-items: baseline; gap: 12px; margin: 14px 0 20px; }
.energy-reading span { font: 600 65px/1.1 var(--display); letter-spacing: -.06em; color: var(--cream); }
.energy-reading small { font-size: 14px; color: #cec6b8; }
input[type=range] { width: 100%; accent-color: var(--red); min-height: 44px; cursor: pointer; margin: 0; }
.state-card input:focus-visible { outline-color: var(--cream); }
.range-labels { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; line-height: 1.5; color: #d1cabe; margin-top: 5px; }
.range-labels > span:last-child { text-align: right; }
.obstacle-choices { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.obstacle-choices legend { font-size: 17px; font-weight: 600; margin-bottom: 13px; }
.obstacle-choices label { display: block; margin: 10px 0; position: relative; }
.obstacle-choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.obstacle-choices span { position: relative; display: block; min-height: 56px; border: 1px solid var(--line); border-radius: 11px; padding: 15px 15px 15px 47px; background: var(--paper); font-size: 15px; line-height: 1.5; color: var(--black); transition: background .18s, border-color .18s; }
.obstacle-choices span::before { content: ''; width: 19px; height: 19px; position: absolute; left: 15px; top: 17px; border: 1px solid var(--muted); border-radius: 50%; }
.obstacle-choices input:checked + span { border-color: var(--black); background: #e8e1d4; }
.obstacle-choices input:checked + span::before { border: 6px solid var(--red); background: var(--paper); }
.obstacle-choices input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 3px; }
.full { width: 100%; }
.support-card { margin-top: 28px; border: 1px solid var(--black); border-left: 5px solid var(--red); padding: 23px 20px; border-radius: 0 14px 14px 0; background: var(--paper); scroll-margin-bottom: 110px; }
.support-card h2 { font-size: 22px; font-weight: 600; line-height: 1.4; letter-spacing: -.045em; margin: 14px 0; }
.support-card p { color: var(--muted); font-size: 16px; line-height: 1.65; margin: 0 0 10px; }
.support-card .inline-button { color: var(--black); text-align: left; }
.history-stat { display: flex; align-items: center; gap: 18px; background: var(--black); color: var(--cream); border-radius: 18px; padding: 24px; margin: 28px 0 32px; }
.history-stat > span { font: 600 54px/1.1 var(--display); letter-spacing: -.06em; color: #ff675d; }
.history-stat p { font-size: 14px; line-height: 1.5; margin: 0; }
.history-stat small { display: block; font-size: 11px; line-height: 1.5; color: #cec6b8; margin-top: 6px; }
.empty-history { text-align: center; padding: 13px 0 15px; }
.empty-history > span { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 22px; font-size: 45px; line-height: 1; background: var(--red); border-radius: 17px; color: var(--cream); transform: rotate(-8deg); box-shadow: 4px 5px 0 var(--black); }
.empty-history h2 { font-size: 23px; line-height: 1.35; letter-spacing: -.045em; font-weight: 600; margin: 0 0 16px; }
.empty-history p { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 0 0 24px; }
.history-item { border-left: 1px solid var(--line); padding: 0 0 28px 23px; margin-left: 9px; position: relative; }
.history-item::before { content: ''; position: absolute; width: 11px; height: 11px; background: var(--red); border: 2px solid var(--cream); border-radius: 50%; left: -6px; top: 5px; }
.history-item time { color: var(--muted); font-size: 12px; line-height: 1.5; }
.history-item h3 { font-size: 16px; line-height: 1.6; font-weight: 500; letter-spacing: -.025em; margin: 10px 0 8px; }
.history-item p { font-size: 13px; line-height: 1.6; color: var(--muted); margin: 0; }

.sheet { color: var(--black); background: var(--cream); border: 1px solid var(--black); border-radius: 22px 22px 0 0; padding: 25px 24px calc(28px + env(safe-area-inset-bottom, 0px)); width: min(100%, 560px); max-width: 100%; max-height: 92dvh; margin: auto auto 0; position: fixed; inset: auto 0 0; overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 -15px 60px #0004; }
.sheet::backdrop { background: #191917b8; }
.sheet[open] { animation: sheet-in .28s var(--ease); }
.sheet-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.sheet-header .small-label { color: var(--black); }
.close-button { flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--black); background: transparent; color: var(--black); font-size: 27px; line-height: 1; width: 44px; height: 44px; border-radius: 50%; }
.wizard-progress { display: flex; gap: 7px; margin-bottom: 28px; }
.wizard-progress i { height: 5px; flex: 1; max-width: 54px; border-radius: 4px; background: var(--line); }
.wizard-progress i.on { background: var(--red); }
.sheet h2 { font-size: clamp(23px, 5.1vw, 29px); letter-spacing: -.05em; line-height: 1.35; margin: 0 0 19px; font-weight: 600; }
.sheet h2 em { color: var(--action); }
.sheet .settings-feedback { color: var(--black); background: #ffe0d4; padding: 12px 14px; border-left: 3px solid var(--action); border-radius: 4px; }
.sheet p { font-size: 15px; line-height: 1.65; color: var(--muted); margin: 0 0 22px; }
.sheet label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 9px; }
.sheet textarea { width: 100%; padding: 15px; background: var(--paper); border: 1px solid var(--black); border-radius: 11px; color: var(--black); resize: vertical; min-height: 117px; max-height: 260px; font-size: 16px; line-height: 1.6; }
.sheet textarea::placeholder { color: var(--muted); opacity: 1; }
.example-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 22px; }
.example-chips button { min-height: 44px; font-size: 12px; line-height: 1.4; background: transparent; color: var(--black); border: 1px solid #b9b0a0; padding: 10px 12px; border-radius: 25px; }
.wizard-note { color: var(--muted); font-size: 13px; line-height: 1.6; padding-left: 13px; border-left: 3px solid var(--red); margin: 15px 0 24px; }
.wizard-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.wizard-actions > .red { flex: 1; }
.sheet .form-error { color: #a82018; font-size: 14px; padding: 12px 14px; border-left: 3px solid var(--red); background: #e532280d; border-radius: 0 8px 8px 0; margin: 12px 0; }
.danger-button { background: transparent; border: 1px solid #b12b22; border-radius: 10px; color: #a82018; width: 100%; min-height: 52px; padding: 12px; margin-top: 15px; font-size: 14px; font-weight: 500; }
.sheet .version-note { font-size: 11px; text-align: center; margin: 28px 0 0; }
.settings-sheet > p { margin-bottom: 24px; }
#confirm-clear { margin-top: 20px; padding: 18px 15px; border: 1px solid #b12b22; border-radius: 12px; background: #e5322808; }
#confirm-clear > p { color: var(--black); margin-bottom: 15px; }
.storage-warning { background: #fff7da; color: #4e3b1d; border: 1px solid #ae8850; padding: 14px; font-size: 13px; line-height: 1.6; border-radius: 10px; margin: 20px 0 0; }
.storage-warning .inline-button { text-align: left; }
.toast { position: fixed; z-index: 20; bottom: calc(103px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); max-width: min(calc(100% - 32px), 490px); width: max-content; background: var(--black); color: var(--cream); border: 1px solid #f3eee44d; border-radius: 12px; padding: 14px 18px; font-size: 14px; line-height: 1.5; box-shadow: 0 5px 20px #0003; animation: toast-in .18s; }

@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes professor-in { from { opacity: 0; transform: translateY(13px) rotate(3deg); } to { opacity: 1; transform: translateY(0) rotate(0); } }
@keyframes sheet-in { from { opacity: .5; transform: translateY(32px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; } to { opacity: 1; } }

@media (hover: hover) and (pointer: fine) {
  .red:hover { background: #be241c; }
  .soft:hover, .example-chips button:hover, .icon-button:hover { background: #e5ddce; }
  .share-button:hover { background: var(--paper); }
  .task-button:hover .check-ring { border-color: #ff675d; }
  .nav-tab:not(.active):hover { color: var(--black); background: #e5ddce; }
}
@media (min-width: 650px) {
  .app-shell { margin: 26px auto; min-height: calc(100dvh - 52px); border-radius: 24px; border: 1px solid #f3eee435; padding-inline: 30px; box-shadow: 0 28px 80px #0004; }
  .greeting { min-height: 299px; }
  .greeting-portrait { height: 285px; right: -9px; }
  .bottom-nav { bottom: 26px; width: 558px; border-radius: 0 0 23px 23px; }
  .sheet { border-radius: 22px; margin: auto; inset: 0; height: max-content; max-height: calc(100dvh - 40px); }
  .toast { bottom: 135px; }
}
@media (max-width: 390px) {
  .app-shell { padding-inline: 20px; }
  .app-header { gap: 11px; height: 90px; }
  .app-title { font-size: 10px; }
  .app-title small { font-size: 8px; }
  .app-brand { width: 43px; height: 45px; font-size: 28px; }
  .greeting { min-height: 267px; }
  .greeting-copy { width: 58%; }
  .greeting-portrait { width: 47%; height: 237px; right: -9px; }
  .greeting-caption { font-size: 11px; }
  .greeting h1 { font-size: 23px; }
  .portrait-stamp { right: 0; font-size: 7px; }
  .plan-card { padding: 22px 20px; }
  .plan-card h2 { font-size: 22px; }
  .professor-note p { font-size: 15px; }
  .signal-link { gap: 10px; font-size: 15px; }
  .signal-link small { font-size: 11px; }
  .sheet { padding-inline: 20px; }
  .sheet h2 { font-size: 23px; }
  .state-card, .history-stat { padding: 22px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
