@font-face {
  font-family: "Estedad";
  src: url("fonts/Estedad-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #050b19;
  --bg-2: #081426;
  --panel: rgba(14, 27, 48, 0.88);
  --panel-2: rgba(18, 35, 62, 0.72);
  --line: rgba(156, 178, 214, 0.18);
  --text: #f4f8ff;
  --muted: #9eb0ca;
  --blue: #4aa3ff;
  --purple: #a970ff;
  --green: #2ee6a6;
  --red: #ff5f76;
  --amber: #ffbd59;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(169, 112, 255, 0.22), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(74, 163, 255, 0.18), transparent 30%),
    linear-gradient(145deg, #030713 0%, var(--bg) 45%, #0a1020 100%);
  color: var(--text);
  font-family: "Estedad", Tahoma, Arial, sans-serif;
}

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

p {
  line-height: 1.9;
}

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

button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(74, 163, 255, 0.2);
}

button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: none;
}

button.danger {
  background: linear-gradient(135deg, #ff4967, #c32648);
}

button.tiny {
  padding: 7px 10px;
  font-size: 12px;
}

button:disabled,
.button-link[aria-disabled="true"] {
  cursor: progress;
  opacity: 0.66;
}

.is-submitting {
  cursor: progress;
}

.app-loading {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 11, 25, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
  backdrop-filter: blur(8px);
}

.app-loading.visible {
  opacity: 1;
  pointer-events: auto;
}

.app-loading > div {
  width: min(360px, 100%);
  border: 1px solid rgba(74, 163, 255, 0.36);
  border-radius: 8px;
  padding: 18px;
  background: rgba(8, 20, 38, 0.96);
  box-shadow: var(--shadow);
  display: grid;
  gap: 9px;
  text-align: center;
}

.app-loading span {
  width: 42px;
  height: 42px;
  margin: 0 auto 2px;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.app-loading b {
  font-size: 16px;
}

.app-loading small {
  color: var(--muted);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  padding: 11px 15px;
  font-weight: 700;
}

.button-link.small {
  padding: 7px 10px;
  font-size: 12px;
}

.button-link.danger-link,
button.danger {
  background: linear-gradient(135deg, #ff4967, #c32648);
}

.button-link.edit-link {
  background: linear-gradient(135deg, #ffbd59, #d9891f);
  color: #1c1306;
}

.button-link.view-link {
  background: linear-gradient(135deg, #4aa3ff, #5a6cff);
}

.icon-view:after,
.icon-edit:after,
.icon-delete:after,
.icon-accept:after,
.icon-reject:after,
.icon-back:after,
.icon-add:after,
.icon-save:after,
.icon-swap:after,
.icon-restart:after,
.icon-download:after,
.icon-send:after {
  display: inline-block;
  font-weight: 900;
  line-height: 1;
}

button.icon-view,
button.icon-edit,
button.icon-delete,
button.icon-accept,
button.icon-reject,
button.icon-back,
button.icon-add,
button.icon-save,
button.icon-swap,
button.icon-restart,
button.icon-download,
button.icon-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.icon-view:after {
  content: "◉";
}

.icon-edit:after {
  content: "✎";
}

.icon-delete:after,
.icon-reject:after {
  content: "×";
}

.icon-accept:after,
.icon-save:after {
  content: "✓";
}

.icon-back:after {
  content: "←";
}

.icon-add:after {
  content: "+";
}

.icon-swap:after {
  content: "↔";
}

.icon-restart:after {
  content: "↻";
}

.icon-download:after {
  content: "⇩";
}

.icon-send:after {
  content: "↗";
}

button.regenerate-button {
  background: #20c98f;
  border-color: #57e9b7;
  color: #061b14;
  box-shadow: 0 10px 24px rgba(32, 201, 143, 0.2);
}

button.regenerate-button:hover {
  background: #35dda4;
  border-color: #7af1c8;
}

.coin-value,
.coin-label,
.wallet-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.coin-value:before,
.coin-label:before,
.wallet-label:before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.coin-value:before,
.coin-label:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffc857' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='8.5' fill='%23ffc857' fill-opacity='.18'/%3E%3Cpath d='M9 9.3c.9-.8 1.9-1.2 3.2-1.2 1.6 0 2.8.7 2.8 1.9 0 1.3-1.2 1.8-3 2-1.8.2-3 .7-3 2 0 1.2 1.2 1.9 2.9 1.9 1.3 0 2.4-.4 3.2-1.2M12 6.5v11'/%3E%3C/svg%3E");
}

.wallet-label:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235ad8c6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7.5A2.5 2.5 0 0 1 6.5 5H18a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H6.5A2.5 2.5 0 0 1 4 16.5v-9Z' fill='%235ad8c6' fill-opacity='.12'/%3E%3Cpath d='M4 8h14M15 13h5M16.5 13h.01'/%3E%3C/svg%3E");
}

.secondary-link {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.full {
  width: 100%;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  outline: none;
}

select {
  appearance: none;
  padding-left: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%239eb0ca' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 16px;
}

textarea {
  min-height: 88px;
}

select option {
  color: #091324;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(74, 163, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(74, 163, 255, 0.14);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.field-unit {
  color: var(--amber);
  font-size: 11px;
}

.mobile-disclosure {
  display: block;
  min-width: 0;
}

.disclosure-summary {
  display: none;
}

.disclosure-body {
  min-width: 0;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.owner-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  background:
    linear-gradient(90deg, rgba(46, 230, 166, 0.05), transparent 38%),
    linear-gradient(145deg, rgba(5, 11, 25, 0.96), rgba(8, 20, 38, 0.82));
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(5, 13, 29, 0.78);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(18px);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.owner-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  border-left: 1px solid var(--line);
  background: rgba(5, 13, 29, 0.84);
  backdrop-filter: blur(18px);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.owner-content {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 30px;
  display: grid;
  align-content: start;
  gap: 18px;
}

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

.owner-nav a {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 12px;
  color: #d9e6ff;
  font-weight: 800;
}

.owner-nav a:hover,
.owner-nav a[aria-current="page"] {
  border-color: rgba(46, 230, 166, 0.28);
  background: rgba(46, 230, 166, 0.08);
}

.owner-hero {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(46, 230, 166, 0.1), transparent 45%),
    rgba(14, 27, 48, 0.84);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: var(--shadow);
}

.owner-hero h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 58px);
}

.owner-hero p {
  max-width: 720px;
}

.owner-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.owner-summary article,
.owner-admin-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 16px;
}

.owner-summary article span,
.owner-admin-row small,
.owner-admin-row span {
  color: var(--muted);
}

.owner-summary article b {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.owner-admin-list {
  display: grid;
  gap: 10px;
}

.owner-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.owner-admin-row div {
  display: grid;
  gap: 4px;
}

.owner-password-form {
  display: grid;
  gap: 14px;
}

.owner-admin-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.owner-admin-actions form {
  margin: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: url("logo-mark.png?v=20260615-rounded") center / contain no-repeat;
  color: transparent;
  font-size: 0;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(74, 163, 255, 0.2);
}

.brand h1,
.hero h2,
.panel h3,
.login h1 {
  margin: 0;
}

.brand p,
.login-brand p,
.hero p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

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

.nav a,
.nav .mobile-stats-nav {
  position: relative;
  padding: 11px 12px;
  border-radius: 8px;
  color: #d9e6ff;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav .mobile-stats-nav,
.mobile-stats-menu {
  display: none;
}

.nav-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  margin-inline-start: auto;
  background: linear-gradient(135deg, var(--red), var(--amber));
  color: #1b0810;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(255, 95, 118, 0.28);
}

.nav svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line);
}

