:root {
  color-scheme: light;
  --bg: #eaf8f4;
  --surface: rgba(255, 255, 255, 0.3);
  --panel: rgba(255, 255, 255, 0.62);
  --ink: #061b2f;
  --muted: rgba(6, 27, 47, 0.68);
  --line: rgba(255, 255, 255, 0.78);
  --green: #237e65;
  --blue: #589bc8;
  --red: #d65a53;
  --gold: #d8b73d;
  --nav: #1d2e38;
  --cream: rgba(217, 216, 207, 0.7);
  --pending-bg: rgba(165, 189, 220, 0.48);
  --pending-line: rgba(255, 255, 255, 0.72);
  --done-bg: rgba(192, 229, 205, 0.5);
  --done-line: rgba(255, 255, 255, 0.74);
  --glass-shadow: 0 8px 18px rgba(76, 116, 112, 0.07);
  --shadow: none;
  --nav-index: 1;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 14%, rgba(146, 207, 247, 0.72), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(197, 244, 218, 0.8), transparent 38%),
    radial-gradient(circle at 74% 72%, rgba(251, 245, 213, 0.7), transparent 42%),
    linear-gradient(135deg, #dff2ff 0%, #eefbf0 52%, #fff7df 100%);
  background-attachment: fixed;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus {
  outline: none;
}

button:focus-visible {
  outline: 2px solid rgba(88, 155, 200, 0.48);
  outline-offset: 3px;
}

input,
select {
  min-width: 0;
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  width: min(860px, 100%);
  height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  margin: 0 auto;
  padding: clamp(34px, 6vw, 70px) clamp(24px, 7vw, 64px) 122px;
  overflow: visible;
}

.app-frame {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(0, auto);
  align-items: center;
  gap: 12px;
  padding: 0 0 22px;
  border-bottom: 0;
}

.date-label,
.eyebrow {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(0.95rem, 2.4vw, 1.12rem);
  font-weight: 600;
}

h1 {
  display: none;
}

.summary-grid {
  display: none;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 18px;
  min-width: 0;
}

.header-tools {
  width: min(246px, 58vw);
  display: grid;
  gap: 10px;
  justify-self: end;
  grid-column: 2;
  grid-row: 1;
  padding-top: 0;
}

.header-tools .summary-grid {
  width: 100%;
  min-width: 0;
}

.backup-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.backup-actions .secondary-button {
  min-height: 36px;
  padding: 0 8px;
  font-size: clamp(0.76rem, 1.8vw, 0.86rem);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.14);
}

.summary-item {
  min-height: clamp(100px, 20vw, 150px);
  display: grid;
  place-items: center;
  align-content: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px);
}

.summary-item span {
  display: block;
  font-size: clamp(2.4rem, 8vw, 3.2rem);
  line-height: 0.95;
  font-weight: 900;
}

.summary-item small {
  color: var(--ink);
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 800;
}

.page {
  display: none;
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.page.is-active {
  display: grid;
}

#page-roles.is-active {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
}

#page-home.is-active {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

#page-teams.is-active {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

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

#page-home > .section-heading {
  display: none;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(2.8rem, 8vw, 4rem);
  line-height: 1.1;
}

.page > .section-heading .eyebrow,
.page > .section-heading h2 {
  display: none;
}

.page > .section-heading > div {
  display: none;
}

.primary-button,
.secondary-button {
  min-height: 52px;
  flex: 0 0 auto;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 600;
}

.primary-button {
  color: #fff;
  background: var(--nav);
}

.secondary-button {
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px);
}

.secondary-button.danger-button {
  color: var(--red);
}

.todo-overview {
  margin-bottom: 10px;
}

.data-form,
.filter-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.data-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: 0 16px 36px rgba(58, 102, 118, 0.08);
  backdrop-filter: blur(18px);
}

.modal-form {
  margin-bottom: 0;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.modal-form input,
.modal-form select,
.modal-form .check-field {
  border-color: rgba(83, 116, 134, 0.38);
  background: rgba(255, 255, 255, 0.56);
}

.modal-form > label:not(.check-field) {
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
}

.modal-form > label:not(.check-field) > span {
  margin: 0;
}

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

.data-form > label,
.filter-grid label {
  display: grid;
  gap: 6px;
}

.data-form > label > span,
.filter-grid label span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.filter-grid label span {
  display: none;
}

.data-form input,
.data-form select,
.filter-grid select {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.56);
  outline: none;
}

