@font-face {
  font-family: "InterLocal";
  src: url("../fonts/Inter_24pt-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "InterLocal";
  src: url("../fonts/Inter_24pt-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "InterLocal";
  src: url("../fonts/Inter_24pt-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "InterLocal";
  src: url("../fonts/Inter_24pt-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "SpaceGroteskLocal";
  src: url("../fonts/SpaceGrotesk-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "SpaceGroteskLocal";
  src: url("../fonts/SpaceGrotesk-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "SpaceGroteskLocal";
  src: url("../fonts/SpaceGrotesk-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #eef3ff;
  --bg-accent: #d8e6ff;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-strong: #ffffff;
  --surface-soft: rgba(244, 248, 255, 0.95);
  --text: #223049;
  --muted: #64748b;
  --border: rgba(132, 152, 190, 0.24);
  --primary: #2563eb;
  --primary-strong: #1745c1;
  --secondary: #edf4ff;
  --success: #059669;
  --warning: #f59e0b;
  --danger: #e11d48;
  --shadow: 0 24px 60px rgba(52, 79, 131, 0.16);
  --radius-lg: 28px;
  --radius-md: 22px;
  --radius-sm: 16px;
  --font-body: "InterLocal", system-ui, sans-serif;
  --font-heading: "SpaceGroteskLocal", "InterLocal", sans-serif;
  --safe-bottom: max(24px, env(safe-area-inset-bottom));
  --mobile-nav-space: 138px;
  --body-radial-a: rgba(181, 210, 255, 0.85);
  --body-radial-b: rgba(255, 221, 196, 0.48);
  --body-linear-start: #f8fbff;
  --body-linear-mid: #eef3ff;
  --body-linear-end: #edf2ff;
  --input-bg: rgba(255, 255, 255, 0.86);
  --nav-bg: rgba(255, 255, 255, 0.88);
  --nav-active-bg: rgba(37, 99, 235, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--body-radial-a), transparent 32%),
    radial-gradient(circle at top right, var(--body-radial-b), transparent 32%),
    linear-gradient(180deg, var(--body-linear-start) 0%, var(--body-linear-mid) 42%, var(--body-linear-end) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-heading);
  line-height: 1.05;
}

p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app-shell {
  display: block;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px calc(var(--mobile-nav-space) + var(--safe-bottom));
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar > div {
  min-width: 0;
}

.topbar h1 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  min-width: 0;
  overflow-wrap: break-word;
  hyphens: auto;
}

.topbar-user {
  display: none;
}

.eyebrow {
  margin-bottom: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.content {
  display: grid;
  gap: 24px;
  min-width: 0;
  flex: 1 0 auto;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: left;
}

.app-footer__left,
.app-footer__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-footer__right {
  margin-left: auto;
}

.app-footer a {
  color: inherit;
}

.app-footer__left span {
  opacity: 0.7;
}

.panel,
.hero-card,
.task-card,
.score-row,
.sidebar-card,
.calendar-day,
.archive-row,
.badge-setting-card,
.list-row {
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
}

.panel,
.hero-card,
.score-row,
.list-row {
  padding: 22px;
}

.hero-grid,
.two-column {
  display: grid;
  gap: 18px;
}

.hero-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.86)),
    linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(5, 150, 105, 0.03));
}

.hero-card h2 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.hero-card p {
  color: var(--muted);
  line-height: 1.55;
}

.hero-card--brand {
  padding: 28px;
}

.hero-stats {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.hero-stats div {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(150, 173, 214, 0.18);
}

.hero-stats strong {
  display: block;
  margin-bottom: 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand__mark {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 42%, rgba(112, 207, 255, 0.38), rgba(37, 99, 235, 0.08));
  box-shadow:
    0 18px 38px rgba(37, 99, 235, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.brand strong {
  display: block;
  font-size: 1.1rem;
}

.brand span {
  color: var(--muted);
  font-size: 0.95rem;
}

.brand__logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand--public .brand__mark {
  width: 64px;
  height: 64px;
  flex-basis: 64px;
  border-radius: 22px;
}

.hero-card__brand-mark {
  width: 108px;
  height: 108px;
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 32px;
  background: radial-gradient(circle at 50% 40%, rgba(112, 207, 255, 0.42), rgba(37, 99, 235, 0.12));
  box-shadow:
    0 22px 48px rgba(37, 99, 235, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.hero-card__brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flash-stack {
  display: grid;
  gap: 10px;
}

.flash {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.flash--success {
  border-color: rgba(5, 150, 105, 0.2);
  color: #065f46;
}

.flash--error {
  border-color: rgba(225, 29, 72, 0.2);
  color: #9f1239;
}

.flash--info {
  color: var(--primary-strong);
}

.progress-card {
  margin-top: 22px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid rgba(132, 152, 190, 0.2);
}

.progress-card__top,
.section-heading,
.task-card__top,
.score-row__head,
.score-row__meta,
.task-card__footer,
.sidebar-card__row,
.toolbar-actions,
.archive-row,
.list-row,
.push-box__state,
.form-actions,
.field-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.form-actions {
  flex-wrap: wrap;
  min-width: 0;
}

.progress {
  margin-top: 12px;
  height: 14px;
  border-radius: 999px;
  background: rgba(162, 182, 218, 0.24);
  overflow: hidden;
}

.progress span,
.score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #34d399);
}

.stack,
.task-grid,
.scoreboard,
.archive-list,
.badge-settings,
.earned-badges-grid {
  display: grid;
  gap: 16px;
}

.section-heading h2,
.panel h2 {
  font-size: 1.5rem;
  min-width: 0;
  overflow-wrap: break-word;
  hyphens: auto;
}

.section-heading__count,
.point-pill,
.reward-chip,
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
}

.section-heading__count,
.point-pill {
  background: var(--secondary);
  color: var(--primary-strong);
}

.empty-state {
  padding: 28px;
  border: 1px dashed rgba(132, 152, 190, 0.44);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
  background: var(--surface-soft);
}

.task-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.task-card__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
}

.task-card__title-block {
  display: grid;
  gap: 10px;
}

.task-card__top > div:first-child,
.task-card__title-block {
  min-width: 0;
}

.task-card__title-block .chip-row {
  gap: 8px;
}

.task-card__top .icon-button {
  align-self: flex-start;
  margin-top: 2px;
}

.task-card h3 {
  font-size: 1.24rem;
  line-height: 1.08;
  overflow-wrap: break-word;
  hyphens: auto;
}

.task-card--compact {
  opacity: 0.94;
}

.chip-row,
.badge-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.earned-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--nav-active-bg);
  color: var(--primary-strong);
  font-weight: 700;
}

.earned-badge__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.83rem;
}

.status-badge--open {
  background: #e8f0ff;
  color: #1d4ed8;
}

.status-badge--due_today,
.status-badge--due_tomorrow,
.status-badge--due_day_after_tomorrow,
.status-badge--soon {
  background: #fff3d6;
  color: #b45309;
}

.status-badge--overdue {
  background: #ffe3ea;
  color: #be123c;
}

.status-badge--completed {
  background: #ddfbf1;
  color: #047857;
}

.task-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 14px;
}

.task-meta dt {
  margin-bottom: 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.task-meta dd {
  margin: 0;
  font-weight: 600;
}

.task-card--compact .task-meta {
  grid-template-columns: 1fr;
}

.task-assignee {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  min-width: 0;
}

.task-assignee__avatars {
  display: inline-flex;
  align-items: center;
}

.task-assignee__avatars .avatar + .avatar {
  margin-left: -10px;
  border: 2px solid var(--surface-strong);
}

.task-assignee span:last-child {
  overflow-wrap: break-word;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 24px rgba(78, 100, 141, 0.14);
}

.avatar--lg {
  width: 52px;
  height: 52px;
}

.done-hint,
.muted,
.inline-note,
.sidebar-card p,
.score-row__meta,
.archive-row__right small,
.calendar-task small {
  color: var(--muted);
}

.button,
.button--ghost,
.button--secondary,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #4f8cff);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
}

.button:hover,
.button--secondary:hover,
.button--ghost:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button--secondary {
  background: var(--secondary);
  color: var(--primary-strong);
}

.button--ghost {
  background: transparent;
  border: 1px solid rgba(132, 152, 190, 0.3);
  color: var(--text);
}

.button--danger {
  border-color: rgba(225, 29, 72, 0.3);
  color: var(--danger);
}

.button--wide {
  width: 100%;
}

.icon-button {
  width: 48px;
  padding: 0;
  background: var(--surface-soft);
  border: 1px solid rgba(132, 152, 190, 0.24);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid--two {
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 8px;
}

.field--full {
  grid-column: 1 / -1;
}

.field label,
.checkbox span {
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(132, 152, 190, 0.3);
  border-radius: 16px;
  background: var(--input-bg);
  color: var(--text);
}

.field--compact input,
.field--compact select {
  min-width: 120px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.checkbox--compact {
  min-height: 48px;
}

.error {
  color: var(--danger);
}

.filter-bar,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

.quick-actions {
  display: grid;
  gap: 12px;
}

.archive-user-tabs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.archive-user-tab {
  flex: 0 0 auto;
  min-width: 108px;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
  text-align: center;
}

.archive-user-tab span {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.15;
}

.archive-user-tab.is-active {
  color: var(--text);
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(52, 211, 153, 0.1));
}

.panel--toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.panel--toolbar > * {
  min-width: 0;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 18px;
  background: var(--surface-soft);
  min-width: 0;
}

.segmented a {
  padding: 10px 16px;
  border-radius: 14px;
  color: var(--muted);
  min-width: 0;
}

.segmented .is-active {
  background: var(--surface-strong);
  color: var(--text);
}

.calendar-toolbar-mobile {
  display: grid;
  gap: 14px;
  max-width: 100%;
  overflow: hidden;
}

.calendar-toolbar-mobile__header,
.calendar-toolbar-mobile__switch {
  width: 100%;
}

.calendar-toolbar-mobile__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.calendar-toolbar-mobile__header > div:first-child {
  min-width: 0;
}

.calendar-toolbar-mobile__arrows {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.calendar-nav-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 14px;
}

.calendar-nav-button span {
  font-size: 1.7rem;
  line-height: 1;
}

.calendar-toolbar-mobile__switch a {
  width: 100%;
  min-width: 0;
}

.calendar-toolbar-mobile__switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-toolbar-desktop {
  display: none;
}

.calendar-mobile-strip {
  padding: 14px 16px;
  max-width: 100%;
  overflow: hidden;
}

.calendar-mobile-strip__scroller {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  max-width: 100%;
}

.calendar-mobile-pill {
  flex: 0 0 auto;
  min-width: 84px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  display: grid;
  gap: 3px;
  scroll-snap-align: start;
  box-shadow: 0 10px 20px rgba(52, 79, 131, 0.08);
}

.calendar-mobile-pill strong {
  font-size: 1rem;
  line-height: 1;
}

.calendar-mobile-pill small {
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.calendar-mobile-pill.is-active {
  border-color: rgba(37, 99, 235, 0.16);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(52, 211, 153, 0.1));
}

.calendar-mobile-list {
  display: grid;
  gap: 14px;
  max-width: 100%;
}

.calendar-mobile-day {
  padding: 18px;
  max-width: 100%;
  overflow: hidden;
}

.calendar-mobile-day__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.calendar-mobile-day__header strong {
  font-size: 1.12rem;
}

.calendar-mobile-day__header span {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.calendar-mobile-day__tasks {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.calendar-mobile-day .calendar-task {
  background: var(--surface-strong);
}

.calendar-grid {
  display: none;
  gap: 12px;
}

.calendar-grid__weekdays {
  display: none;
}

.calendar-day {
  min-height: 132px;
  padding: 14px;
  overflow: hidden;
}

.calendar-day strong {
  display: inline-flex;
  margin-bottom: 10px;
}

.calendar-day--empty {
  display: none;
}

.calendar-day__tasks {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.calendar-task {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  padding: 9px 10px;
  border-radius: 14px;
  background: var(--surface-soft);
  overflow: hidden;
}

.calendar-task__title {
  display: block;
  overflow: visible;
  min-width: 0;
  font-size: 0.96rem;
  line-height: 1.15;
  font-weight: 600;
  color: var(--text);
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: manual;
}

.calendar-task__person {
  display: block;
  overflow: visible;
  min-width: 0;
  font-size: 0.74rem;
  line-height: 1.2;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: manual;
}

.calendar-task--open {
  border-left: 4px solid #2563eb;
}

.calendar-task--due_today,
.calendar-task--due_tomorrow,
.calendar-task--due_day_after_tomorrow,
.calendar-task--soon {
  border-left: 4px solid #f59e0b;
}

.calendar-task--overdue {
  border-left: 4px solid #e11d48;
}

.calendar-task--completed {
  border-left: 4px solid #059669;
}

.score-row {
  display: grid;
  gap: 16px;
}

.score-row--leader {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 255, 249, 0.92)),
    linear-gradient(135deg, rgba(52, 211, 153, 0.08), rgba(37, 99, 235, 0.08));
}

.score-row__person,
.archive-row__left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.score-row__points strong {
  display: block;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  text-align: right;
}

.score-bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(162, 182, 218, 0.22);
  overflow: hidden;
}

.reward-chip,
.rank-badge {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-strong);
}

.badge-setting-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.badge-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
}

.badge-card--earned {
  background: var(--nav-active-bg);
}

.badge-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(52, 211, 153, 0.12));
  color: var(--primary-strong);
}

