.av-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--av-text);
}

.av-brand__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid rgb(0 240 255 / 42%);
  border-radius: 8px;
  background: linear-gradient(135deg, rgb(0 240 255 / 18%), rgb(255 43 214 / 12%));
  color: var(--av-cyan);
  box-shadow: 0 0 16px rgb(0 240 255 / 17%);
  font-size: 23px;
  line-height: 1;
}

.av-brand__text { min-width: 0; }
.av-brand__name {
  display: block;
  overflow: hidden;
  background: linear-gradient(90deg, var(--av-cyan), var(--av-magenta), var(--av-purple), var(--av-gold), var(--av-cyan));
  background-size: 300% 100%;
  animation: av-gradient-flow 8s linear infinite;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--av-font-heading);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.av-brand__sub {
  display: block;
  color: var(--av-text-dim);
  font-size: 9px;
  letter-spacing: .19em;
  text-transform: uppercase;
}

.av-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--av-radius-sm);
  color: var(--av-bg);
  background: linear-gradient(110deg, var(--av-cyan), var(--av-magenta));
  font-family: var(--av-font-ui);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .07em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  transition: transform .18s var(--av-ease), box-shadow .18s var(--av-ease);
}
.av-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgb(0 240 255 / 30%);
  color: var(--av-bg);
}
.av-button--outline {
  border-color: var(--av-line-bright);
  color: var(--av-cyan);
  background: rgb(0 240 255 / 7%);
}
.av-button--outline:hover:not(:disabled) { color: var(--av-cyan); }
.av-button--quiet {
  border-color: var(--av-line);
  color: var(--av-text-muted);
  background: rgb(234 242 255 / 4%);
}
.av-button--quiet:hover:not(:disabled) { color: var(--av-text); }
.av-button--sm { min-height: 38px; padding: 8px 12px; font-size: 11px; }
.av-button:disabled {
  border-color: var(--av-line);
  color: var(--av-text-muted);
  background: rgb(169 182 214 / 8%);
  opacity: .82;
  box-shadow: none;
}

.av-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--av-cyan);
  font-family: var(--av-font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.av-hero__title {
  max-width: 22ch;
  margin: 0;
  font-family: var(--av-font-heading);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.12;
  background: linear-gradient(90deg, var(--av-cyan), var(--av-magenta), var(--av-purple), var(--av-gold), var(--av-cyan));
  background-size: 300% 100%;
  animation: av-gradient-flow 10s linear infinite;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.av-hero__lead {
  max-width: 58ch;
  margin: 12px 0 0;
  color: var(--av-text-muted);
  font-size: 15px;
}
.av-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.av-title {
  margin: 0;
  font-family: var(--av-font-heading);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}
.av-count {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  height: 27px;
  padding: 0 7px;
  border: 1px solid var(--av-line-bright);
  border-radius: 999px;
  color: var(--av-cyan);
  font-family: var(--av-font-number);
  font-size: 12px;
  letter-spacing: 0;
}
.av-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--av-line-bright);
  border-radius: 999px;
  color: var(--av-cyan);
  background: rgb(0 240 255 / 7%);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1.1;
  white-space: nowrap;
}
.av-chip--gold {
  border-color: rgb(255 210 74 / 36%);
  color: var(--av-gold);
  background: rgb(255 210 74 / 7%);
}
.av-chip--green {
  border-color: rgb(94 216 160 / 36%);
  color: var(--av-green);
  background: rgb(94 216 160 / 8%);
}
.av-chip--muted {
  border-color: var(--av-line);
  color: var(--av-text-muted);
  background: rgb(169 182 214 / 6%);
}