.site-footprint {
  max-width: 1240px;
  margin: 8px auto 18px;
  padding: 0 28px;
  color: rgba(158, 176, 202, 0.72);
  font-size: 12px;
  letter-spacing: 0;
  text-align: center;
}

.content {
  padding: 28px;
  display: grid;
  gap: 20px;
  align-content: start;
}

.content.single {
  max-width: 1240px;
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(13, 31, 59, 0.94), rgba(18, 23, 49, 0.78)),
    linear-gradient(90deg, rgba(255, 95, 118, 0.16), rgba(46, 230, 166, 0.12));
  box-shadow: var(--shadow);
}

.hero:before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--purple), var(--red));
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h2 {
  margin-top: 10px;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: 0;
}

.hero-card {
  min-width: 220px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  padding: 18px;
  display: grid;
  gap: 8px;
}

.hero-card span,
.hero-card small,
.eyebrow,
.muted {
  color: var(--muted);
}

.hero-card b {
  font-size: 26px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat,
.panel,
.login {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.stat:before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--blue);
}

.stat.red:before {
  background: var(--red);
}

.stat.green:before {
  background: var(--green);
}

.stat.purple:before {
  background: var(--purple);
}

.stat span {
  color: var(--muted);
}

.stat b {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.panel {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.compact-panel {
  padding: 14px 18px;
}

.tabs-panel {
  display: flex;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px;
  box-shadow: var(--shadow);
}

.tabs-panel a {
  flex: 1;
  min-height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.tabs-panel a.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(169, 112, 255, 0.35), rgba(74, 163, 255, 0.28));
}

.rotation-switcher {
  max-width: 520px;
}

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

.section-head + .people-grid,
.section-head + .rule-calendar,
.section-head + .calendar-grid,
.section-head + .stats,
.section-head + .price-rules {
  margin-top: 18px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 99px;
  margin-left: 5px;
  background: var(--muted);
}

.dot.mine {
  background: var(--green);
}

.dot.partner {
  background: var(--purple);
}

.dot.other {
  background: var(--blue);
}

.dot.hot {
  background: var(--red);
}

.dot.sensitive {
  background: var(--amber);
}

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

.mobile-calendar-tools,
.compact-calendar,
.day-sheet {
  display: none;
}

.weekday-head {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.day-card {
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-card.blank,
.rule-day.blank {
  min-height: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.day-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.day-card header b {
  color: var(--text);
  font-size: 26px;
}

.day-card small {
  color: var(--muted);
}

.day-card.mine {
  border-color: rgba(46, 230, 166, 0.75);
  background: linear-gradient(180deg, rgba(46, 230, 166, 0.16), rgba(255, 255, 255, 0.05));
}

.day-card.partner {
  border-color: rgba(169, 112, 255, 0.7);
}

.day-card.other {
  border-color: rgba(74, 163, 255, 0.42);
}

.day-card.free {
  border-color: rgba(154, 169, 196, 0.22);
  background: rgba(255, 255, 255, 0.035);
}

.day-card.sensitive {
  box-shadow: inset 0 0 0 1px rgba(255, 189, 89, 0.62), 0 0 18px rgba(255, 189, 89, 0.12);
}

.day-card.off-day {
  box-shadow: inset 0 0 0 1px rgba(255, 95, 118, 0.68), 0 0 18px rgba(255, 95, 118, 0.13);
}

.day-card.past,
.rule-day.past {
  opacity: 0.58;
}

.assignees {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assignees span,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.09);
  color: #dfe9ff;
  white-space: nowrap;
}

.day-card footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.day-card em {
  color: var(--amber);
  font-style: normal;
  font-size: 12px;
}

.no-shift {
  margin-top: auto;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: right;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.form-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.coin-adjust-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.8fr) minmax(180px, 1.3fr) auto;
  gap: 12px;
  align-items: end;
  margin: 18px 0 8px;
}

.coin-adjust-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.coin-adjust-form input,
.coin-adjust-form select {
  margin-top: 7px;
}

.coin-adjust-form button {
  min-height: 44px;
}

.owner-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.owner-panel-compact {
  max-width: 980px;
  margin-inline: auto;
}

.owner-create-form input {
  width: 100%;
}

.owner-create-form button {
  min-height: 44px;
  white-space: nowrap;
}

.chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border: 1px solid rgba(156, 178, 214, 0.2);
  border-radius: 8px;
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.green {
  border-color: rgba(46, 230, 166, 0.28);
  color: var(--green);
}

.status-pill.red {
  border-color: rgba(255, 95, 118, 0.3);
  color: var(--red);
}

.section-head.separated {
  margin-top: 24px;
}

.rule-formula {
  border-inline-start: 4px solid var(--green);
  padding: 12px 14px;
  background: rgba(46, 230, 166, 0.07);
  display: grid;
  gap: 5px;
}

.rule-formula span {
  color: var(--text);
  font-weight: 800;
}

.rule-formula small {
  color: var(--muted);
  line-height: 1.9;
}

.rule-subheading {
  margin: 22px 0 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
}

.rule-price-grid label {
  min-width: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 16px;
}

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

.action-card,
.person-card,
.rule-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 16px;
}

.action-card {
  min-height: 170px;
  display: grid;
  align-content: end;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.action-card:before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--blue);
}