.badge-card__icon .nav-icon,
.badge-card__icon .nav-icon svg {
  width: 26px;
  height: 26px;
}

.badge-card__body {
  display: grid;
  gap: 8px;
}

.settings-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px;
  border-radius: 22px;
  background: var(--surface-soft);
  border: 1px solid rgba(132, 152, 190, 0.18);
  box-shadow: 0 12px 30px rgba(58, 82, 128, 0.1);
}

.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  color: var(--muted);
  font-weight: 700;
}

.settings-tab.is-active {
  background: var(--surface-strong);
  color: var(--primary-strong);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.08);
}

.push-box {
  display: grid;
  gap: 18px;
}

.admin-user-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.admin-user-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid rgba(132, 152, 190, 0.22);
}

.admin-user-card__identity,
.admin-user-card__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-user-card__actions form {
  margin: 0;
}

.quick-win-list {
  display: grid;
  gap: 12px;
}

.quick-win-list__toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.quick-win-manage-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid rgba(132, 152, 190, 0.22);
}

.quick-win-manage-card {
  align-items: stretch;
  cursor: move;
}

.quick-win-manage-card.is-dragging {
  opacity: 0.72;
}

.quick-win-manage-form {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.quick-win-manage-form[hidden] {
  display: none !important;
}

.quick-win-manage-card__summary {
  display: grid;
  gap: 10px;
}

.quick-win-manage-card__title strong {
  display: block;
  font-size: 1.12rem;
  line-height: 1.25;
}

.quick-win-manage-card__drag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.quick-win-manage-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-win-grid {
  display: grid;
  gap: 12px;
}

.quick-win-dialog-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.quick-win-dialog-header__badge {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(52, 211, 153, 0.24));
  border: 1px solid rgba(132, 152, 190, 0.22);
  color: var(--primary-strong);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.16);
}