.av-card {
  min-width: 0;
  border: 1px solid var(--av-line);
  border-radius: var(--av-radius);
  background: linear-gradient(160deg, var(--av-surface), rgb(17 21 42 / 80%));
  box-shadow: 0 8px 28px rgb(0 0 0 / 14%);
}
.av-card--padded { padding: 20px; }
.av-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.av-card__title {
  margin: 0;
  font-family: var(--av-font-heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.2;
}
.av-card__copy {
  margin: 10px 0 0;
  color: var(--av-text-muted);
  font-size: 14px;
}

.av-metric {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--av-line);
  border-radius: 10px;
  background: rgb(10 13 28 / 90%);
}
.av-metric__value {
  display: block;
  color: var(--av-cyan);
  font-family: var(--av-font-number);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 0 12px rgb(0 240 255 / 28%);
}
.av-metric__label {
  display: block;
  margin-top: 4px;
  color: var(--av-text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.av-metric--gold .av-metric__value { color: var(--av-gold); text-shadow: 0 0 12px rgb(255 210 74 / 24%); }
.av-metric--magenta .av-metric__value { color: var(--av-magenta); text-shadow: 0 0 12px rgb(255 43 214 / 24%); }

.av-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--av-line);
  border-radius: 12px;
  color: var(--av-text);
  background: linear-gradient(145deg, var(--av-surface-raised), var(--av-surface));
  text-align: left;
  transform: perspective(800px) rotateY(0deg);
  transform-style: preserve-3d;
  transition: border-color .2s var(--av-ease), transform .35s var(--av-ease), box-shadow .25s var(--av-ease), background .2s ease;
}
.av-day:hover:not(:disabled) {
  border-color: var(--av-line-bright);
  transform: perspective(800px) translateY(-2px) rotateY(0deg);
  box-shadow: 0 0 0 1px var(--av-line-bright), 0 0 18px rgb(0 240 255 / 16%);
}
.av-day:active:not(:disabled) { transform: perspective(800px) translateY(0) scale(.98); }
.av-day--opening:not(:disabled) {
  border-color: var(--av-cyan);
  box-shadow: 0 0 0 1px rgb(0 240 255 / 55%), 0 0 28px rgb(0 240 255 / 28%);
  transform: perspective(800px) rotateY(180deg) scale(1.06);
}
.av-day[aria-pressed="true"] {
  border-color: var(--av-cyan);
  box-shadow: 0 0 0 1px rgb(0 240 255 / 34%), 0 0 18px rgb(0 240 255 / 12%);
}
.av-day--today {
  border-color: rgb(255 210 74 / 52%);
  background: linear-gradient(140deg, rgb(255 210 74 / 13%), var(--av-surface));
  animation: av-day-aura 7s ease-in-out infinite;
}
.av-day--future { color: var(--av-text-dim); opacity: .72; }
.av-day--future::after {
  content: "✦";
  position: absolute;
  top: 9px;
  right: 10px;
  color: var(--av-text-dim);
  font-size: 12px;
}
.av-day__num {
  font-family: var(--av-font-number);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.av-day__state {
  color: var(--av-text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1.2;
  text-transform: uppercase;
}
.av-day--today .av-day__num,
.av-day--today .av-day__state { color: var(--av-gold); }
.av-day--done { border-color: rgb(94 216 160 / 45%); }
.av-day--done .av-day__num,
.av-day--done .av-day__state { color: var(--av-green); }
.av-day--future .av-day__state { color: var(--av-text-dim); }

/* Окно дня использует появление с масштабом и подъёмом, как диалоги референса. */
.av-day-dialog {
  width: min(960px, calc(100vw - 32px));
  max-width: none;
  max-height: min(90dvh, 900px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  color: var(--av-text);
  background: transparent;
}
.av-day-dialog[open] { animation: av-dialog-fade-in .24s ease both; }
.av-day-dialog::backdrop {
  background: rgb(1 2 8 / 78%);
  backdrop-filter: blur(8px);
  animation: av-backdrop-in .24s ease both;
}
.av-day-dialog__panel {
  max-height: min(88dvh, 860px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--av-line-bright);
  border-top: 2px solid var(--av-cyan);
  border-radius: var(--av-radius-lg);
  background:
    radial-gradient(90% 100% at 100% 0%, rgb(138 43 255 / 13%), transparent 70%),
    linear-gradient(160deg, rgb(10 13 28 / 98%), rgb(5 6 13 / 98%));
  background-size: 220% 220%, 100% 100%;
  background-position: 100% 0%, 0 0;
  box-shadow: 0 24px 70px rgb(0 0 0 / 65%), 0 0 30px rgb(0 240 255 / 12%);
  animation: av-dialog-pop .35s var(--av-ease) both;
}
.av-day-dialog[open] .av-day-dialog__panel { animation: av-dialog-pop .35s var(--av-ease) both, av-panel-glow 12s ease-in-out .35s infinite; }
.av-day-dialog__header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--av-line);
  background: rgb(8 10 21 / 94%);
  backdrop-filter: blur(12px);
}
.av-day-dialog__header-actions { display: flex; align-items: center; gap: 10px; }
.av-day-dialog__title {
  margin: 5px 0 0;
  font-family: var(--av-font-heading);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 900;
  line-height: 1.15;
}
.av-icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--av-line);
  border-radius: 10px;
  color: var(--av-text-muted);
  background: rgb(234 242 255 / 4%);
  font-size: 26px;
  line-height: 1;
  transition: border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.av-icon-button:hover { border-color: var(--av-line-bright); color: var(--av-cyan); transform: rotate(90deg); box-shadow: 0 0 14px rgb(0 240 255 / 16%); }
