:root {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: #18233d;
  background: #f4f6fb;
  font-synthesis: none;
  --ink: #18233d;
  --muted: #6f7890;
  --line: #dce2ee;
  --indigo: #5366ca;
  --apricot: #e4aa71;
  --paper: #fff;
  --wash: #eef1fb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
button,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
button:focus-visible,
a:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #5366ca;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 226px 1fr;
}
.rail {
  background: #e9edfa;
  border-right: 1px solid #d9dfef;
  padding: 33px 18px 25px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 740;
  letter-spacing: -0.05em;
  text-decoration: none;
  padding: 0 14px;
}
.brand small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.02em;
  font-weight: 500;
  color: var(--muted);
  margin-top: 1px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  background: var(--indigo);
  color: white;
  border-radius: 10px;
  font-weight: 750;
  letter-spacing: -0.08em;
  flex: none;
}
.side-nav {
  display: grid;
  gap: 4px;
  margin-top: 71px;
}
.nav-button {
  border: 0;
  background: transparent;
  text-align: left;
  color: #56617d;
  padding: 13px 15px;
  border-radius: 10px;
  font-weight: 590;
}
.nav-button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: inset 3px 0 var(--indigo);
}
.nav-button:hover:not(.active) {
  background: #dde4f6;
}
.rail-foot {
  margin-top: auto;
  padding: 0 14px;
  display: grid;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
}
.plain-button {
  min-height: 44px;
  background: none;
  border: 0;
  color: var(--indigo);
  font-weight: 650;
  padding: 5px 0;
  text-align: left;
}
.workspace {
  min-width: 0;
}
.topline {
  height: 78px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 22px;
  padding: 0 clamp(24px, 5vw, 72px);
  font-size: 13px;
  color: var(--muted);
}
.mobile-brand,
.mobile-logout {
  display: none;
}
#main {
  max-width: 1200px;
  margin: auto;
  padding: 38px clamp(24px, 5vw, 72px) 90px;
}
.eyeline {
  font-size: 13px;
  font-weight: 620;
  color: var(--indigo);
  margin: 0 0 10px;
}
.page-title {
  font-size: clamp(34px, 4.1vw, 58px);
  letter-spacing: -0.065em;
  line-height: 1.06;
  font-weight: 720;
  margin: 0;
}
.page-subtitle {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
  margin: 15px 0 0;
}
.week-ribbon {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 34px 0 42px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}
.week-day {
  min-height: 106px;
  padding: 18px 16px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.week-day:last-child {
  border: 0;
}
.week-day.today {
  background: var(--indigo);
  color: #fff;
}
.week-day .weekday {
  font-size: 12px;
  color: var(--muted);
}
.week-day.today .weekday {
  color: #dfe5ff;
}
.week-day .day-number {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
}
.week-day .day-caption {
  font-size: 11px;
  color: var(--muted);
}
.week-day.today .day-caption {
  color: #dfe5ff;
}
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(280px, 0.88fr);
  gap: 22px;
  align-items: start;
}
.column {
  display: grid;
  gap: 22px;
  min-width: 0;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 27px;
  min-width: 0;
}
.panel h2 {
  font-size: 23px;
  letter-spacing: -0.045em;
  margin: 0;
}
.panel h3 {
  font-size: 17px;
  letter-spacing: -0.025em;
  margin: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  margin-bottom: 20px;
}
.source-note,
.muted {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.source-note {
  margin: 7px 0 0;
}
.count-pill {
  color: var(--indigo);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.prayer-list {
  display: grid;
}
.prayer-row {
  border-top: 1px solid var(--line);
  padding: 13px 0;
}
.prayer-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
}
.prayer-name {
  font-weight: 660;
  min-width: 86px;
}
.prayer-time {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.prayer-status {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}
.prayer-status[data-status="on_time"] {
  color: #27836d;
}
.prayer-status[data-status="late"] {
  color: #a26428;
}
.prayer-status[data-status="missed"] {
  color: #ba5555;
}
.prayer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.choice {
  min-height: 44px;
  background: #f6f7fb;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #3f4d70;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
}
.choice[aria-pressed="true"] {
  border-color: var(--indigo);
  background: #e9edff;
  color: #3449ae;
}
.choice:hover:not(:disabled) {
  border-color: #8e9be0;
}
.feedback {
  min-height: 1.2em;
  margin: 7px 0 0;
  color: var(--indigo);
  font-size: 12px;
}
.feedback.error {
  color: #a63c3c;
}
.task-list,
.record-list {
  display: grid;
}
.task-row,
.record-row {
  display: flex;
  align-items: start;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px 0;
  line-height: 1.4;
}
.task-row:first-child,
.record-row:first-child {
  border-top: 0;
}
.task-title {
  font-size: 14px;
  font-weight: 590;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.task-action {
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 7px;
  color: var(--indigo);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.section-link {
  border: 0;
  background: none;
  color: var(--indigo);
  font-size: 13px;
  font-weight: 650;
  padding: 3px;
}
.journal-form {
  display: grid;
  gap: 13px;
}
.journal-form textarea {
  width: 100%;
  min-height: 155px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafbfe;
  color: var(--ink);
  padding: 14px;
  line-height: 1.5;
}
.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.primary-button {
  background: var(--indigo);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 11px 16px;
  font-weight: 680;
  min-height: 43px;
}
.primary-button:hover:not(:disabled) {
  background: #3f52b2;
}
.empty {
  background: #f7f8fc;
  border: 1px dashed #d6ddec;
  border-radius: 9px;
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.empty p {
  margin: 0;
}
.notice {
  border-left: 3px solid var(--apricot);
  padding: 9px 13px;
  background: #fbf7f2;
  color: #6b5846;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 15px;
}
.small-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.metric-large {
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.065em;
  font-weight: 700;
  margin: 13px 0 5px;
}
.metric-label {
  font-size: 13px;
  color: var(--muted);
}
.period-controls {
  display: flex;
  gap: 8px;
  margin: 26px 0;
}
.period-button {
  padding: 9px 15px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 650;
}
.period-button.active {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #fff;
}
.progress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.progress-grid .panel {
  min-height: 205px;
}
.stat-line {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.stat-line strong {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.stat-line:first-of-type {
  border-top: 0;
}
.stack-bar {
  height: 13px;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  background: #e8ebf1;
  margin: 19px 0;
}
.stack-bar span {
  height: 100%;
}
.record-row > div {
  flex: 1;
}
.record-row strong {
  font-size: 14px;
}
.record-row p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.bottom-nav {
  display: none;
}
.login {
  min-height: 100vh;
  background: #e9edfa;
  display: flex;
  flex-direction: column;
  padding: 34px clamp(24px, 7vw, 90px);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  font-weight: 740;
  letter-spacing: -0.05em;
}
.login-body {
  max-width: 620px;
  margin: auto 0;
}
.login-overline {
  font-size: 14px;
  color: var(--indigo);
  font-weight: 680;
}
.login h1 {
  font-size: clamp(48px, 7vw, 91px);
  line-height: 0.99;
  letter-spacing: -0.075em;
  margin: 15px 0 25px;
}
.login-body > p:not(.login-overline) {
  font-size: 17px;
  line-height: 1.55;
  max-width: 420px;
  color: #56617d;
}
.login .primary-button {
  margin-top: 22px;
  min-width: 210px;
}
.login-foot {
  font-size: 12px;
  color: var(--muted);
}
.pairing-code {
  font-size: clamp(29px, 6vw, 44px);
  font-weight: 760;
  letter-spacing: 0.12em;
  color: var(--indigo);
  margin: 18px 0 4px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 170px 1fr;
  }
  .rail {
    padding: 25px 10px;
  }
  .brand {
    font-size: 18px;
  }
  .main-grid,
  .progress-grid {
    grid-template-columns: 1fr;
  }
  .week-day {
    min-height: 90px;
    padding: 13px 8px;
  }
  .week-day .day-number {
    font-size: 25px;
  }
}
@media (max-width: 680px) {
  .shell {
    display: block;
  }
  .rail {
    display: none;
  }
  .mobile-brand {
    display: block;
    margin-right: auto;
    font-weight: 740;
    color: var(--ink);
    font-size: 19px;
    letter-spacing: -0.04em;
  }
  .topline {
    height: 62px;
    padding: 0 18px;
    gap: 12px;
  }
  .topline #sync-state {
    font-size: 11px;
    max-width: 52%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topline .plain-button {
    font-size: 12px;
  }
  .mobile-logout {
    display: block;
  }
  #main {
    padding: 27px 17px 110px;
  }
  .page-title {
    font-size: 40px;
  }
  .week-ribbon {
    margin: 27px 0;
    overflow-x: auto;
  }
  .week-day {
    min-width: 47px;
    padding: 10px 6px;
    min-height: 77px;
  }
  .week-day .weekday {
    font-size: 10px;
  }
  .week-day .day-number {
    font-size: 22px;
  }
  .week-day .day-caption {
    display: none;
  }
  .panel {
    padding: 21px 18px;
  }
  .small-grid {
    grid-template-columns: 1fr;
  }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    z-index: 5;
  }
  .bottom-nav .nav-button {
    text-align: center;
    min-height: 46px;
    font-size: 13px;
  }
  .bottom-nav .nav-button.active {
    box-shadow: inset 0 3px var(--indigo);
    background: #f1f3fb;
  }
  .prayer-name {
    min-width: 74px;
  }
  .prayer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }
  .choice {
    padding: 9px 7px;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.daily-panel {
  grid-column: 1/-1;
}
.day-matrix-scroll {
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
}
.day-matrix {
  display: grid;
  grid-template-columns: 88px repeat(var(--days), minmax(41px, 1fr));
  min-width: max-content;
  align-items: center;
  gap: 4px;
}
.matrix-corner,
.matrix-label {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  padding: 8px 5px;
  font-size: 12px;
  font-weight: 650;
}
.matrix-date {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.matrix-cell {
  width: 38px;
  height: 34px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: #f2f4fa;
  color: #a8b0c4;
  font-size: 20px;
  font-weight: 700;
}
.matrix-cell.is-on_time {
  background: #e2f4ee;
  color: #27836d;
}
.matrix-cell.is-late {
  background: #fdf0de;
  color: #a26428;
}
.matrix-cell.is-missed {
  background: #fae6e6;
  color: #ad5050;
}
.matrix-cell.is-done_unknown {
  background: #e9ecfa;
  color: #5366ca;
}
.daily-activity {
  margin-top: 22px;
}
.daily-activity .stat-line {
  font-size: 12px;
  color: #53617d;
}
.currency-group + .currency-group {
  margin-top: 20px;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 100;
  padding: 12px 15px;
  background: #fff;
  color: var(--indigo);
  border: 2px solid var(--indigo);
  border-radius: 8px;
}
.skip-link:focus {
  top: 12px;
}
.telegram-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--indigo);
  font-size: 14px;
  font-weight: 650;
  margin-top: 12px;
}
@media (max-width: 420px) {
  .topline #sync-state {
    display: none;
  }
  .topline {
    gap: 18px;
  }
  .topline .plain-button {
    font-size: 13px;
  }
  .stat-line span,
  .stat-line strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .daily-activity .stat-line {
    display: block;
  }
  .daily-activity .stat-line strong {
    display: block;
    text-align: left;
    margin-top: 3px;
  }
}