.quick-win-dialog-header__badge svg {
  width: 24px;
  height: 24px;
}

.quick-win-manage-card p {
  color: var(--muted);
}

.quick-win-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.quick-win-tag {
  position: relative;
  min-width: 0;
  flex: 0 0 auto;
  max-width: 100%;
}

.quick-win-tag input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.quick-win-tag span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  max-width: 100%;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(132, 152, 190, 0.22);
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  cursor: pointer;
}

.quick-win-tag input:checked + span {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(52, 211, 153, 0.16));
  border-color: rgba(37, 99, 235, 0.34);
  color: var(--primary-strong);
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.16);
  transform: translateY(-1px);
}

.quick-win-tag--custom span {
  border-style: dashed;
}

.quick-win-tag--custom {
  flex-basis: 100%;
}

.quick-win-tag--custom span {
  width: fit-content;
}

.quick-win-custom-fields {
  display: grid;
  gap: 14px;
}

.quick-win-custom-fields[hidden] {
  display: none !important;
}

.dialog-actions--stack {
  display: grid;
  gap: 12px;
}

@media (max-width: 640px) {
  .brand {
    gap: 12px;
  }

  .brand__mark {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    border-radius: 18px;
  }

  .brand--public .brand__mark,
  .hero-card__brand-mark {
    width: 88px;
    height: 88px;
    flex-basis: 88px;
    border-radius: 28px;
  }

  .archive-user-tabs {
    gap: 10px;
    margin-bottom: 4px;
  }

  .archive-user-tab {
    min-width: 92px;
    padding: 12px 12px;
    gap: 6px;
    border-radius: 18px;
  }

  .archive-user-tab span {
    font-size: 0.82rem;
  }

  .task-card {
    gap: 14px;
    padding: 18px;
  }

  .task-card__top {
    gap: 10px;
  }

  .task-card__title-block {
    gap: 8px;
  }

  .task-card__title-block .chip-row {
    gap: 6px;
  }

  .task-card__top .icon-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 14px;
    margin-top: 0;
  }

  .task-card h3 {
    font-size: 1.15rem;
  }

  .form-panel h2 {
    font-size: 1.85rem;
    line-height: 1.08;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .complete-dialog__surface {
    width: min(410px, 100%);
    max-width: 100%;
    padding: 18px 16px;
    gap: 14px;
    overflow-x: hidden;
  }

  .quick-win-dialog-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quick-win-dialog-header__badge {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .quick-win-dialog-header__badge svg {
    width: 19px;
    height: 19px;
  }

  .quick-win-tag-grid {
    gap: 8px;
  }

  .quick-win-tag {
    max-width: 100%;
    flex: 0 1 auto;
  }

  .quick-win-tag span {
    width: 100%;
    max-width: 100%;
    padding: 6px 11px;
    font-size: 0.84rem;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    justify-content: center;
  }

  .quick-win-tag--custom span {
    width: auto;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .celebration-score {
    width: 80vw;
    font-size: clamp(5.5rem, 28vw, 8.5rem);
  }

  .celebration-glow {
    width: min(78vw, 240px);
  }

  .form-actions .button,
  .form-actions a.button {
    width: 100%;
  }

  .quick-win-list__toolbar {
    justify-content: stretch;
  }

  .quick-win-list__toolbar .button {
    width: 100%;
  }
}

.push-box__state {
  align-items: flex-start;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-soft);
}

.push-box__state.is-disabled {
  border: 1px dashed rgba(225, 29, 72, 0.26);
}

.push-box__state.is-ready {
  border: 1px solid rgba(5, 150, 105, 0.18);
}

.auth-layout {
  display: grid;
  gap: 18px;
}

.auth-panel {
  max-width: 520px;
}

.sidebar {
  display: none;
}

.bottom-nav {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  padding: 8px 8px;
  border-radius: 22px;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 44px rgba(58, 82, 128, 0.2);
  border: 1px solid rgba(132, 152, 190, 0.22);
  z-index: 40;
}

.bottom-nav__item,
.nav-link {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  padding: 10px 3px 9px;
  color: var(--muted);
  border-radius: 16px;
  text-align: center;
  font-size: 0.61rem;
  font-weight: 700;
  line-height: 1.05;
}

.bottom-nav__item span {
  display: block;
  width: 100%;
  min-height: 2.3em;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.bottom-nav__item.is-active,
.nav-link.is-active {
  color: var(--primary-strong);
  background: var(--nav-active-bg);
}

.nav-icon,
.nav-icon svg {
  width: 18px;
  height: 18px;
  display: inline-block;
}

.complete-dialog {
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 12px;
  border: 0;
  background: transparent;
  overflow: visible;
  box-sizing: border-box;
}

.complete-dialog:not([open]) {
  display: none;
}

.complete-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.complete-dialog::backdrop {
  background: rgba(18, 31, 56, 0.36);
  backdrop-filter: blur(6px);
}

.complete-dialog__surface {
  width: min(460px, 100%);
  max-width: 100%;
  padding: 24px;
  border-radius: 28px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  min-width: 0;
}

.complete-dialog__surface--task {
  width: min(520px, 100%);
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-y;
}

.celebration-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  overflow: hidden;
}

.celebration-score,
.celebration-glow,
.celebration-particle {
  position: absolute;
  left: 50%;
  top: 50%;
}

.celebration-score {
  width: min(80vw, 520px);
  padding: 0;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(214, 234, 255, 0.92) 18%,
      rgba(94, 168, 255, 0.72) 42%,
      rgba(52, 211, 153, 0.74) 70%,
      rgba(255, 255, 255, 0.92) 100%
    );
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.22);
  font-size: clamp(6.5rem, 28vw, 12rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.08em;
  text-align: center;
  transform: translate(-50%, -50%);
  filter:
    drop-shadow(0 10px 24px rgba(94, 168, 255, 0.18))
    drop-shadow(0 0 18px rgba(255, 255, 255, 0.18));
  animation: celebration-score-in 1.15s cubic-bezier(0.18, 0.84, 0.24, 1) forwards;
}