.av-day-dialog__content {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: 20px;
  padding: 22px 24px 26px;
}
.av-day-reading,
.av-day-tasks {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--av-line);
  border-radius: var(--av-radius);
  background: rgb(5 6 13 / 45%);
}
.av-day-reading__summary { margin: 0; color: var(--av-text-muted); font-size: 15px; line-height: 1.65; }
.av-day-tasks__list { display: grid; gap: 10px; margin-top: 14px; }
.av-note--expired { color: var(--av-gold); font-weight: 700; }
.av-chip--expired { color: var(--av-gold); background: rgb(255 210 74 / 9%); box-shadow: inset 0 0 0 1px rgb(255 210 74 / 24%); }

.av-task-entry {
  overflow: hidden;
  border: 1px solid var(--av-line);
  border-radius: 11px;
  background: linear-gradient(145deg, rgb(17 21 42 / 72%), rgb(5 6 13 / 72%));
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s var(--av-ease);
}
.av-task-entry:hover { border-color: var(--av-line-bright); transform: translateY(-1px); box-shadow: 0 0 16px rgb(0 240 255 / 9%); }
.av-task-entry[open] { border-color: rgb(0 240 255 / 35%); box-shadow: 0 0 18px rgb(0 240 255 / 8%); }
.av-task-entry.is-complete { border-color: rgb(94 216 160 / 38%); }
.av-task-entry__trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: start;
  gap: 12px;
  min-height: 68px;
  padding: 12px;
  list-style: none;
  cursor: pointer;
}
.av-task-entry__trigger::-webkit-details-marker { display: none; }
.av-task-entry__copy { display: grid; gap: 6px; width: 100%; min-width: 0; }
.av-task-entry__excerpt { min-width: 0; color: var(--av-text-muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.av-task__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; min-width: 0; color: var(--av-text-dim); font-size: 12px; line-height: 1.45; }
.av-task__reward { display: inline-flex; align-items: center; gap: 4px; color: var(--av-gold); white-space: nowrap; }
.av-task__reward img, .av-points-inline-icon { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; }
.av-task-entry__copy .av-task__title,
.av-task-entry__copy .av-task__text { display: block; }
.av-task-entry__copy .av-task__text { margin: 4px 0 8px; }
.av-task-entry__chevron { align-self: center; color: var(--av-cyan); font-size: 20px; text-align: center; transition: transform .2s var(--av-ease); }
.av-task-entry[open] .av-task-entry__chevron { transform: rotate(180deg); }
.av-task-entry__body { padding: 12px 16px 16px; animation: av-task-reveal .2s var(--av-ease) both; }
.av-task-entry__body p { white-space: pre-line; overflow-wrap: anywhere; }
.av-task-entry__complete { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; white-space: normal; text-align: center; }
.av-task-entry__body .av-card__copy { margin: 0 0 14px; line-height: 1.65; }
.av-task-entry__complete { min-height: 44px; }
.av-task-entry__complete:disabled { transform: none; box-shadow: none; }
.av-task-entry__complete.av-button--done {
  border-color: rgb(94 216 160 / 35%);
  color: var(--av-green);
  background: rgb(94 216 160 / 10%);
}

@keyframes av-dialog-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes av-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes av-dialog-pop { from { opacity: 0; transform: scale(.92) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes av-task-reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes av-gradient-flow { from { background-position: 0% 50%; } to { background-position: 300% 50%; } }
@keyframes av-panel-glow { 0%, 100% { background-position: 100% 0%, 0 0; } 50% { background-position: 0% 100%, 0 0; } }
@keyframes av-day-aura {
  0%, 100% { border-color: rgb(255 210 74 / 62%); box-shadow: 0 0 0 1px rgb(255 210 74 / 22%), 0 0 16px rgb(255 210 74 / 12%); }
  33% { border-color: rgb(0 240 255 / 62%); box-shadow: 0 0 0 1px rgb(0 240 255 / 22%), 0 0 18px rgb(0 240 255 / 16%); }
  66% { border-color: rgb(255 43 214 / 54%); box-shadow: 0 0 0 1px rgb(255 43 214 / 20%), 0 0 18px rgb(255 43 214 / 13%); }
}

.av-day-panel { padding: 22px; }
.av-day-panel__title {
  margin: 12px 0 0;
  font-family: var(--av-font-heading);
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.15;
}
.av-day-panel__verse {
  margin: 16px 0 0;
  padding-left: 16px;
  border-left: 2px solid var(--av-gold);
  color: var(--av-text);
  font-size: 17px;
  line-height: 1.5;
}
.av-day-panel__verse cite {
  display: block;
  margin-top: 6px;
  color: var(--av-text-dim);
  font-size: 12px;
  font-style: normal;
}
.av-day-panel__actions { margin-top: 20px; }
.av-note {
  margin: 12px 0 0;
  color: var(--av-text-muted);
  font-size: 12px;
}
.av-note--expired { color: var(--av-gold); font-weight: 700; }

.av-task {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--av-line);
  border-radius: 10px;
  background: rgb(5 6 13 / 56%);
}
.av-task__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--av-line-bright);
  border-radius: 8px;
  color: var(--av-cyan);
  background: rgb(0 240 255 / 8%);
  font-size: 20px;
}
.av-task__title {
  margin: 0;
  color: var(--av-text);
  font-size: 15px;
  font-weight: 800;
}
.av-task__text {
  margin: 4px 0 8px;
  color: var(--av-text-muted);
  font-size: 13px;
}
.av-task__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.av-progress { margin-top: 14px; }
.av-progress__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--av-text-muted);
  font-size: 12px;
}
.av-progress__row strong { color: var(--av-text); font-family: var(--av-font-number); }
.av-progress__track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(234 242 255 / 9%);
}
.av-progress__fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--av-cyan), var(--av-magenta));
  box-shadow: 0 0 12px rgb(0 240 255 / 45%);
}

