:root {
  font-family: "Pretendard Variable", "Segoe UI", "Noto Sans KR", system-ui,
    -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1f2d3d;
  background-color: #f7f9fb;
  --blue: #5da9e9;
  --navy: #203a55;
  --mint: #7dd1c2;
  --cream: #fff7ea;
  --lavender: #d8ccff;
  --line: #e2e8f0;
  --shadow: 0 15px 40px rgba(32, 58, 85, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #fdfcfb, #f4fbfb);
  color: #1f2d3d;
}

img {
  max-width: 100%;
  display: block;
}

button,
select,
input {
  font: inherit;
}

.app-shell {
  max-width: 430px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.hero {
  background: linear-gradient(135deg, #dff6ff, #fef3f8);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.brand-logo {
  width: 96px;
  height: 96px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.brand-sub {
  margin: 0;
  color: #4e5c6e;
  font-size: 0.85rem;
}

.hero-actions {
  text-align: right;
}

.today-date {
  margin: 0.25rem 0;
  font-weight: 500;
}

.location-pill {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.material-icon {
  font-size: 1rem;
}

.icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
}

.location-search {
  display: flex;
  gap: 0.5rem;
}

.location-search input {
  flex: 1;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0.65rem 0.9rem;
}

.search-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(148, 180, 214, 0.2);
}

.weather-bar {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.temp {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.temp p {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.temp small {
  color: #64748b;
}

.weather-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.weather-badge {
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  color: #42566a;
  box-shadow: 0 4px 14px rgba(79, 130, 166, 0.12);
}

main {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel {
  background: #fff;
  border-radius: 24px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.profile-panel {
  display: flex;
  gap: 1.25rem;
}

.avatar-block {
  text-align: center;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb9d4, #ffa7c2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  margin: 0 auto 0.5rem;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ghost-btn {
  border: 1px dashed #9bb7d3;
  background: rgba(255, 255, 255, 0.6);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.ghost-btn.small {
  font-size: 0.8rem;
}

.ghost-btn.tiny {
  font-size: 0.7rem;
  margin-top: 0.35rem;
}

.profile-info h2 {
  margin: 0;
  font-size: 1.25rem;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gender-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--lavender);
  color: var(--navy);
  font-size: 1rem;
  font-weight: 600;
}

.profile-meta {
  margin: 0.3rem 0;
  color: #5c6b7d;
}

.profile-notes {
  margin: 0.6rem 0;
  font-size: 0.9rem;
  color: #516070;
}

.rules {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.rule-badge {
  background: var(--cream);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #c67600;
}

.wardrobe-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.season-toggle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.9rem 0;
}

.pill {
  border: 1px solid #d7e0f0;
  background: #fff;
  border-radius: 999px;
  padding: 0.5rem 0.3rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

.pill.active {
  background: #d7f3ee;
  color: #136050;
  border-color: #9ed8cc;
  box-shadow: 0 8px 16px rgba(18, 110, 92, 0.18);
}

#triggerOotdCapture {
  flex: 0 0 auto;        /* 내용 기준으로 크기 결정 */
  white-space: nowrap;   /* 줄바꿈 금지 */
}

.primary-btn {
  border: none;
  background: var(--blue);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(93, 169, 233, 0.26);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn.small {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.primary-btn.wide {
  width: 100%;
  margin-top: 1rem;
}

.primary-btn:active {
  transform: scale(0.97);
}

.wardrobe-summary {
  margin: 0.5rem 0;
  color: #4a596a;
}

.wardrobe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wardrobe-tag {
  padding: 0.3rem 0.8rem;
  border-radius: 14px;
  background: #f0f6ff;
  font-size: 0.8rem;
  color: #3f5b7b;
}

.conditions-panel {
  animation: fadeUp 0.6s ease forwards;
}

.conditions-panel h3 {
  margin-top: 0;
}

.form-row {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row label {
  font-size: 0.85rem;
  color: #4b5a6c;
}

.form-row input,
.form-row select {
  background: #f6f9ff;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 0.65rem 0.9rem;
}

.form-row.readonly input {
  background: #f1f5f9;
  color: #4c5c70;
}

.chip-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  background: #eef3fb;
  color: #4b607b;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.chip.active {
  background: #d7f3ee;
  color: #217968;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.15);
}

.cta-btn {
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 0.9rem;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #5da9e9, #7dd1c2);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(103, 159, 247, 0.35);
  transition: transform 0.2s ease;
}

.cta-btn:active {
  transform: scale(0.96);
}

.recommendations-panel {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.cards-header {
  padding: 0 0.25rem;
}

.hint {
  margin: 0.3rem 0 0;
  color: #7b8798;
  font-size: 0.85rem;
}

.cards-track {
  margin-top: 0.6rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(80vw);
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  scroll-snap-type: x mandatory;
  scroll-padding: 1rem;
}

.cards-track::-webkit-scrollbar {
  height: 8px;
}

.cards-track::-webkit-scrollbar-thumb {
  background: rgba(93, 169, 233, 0.5);
  border-radius: 999px;
}

.outfit-card {
  background: #fff;
  border-radius: 26px;
  padding: 1rem;
  box-shadow: var(--shadow);
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 320px;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s;
}

.outfit-card.selected {
  transform: scale(1.03);
  box-shadow: 0 20px 40px rgba(69, 124, 207, 0.25);
  animation: bounce 0.6s ease;
}

.outfit-card.dimmed {
  opacity: 0.6;
  transform: scale(0.97);
}

.card-title {
  margin: 0;
  font-weight: 700;
}

.card-hero {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  height: 150px;
  background: #f3f5f9;
  margin-bottom: 0.5rem;
}

.card-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-items {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.item-chip {
  flex: 1 1 45%;
  background: #f6f9ff;
  border-radius: 18px;
  padding: 0.6rem;
  min-width: 120px;
}

.item-chip strong {
  display: block;
  font-size: 0.9rem;
}

.thumb {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffe2ec, #ffd4f1);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2f6c5c;
}

.tone-tag {
  background: #e7f7ff;
  color: #167cb3;
  padding: 0.35rem 0.7rem;
  border-radius: 14px;
  font-size: 0.75rem;
}

.badge-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.badge {
  background: #f2f6ff;
  padding: 0.3rem 0.7rem;
  border-radius: 12px;
  font-size: 0.78rem;
  color: #41536a;
}

.badge.warning {
  background: #ffe6df;
  color: #c05336;
}

.select-card-btn {
  margin-top: auto;
  border: none;
  border-radius: 16px;
  padding: 0.55rem;
  background: #ffe8ef;
  color: #c44574;
  font-weight: 600;
  cursor: pointer;
}

.selected-card-label {
  color: #5a6a7b;
  font-size: 0.9rem;
}

.feedback-groups {
  display: grid;
  gap: 1rem;
}

.check-group {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.laundry-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d7dee8;
  border-radius: 999px;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: var(--mint);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.checklist li {
  background: #f6f9ff;
  border-radius: 18px;
  padding: 0.6rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.checklist li.important {
  border: 1px solid #ffb347;
  background: #fffaf0;
}

.checklist input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.ootd-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.ootd-panel .sub {
  margin: 0.3rem 0 0;
  color: #6a778b;
  font-size: 0.85rem;
}

.ootd-preview {
  margin-top: 0.8rem;
  min-height: 140px;
  border-radius: 18px;
  background: #f4f7fb;
  display: grid;
  place-items: center;
  color: #7a879a;
  padding: 0.8rem;
  text-align: center;
}

.ootd-preview img {
  width: 100%;
  max-height: 240px;
  border-radius: 16px;
  object-fit: cover;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: rgba(32, 58, 85, 0.9);
  color: #fff;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  z-index: 30;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 50;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 28px;
  padding: 1.5rem;
  width: min(420px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  float: right;
  cursor: pointer;
}

#wardrobeForm label,
#wardrobeForm fieldset {
  display: block;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
  color: #4a5868;
}

#wardrobeForm input,
#wardrobeForm select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid #d8e3f0;
  margin-top: 0.35rem;
}

.season-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.gallery-modal {
  width: min(480px, 100%);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.gallery-item {
  border-radius: 16px;
  background: #f6f9ff;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: #455468;
}

.gallery-item img {
  border-radius: 12px;
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.gallery-item strong {
  font-size: 0.78rem;
  color: #2c3a4c;
}

.location-modal {
  width: min(420px, 100%);
}

.location-search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.icon-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #86b5ff, #9be7d5);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(104, 140, 228, 0.3);
}

.location-results {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 320px;
  overflow-y: auto;
}

.location-results li {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.6rem 0.8rem;
  background: #fdfdfd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.location-results li strong {
  display: block;
  font-size: 0.95rem;
  color: #1f2d3d;
}

.location-results li small {
  display: block;
  font-size: 0.76rem;
  color: #6b7a90;
  margin-top: 0.2rem;
}

.location-results li button {
  border: none;
  border-radius: 10px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  background: #5da9e9;
  color: #fff;
  cursor: pointer;
}

.location-results .empty {
  border: none;
  background: transparent;
  text-align: center;
  color: #7c8799;
}

.modal-hint {
  font-size: 0.75rem;
  color: #77849a;
  margin-top: 0.8rem;
  line-height: 1.4;
}

.ghost-btn,
.primary-btn,
.chip,
.select-card-btn,
.cta-btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.05);
  }
  65% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1.03);
  }
}

.drop-in {
  animation: dropIn 0.6s ease forwards;
}

.fade-in {
  animation: fadeUp 0.7s ease forwards;
}

@media (min-width: 600px) {
  .app-shell {
    padding-top: 2rem;
  }

  .cards-track {
    grid-auto-columns: 300px;
  }
}