.celebration-glow {
  width: min(56vw, 280px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(94, 168, 255, 0.26) 0%, rgba(52, 211, 153, 0.2) 42%, rgba(94, 168, 255, 0) 74%);
  transform: translate(-50%, -50%);
  filter: blur(10px);
  animation: celebration-glow 0.95s ease-out forwards;
}

.celebration-particle {
  width: var(--size, 10px);
  height: var(--size, 10px);
  border-radius: 999px;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-4px);
  animation: celebration-particle 0.82s ease-out var(--delay, 0s) forwards;
}

.choice-grid {
  display: grid;
  gap: 12px;
}

.dialog-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.text-link {
  color: var(--primary-strong);
  font-weight: 700;
}

.fab-quick-task {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(86px + var(--safe-bottom));
  width: 62px;
  height: 62px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #34d399);
  color: #fff;
  box-shadow: 0 24px 40px rgba(37, 99, 235, 0.34);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 45;
  cursor: pointer;
}

.fab-quick-task .nav-icon,
.fab-quick-task .nav-icon svg {
  width: 24px;
  height: 24px;
}

@keyframes celebration-score-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -42%) scale(0.74);
    filter: blur(16px);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(0);
  }
  58% {
    opacity: 1;
    transform: translate(-50%, -53%) scale(1.03);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -76%) scale(1.08);
    filter: blur(20px);
  }
}