.av-feed-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
}
.av-feed-item__avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(255 43 214 / 36%);
  border-radius: 12px;
  color: var(--av-magenta);
  background: rgb(255 43 214 / 9%);
  font-size: 19px;
}
.av-feed-item__text { margin: 0; color: var(--av-text-muted); font-size: 14px; }
.av-feed-item__text strong { color: var(--av-text); }
.av-feed-item__time { display: block; margin-top: 7px; color: var(--av-text-dim); font-size: 11px; }
.av-feed-item__reactions { display: flex; gap: 6px; margin-top: 12px; }
.av-reaction {
  min-width: 38px;
  min-height: 34px;
  border: 1px solid var(--av-line);
  border-radius: 9px;
  color: var(--av-text-muted);
  background: rgb(234 242 255 / 4%);
}
.av-reaction[aria-pressed="true"] {
  border-color: var(--av-line-bright);
  color: var(--av-cyan);
  background: rgb(0 240 255 / 9%);
}

@media (max-width: 720px) {
  .av-tabs__link .av-count { display: none; }
  .av-day-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .av-day-dialog__panel { max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); border-radius: 16px; }
  .av-day-dialog__content { grid-template-columns: 1fr; gap: 12px; padding: 14px; }
  .av-day-dialog__header { padding: 16px; }
  .av-day-reading, .av-day-tasks { padding: 15px; }
  .av-task-entry__body { padding-left: 16px; }
}

@media (max-width: 480px) {
  .av-brand__name { font-size: 15px; }
  .av-brand__sub { font-size: 8px; }
  .av-brand__mark { width: 28px; height: 28px; font-size: 20px; }
  .av-button--sm { padding-inline: 10px; font-size: 10px; }
  .av-title { font-size: 15px; }
  .av-metric { padding: 10px; }
  .av-metric__value { font-size: 17px; }
  .av-metric__label { font-size: 8px; letter-spacing: .05em; }
  .av-day { min-height: 76px; padding: 9px; }
  .av-day__num { font-size: 18px; }
  .av-day__state { font-size: 8px; }
  .av-day-panel { padding: 18px; }
  .av-card--padded { padding: 16px; }
  .av-day-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .av-day-dialog__panel { max-height: calc(100dvh - 12px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
  .av-day-dialog__header { gap: 8px; padding: 13px 12px; }
  .av-day-dialog__header-actions { gap: 6px; }
  .av-day-dialog__header-actions .av-chip { font-size: 9px; }
  .av-day-dialog__content { padding: 10px; }
  .av-day-reading, .av-day-tasks { padding: 12px; }
  .av-task-entry__trigger { grid-template-columns: minmax(0, 1fr) 20px; gap: 8px; padding: 12px; }
  .av-task-entry__copy .av-task__meta { gap: 4px 10px; }
}

@media (hover: none) {
  .av-day:hover:not(:disabled), .av-task-entry:hover { transform: none; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .av-day, .av-task-entry, .av-task-entry__chevron, .av-icon-button { transition: none; }
  .av-day--opening:not(:disabled) { transform: none; }
  .av-brand__name, .av-hero__title, .av-hero, .av-day--today,
  .av-day-dialog[open], .av-day-dialog::backdrop, .av-day-dialog__panel,
  .av-day-dialog[open] .av-day-dialog__panel, .av-task-entry__body { animation: none; }
}