.action-card.green:before {
  background: var(--green);
}

.action-card.purple:before {
  background: var(--purple);
}

.action-card.owner:before {
  background: var(--amber);
}

.action-card span,
.action-card small {
  color: var(--muted);
}

.action-card b {
  font-size: 24px;
}

.profile-card {
  align-content: start;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.profile-row span {
  color: var(--muted);
}

.profile-actions {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.profile-actions .button-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.telegram-card {
  align-content: start;
}

.telegram-connected {
  border-color: rgba(46, 230, 166, 0.44);
  background: rgba(46, 230, 166, 0.12);
  color: var(--green);
}

.telegram-copy {
  min-height: 48px;
  margin: 0;
  line-height: 1.9;
}

.telegram-action {
  margin-top: 16px;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.people-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.person-card {
  display: grid;
  gap: 12px;
}

.person-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.person-card header span {
  color: var(--muted);
}

.date-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.date-group h3 {
  grid-column: 1 / -1;
  margin: 0;
}

.grid-flow {
  display: grid;
  gap: 18px;
}

.rule-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(135px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.swap-source {
  display: grid;
  gap: 10px;
}

.swap-source b {
  font-size: 26px;
}

.swap-source > span {
  color: var(--amber);
}

.admin-swap-calendar {
  padding-bottom: 108px;
  scroll-margin-top: 18px;
}

.admin-edit-mode {
  width: min(100%, 480px);
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.admin-edit-mode button {
  min-height: 44px;
  box-shadow: none;
  background: transparent;
}

.admin-edit-mode button.active {
  border-color: rgba(74, 163, 255, 0.55);
  background: rgba(74, 163, 255, 0.16);
  color: var(--text);
}

.admin-preference-legend {
  border-inline-start: 4px solid var(--red);
  padding: 10px 12px;
  background: rgba(255, 95, 118, 0.075);
  display: flex;
  align-items: center;
  gap: 9px;
}

.admin-preference-legend > span {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 3px;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 95, 118, 0.14);
}

.admin-preference-legend p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-preference-legend b {
  color: #ffd7dd;
}

.admin-swap-instruction {
  min-height: 70px;
  margin-bottom: 18px;
  border: 1px solid rgba(74, 163, 255, 0.28);
  border-radius: 8px;
  background: rgba(74, 163, 255, 0.075);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-swap-instruction > div {
  display: grid;
  gap: 4px;
}

.admin-swap-instruction strong {
  color: var(--text);
}

.admin-swap-instruction small {
  color: var(--muted);
}

.admin-swap-step {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid rgba(74, 163, 255, 0.42);
  border-radius: 8px;
  background: rgba(74, 163, 255, 0.16);
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 900;
}

.admin-swap-reset {
  margin-inline-start: auto;
  white-space: nowrap;
}

button.admin-swap-day {
  width: 100%;
  color: var(--text);
  text-align: right;
  cursor: pointer;
  box-shadow: none;
}

button.admin-swap-day:hover {
  border-color: rgba(169, 112, 255, 0.7);
  transform: translateY(-1px);
}

.admin-preference-lock {
  border-inline-start: 3px solid var(--red);
  padding: 6px 8px;
  background: rgba(255, 95, 118, 0.1);
  display: grid;
  gap: 2px;
  text-align: right;
}

.admin-preference-lock span {
  color: #ffbdc8;
  font-size: 10px;
}

.admin-preference-lock b {
  color: var(--text);
  font-size: 11px;
  line-height: 1.6;
}

.preference-lock-count {
  position: absolute;
  z-index: 2;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  min-width: 17px;
  height: 17px;
  border-radius: 5px;
  padding-inline: 4px;
  background: var(--red);
  color: white;
  display: grid;
  place-items: center;
  font-size: 9px;
  line-height: 1;
}

.admin-swap-option.source-selected {
  border-color: rgba(169, 112, 255, 0.98) !important;
  background: rgba(169, 112, 255, 0.2) !important;
  box-shadow: 0 0 0 3px rgba(169, 112, 255, 0.2), 0 16px 34px rgba(169, 112, 255, 0.12) !important;
  opacity: 1;
}

.admin-swap-option.target-selected {
  border-color: rgba(46, 230, 166, 0.98) !important;
  background: rgba(46, 230, 166, 0.2) !important;
  box-shadow: 0 0 0 3px rgba(46, 230, 166, 0.2), 0 16px 34px rgba(46, 230, 166, 0.12) !important;
  opacity: 1;
}

.admin-swap-confirm {
  z-index: 30;
}

.admin-replacement-field {
  min-width: 280px;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.admin-replacement-field[hidden] {
  display: none;
}

.admin-replacement-field select {
  width: 100%;
  min-height: 48px;
}

.swap-calendar {
  margin-bottom: 16px;
  padding-bottom: 92px;
}

.swap-day {
  position: relative;
}

.swap-day input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.compact-day input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.swap-day.selectable {
  cursor: pointer;
}

.swap-day.selectable:hover {
  border-color: rgba(46, 230, 166, 0.85);
  transform: translateY(-1px);
}

.swap-day.selectable:has(input:checked) {
  border-color: rgba(46, 230, 166, 0.95);
  box-shadow: 0 0 0 2px rgba(46, 230, 166, 0.2), 0 18px 40px rgba(46, 230, 166, 0.12);
}

.compact-day.selectable:has(input:checked) {
  border-color: rgba(46, 230, 166, 0.95);
  background: rgba(46, 230, 166, 0.22);
  box-shadow: 0 0 0 2px rgba(46, 230, 166, 0.16);
}

.swap-day.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.compact-day.disabled {
  cursor: not-allowed;
}

.swap-day.own-shift.disabled,
.swap-compact-calendar .compact-day.own-shift.disabled {
  border-color: rgba(154, 169, 196, 0.16);
  background: rgba(154, 169, 196, 0.045);
  color: rgba(154, 169, 196, 0.66);
  box-shadow: none;
  filter: grayscale(1) saturate(0);
  opacity: 0.34;
}

.swap-confirm-bar {
  position: fixed;
  z-index: 20;
  inset-inline: max(18px, calc((100vw - 1120px) / 2));
  inset-block-end: 20px;
  border: 1px solid rgba(46, 230, 166, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(46, 230, 166, 0.18), rgba(74, 163, 255, 0.16)),
    rgba(8, 20, 38, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  backdrop-filter: blur(18px);
}

.swap-confirm-bar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.swap-confirm-bar > div {
  display: grid;
  gap: 4px;
}

.swap-confirm-bar strong {
  color: var(--text);
  font-size: 17px;
}

.swap-confirm-bar small {
  color: var(--muted);
}

.preference-total {
  min-width: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.055);
  display: grid;
  gap: 5px;
}

.preference-total span {
  color: var(--muted);
  font-size: 12px;
}

.preference-total b {
  color: var(--green);
}

.wallet-meter {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
}

.wallet-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--amber));
  transition: width 0.18s ease, background 0.18s ease;
}

.wallet-meter i.over-budget {
  background: var(--red);
}

#walletRemaining {
  color: var(--muted);
  font-size: 11px;
}

#walletRemaining.over-budget {
  color: #ffd0d7;
}

.price-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.price-rules span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.055);
  color: #dfe9ff;
  font-size: 12px;
}