@keyframes celebration-glow {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.32);
  }
  22% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.42);
  }
}

@keyframes celebration-particle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(0) scale(0.4);
    filter: blur(4px);
  }
  18% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(var(--distance) * -1)) scale(0.9);
    filter: blur(6px);
  }
}

@media (max-width: 759px) {
  .calendar-toolbar-mobile__header {
    align-items: flex-start;
  }

  .calendar-toolbar-mobile__header h2 {
    font-size: 1.5rem;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b1220;
    --bg-accent: #15233d;
    --surface: rgba(17, 24, 39, 0.82);
    --surface-strong: rgba(15, 23, 38, 0.96);
    --surface-soft: rgba(20, 30, 49, 0.92);
    --text: #e5eefc;
    --muted: #9eb0cc;
    --border: rgba(121, 146, 191, 0.2);
    --primary: #5ea8ff;
    --primary-strong: #d7e7ff;
    --secondary: rgba(37, 99, 235, 0.16);
    --shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
    --body-radial-a: rgba(37, 99, 235, 0.28);
    --body-radial-b: rgba(20, 184, 166, 0.14);
    --body-linear-start: #0b1220;
    --body-linear-mid: #0f172a;
    --body-linear-end: #131f35;
    --input-bg: rgba(16, 24, 38, 0.92);
    --nav-bg: rgba(15, 23, 38, 0.9);
    --nav-active-bg: rgba(59, 130, 246, 0.18);
  }

  .hero-card {
    background:
      linear-gradient(135deg, rgba(16, 24, 38, 0.98), rgba(20, 30, 49, 0.92)),
      linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(20, 184, 166, 0.06));
  }

  .hero-stats div {
    background: var(--surface-soft);
  }

  .icon-button {
    border-color: rgba(121, 146, 191, 0.24);
  }

  .flash--success {
    color: #7df1c7;
  }

  .flash--error {
    color: #ff94b0;
  }

  .status-badge--open {
    background: rgba(37, 99, 235, 0.16);
    color: #8db7ff;
  }

  .status-badge--due_today,
  .status-badge--due_tomorrow,
  .status-badge--due_day_after_tomorrow,
  .status-badge--soon {
    background: rgba(245, 158, 11, 0.18);
    color: #ffd38a;
  }

  .status-badge--overdue {
    background: rgba(225, 29, 72, 0.18);
    color: #ff9cb2;
  }

  .status-badge--completed {
    background: rgba(5, 150, 105, 0.18);
    color: #8df0cb;
  }

  .button--ghost {
    border-color: rgba(121, 146, 191, 0.24);
  }

  .score-row--leader {
    background:
      linear-gradient(135deg, rgba(18, 29, 49, 0.98), rgba(24, 39, 62, 0.94)),
      linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(94, 168, 255, 0.08));
    border-color: rgba(94, 168, 255, 0.2);
  }

  .score-row--leader .rank-badge,
  .score-row--leader .earned-badge {
    background: rgba(94, 168, 255, 0.16);
    color: var(--primary-strong);
  }

  .score-row--leader .earned-badge__icon {
    background: rgba(10, 18, 32, 0.56);
  }

  .score-row__points span,
  .archive-row__right span {
    color: var(--muted);
  }

  .sidebar {
    background: rgba(10, 16, 28, 0.76);
    border-right-color: rgba(121, 146, 191, 0.16);
  }

  .topbar-user {
    border-color: rgba(121, 146, 191, 0.2);
  }
}

