.appearance-dialog {
  width: min(900px, 96vw);
  height: min(690px, 94vh);
  padding: 0;
  border: 0;
  background: transparent;
  color: #d6d0bf;
  font-family: Tahoma, Arial, sans-serif;
}
.appearance-dialog::backdrop { background: #000b; }
.appearance-dialog > form {
  box-sizing: border-box;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: 38px 54px minmax(0, 1fr) 48px;
  padding: 5px;
  background: #11191b url('assets/client-hud/images/background.png');
  border: 3px solid transparent;
  border-image: url('assets/client-hud/images/3pixel-frame-borderimage.png') 3 fill repeat;
}
.appearance-dialog header,
.appearance-dialog footer {
  height: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: #0b1214;
  border: 1px solid #2d393b;
  text-shadow: none;
}
.appearance-dialog header { position: relative; }
.appearance-dialog header b {
  margin: auto;
  color: #d5c39a;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.appearance-dialog header button { position: absolute; right: 14px; }
.appearance-dialog button,
.appearance-dialog input {
  border: 1px solid #485154;
  background: #111718;
  color: #d8d2c1;
  padding: 7px;
  font: inherit;
}
.appearance-dialog nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #0c1315;
  border: 1px solid #273033;
}
.appearance-dialog nav button {
  border: 0;
  border-right: 1px solid #273033;
  color: #817b6d;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 14px;
}
.appearance-dialog nav button span { margin-right: 8px; font-size: 24px; }
.appearance-dialog nav button.active {
  color: #f4ead3;
  background: #172123;
  box-shadow: inset 0 -2px #aa8532;
}
.appearance-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(285px, 42%) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 3px;
}
.appearance-browser,
.appearance-preview-panel {
  min-height: 0;
  overflow: hidden;
  padding: 10px;
  background: #0a1113;
  border: 1px solid #283234;
}
.appearance-browser { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.appearance-list-title {
  display: flex;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #263032;
  text-transform: uppercase;
}
.appearance-list-title b,
.appearance-preview-panel h2,
.appearance-colors-title {
  color: #ead9b4;
  font-family: Georgia, serif;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.appearance-list-title em { margin-left: auto; color: #d8aa3b; font-style: normal; }
.appearance-search {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: #a99f88;
}
.appearance-search input { min-width: 0; }
.appearance-grid {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 5px;
}
.appearance-card {
  position: relative;
  min-height: 74px;
  display: grid;
  grid-template-columns: 70px 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: end;
  padding: 6px !important;
  text-align: left;
  background: #0d1416 !important;
  border-color: #263033 !important;
}
.appearance-card-preview {
  grid-row: 1 / 3;
  justify-self: center;
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
}
.appearance-card b { color: #eee4cf; font: 700 15px Georgia, serif; }
.appearance-card small { align-self: start; color: #858b87; font-size: 11px; }
.appearance-card.selected {
  background: #171b19 !important;
  border-color: #a47b25 !important;
  box-shadow: inset 3px 0 #b58c2e;
}
.appearance-card.locked { opacity: .62; filter: grayscale(.72); cursor: not-allowed; }
.appearance-card.locked:hover { border-color: #6d4a43 !important; background: #131011 !important; }
.appearance-card.locked b { color: #aaa39a; }
.appearance-card.locked small { color: #c17a70; font-weight: 700; }
.appearance-lock { position: absolute; top: 7px; right: 8px; display: grid; place-items: center; width: 22px; height: 22px; color: #f0d28c; background: #211819; border: 1px solid #7a554d; border-radius: 50%; font-size: 12px; filter: none; }
.appearance-preview-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(160px, 1fr) auto auto auto;
  gap: 8px;
}
.appearance-preview-panel.mount-mode { grid-template-rows: auto minmax(180px, 1fr) auto; }
.appearance-preview-panel h2 { margin: 0; font-size: 17px; }
.appearance-preview-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sex-toggle { display: flex; align-items: center; gap: 6px; color: #d2c6a8; }
.sex-toggle[hidden] { display: none; }
.sex-toggle input { accent-color: #b89134; }
.appearance-preview {
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background-color: #5c6552;
  background-image: linear-gradient(#6e7764aa 1px, transparent 1px), linear-gradient(90deg, #6e7764aa 1px, transparent 1px);
  background-size: 32px 32px;
  border: 2px solid #9e9b82;
  box-shadow: inset 0 0 30px #0006;
}
.appearance-preview canvas { width: 224px; height: 224px; image-rendering: pixelated; }
.appearance-options {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 8px;
  background: #0d1517;
  border: 1px solid #2a3537;
}
.addon-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
}
.addon-switcher span { margin-right: 6px; color: #ad9d7c; font-size: 12px; text-transform: uppercase; }
.addon-switcher button {
  min-width: 42px;
  padding: 6px 10px;
  color: #929995;
  border-radius: 3px;
}
.addon-switcher button.active {
  color: #fff4d0;
  background: #72591f;
  border-color: #d0a444;
}
.mount-toggle {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px;
  color: #ead8ad;
  background: #18201d;
  border: 1px solid #987a35;
  cursor: pointer;
}
.mount-toggle input { accent-color: #b89134; }
.appearance-colors-title { font-size: 14px; }
.appearance-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.appearance-colors button { display: flex; align-items: center; gap: 10px; text-align: left; color: #c9b995; }
.appearance-colors i {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 2px solid #cab57a;
  box-shadow: 0 0 0 2px #070b0c;
  background: #fff;
}
.color-palette {
  position: absolute;
  z-index: 5;
  right: 10px;
  bottom: 93px;
  display: grid;
  grid-template-columns: repeat(19, 20px);
  gap: 2px;
  padding: 7px;
  background: #241b17;
  border: 2px solid #8d7b66;
  box-shadow: 0 8px 28px #000;
}
.color-palette[hidden],
.appearance-colors[hidden],
.appearance-colors-title[hidden],
.addon-switcher[hidden],
.mount-toggle[hidden] { display: none !important; }
.color-palette button { width: 20px; height: 20px; padding: 0; border: 1px solid #080808; box-shadow: inset 0 0 0 1px #ffffff38; }
.color-palette button.selected { z-index: 1; outline: 2px solid white; }
.appearance-dialog footer {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: auto !important;
  min-width: 0;
  margin: 0 !important;
}
.appearance-dialog footer span {
  min-width: 0;
  overflow: hidden;
  margin-right: auto;
  color: #cdbb8e;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.appearance-dialog footer span.blocked { color: #e28c7e; font-weight: 700; }
.appearance-dialog footer button:disabled { opacity: .5; cursor: not-allowed; color: #9b9485; border-color: #4a4740; background: #171717; }
.appearance-dialog footer button { min-width: 88px; }
.appearance-dialog footer button:last-child { color: #f0ddb1; border-color: #a07d32; background: #282315; }
@media (max-width: 720px) {
  .appearance-dialog { height: 96vh; }
  .appearance-body { grid-template-columns: 1fr; }
  .appearance-browser { max-height: 230px; }
  .appearance-preview { min-height: 190px; }
  .appearance-preview canvas { width: 170px; height: 170px; }
  .color-palette { grid-template-columns: repeat(10, 20px); }
}
@media (max-height: 700px) {
  .appearance-dialog { height: 96vh; }
  .appearance-body { padding: 6px 3px; }
  .appearance-browser,
  .appearance-preview-panel { padding: 7px; }
  .appearance-preview-panel { grid-template-rows: auto minmax(130px, 1fr) auto auto auto; }
  .appearance-preview-panel.mount-mode { grid-template-rows: auto minmax(140px, 1fr) auto; }
  .appearance-preview canvas { width: 176px; height: 176px; }
  .appearance-options { min-height: 34px; }
}
