/*
 * Shared by the two styles (body.compass.style-<key>): fonts, vendored from @fontsource(-variable) 5.3.0
 * (app/assets/fonts/styles, Cyrillic and Latin subsets, each with its OFL license) — Manrope and
 * Unbounded for «Неон», Exo 2 and Tektur for «Визор» — and the structure of the shared pieces: the
 * header, the toasts, the inbox actions, the day picker. Looks live in neon.css / visor.css.
 * A font is only downloaded by a page that uses it.
 */
@font-face {
  font-family: "Manrope";
  src: url("/assets/styles/manrope-cyrillic-676bb72e.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  src: url("/assets/styles/manrope-latin-757d91ba.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Unbounded";
  src: url("/assets/styles/unbounded-cyrillic-bc09ba47.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  src: url("/assets/styles/unbounded-latin-cafa3ec4.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Exo 2";
  src: url("/assets/styles/exo2-cyrillic-f19cd7a8.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Exo 2";
  src: url("/assets/styles/exo2-latin-ff092b94.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Tektur";
  src: url("/assets/styles/tektur-cyrillic-2cd86456.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Tektur";
  src: url("/assets/styles/tektur-latin-a2a532f2.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Every style: no motion for those who asked for none (the day controller skips confetti too). */
@media (prefers-reduced-motion: reduce) {
  .compass *,
  .compass *::before,
  .compass *::after {
    animation: none !important;
    transition: none !important;
  }
  /* …but a toast still goes away: no fade, an instant hide after the same delay. */
  .compass .app-flash { animation: app-flash-out 0.01s linear 4s forwards !important; }
}

/* A section the task form hides (task_form_controller.js) stays hidden whatever display a style gives it. */
.compass [hidden] { display: none !important; }

/* The shared header's structure (app/views/layouts/_header.html.erb); looks are per style. It stays at
   the top, so the toasts (below) always sit over the header band and never over a task. */
.compass .app-nav { position: sticky; top: 0; z-index: 30; }
.compass .app-nav__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem;
}
.compass .app-nav__links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; }
.compass .app-nav__link { display: inline-flex; align-items: center; gap: 0.4rem; }
.compass .app-nav__link.is-soon { cursor: default; }
.compass .app-nav__badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
}
.compass .app-nav__aside { display: flex; align-items: center; gap: 1rem; }
.compass .app-nav__switch { display: inline-flex; align-items: center; gap: 0.3rem; }
.compass .app-nav__dot-form,
.compass .app-nav__signout-form,
.compass .inbox-actions__form { display: inline; }
.compass .app-nav__add { display: inline-flex; align-items: center; white-space: nowrap; }
.compass .app-nav__dot {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
}
.compass .app-nav__signout { cursor: pointer; }

/* ── «Обзор» (overview/show): the structure; looks are per style ──────────────────────────────
   Phone: the week strip, the day, the list below it. From 48rem: the month calendar and the list on
   the left, the day on the right. From 80rem: calendar | day | list. The day panel is a size
   container, so each style lays out its HUD by the room it actually gets. */
.compass { --nav-h: 4rem; }
.compass .overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "week" "day" "list";
  gap: 1.5rem;
  width: 100%;
  max-width: 100rem;
  margin: 0 auto;
  padding: 1rem 1rem 5rem;
}
.compass .overview__calendar { grid-area: cal; display: none; }
.compass .overview__week { grid-area: week; min-width: 0; }
.compass .overview__day { grid-area: day; min-width: 0; container-type: inline-size; }
.compass .overview__list { grid-area: list; min-width: 0; scroll-margin-top: calc(var(--nav-h) + 1rem); }
@media (min-width: 48rem) {
  .compass .overview { grid-template-columns: 18rem minmax(0, 1fr); grid-template-areas: "cal day" "list day"; align-items: start; padding-top: 1.5rem; }
  .compass .overview__calendar { display: block; }
  .compass .overview__week { display: none; }
}
@media (min-width: 80rem) {
  .compass .overview { grid-template-columns: 19rem minmax(0, 1fr) 22rem; grid-template-areas: "cal day list"; gap: 2rem; }
  .compass .overview__calendar,
  .compass .overview__list { position: sticky; top: calc(var(--nav-h) + 1rem); max-height: calc(100vh - var(--nav-h) - 2rem); overflow-y: auto; scrollbar-width: thin; }
}

/* The calendar and the week strip (overview/_calendar, _week, _cell) */
.compass .cal__head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.compass .cal__title { flex: 1; text-align: center; }
.compass .cal__arrow { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; font-size: 1.25rem; line-height: 1; }
.compass .cal__weekdays,
.compass .cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.compass .cal__weekdays { margin-top: 0.75rem; text-align: center; }
.compass .cal__grid { margin-top: 0.35rem; }
.compass .cal__cell { min-width: 0; }
.compass .cal__day {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 2.5rem;
  text-decoration: none;
}
.compass .cal__num { position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
/* The day's % as a thin ring around its number (each style colours it); none when it has no tasks. */
.compass .cal__ring {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  transition: background 0.4s;
}
.compass .cal__cell.is-empty .cal__ring { display: none; }
/* A future day's planned count: a small pill under its number. */
.compass .cal__cell.is-future .cal__num { translate: 0 -0.3rem; }
.compass .cal__planned {
  position: absolute;
  bottom: 9%;
  left: 50%;
  translate: -50% 0;
  min-width: 0.95rem;
  height: 0.85rem;
  padding: 0 0.25rem;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 0.85rem;
  text-align: center;
}
.compass .cal__to-today { display: inline-block; margin-top: 0.75rem; }
.compass .cal__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.6rem; }
.compass .cal__foot .cal__to-today { margin-top: 0; }
.compass .cal__list-jump { margin-left: auto; }
.compass .cal--week .cal__day { aspect-ratio: auto; height: 2.9rem; }

/* The phone: the header in one row — the brand is the way to «Обзор», «+ Задача» shrinks to «+». */
@media (max-width: 40rem) {
  .compass .app-nav__links { display: none; }
  .compass .app-nav__inner { flex-wrap: nowrap; gap: 0.75rem; padding: 0.75rem 1rem; }
  .compass .app-nav__aside { gap: 0.6rem; }
  .compass .app-nav__add { font-size: 0 !important; padding-inline: 0.7rem !important; }
  .compass .app-nav__add::before { content: "+"; font-size: 1rem; }
}

/* Moving tasks (overview/_move, _move_actions; move_controller.js): while a task is dragged, every
   place it can land is outlined (each style colours .is-drop-over), a past day dims, and the task
   itself fades a little — its title stays readable. */
.compass .move-actions { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; }
.compass .is-done .move-actions { display: none; }
.compass .is-done[draggable="true"] { cursor: auto; }
.compass [draggable="true"] { cursor: grab; }
.compass [draggable="true"] :is(button, a, input) { cursor: pointer; }
.compass .is-dragged { opacity: 0.6; }
.compass .overview.is-dragging [data-move-day] { outline: 1px dashed currentColor; outline-offset: 2px; }
.compass .overview.is-dragging .cal__cell.is-past .cal__day { opacity: 0.4; }
.compass .overview.is-dragging .is-drop-over { outline-style: solid; outline-width: 2px; }
.compass .move-form { display: none; }
.compass .move-picker__quick { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.compass .move-picker__day { justify-content: center; font-weight: 700; }

/* The toasts — after a change (layouts/_flash, .app-flash) and after a check-off (the day's .app-toast):
   at most two lines inside the sticky header's band, so they never cover a task's text. */
.compass .app-flash,
.compass .app-toast {
  position: fixed;
  top: 0.3rem;
  left: 1rem;
  right: 1rem;
  z-index: 40;
  width: fit-content;
  max-width: min(32rem, calc(100vw - 2rem));
  margin-inline: auto;
  padding: 0.45rem 1.1rem;
  font-size: 0.9rem;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.compass .app-flash { animation: app-flash-in 0.4s ease-out both, app-flash-out 0.5s ease-in 4s forwards; }
@keyframes app-flash-in { from { opacity: 0; transform: translateY(-0.75rem); } }
@keyframes app-flash-out { to { opacity: 0; visibility: hidden; } }

/* A free day (overview/_empty) */
.compass .day-empty { display: grid; gap: 0.75rem; justify-items: start; padding: 2rem 0; }
.compass .day-empty__add { display: inline-flex; margin-top: 0.5rem; }

/* An undated task's actions (overview/_list_actions) */
.compass .inbox-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin-top: 0.6rem; }
.compass .inbox-actions__button,
.compass .inbox-actions__link { cursor: pointer; white-space: nowrap; }

/* The day picker (overview/_picker): a modal dialog */
.compass .day-picker {
  width: min(26rem, calc(100vw - 2rem));
  margin: auto;
  padding: 0;
  border: 0;
}
.compass .day-picker__form { display: grid; gap: 1rem; padding: 1.5rem; }
.compass .day-picker__options { display: grid; gap: 0.5rem; }
.compass .day-picker__option { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; cursor: pointer; }
.compass .day-picker__date { min-width: 0; margin-left: auto; }
.compass .day-picker__buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.compass .day-picker__confirm,
.compass .day-picker__cancel { cursor: pointer; }

/* Form controls inherit the style's type */
.compass input,
.compass button,
.compass select { font: inherit; color: inherit; }
.compass input[type="date"],
.compass input[type="time"] { color-scheme: inherit; }

/* A long unbroken title (a URL) wraps instead of overflowing a row, a card or the picker. */
.compass [class*="task__title"],
.compass [class*="item__title"],
.compass [class*="card__title"],
.compass .day-picker__kicker,
.compass .app-flash { overflow-wrap: anywhere; }
.compass [class*="task__body"],
.compass [class*="task__card"],
.compass [class*="item__body"],
.compass [class*="item__card"],
.compass [class*="card__body"] { min-width: 0; }
