:root {
  color-scheme: light;
  --ink: #17211e;
  --muted: #6e7773;
  --green: #17352e;
  --green-soft: #dce8e1;
  --cream: #f5f1eb;
  --paper: #fffdf9;
  --line: #dedbd4;
  --accent: #cb7659;
  --shadow: 0 18px 45px rgba(32, 50, 44, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  min-height: 100svh;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
}

.app-header,
main {
  width: min(100% - 28px, 980px);
  margin: 0 auto;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: max(20px, env(safe-area-inset-top)) 0 18px;
}

.eyebrow,
.step {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

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

h1 {
  margin-bottom: 7px;
  font-size: clamp(1.62rem, 5vw, 2.35rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 3px;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.subtitle,
.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.55;
}

.ghost-button,
.text-button {
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.ghost-button {
  align-self: flex-start;
  padding: 10px 0;
}

.install-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: white;
  background: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.panel {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid rgba(222, 219, 212, 0.8);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.dashboard-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dashboard-button {
  display: grid;
  gap: 3px;
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: var(--paper);
  text-align: left;
}

.dashboard-button span {
  color: var(--accent);
  font-size: 0.63rem;
  font-weight: 900;
}

.dashboard-button b {
  font-size: 0.88rem;
}

.dashboard-button small {
  color: var(--muted);
  font-size: 0.67rem;
}

.dashboard-button.active {
  border-color: var(--green);
  color: white;
  background: var(--green);
  box-shadow: var(--shadow);
}

.dashboard-button.active span,
.dashboard-button.active small {
  color: rgba(255, 255, 255, 0.72);
}

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

.status-pill {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

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

.slot-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.batch-grid {
  display: grid;
  gap: 13px;
}

.batch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
}

.pair-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.pair-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 9px 7px;
  font-size: 0.74rem;
}

.pair-heading span {
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 900;
}

.pair-arrow {
  color: var(--accent);
  font-size: 1.22rem;
  font-weight: 900;
  text-align: center;
}

.square-frame,
.slot-image {
  position: relative;
  display: grid;
  width: 100%;
  overflow: hidden;
  place-items: center;
  border: 0;
  background: #edece8;
  aspect-ratio: 1 / 1;
  cursor: pointer;
}

.square-frame img,
.slot-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-state {
  display: grid;
  gap: 5px;
  place-items: center;
  color: var(--green);
  text-align: center;
}

.empty-state b {
  font-size: 0.91rem;
}

.empty-state small {
  color: var(--muted);
  font-size: 0.7rem;
}

.pair-caption {
  min-height: 43px;
  margin: 0;
  padding: 9px;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.45;
}

.garment-caption-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.garment-caption {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clear-garment {
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 0.63rem;
  font-weight: 800;
}

.compose-options {
  margin-top: 15px;
}

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

.compose-field span {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
}

.compose-field select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
}

.primary-button {
  display: grid;
  width: 100%;
  gap: 3px;
  min-height: 66px;
  margin-top: 15px;
  padding: 15px 18px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--green);
  text-align: left;
}

.primary-button span {
  font-size: 0.95rem;
  font-weight: 800;
}

.primary-button small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.7rem;
}

.form-message {
  min-height: 19px;
  margin: 10px 1px 0;
  color: var(--accent);
  font-size: 0.76rem;
}

.register-heading {
  margin-bottom: 12px;
}

.category-tabs {
  display: flex;
  gap: 6px;
  margin: 0 -18px 13px;
  padding: 0 18px 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: white;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.tab-button.active {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.slot-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(203, 118, 89, 0.2);
}

.slot-image {
  aspect-ratio: 1 / 1;
}

.slot-empty {
  display: grid;
  gap: 3px;
  color: var(--muted);
  place-items: center;
}

.slot-empty b {
  color: var(--green);
  font-size: 1.8rem;
  font-weight: 300;
  line-height: 1;
}

.slot-empty small,
.slot-footer {
  font-size: 0.68rem;
}

.selected-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  padding: 4px 7px;
  border-radius: 8px;
  color: white;
  background: var(--accent);
  font-size: 0.61rem;
  font-weight: 900;
}

.slot-card.selected .selected-badge {
  display: block;
}

.slot-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
}

.slot-footer div {
  display: flex;
  gap: 3px;
}

.mini-button {
  min-height: 30px;
  padding: 4px 5px;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 0.65rem;
  font-weight: 800;
}

@media (max-width: 430px) {
  .app-header,
  main {
    width: min(100% - 18px, 980px);
  }

  .app-header {
    gap: 10px;
  }

  .subtitle,
  .section-heading p {
    font-size: 0.78rem;
  }

  .section-heading {
    display: grid;
  }

  .status-pill {
    width: fit-content;
  }

  .batch-row {
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
    gap: 4px;
  }

  .pair-heading {
    min-height: 38px;
    padding: 8px 7px 6px;
  }

  .pair-caption {
    min-height: 48px;
    padding: 8px 7px;
  }

  .empty-state b {
    font-size: 0.82rem;
  }

  .empty-state small {
    font-size: 0.64rem;
  }
}

.delete-button {
  color: var(--accent);
}

@media (min-width: 700px) {
  .panel {
    padding: 22px;
  }

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

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