:root {
  color-scheme: dark;
  --bg: #070707;
  --panel: #171719;
  --panel-2: #1f2023;
  --panel-3: #111113;
  --line: rgba(255, 244, 219, 0.1);
  --line-strong: rgba(255, 184, 77, 0.32);
  --text: #f2ede3;
  --muted: #9f9a92;
  --soft: #cec5b7;
  --gold: #f0a21a;
  --gold-2: #ffbe45;
  --orange: #df6f08;
  --green: #33c07a;
  --red: #e35757;
  --blue: #3b98ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 70% 0%, rgba(223, 111, 8, 0.14), transparent 34rem),
    linear-gradient(135deg, #050505 0%, #111111 48%, #070707 100%);
  color: var(--text);
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

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

.login-card {
  width: min(460px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  min-width: 0;
  overflow: hidden;
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: rgba(17, 17, 19, 0.94);
  box-shadow: var(--shadow);
}

.login-card > *,
.topbar > * {
  min-width: 0;
  max-width: 100%;
}

.login-card h1,
.topbar h1 {
  overflow-wrap: anywhere;
}

.login-card img {
  width: 136px;
  max-width: 42vw;
  justify-self: center;
  border-radius: 14px;
  background: #101012;
}

.login-card h1 {
  margin-top: 4px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.5;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: #ff8d8d;
  font-weight: 700;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  background: rgba(19, 19, 21, 0.94);
  border-right: 1px solid var(--line);
  box-shadow: 18px 0 52px rgba(0, 0, 0, 0.35);
  z-index: 10;
}

.sidebar-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101012;
}

.sidebar-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
  padding: 4px 2px;
}

.brand img {
  width: 64px;
  height: 52px;
  object-fit: contain;
  border-radius: 10px;
  background: #111;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand strong {
  font-size: 1.2rem;
  letter-spacing: 0;
}

.brand small {
  color: var(--gold-2);
  margin-top: 4px;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: auto;
  padding-right: 4px;
}

.nav button {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: left;
}

.nav button:hover,
.nav button.active {
  color: var(--text);
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(240, 162, 26, 0.15), rgba(223, 111, 8, 0.08));
}

.nav .icon {
  color: var(--gold);
  font-size: 1.05rem;
}

.nav .locked {
  font-size: 0.76rem;
  color: #6e6a64;
}

.role-panel {
  margin-top: auto;
  padding: 14px;
  border-radius: var(--radius);
  background: #101012;
  border: 1px solid var(--line);
}

.role-panel label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.role-panel select {
  width: 100%;
  color: var(--text);
  background: #1d1d20;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px;
}

.role-panel p {
  margin: 11px 0 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.86rem;
}

.role-panel strong,
.role-panel small {
  display: block;
}

.role-panel strong {
  color: var(--text);
  font-size: 1rem;
}

.role-panel small {
  margin-top: 4px;
  color: var(--gold-2);
  line-height: 1.35;
}

.logout-action {
  width: 100%;
  min-height: 38px;
  margin-top: 12px;
  border: 1px solid rgba(227, 87, 87, 0.4);
  border-radius: 12px;
  color: #ffd0d0;
  background: rgba(227, 87, 87, 0.12);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 94px;
  padding: 22px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 7, 0.82);
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.5vw, 2.35rem);
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-actions button,
.primary-action,
.ghost-action {
  min-height: 42px;
  border-radius: 13px;
  padding: 0 15px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(240, 162, 26, 0.13);
}

.refresh-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.refresh-action span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 1.05rem;
  line-height: 1;
}

.refresh-action.syncing span {
  animation: spin 850ms linear infinite;
}

.refresh-action.synced {
  border-color: rgba(51, 192, 122, 0.55);
  background: rgba(51, 192, 122, 0.15);
}

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

.top-actions button:first-child,
.primary-action {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  border-color: transparent;
  color: #1b1104;
  font-weight: 800;
}

.view {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 34px;
  outline: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: 28px;
  margin-bottom: 24px;
}

.hero-copy {
  min-width: 0;
}

.hero-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1;
}

.hero-copy p {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--soft);
  font-size: 1.05rem;
  line-height: 1.55;
}

.hero-logo {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  justify-self: end;
}

.metric-grid,
.module-grid,
.phase-grid,
.stock-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.module-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.phase-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card,
.metric,
.work-card,
.map-panel,
.sheet,
.tab-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(31, 32, 35, 0.96), rgba(16, 16, 18, 0.96));
  box-shadow: var(--shadow);
}

