.atelier-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(22px, 4vh, 52px) 0 clamp(22px, 4vh, 52px) clamp(24px, 3vw, 54px);
  box-sizing: border-box;
  border: 0;
  overflow: hidden;
  color: #f3e8d7;
  background: transparent;
  font: 500 16px/1.25 "Barlow", system-ui, sans-serif;
}

.atelier-dialog::backdrop {
  background: linear-gradient(90deg, #171513a8, #17151316 56%, transparent 85%);
}

.atelier-panel {
  display: flex;
  flex-direction: column;
  width: min(390px, 42vw);
  max-height: 100%;
  overflow: hidden;
  border: 1px solid #eecdad38;
  border-top: 3px solid #cc9b67;
  background: #221f1bef;
  box-shadow: 0 24px 75px #0d0b0899;
}

.atelier-header,
.atelier-checkout { padding: 18px 20px; }

.atelier-header { display: flex; justify-content: space-between; gap: 14px; }
.atelier-header p {
  margin: 0 0 5px;
  color: #d3b697;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.atelier-header h2 {
  margin: 0;
  color: #f6e9d4;
  font: 400 clamp(24px, 3.8vw, 40px)/1 Georgia, serif;
  letter-spacing: -.045em;
}

.atelier-dialog button { font: inherit; cursor: pointer; }
.atelier-dialog button:focus-visible { outline: 2px solid #f9dcb6; outline-offset: -2px; }
.atelier-dialog button:disabled { cursor: default; opacity: .62; }
.atelier-close {
  flex: 0 0 36px;
  height: 36px;
  border: 1px solid #755f4b;
  background: transparent;
  color: #f6e9d4;
  font-size: 24px !important;
}
.atelier-stock { min-height: 0; display: flex; flex-direction: column; }
.atelier-departments {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid #eecdad2e;
  padding-inline: 12px;
}
.atelier-departments button {
  padding: 11px 3px 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #c5b29f;
  background: transparent;
  font-weight: 600;
}
.atelier-departments button:hover,
.atelier-departments button[aria-pressed="true"] { color: #f7e1c5; background: #eecdad12; }
.atelier-departments button[aria-pressed="true"] { border-bottom-color: #e7ac78; }
.atelier-list {
  list-style: none;
  margin: 0;
  padding: 6px 11px;
  overflow: auto;
  scrollbar-color: #977657 #2c261f;
}
.atelier-list button {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 7px 9px;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-bottom-color: #eecdad13;
}
.atelier-list button:hover { background: #eecdad14; }
.atelier-list button[aria-pressed="true"] { border-color: #d29e68a6; background: #75533753; }
.atelier-list button i {
  width: 16px;
  height: 16px;
  border: 1px solid #f5dfc280;
  background: var(--cloth-color);
}
.atelier-list b, .atelier-list small { display: block; }
.atelier-list small { color: #d0bda9; font-size: 12px; }
.atelier-list strong { color: #dfc7a9; font-size: 12px; white-space: nowrap; }
.atelier-checkout { border-top: 1px solid #eecdad2e; padding-bottom: 8px; }
.atelier-totals {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: #e4c8a7;
  font-size: 13px;
}
.atelier-buy {
  width: 100%;
  padding: 11px;
  border: 1px solid #f3d4ae;
  background: #e0b285;
  color: #241a11;
  font-weight: 750 !important;
}
.atelier-buy:not(:disabled):hover { background: #f3c9a1; }
.atelier-status { min-height: 1.25em; margin: 6px 0 0; color: #efcaab; font-size: 12px; }
.atelier-turn {
  position: absolute;
  right: clamp(30px, 5vw, 72px);
  bottom: clamp(24px, 5vh, 60px);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #221e1af2;
  border: 1px solid #d1a98363;
  font-size: 13px;
}
.atelier-turn button {
  width: 38px;
  height: 36px;
  border: 0;
  color: #ffdfbb;
  background: #ba8c6228;
  font-size: 24px;
}
.atelier-turn button:hover { background: #ba8c6260; }
body.atelier-open :is(#hud, #hud-top-right, #weapon-crosshair, #game-chat, #fps-pill) { visibility: hidden; }

@media (max-width: 680px) {
  .atelier-dialog { padding: 0 12px 12px; }
  .atelier-dialog::backdrop { background: linear-gradient(0deg,#1715139e,transparent 76%); }
  .atelier-panel { position: absolute; bottom: 8px; inset-inline: 8px; width: auto; max-height: 53%; }
  .atelier-header { padding: 8px 12px; }
  .atelier-header p { font-size: 9px; margin-bottom: 3px; }
  .atelier-close { flex-basis: 32px; height: 32px; }
  .atelier-departments button { padding: 6px 3px; font-size: 13px; }
  .atelier-list button { min-height: 41px; }
  .atelier-checkout { padding: 5px 12px; }
  .atelier-totals { margin-bottom: 4px; }
  .atelier-buy { padding: 6px; }
  .atelier-status { margin-top: 3px; }
  .atelier-turn { right: 12px; bottom: max(54%, 200px); }
  .atelier-turn span { display: none; }
}
@media (max-height: 520px) and (min-width: 681px) {
  .atelier-dialog { padding-block: 10px; }
  .atelier-header, .atelier-checkout { padding-block: 7px; }
  .atelier-header h2 { font-size: 24px; }
}