@media (min-width: 760px) {
  .calendar-toolbar-mobile {
    display: none;
  }

  .calendar-toolbar-desktop {
    display: flex;
  }

  .page-shell {
    padding: 28px 28px 32px;
  }

  .hero-grid,
  .two-column,
  .auth-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.95fr);
  }

  .task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid--two,
  .badge-settings,
  .earned-badges-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-mobile-strip,
  .calendar-mobile-list {
    display: none;
  }

  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
  }

  .calendar-grid__weekdays {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    color: var(--muted);
    font-weight: 700;
    padding: 0 4px;
  }

  .calendar-day--empty {
    display: block;
    opacity: 0;
    box-shadow: none;
    background: transparent;
    border: 0;
  }

  .calendar-day {
    display: flex;
    flex-direction: column;
    min-height: 152px;
    padding: 12px 10px;
  }

  .calendar-day__tasks {
    gap: 6px;
    max-height: 100%;
    overflow: auto;
    padding-right: 2px;
  }

  .calendar-task {
    padding: 8px 9px;
    border-radius: 12px;
  }

  .calendar-task__title {
    font-size: 0.82rem;
    line-height: 1.18;
  }

  .calendar-task__person {
    font-size: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .celebration-score {
    animation-duration: 0.46s;
  }

  .celebration-glow,
  .celebration-particle {
    animation: none;
    opacity: 0;
  }
}

@media (min-width: 1100px) {
  .app-shell {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100vh;
    padding: 28px 20px;
    border-right: 1px solid rgba(132, 152, 190, 0.2);
    background: var(--surface-soft);
    backdrop-filter: blur(12px);
  }

  .sidebar-nav {
    display: grid;
    gap: 8px;
  }

  .nav-link {
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: left;
    font-size: 0.94rem;
    padding: 12px 14px;
  }

  .page-shell {
    padding: 36px 40px 48px;
  }

  .topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 8px 18px;
    border-radius: 999px;
    background: var(--nav-bg);
    border: 1px solid rgba(132, 152, 190, 0.2);
  }

  .bottom-nav {
    display: none;
  }

  .fab-quick-task {
    right: 28px;
    bottom: 28px;
  }

  .task-grid,
  .scoreboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