.data-form input:focus,
.data-form select:focus,
.filter-grid select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 96, 157, 0.12);
}

.check-field {
  align-self: end;
  min-height: 48px;
  display: flex !important;
  grid-column: span 1;
  flex-direction: row;
  align-items: center;
  gap: 10px !important;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
}

.modal-form > .check-field {
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
}

.modal-form input,
.modal-form select,
.modal-form .check-field {
  border-color: rgba(83, 116, 134, 0.38);
}

.check-field input {
  width: 18px;
  height: 18px;
}

.data-form .primary-button {
  align-self: end;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-self: end;
}

.form-wide {
  grid-column: 1 / -1;
}

.role-list {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 0 4px 18px;
  scrollbar-width: none;
}

.role-list::-webkit-scrollbar,
.home-stack::-webkit-scrollbar,
.team-groups::-webkit-scrollbar {
  display: none;
}

.role-card,
.team-card {
  --reveal-offset: 0px;
  position: relative;
  min-height: 76px;
  align-self: start;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
  touch-action: pan-y;
  user-select: none;
}

.card-body {
  position: relative;
  z-index: 2;
  min-height: 74px;
  display: grid;
  align-items: center;
  padding: 13px 14px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.66);
  transform: translateX(var(--reveal-offset));
  transition: transform 180ms ease;
}

.role-card.is-revealed .card-body,
.team-card.is-revealed .card-body {
  transition: transform 160ms ease;
}

.role-content {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.role-content h4 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  font-weight: 600;
}

.role-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.role-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 6px;
}

.role-title-row h4 {
  min-width: 0;
}

.team-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.team-tag-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.team-role-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 1;
  width: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  padding: 0 10px;
  transform: translateX(100%);
  transition: transform 180ms ease;
}

.role-card.is-revealed .card-actions,
.team-card.is-revealed .card-actions {
  transform: translateX(0);
}

.status-badge {
  display: inline-grid;
  min-height: 22px;
  place-items: center;
  flex: 0 0 auto;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-badge.warning {
  color: #5c4715;
  background: rgba(213, 165, 63, 0.18);
}

.status-badge.zone {
  color: #18577f;
  background: rgba(88, 155, 200, 0.22);
}

.status-badge.region {
  color: #265a76;
  background: rgba(178, 222, 238, 0.5);
}

.status-badge.success {
  color: #1f563d;
  background: rgba(47, 125, 90, 0.16);
}

.status-badge.muted {
  color: var(--muted);
  background: #f0ebe3;
}

.ghost-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  font-weight: 800;
}

.ghost-button.danger {
  color: var(--red);
}

.icon-action {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(31, 64, 84, 0.12);
}

.icon-action.edit {
  background: rgba(52, 124, 175, 0.82);
}

.icon-action.delete {
  background: rgba(214, 90, 83, 0.86);
  line-height: 1;
  padding-bottom: 3px;
}

.progress-block {
  display: grid;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px);
}

.progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.progress-copy span {
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  line-height: 1;
  font-weight: 600;
}

.progress-copy small {
  color: var(--ink);
  font-size: clamp(0.86rem, 2.6vw, 1rem);
  font-weight: 600;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--cream);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.empty-panel {
  min-height: 260px;
  display: grid;
  place-content: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: none;
  backdrop-filter: blur(18px);
  text-align: center;
}

.empty-panel.compact {
  min-height: 160px;
}

.empty-panel.is-hidden,
.is-hidden {
  display: none;
}

.empty-panel h3 {
  margin-bottom: 12px;
  font-size: clamp(1.15rem, 4vw, 1.55rem);
  font-weight: 600;
}

.empty-panel p {
  max-width: 430px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

#pendingEmpty,
#doneEmpty {
  min-height: 86px;
  padding: 18px;
  border: 1px dashed rgba(108, 125, 135, 0.48);
  background: rgba(255, 255, 255, 0.36);
  box-shadow: none;
  backdrop-filter: none;
}