.metric,
.work-card {
  padding: 18px;
}

.metric span,
.work-card span,
.section-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.5rem, 2.8vw, 2.35rem);
  color: var(--text);
}

.metric small {
  color: var(--green);
}

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

.patron-needs .metric {
  min-height: 116px;
}

.boss-zone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0 10px;
}

.boss-zone-card {
  min-height: 150px;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  background: linear-gradient(145deg, rgba(240, 162, 26, 0.16), rgba(16, 16, 18, 0.96));
  box-shadow: var(--shadow);
  text-align: left;
}

.boss-zone-card span,
.boss-zone-card small {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.8rem;
}

.boss-zone-card strong {
  display: block;
  margin: 10px 0;
  color: var(--gold-2);
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
}

.boss-zone-card:hover {
  border-color: rgba(255, 190, 69, 0.75);
  transform: translateY(-1px);
}

.boss-zone-detail {
  margin: 12px 0 22px;
}

.work-card {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.static-card {
  cursor: default;
  text-align: left;
}

.work-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.work-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

.pill.gold {
  color: #1d1202;
  background: var(--gold-2);
  border-color: transparent;
  font-weight: 800;
}

.pill.red {
  color: #ffe8e8;
  background: rgba(227, 87, 87, 0.18);
  border-color: rgba(227, 87, 87, 0.35);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin: 28px 0 16px;
}

.section-head h2 {
  margin: 4px 0 0;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.section-head p {
  max-width: 720px;
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.map-panel {
  position: relative;
  overflow: hidden;
}

.map-panel img {
  width: 100%;
  display: block;
  min-height: 390px;
  object-fit: cover;
}

.map-hotspot {
  position: absolute;
  border: 2px solid rgba(255, 218, 104, 0.8);
  background: rgba(6, 6, 6, 0.14);
  border-radius: 22px;
  color: #fff9e8;
  font-weight: 900;
  text-shadow: 0 2px 12px #000;
}

.map-hotspot.zone2 {
  border-color: rgba(59, 152, 255, 0.88);
}

.map-hotspot:hover {
  background: rgba(240, 162, 26, 0.18);
}

.z1-hotspot {
  left: 7%;
  top: 16%;
  width: 49%;
  height: 61%;
}

.z2-hotspot {
  right: 5%;
  top: 18%;
  width: 37%;
  height: 66%;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: rgba(20, 20, 22, 0.82);
}

th,
td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  color: var(--soft);
}

th {
  color: var(--text);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.pj-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 220px;
}

.pj-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #1b1104;
  background: var(--gold-2);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
}

.pj-link.missing {
  color: #ffe8e8;
  background: rgba(227, 87, 87, 0.18);
  border: 1px solid rgba(227, 87, 87, 0.35);
}

.muted-cell {
  color: var(--muted);
}

.day-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 18px;
}

.week-selector {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.week-selector button {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: #151517;
  text-align: left;
  padding: 12px;
}

.week-selector button strong,
.week-selector button span {
  display: block;
}

.week-selector button span {
  color: var(--muted);
  margin-top: 5px;
}

.week-selector button.active {
  color: #1b1104;
  background: var(--gold-2);
  border-color: transparent;
}

.week-selector button.active span {
  color: #412801;
}

.day-selector button {
  min-width: 74px;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--text);
  background: #151517;
  font-weight: 800;
}

.day-selector button.active {
  color: #1b1104;
  background: var(--gold-2);
  border-color: transparent;
}

.atelier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.atelier-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.atelier-card {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-height: 320px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(31, 32, 35, 0.96), rgba(16, 16, 18, 0.96));
  box-shadow: var(--shadow);
}