.preference-price-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.preference-price-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.preference-price-item > span {
  color: var(--muted);
  font-size: 12px;
}

.preference-price-item b {
  flex: 0 0 auto;
  color: var(--amber);
  font-size: 13px;
}

.preference-receipt {
  display: grid;
  gap: 14px;
}

.preference-receipt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.preference-receipt-head > div {
  display: grid;
  gap: 5px;
}

.preference-receipt-head small {
  color: var(--muted);
}

.preference-receipt-days {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preference-receipt-days > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.preference-receipt form button {
  width: 100%;
}

.price-guide-note {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.8;
}

.assessment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.assessment-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
  display: grid;
  gap: 7px;
}

.assessment-card.green {
  border-color: rgba(46, 230, 166, 0.34);
  background: rgba(46, 230, 166, 0.08);
}

.assessment-card.blue {
  border-color: rgba(74, 163, 255, 0.34);
  background: rgba(74, 163, 255, 0.08);
}

.assessment-card.red {
  border-color: rgba(255, 95, 118, 0.42);
  background: rgba(255, 95, 118, 0.08);
}

.assessment-card h4,
.raw-metrics-title {
  margin: 0;
}

.assessment-card span {
  color: var(--muted);
  font-size: 12px;
}

.assessment-card b {
  font-size: 24px;
}