#pendingEmpty h3,
#doneEmpty h3 {
  margin-bottom: 0;
  color: rgba(6, 27, 47, 0.52);
  font-size: 1rem;
  font-weight: 500;
}

#pendingEmpty p,
#doneEmpty p {
  display: none;
}

.notice-list {
  display: none;
}

.notice-card {
  padding: 12px 14px;
  border: 1px solid rgba(213, 165, 63, 0.5);
  border-radius: 8px;
  color: #5c4715;
  background: rgba(213, 165, 63, 0.16);
  font-weight: 800;
  line-height: 1.5;
}

.home-stack {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 0 4px 18px;
  scrollbar-width: none;
}

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

.mini-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-heading h3 {
  margin-bottom: 0;
  font-size: clamp(1.05rem, 3.8vw, 1.35rem);
  font-weight: 600;
}

.mini-heading span {
  min-width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(6, 27, 47, 0.72);
  font-size: 0.82rem;
  font-weight: 600;
}

.task-list {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 0 1px 2px;
}

.task-card {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 18px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
  touch-action: pan-y;
  user-select: none;
}

.task-card.is-pending {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.62);
}

.task-card.is-done {
  border-color: transparent;
  background: rgba(213, 239, 221, 0.76);
}

.task-card.swipe-feedback,
.role-card.swipe-feedback,
.team-card.swipe-feedback {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 125, 90, 0.12);
  transform: translateX(-8px);
}

.task-card.swipe-danger,
.role-card.swipe-danger,
.team-card.swipe-danger {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(184, 74, 59, 0.12);
  transform: translateX(-8px);
}

.task-card.is-swiping,
.role-card.is-swiping,
.team-card.is-swiping {
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.task-content {
  min-width: 0;
}

.task-content h4 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: clamp(1.02rem, 3.4vw, 1.22rem);
  line-height: 1.15;
  font-weight: 600;
}

.task-content p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: clamp(0.86rem, 2.8vw, 1rem);
  font-weight: 500;
}

.task-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.task-region {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-groups,
.team-list,
.team-role-picker,
.role-choice-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.team-groups {
  gap: 18px;
  min-height: 0;
  overflow: auto;
  padding: 0 4px 18px;
  scrollbar-width: none;
}

.team-group {
  display: grid;
  gap: 10px;
}

.team-role-picker {
  padding-top: 4px;
}

.role-choice-list {
  max-height: 230px;
  overflow: auto;
  padding: 2px;
}

.role-choice {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.4;
}

.role-choice input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}

.role-choice span {
  min-width: 0;
  color: var(--ink);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 18px;
  width: min(344px, calc(100vw - 56px));
  min-height: 62px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(219, 238, 210, 0.92);
  box-shadow: none;
  backdrop-filter: none;
  transform: translateX(-50%);
  pointer-events: none;
}

.bottom-nav::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: calc((100% - 12px) / 3);
  border-radius: 999px;
  background: rgba(250, 224, 143, 0.96);
  transform: translateX(calc(var(--nav-index) * 100%));
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-button {
  min-width: 0;
  min-height: 50px;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 999px;
  border: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  font-weight: 600;
  pointer-events: auto;
}

.nav-button:active,
.nav-button:focus {
  background: transparent;
}

.nav-button span {
  display: none;
  width: 50px;
  height: 50px;
}

.nav-button strong {
  display: grid;
  place-items: center;
  min-height: 50px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  transition:
    color 160ms ease,
    transform 160ms ease;
}

.nav-button.is-active {
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.nav-button.is-active span {
  color: var(--ink);
  background: transparent;
  transform: none;
}

.nav-button.is-active strong {
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  top: max(12px, env(safe-area-inset-top));
  z-index: 100;
  width: min(420px, calc(100vw - 28px));
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 44px rgba(31, 64, 84, 0.18);
  backdrop-filter: blur(18px) saturate(1.08);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 24px));
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--green);
  font-size: 1rem;
  font-weight: 700;
}

.toast-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.toast-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 600;
}

.toast-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.mini-popover {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(215, 236, 239, 0.22);
  backdrop-filter: blur(8px);
}