.atelier-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.atelier-card-head span,
.atelier-card dt {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.atelier-card-head strong {
  color: #1b1104;
  background: var(--gold-2);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.atelier-card.status-terminé .atelier-card-head strong {
  background: var(--green);
}

.atelier-card.status-bloqué .atelier-card-head strong {
  color: #ffe8e8;
  background: rgba(227, 87, 87, 0.28);
}

.atelier-card.status-en-cours .atelier-card-head strong {
  background: var(--blue);
  color: #eef6ff;
}

.atelier-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.atelier-card p {
  margin: 0;
  color: var(--soft);
  line-height: 1.45;
}

.atelier-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.atelier-card dd {
  margin: 3px 0 0;
  color: var(--text);
}

.atelier-card .primary-action {
  margin-top: auto;
  width: 100%;
}

.field-panel {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 22px 0;
}

.store-form {
  display: grid;
  gap: 14px;
  align-content: start;
}

.store-form h3 {
  margin: 0;
  color: var(--gold-2);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.detail-block {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.detail-block h3 {
  margin: 0 0 8px;
}

.detail-block p {
  margin: 0;
  color: var(--soft);
  line-height: 1.5;
}

.assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.assigned-list {
  margin: 0;
  padding-left: 20px;
  color: var(--soft);
  line-height: 1.6;
}

.compact-action {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.85rem;
}

.settings-table input {
  width: 100%;
  min-width: 170px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.settings-table input:focus {
  outline: 2px solid rgba(245, 158, 11, 0.35);
  border-color: rgba(245, 158, 11, 0.75);
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  white-space: nowrap;
}

.mini-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.mini-progress {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.mini-progress span,
.mini-progress small {
  display: block;
  color: var(--muted);
}

.mini-progress strong {
  display: block;
  margin: 6px 0;
  color: var(--gold-2);
  font-size: 1.4rem;
}

.progress {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--orange));
}

.sheet {
  padding: 22px;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.sheet-head h2 {
  margin: 0;
}

.sheet-head p {
  margin: 7px 0 0;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.tabs button {
  flex: 0 0 auto;
  color: var(--muted);
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #151517;
  border-radius: 999px;
}

.tabs button.active {
  color: #1b1104;
  background: var(--gold-2);
  border-color: transparent;
  font-weight: 800;
}

.tab-shell {
  padding: 22px;
  min-height: 250px;
  box-shadow: none;
}

.empty-tab {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 26px;
  background: rgba(240, 162, 26, 0.06);
}

.empty-tab span {
  color: var(--gold-2);
  font-weight: 800;
}

.empty-tab p {
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.5;
}

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

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

.field label {
  color: var(--muted);
  font-size: 0.82rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #101012;
  padding: 11px;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.notice {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(227, 87, 87, 0.36);
  background: rgba(227, 87, 87, 0.1);
  color: #ffdede;
}

.missing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.missing-item {
  min-height: 96px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px dashed rgba(255, 190, 69, 0.38);
  background: rgba(240, 162, 26, 0.07);
}

.missing-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-2);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.missing-item strong {
  color: var(--soft);
  line-height: 1.35;
}

.rules-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.rules-panel article {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(51, 192, 122, 0.28);
  background: rgba(51, 192, 122, 0.08);
}

.rules-panel span {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.rules-panel p {
  margin: 0;
  color: var(--soft);
  line-height: 1.45;
}

.mobile-backdrop {
  display: none;
}

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, 88vw);
    gap: 14px;
    padding: calc(76px + env(safe-area-inset-top)) 14px 16px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar .brand {
    padding-left: 56px;
    margin-top: -62px;
    min-height: 64px;
  }

  .brand img {
    width: 54px;
    height: 44px;
  }

  .brand strong {
    font-size: 1rem;
  }

  .nav button {
    min-height: 38px;
    padding: 8px 9px;
    border-radius: 11px;
    font-size: 0.92rem;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 30;
  }

  .topbar {
    padding: calc(20px + env(safe-area-inset-top)) 14px 16px 76px;
    padding-right: 188px;
  }

  .role-panel {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    right: 12px;
    z-index: 40;
    width: 158px;
    margin: 0;
    padding: 8px;
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  }

  .role-panel label {
    margin-bottom: 5px;
    font-size: 0.65rem;
  }

  .role-panel select {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 0.9rem;
  }

  .role-panel p {
    display: none;
  }

  .refresh-action {
    min-width: 132px;
    justify-content: center;
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.56);
    z-index: 8;
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: 150px;
    padding-right: 178px;
  }

  .view {
    padding: 18px 14px calc(36px + env(safe-area-inset-bottom));
  }

  .hero,
  .metric-grid,
  .module-grid,
  .form-grid,
  .field-panel,
  .store-grid {
    grid-template-columns: 1fr;
  }

  .boss-zone-grid {
    grid-template-columns: 1fr;
  }

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

  .patron-needs .metric {
    min-height: 96px;
    padding: 14px;
  }

  .patron-needs .metric strong {
    font-size: clamp(1.45rem, 6vw, 2rem);
  }

  .hero-logo {
    justify-self: start;
    max-width: 230px;
  }

  .hero {
    gap: 18px;
    margin-bottom: 18px;
  }

  .hero-copy h2 {
    font-size: clamp(1.75rem, 7vw, 2.8rem);
  }

  .hero-copy p {
    margin-top: 10px;
    font-size: 0.98rem;
    line-height: 1.45;
  }

  .metric-grid,
  .module-grid,
  .phase-grid,
  .stock-grid {
    gap: 12px;
  }

  .metric,
  .work-card {
    padding: 14px;
  }

  .metric strong {
    font-size: clamp(1.45rem, 5vw, 2rem);
  }

  .work-card {
    min-height: 116px;
    gap: 8px;
  }

  .work-card h3 {
    font-size: 1.02rem;
  }

  .work-card p {
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .section-head {
    margin: 22px 0 12px;
  }

  .section-head h2 {
    font-size: clamp(1.2rem, 5vw, 1.55rem);
  }

  .table-wrap {
    max-width: 100%;
    border-radius: 12px;
  }

  table {
    min-width: 620px;
  }

  th,
  td {
    padding: 11px;
    font-size: 0.9rem;
  }

  .sheet {
    padding: 16px;
  }

  .detail-block {
    margin-top: 12px;
    padding: 13px;
  }

  .assignment-grid,
  .detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
  }

  .map-panel img {
    min-height: 320px;
  }
}

@media (max-width: 560px) {
  .login-screen {
    padding: 12px;
  }

  .login-card {
    width: min(340px, calc(100vw - 40px));
    max-width: min(340px, calc(100vw - 40px));
    padding: 20px;
  }

  .login-card .field,
  .login-card input,
  .login-card button,
  .login-card p {
    max-width: 100%;
    min-width: 0;
  }

  .topbar {
    min-height: 150px;
    padding-top: calc(66px + env(safe-area-inset-top));
    padding-right: 14px;
    padding-left: 14px;
  }

  .sidebar-toggle {
    top: calc(10px + env(safe-area-inset-top));
    left: 10px;
  }

  .role-panel {
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
    width: min(168px, calc(100vw - 74px));
  }

  .top-actions {
    width: 100%;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .top-actions button {
    width: auto;
    flex: 0 1 auto;
    min-width: 0;
    min-height: 36px;
    padding: 0 9px;
    font-size: 0.84rem;
  }

  .primary-action,
  .ghost-action {
    min-height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 0.86rem;
  }

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

  .map-hotspot {
    font-size: 0.9rem;
  }

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

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

  .day-selector button,
  .week-selector button {
    min-width: 0;
    min-height: 38px;
    padding: 8px;
    border-radius: 10px;
    font-size: 0.86rem;
  }

  .atelier-grid,
  .atelier-grid.compact {
    grid-template-columns: 1fr;
    gap: 11px;
    margin-top: 12px;
  }

  .atelier-card {
    min-height: 0;
    gap: 9px;
    padding: 13px;
    border-radius: 13px;
  }

  .atelier-card h3 {
    font-size: 1rem;
  }

  .atelier-card p,
  .atelier-card dd {
    font-size: 0.88rem;
    line-height: 1.32;
  }

  .atelier-card dl {
    gap: 7px;
  }

  .atelier-card-head {
    gap: 8px;
  }

  .atelier-card-head span,
  .atelier-card dt {
    font-size: 0.67rem;
  }

  .atelier-card-head strong {
    padding: 4px 7px;
    font-size: 0.68rem;
    white-space: normal;
    text-align: right;
  }

  .sheet {
    padding: 13px;
    border-radius: 14px;
  }

  .sheet-head {
    gap: 10px;
    margin-bottom: 12px;
  }

  .detail-block {
    padding: 11px;
    border-radius: 12px;
  }

  .detail-block h3 {
    font-size: 0.98rem;
  }

  .field {
    gap: 6px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 38px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 0.92rem;
  }

  .tabs {
    gap: 6px;
  }

  .tabs button {
    min-height: 34px;
    padding: 7px 9px;
    border-radius: 999px;
    font-size: 0.82rem;
  }

  table {
    min-width: 560px;
  }

  th,
  td {
    padding: 9px;
    font-size: 0.84rem;
  }

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

  .patron-needs .metric {
    padding: 12px;
  }

  .patron-needs .metric span {
    font-size: 0.68rem;
  }

  .patron-needs .metric small {
    font-size: 0.78rem;
  }

  .z1-hotspot {
    left: 5%;
    top: 15%;
    width: 53%;
    height: 48%;
  }

  .z2-hotspot {
    right: 5%;
    top: 39%;
    width: 45%;
    height: 42%;
  }
}

@media (max-width: 380px) {
  .patron-needs {
    grid-template-columns: 1fr;
  }
}