.assessment-card p,
.recommendation-list {
  margin: 0;
  color: #c7d5ed;
  line-height: 1.8;
  font-size: 13px;
}

.recommendation-list {
  padding-inline-start: 20px;
}

.raw-metrics-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.preference-day {
  cursor: pointer;
  text-align: inherit;
}

.preference-hidden-inputs,
.preference-day input,
.preference-sheet .preference-sheet-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.preference-day.selected {
  border-color: rgba(46, 230, 166, 0.95);
  background: linear-gradient(180deg, rgba(46, 230, 166, 0.36), rgba(46, 230, 166, 0.18));
  box-shadow: 0 0 0 2px rgba(46, 230, 166, 0.32), 0 18px 42px rgba(46, 230, 166, 0.18);
}

.preference-day.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.preference-day.disabled {
  pointer-events: none;
}

.preference-day:has(input:checked) {
  border-color: rgba(46, 230, 166, 0.95);
  background: linear-gradient(180deg, rgba(46, 230, 166, 0.36), rgba(46, 230, 166, 0.18));
  box-shadow: 0 0 0 2px rgba(46, 230, 166, 0.32), 0 18px 42px rgba(46, 230, 166, 0.18);
}

.preference-sheet button:not(.sheet-close) {
  min-height: 44px;
}

.preference-price {
  margin-top: auto;
  color: var(--amber);
  font-weight: 800;
}

.preference-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.preference-cart-bar {
  position: fixed;
  z-index: 25;
  inset-inline: max(18px, calc((100vw - 1120px) / 2));
  inset-block-end: 20px;
  border: 1px solid rgba(46, 230, 166, 0.44);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(46, 230, 166, 0.18), rgba(74, 163, 255, 0.16)),
    rgba(8, 20, 38, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px);
  transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  backdrop-filter: blur(18px);
}

.preference-cart-bar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.preference-cart-bar.over-budget {
  border-color: rgba(255, 95, 118, 0.65);
  background:
    linear-gradient(135deg, rgba(255, 95, 118, 0.22), rgba(255, 189, 89, 0.12)),
    rgba(8, 20, 38, 0.97);
}

.preference-cart-bar > div {
  display: grid;
  gap: 4px;
}

.preference-cart-bar strong {
  color: var(--text);
  font-size: 17px;
}

.preference-cart-bar small {
  color: var(--muted);
}

.preference-cart-bar.over-budget small {
  color: #ffd0d7;
}

.preference-cart-bar button {
  min-width: 190px;
  min-height: 48px;
}

.soft-toast {
  position: fixed;
  z-index: 70;
  inset-inline: max(18px, calc((100vw - 620px) / 2));
  inset-block-start: 18px;
  border: 1px solid rgba(255, 189, 89, 0.48);
  border-radius: 8px;
  padding: 13px 15px;
  background:
    linear-gradient(135deg, rgba(255, 189, 89, 0.18), rgba(255, 95, 118, 0.12)),
    rgba(8, 20, 38, 0.98);
  color: #fff2df;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  backdrop-filter: blur(16px);
  text-align: center;
  line-height: 1.8;
}

.soft-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.swap-confirm-bar button {
  min-width: 190px;
  min-height: 48px;
}

.swap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.swap-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 14px;
  color: var(--text);
  display: grid;
  gap: 7px;
}

.swap-option input {
  width: auto;
}

.swap-option small {
  color: var(--amber);
}

.swap-option span {
  color: var(--muted);
  line-height: 1.7;
}

.rule-day {
  min-height: 220px;
  display: grid;
  gap: 9px;
  align-content: start;
}

.rule-day.auto-hot {
  border-color: rgba(255, 95, 118, 0.45);
}

.rule-day header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.rule-day header b {
  color: var(--text);
  font-size: 24px;
}

