:root {
  --bg: #fff8fc;
  --surface: #ffffff;
  --text: #2d1f3f;
  --muted: #6f6080;
  --line: #f1d2e7;
  --accent: #ea5ca5;
  --accent-2: #41d3cc;
  --accent-3: #8a58d6;
  --accent-gold: #f5c857;
  --radius: 14px;
  --content-max: 100%;
  --page-pad-x: 0.9rem;
  --page-pad-y: 0.9rem;
}
* { box-sizing: border-box; }
.hidden { display: none !important; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, #fff 0, #fff4fb 38%),
    radial-gradient(circle at 90% 6%, rgba(65, 211, 204, 0.12) 0, rgba(65, 211, 204, 0) 45%),
    linear-gradient(180deg, #fff6fc, #f7fbff);
}
a { color: inherit; text-decoration: none; }
.site-header, .site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
}
.site-header { box-shadow: 0 10px 24px rgba(138, 88, 214, 0.12); }
.site-header {
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
}
.site-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  margin-top: auto;
  box-shadow: 0 -10px 22px rgba(234, 92, 165, 0.11);
  justify-content: center;
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.8rem;
}
.brand-logo {
  height: 7.8rem;
  width: auto;
  display: block;
}
nav, .site-footer { display: flex; gap: 1rem; }
.site-header nav {
  gap: .55rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-icon-link {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid #efc8e3;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.footer-icon-link:hover {
  border-color: var(--accent-3);
  color: var(--accent-3);
  box-shadow: 0 0 0 3px rgba(138, 88, 214, 0.11);
}
main {
  flex: 1 0 auto;
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: var(--page-pad-y) calc(var(--page-pad-x) + env(safe-area-inset-right)) var(--page-pad-y) calc(var(--page-pad-x) + env(safe-area-inset-left));
}
.hero {
  background: linear-gradient(135deg, #fff, #ffe7f4 58%, #eafcfb);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 2rem 1.2rem;
  margin-bottom: 1rem;
}
.hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.1; margin: 0.4rem 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); font-size: .75rem; }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.wardrobe-item-card {
  box-shadow: 0 0 0 rgba(234, 92, 165, 0), 0 10px 22px rgba(138, 88, 214, 0.13);
  transition: box-shadow 180ms ease, transform 180ms ease;
}
.wardrobe-item-card:hover {
  box-shadow: 0 0 20px rgba(234, 92, 165, 0.2), 0 14px 28px rgba(138, 88, 214, 0.17);
  transform: translateY(-2px);
}
.narrow { max-width: 720px; margin-inline: auto; }
.stack { display: grid; gap: .7rem; }
label { display: grid; gap: .4rem; color: var(--muted); font-size: .95rem; }
input, textarea, select {
  width: 100%;
  border: 1px solid #efc8e3;
  border-radius: 10px;
  padding: .72rem .8rem;
  font: inherit;
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  border: 1px solid #efc8e3;
  padding: 0.45rem 0.5rem;
  text-align: left;
  vertical-align: top;
}
th {
  background: #fff2fb;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: .75rem 1rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #fff;
  box-shadow: 0 10px 22px rgba(138, 88, 214, 0.24);
}
.btn-outline {
  border-color: var(--accent-2);
  color: #1d6f77;
  background: #fff;
}
.link-btn {
  border: 0;
  background: transparent;
  color: var(--accent-3);
  font: inherit;
  text-decoration: underline;
  padding: 0;
  cursor: pointer;
}
.links-row { display: flex; justify-content: space-between; margin-top: .6rem; gap: .8rem; flex-wrap: wrap; }
.muted, .status { color: var(--muted); }
.between { display: flex; justify-content: space-between; gap: .8rem; align-items: center; }
.item-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: .9rem 0;
}
.sell-links {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .65rem;
}
.confidence-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.confidence-badge {
  font-size: .78rem;
  padding: .25rem .45rem;
  border-radius: 999px;
  border: 1px solid #d7cec6;
  background: #fff;
  color: var(--muted);
}
.confidence-badge.high {
  border-color: #7fa885;
  color: #2b6b38;
}
.confidence-badge.med {
  border-color: #c9ad63;
  color: #8a6b17;
}
.confidence-badge.low {
  border-color: #c78b8b;
  color: #8c3f3f;
}
.search-bar-form {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin-bottom: .8rem;
}
.search-bar-form input[type="text"] {
  flex: 1 1 280px;
}
.search-toggle-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .5rem;
  margin-bottom: .6rem;
}
.search-switch {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  user-select: none;
}
.search-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.search-slider {
  width: 2.8rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #efc8e3;
  border: 1px solid #e1b4d3;
  position: relative;
  transition: background-color 180ms ease;
}
.search-slider::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform 180ms ease;
}
.search-switch input:checked + .search-slider {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
}
.search-switch input:checked + .search-slider::after {
  transform: translateX(1.25rem);
}
.search-panel {
  overflow: hidden;
  max-height: 180px;
  opacity: 1;
  transition: max-height 200ms ease, opacity 200ms ease, margin 200ms ease;
}
.search-panel.search-panel-collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0;
}
.item-thumb {
  width: 60%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #f1ebe5;
  margin: 0 auto .65rem auto;
  display: block;
}
.item-card-actions {
  display: flex;
  gap: .5rem;
  margin-top: .65rem;
}
.icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  border: 1px solid #efc8e3;
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.icon-btn:hover {
  border-color: var(--accent-3);
  color: var(--accent-3);
  box-shadow: 0 0 0 3px rgba(138, 88, 214, 0.11);
}
.modal.hidden { display: none; }

.add-item-form > label {
  background: linear-gradient(180deg, #fff, #fff4fb);
  border: 1px solid #f2d6e9;
  border-radius: 12px;
  padding: .72rem .78rem;
}
.add-item-form > label:nth-of-type(even) {
  background: linear-gradient(180deg, #fff, #f8faff);
}
.add-item-form > label:focus-within {
  border-color: #d494c6;
  box-shadow: 0 0 0 3px rgba(234, 92, 165, 0.14);
}
.add-item-form input,
.add-item-form textarea,
.add-item-form select {
  box-shadow: 0 8px 16px rgba(29, 26, 24, 0.08);
}
.add-item-form .btn {
  box-shadow: 0 10px 20px rgba(29, 26, 24, 0.14);
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}
.modal-panel {
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 1rem;
}
@media (min-width: 560px) {
  :root {
    --page-pad-x: 1.1rem;
    --page-pad-y: 1rem;
    --content-max: 100%;
  }
}
@media (min-width: 780px) {
  :root {
    --page-pad-x: 1.5rem;
    --page-pad-y: 1.15rem;
    --content-max: 1200px;
  }
  .site-header, .site-footer { padding-inline: 2rem; }
  .site-header {
    flex-direction: row;
    justify-content: space-between;
    gap: 0;
  }
  .site-header nav { justify-content: flex-end; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  :root {
    --content-max: 1440px;
    --page-pad-x: 1.9rem;
  }
}