.mini-popover.is-open {
  display: grid;
}

.mini-popover-card {
  width: min(340px, 100%);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background: rgba(248, 253, 252, 0.78);
  box-shadow: 0 18px 48px rgba(45, 83, 96, 0.18);
  backdrop-filter: blur(22px);
}

.mini-popover-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mini-popover-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.mini-role-list {
  display: grid;
  gap: 8px;
}

.mini-role-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.54);
}

.mini-role-item strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.mini-role-item span,
.mini-role-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(215, 236, 239, 0.38);
  backdrop-filter: blur(18px) saturate(1.08);
}

.modal-backdrop.is-open {
  display: grid;
}

.modal-dialog {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background: rgba(248, 253, 252, 0.7);
  backdrop-filter: blur(26px) saturate(1.08);
  box-shadow: 0 24px 70px rgba(45, 83, 96, 0.18);
}

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

.modal-header h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

.icon-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-weight: 900;
}

.icon-close.compact {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .app-shell {
    width: 100%;
    padding: 28px 28px 100px;
  }

  .app-frame {
    min-height: 0;
  }

  .app-header {
    grid-template-columns: minmax(92px, 1fr) minmax(0, auto);
    align-items: center;
    gap: 10px;
    padding-bottom: 20px;
  }

  h1 {
    font-size: clamp(1.8rem, 8vw, 2.7rem);
  }

  .date-label,
  .eyebrow {
    font-size: clamp(0.82rem, 3vw, 1rem);
  }

  .section-heading {
    flex-direction: column;
    gap: 12px;
  }

  .summary-grid {
    display: none;
    width: 100%;
    min-width: 0;
    gap: 12px;
  }

  .header-tools {
    width: min(220px, 62vw);
    gap: 6px;
    justify-self: end;
    padding-top: 0;
  }

  .summary-item {
    min-height: 64px;
    padding: 10px;
  }

  .summary-item span {
    font-size: 1.7rem;
  }

  .summary-item small {
    font-size: 0.92rem;
  }

  .backup-actions {
    gap: 6px;
  }

  .backup-actions .secondary-button {
    min-height: 34px;
    padding: 0 6px;
    font-size: 0.76rem;
  }

  .section-heading {
    margin-bottom: 14px;
  }

  .section-heading h2 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .home-stack {
    gap: 10px;
  }

  .task-section {
    gap: 10px;
  }

  .mini-heading h3 {
    font-size: clamp(1rem, 4.4vw, 1.25rem);
  }

  .section-heading .primary-button,
  .section-heading .secondary-button {
    width: 100%;
  }

  .data-form,
  .modal-form {
    grid-template-columns: 1fr;
  }

  .modal-form > label:not(.check-field) {
    grid-template-columns: 78px minmax(0, 1fr);
  }

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

  .modal-backdrop {
    align-items: end;
    padding: 10px;
  }

  .modal-dialog {
    max-height: calc(100vh - 20px);
  }

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

  .role-card,
  .team-card {
    min-height: 70px;
  }

  .task-card {
    grid-template-columns: 1fr;
    min-height: 70px;
    padding: 12px 14px;
  }

  .task-content h4 {
    margin-bottom: 0;
    font-size: 1rem;
  }

  .task-content p {
    font-size: 0.86rem;
  }

  .progress-block {
    gap: 7px;
    padding: 10px 16px;
  }

  .progress-copy span {
    font-size: 1.25rem;
  }

  .progress-copy small {
    font-size: 0.86rem;
  }

  .progress-track {
    height: 7px;
  }

  .bottom-nav {
    left: 50%;
    right: auto;
    width: min(316px, calc(100vw - 56px));
    bottom: 14px;
    min-height: 58px;
    gap: 0;
    padding: 5px;
  }

  .bottom-nav::before {
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: calc((100% - 10px) / 3);
  }

  .nav-button {
    min-height: 48px;
    grid-template-columns: 1fr;
    gap: 0;
    font-size: 0.82rem;
  }

  .nav-button span {
    width: 48px;
    height: 48px;
    margin: 0 auto;
  }

  .nav-button strong {
    min-height: 48px;
    font-size: 0.98rem;
  }
}