.auto-tags {
  min-height: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.auto-tags span {
  border-radius: 999px;
  background: rgba(255, 95, 118, 0.14);
  color: #ffd4dc;
  padding: 3px 8px;
  font-size: 11px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.check input {
  width: auto;
}

.publish-button {
  justify-self: stretch;
  min-height: 52px;
  font-size: 16px;
  font-weight: 800;
}

.span-2 {
  grid-column: 1 / -1;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rotation-detail-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
  max-width: 100%;
}

.rotation-detail-actions > form {
  display: inline-flex;
}

.rotation-detail-actions .button-link,
.rotation-detail-actions button {
  min-height: 46px;
  white-space: normal;
  line-height: 1.45;
}

.empty {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.alert {
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.alert.error {
  color: #ffd7dd;
  border-color: rgba(255, 95, 118, 0.45);
}

.alert.success {
  color: #d9fff2;
  border-color: rgba(46, 230, 166, 0.45);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login {
  width: min(440px, 100%);
  padding: 28px;
  display: grid;
  gap: 18px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guide-page {
  counter-reset: guide-section;
}

.guide-hero h2 {
  max-width: 780px;
}

.guide-hero-actions {
  min-width: 240px;
  display: grid;
  gap: 10px;
}

.guide-hero-actions .hero-card {
  min-width: 0;
}

.guide-hero-actions .button-link {
  width: 100%;
}

.guide-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
}

.guide-toc a {
  min-height: 40px;
  border: 1px solid rgba(156, 178, 214, 0.18);
  border-radius: 8px;
  padding: 9px 12px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  color: #dbe8ff;
  font-weight: 800;
}

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

.guide-card p {
  margin: 0;
  color: #d6e2f5;
}

.guide-card h3 {
  font-size: 24px;
  line-height: 1.45;
}

.guide-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.guide-steps article,
.guide-timeline article {
  border: 1px solid rgba(156, 178, 214, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 14px;
}

.guide-steps article > b {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(46, 230, 166, 0.22), rgba(74, 163, 255, 0.18));
  color: var(--green);
}

.guide-timeline {
  display: grid;
  gap: 10px;
}

.guide-timeline article {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.guide-timeline b {
  color: var(--text);
  font-size: 17px;
}

.guide-screen-map {
  border: 1px solid rgba(74, 163, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(3, 7, 19, 0.72), rgba(8, 20, 38, 0.82)),
    rgba(255, 255, 255, 0.04);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.guide-screen-map > div {
  min-height: 74px;
  border: 1px solid rgba(156, 178, 214, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 4px;
  position: relative;
}

.guide-screen-map span {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #03120d;
  font-weight: 900;
}

.guide-screen-map b,
.guide-screen-map small {
  padding-inline-start: 38px;
}

.guide-screen-map small {
  color: var(--muted);
}

.guide-screen-map .map-hero {
  min-height: 96px;
  background: linear-gradient(135deg, rgba(74, 163, 255, 0.18), rgba(169, 112, 255, 0.13));
}

.guide-screen-map .map-row {
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.guide-screen-map .map-row > div {
  min-height: 92px;
  border: 1px solid rgba(156, 178, 214, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 4px;
  position: relative;
}

.guide-screen-map .map-calendar {
  min-height: 150px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 14.2% 32px;
}

.guide-screen-map .muted-map {
  background: rgba(255, 255, 255, 0.035);
}

.guide-callouts {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.guide-callouts p {
  border-inline-start: 3px solid var(--blue);
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(74, 163, 255, 0.08);
}

.guide-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: center;
}

.approval-chain {
  display: grid;
  gap: 8px;
}

.approval-chain span {
  min-height: 44px;
  border: 1px solid rgba(46, 230, 166, 0.28);
  border-radius: 8px;
  background: rgba(46, 230, 166, 0.08);
  display: grid;
  place-items: center;
  color: #dffdf3;
  font-weight: 800;
}

.approval-chain i {
  width: 2px;
  height: 16px;
  margin: 0 auto;
  background: rgba(158, 176, 202, 0.4);
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .owner-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .owner-rail {
    position: static;
    height: auto;
  }

  .owner-content {
    padding: 18px;
  }

  .owner-hero {
    min-height: auto;
    flex-direction: column;
    align-items: stretch;
  }

  .owner-summary {
    grid-template-columns: 1fr;
  }

  .stats,
  .admin-grid,
  .form-grid,
  .coin-adjust-form,
  .owner-create-form,
  .action-grid,
  .assessment-grid,
  .people-grid,
  .people-grid.compact,
  .date-group,
  .swap-grid {
    grid-template-columns: 1fr;
  }

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

  .preference-receipt-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .preference-receipt-days {
    grid-template-columns: 1fr;
  }

  .hero,
  .section-head {
    flex-direction: column;
  }

  .swap-confirm-bar {
    inset-inline: 12px;
    inset-block-end: 12px;
    align-items: stretch;
    flex-direction: column;
  }

  .admin-swap-instruction {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .admin-swap-instruction > div {
    min-width: calc(100% - 52px);
    flex: 1;
  }

  .admin-swap-reset {
    width: 100%;
    margin-inline-start: 0;
  }

  .admin-edit-mode {
    width: 100%;
  }

  .admin-replacement-field {
    width: 100%;
    min-width: 0;
  }

  .swap-confirm-bar button,
  .preference-cart-bar button {
    width: 100%;
  }
}

@media (max-width: 1100px) {
  body {
    padding-bottom: 74px;
  }

  .shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: fixed;
    z-index: 30;
    inset: auto 10px 10px;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    background: rgba(5, 13, 29, 0.94);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  }

  .sidebar .brand,
  .sidebar form {
    display: none;
  }

  .nav {
    display: grid;
    gap: 6px;
  }

  .nav.intern-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .nav.admin-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .nav.owner-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav .desktop-guide-nav {
    display: none;
  }

.nav a,
.nav .mobile-stats-nav {
    min-height: 54px;
    padding: 7px 5px;
    display: grid;
    place-items: center;
    text-align: center;
    font-size: 10px;
    line-height: 1.35;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(156, 178, 214, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  .nav .mobile-stats-nav {
    display: grid;
    border: 1px solid rgba(156, 178, 214, 0.16);
    color: #d9e6ff;
  }

  .nav-badge {
    position: absolute;
    inset-block-start: -5px;
    inset-inline-end: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin: 0;
    font-size: 11px;
  }

  .nav a:active,
  .nav .mobile-stats-nav:active {
    transform: translateY(1px);
    background: rgba(74, 163, 255, 0.16);
  }

  .nav svg,
  .nav .mobile-stats-nav svg {
    width: 20px;
    height: 20px;
    color: var(--blue);
  }

  .nav .rotation-stats-nav,
  .nav .overall-stats-nav {
    display: none;
  }

  .mobile-stats-menu {
    position: fixed;
    z-index: 29;
    inset-inline: 10px;
    inset-block-end: 82px;
    border: 1px solid rgba(74, 163, 255, 0.34);
    border-radius: 8px;
    padding: 8px;
    background: rgba(5, 13, 29, 0.97);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
    gap: 6px;
    backdrop-filter: blur(18px);
  }

  .mobile-stats-menu.visible {
    display: grid;
  }

  .mobile-stats-menu a {
    border: 1px solid rgba(156, 178, 214, 0.16);
    border-radius: 8px;
    padding: 11px 12px;
    background: rgba(255, 255, 255, 0.06);
    display: grid;
    gap: 4px;
  }

  .mobile-stats-menu span {
    color: var(--text);
    font-weight: 800;
  }

  .mobile-stats-menu small {
    color: var(--muted);
  }

  .content,
  .content.single {
    padding: 12px;
    gap: 12px;
    max-width: none;
  }

  .site-footprint {
    margin: 0 auto 86px;
    padding: 0 14px;
    font-size: 11px;
  }

  .content > * {
    min-width: 0;
  }

  .hero {
    min-height: auto;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
    background:
      linear-gradient(135deg, rgba(13, 36, 70, 0.96), rgba(9, 18, 38, 0.92)),
      linear-gradient(90deg, rgba(46, 230, 166, 0.12), rgba(74, 163, 255, 0.14), rgba(255, 95, 118, 0.1));
  }

  .hero h2 {
    margin-top: 8px;
    font-size: 28px;
    line-height: 1.35;
  }

  .hero p {
    display: block;
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.8;
    color: #c9d8ef;
  }

  .hero-card {
    min-width: 0;
    width: 100%;
    padding: 11px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    background: rgba(255, 255, 255, 0.055);
  }

  .hero-card span {
    grid-column: 1 / -1;
    font-size: 11px;
  }

  .hero-card b,
  .hero-card small {
    min-height: 34px;
    border: 1px solid rgba(156, 178, 214, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    padding: 7px 9px;
    display: flex;
    align-items: center;
    overflow-wrap: anywhere;
  }

  .hero-card b {
    font-size: 16px;
    color: var(--text);
  }

  .hero-card small {
    color: #c7d5ed;
    font-size: 11px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .button-link {
    flex: 1 1 130px;
    min-height: 42px;
  }

  .hero > .button-link {
    align-self: flex-end;
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 13px;
  }

  .hero .rotation-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .hero .rotation-detail-actions > form {
    display: flex;
    min-width: 0;
  }

  .hero .rotation-detail-actions .button-link,
  .hero .rotation-detail-actions button {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 9px 10px;
    overflow-wrap: anywhere;
  }

  .rotation-panel {
    order: 1;
  }

  .calendar-panel {
    order: 2;
  }

  .dashboard-stats {
    order: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dashboard-stats .stat {
    padding: 12px;
  }

  .dashboard-stats .stat span {
    font-size: 11px;
  }

  .dashboard-stats .stat b {
    font-size: 22px;
  }

  #ledger {
    order: 4;
  }

  .panel {
    padding: 14px;
  }

  .section-head {
    gap: 10px;
  }

  .legend {
    width: 100%;
    gap: 8px;
  }

  .mobile-calendar-tools {
    display: flex;
    justify-content: flex-end;
  }

  .disclosure-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    color: var(--text);
    font-weight: 800;
    list-style: none;
  }

  .mobile-disclosure {
    display: block;
  }

  .mobile-disclosure > .disclosure-body {
    max-width: 100%;
  }

  .disclosure-summary::-webkit-details-marker {
    display: none;
  }

  .disclosure-summary:after {
    content: "+";
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(74, 163, 255, 0.12);
    color: var(--blue);
  }

  .mobile-disclosure[open] > .disclosure-summary:after {
    content: "−";
  }

  .disclosure-summary small {
    margin-inline-start: auto;
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
  }

  .mobile-disclosure[open] > .disclosure-body {
    margin-top: 14px;
  }

  .mobile-disclosure > .disclosure-body > .section-head {
    display: none;
  }

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

  .compact-weekday {
    min-height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font-weight: 800;
    font-size: 12px;
  }

  .compact-day {
    min-width: 0;
    aspect-ratio: 1;
    border: 1px solid rgba(156, 178, 214, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    padding: 0;
    display: grid;
    place-items: center;
    position: relative;
    box-shadow: none;
  }

  .compact-day span {
    font-weight: 800;
    font-size: 16px;
    line-height: 1;
    position: relative;
    z-index: 1;
  }

  .compact-day.mine {
    border-color: rgba(46, 230, 166, 0.85);
    background: rgba(46, 230, 166, 0.2);
  }

  .compact-day.other {
    border-color: rgba(74, 163, 255, 0.42);
  }

  .compact-day.free {
    opacity: 0.45;
  }

  .compact-day.off-day {
    box-shadow: inset 0 0 0 2px rgba(255, 95, 118, 0.72), 0 0 12px rgba(255, 95, 118, 0.12);
  }

  .compact-day.sensitive {
    box-shadow: inset 0 0 0 2px rgba(255, 189, 89, 0.78), 0 0 12px rgba(255, 189, 89, 0.12);
  }

  .compact-day.off-day i,
  .compact-day.sensitive i {
    display: none;
  }

  .compact-day.blank {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }

  .compact-day.past {
    opacity: 0.5;
  }

  .full-calendar {
    display: none;
  }

  .calendar-panel.expanded .full-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(118px, 1fr));
  }

  .calendar-panel.expanded .compact-calendar {
    display: none;
  }

  .swap-form.expanded .swap-full-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(118px, 1fr));
  }

  .swap-form.expanded .swap-compact-calendar {
    display: none;
  }

  .admin-swap-calendar.expanded .admin-swap-full-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(118px, 1fr));
  }

  .admin-swap-calendar.expanded .admin-swap-compact-calendar {
    display: none;
  }

  .preference-form.expanded .preference-full-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(118px, 1fr));
  }

  .preference-form.expanded .preference-compact-calendar {
    display: none;
  }

  .day-sheet {
    position: fixed;
    z-index: 35;
    inset-inline: 12px;
    inset-block-end: 84px;
    border: 1px solid rgba(74, 163, 255, 0.35);
    border-radius: 8px;
    background: rgba(8, 20, 38, 0.97);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    padding: 16px;
    gap: 8px;
    transform: translateY(18px);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(18px);
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .day-sheet.visible {
    display: grid;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .day-sheet strong {
    font-size: 22px;
  }

  .day-sheet p {
    margin: 0;
    color: var(--text);
    line-height: 1.8;
  }

  .day-sheet em {
    color: var(--amber);
    font-style: normal;
  }

  .sheet-close {
    position: absolute;
    inset-inline-end: 10px;
    inset-block-start: 10px;
    width: 34px;
    height: 34px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
  }

  .preference-cart-bar {
    inset-inline: 12px;
    inset-block-end: 84px;
    align-items: stretch;
    flex-direction: column;
  }

  .soft-toast {
    inset-inline: 12px;
    inset-block-start: 12px;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .mobile-card-table {
    overflow-x: visible;
  }

  .mobile-card-table table,
  .mobile-card-table thead,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .mobile-card-table thead {
    display: none;
  }

  .mobile-card-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    padding: 10px;
    margin-bottom: 10px;
  }

  .mobile-card-table td {
    border-bottom: 0;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-card-table td:before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    flex: 0 0 auto;
  }

  .mobile-card-table td:last-child {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .mobile-card-table td:last-child:before {
    width: 100%;
  }

  .mobile-card-table .button-link.small {
    flex: 1 1 90px;
    min-height: 38px;
  }

  .preference-actions {
    flex-direction: column-reverse;
  }

  .preference-actions .button-link,
  .preference-actions button {
    width: 100%;
  }

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

  .guide-toc a {
    text-align: center;
    font-size: 12px;
  }

  .guide-grid,
  .guide-steps,
  .guide-split {
    grid-template-columns: 1fr;
  }

  .guide-card h3 {
    font-size: 20px;
  }

  .guide-timeline article {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .guide-screen-map .map-row {
    grid-template-columns: 1fr;
  }

  .guide-screen-map > div,
  .guide-screen-map .map-row > div {
    min-height: 84px;
  }

  .guide-screen-map .map-calendar {
    min-height: 130px;
  }
}
