:root {
  --bg: #f7f4ee;
  --paper: #fffdf9;
  --panel: #ffffff;
  --ink: #202124;
  --muted: #73706a;
  --line: #e5ded3;
  --accent: #127f75;
  --accent-soft: #e4f3ef;
  --coral: #e96856;
  --gold: #c8963e;
  --shadow: 0 18px 46px rgba(55, 49, 40, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(247, 244, 238, 0.96)),
    var(--bg);
  font-family:
    Inter,
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) 14px calc(env(safe-area-inset-bottom) + 92px);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -16px -14px 14px;
  padding: calc(env(safe-area-inset-top) + 16px) 14px 12px;
  background: rgba(247, 244, 238, 0.88);
  border-bottom: 1px solid rgba(229, 222, 211, 0.72);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
}

.status-pill,
.weather-chips span,
.fit-notes span,
#closetCount {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.dot.offline {
  background: var(--gold);
}

.screen {
  display: none;
  animation: rise 0.22s ease;
}

.screen.active {
  display: grid;
  gap: 14px;
}

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

.hero-card,
.panel,
.outfit-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 190px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 18px;
  background: #f6faf8;
}

.weather-spotlight {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.weather-temperature {
  color: var(--ink);
  font-size: 46px;
  line-height: 1;
}

.weather-primary {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.weather-primary strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-primary span {
  color: var(--muted);
  font-size: 13px;
}

.weather-alert {
  max-width: 120px;
  border: 1px solid rgba(181, 105, 65, 0.25);
  border-radius: 8px;
  color: #75482f;
  background: #fff1e7;
  padding: 7px 9px;
  font-size: 12px;
  text-align: center;
}

.hero-copy h2 {
  margin-bottom: 7px;
  font-size: 24px;
}

.hero-copy p:last-child,
.muted {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.panel {
  padding: 14px;
}

.stacked {
  display: grid;
  gap: 13px;
}

.section-title {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.field-label {
  color: var(--muted);
  font-size: 13px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.color-field {
  display: grid;
  gap: 8px;
}

.color-disclosure {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.color-disclosure summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  cursor: pointer;
}

.color-disclosure summary span {
  flex: 1;
}

.color-disclosure summary::after {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
  content: "";
}

.color-disclosure[open] summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.color-disclosure summary strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.color-disclosure summary i {
  width: 18px;
  height: 18px;
  border: 1px solid #c9cdd0;
  border-radius: 50%;
  background: var(--swatch);
}

.color-disclosure[open] .color-field {
  padding: 0 10px 10px;
}

.color-disclosure:not([open]) > .color-field {
  display: none;
}

.color-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 7px;
}

.color-swatch {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  padding: 5px 7px;
  font-size: 12px;
  text-align: left;
}

.color-swatch::before {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(32, 33, 36, 0.18);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
  content: "";
}

.color-swatch.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px rgba(18, 127, 117, 0.1);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  padding: 0 12px;
  outline: none;
}

textarea {
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(18, 127, 117, 0.5);
  box-shadow: 0 0 0 4px rgba(18, 127, 117, 0.1);
}

.form-row {
  display: grid;
  gap: 10px;
}

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

.weather-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.weather-actions {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px;
}

.weather-chips,
.fit-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wardrobe-readiness {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.wardrobe-readiness span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.wardrobe-readiness span.missing {
  color: #9a3d32;
  border-color: #ebc1b9;
  background: #fff5f2;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  color: white;
  background: var(--ink);
}

.ghost-button,
.icon-button {
  color: var(--ink);
  border: 1px solid var(--line);
  background: white;
}

.ghost-button.active {
  color: var(--accent);
  border-color: rgba(18, 127, 117, 0.32);
  background: var(--accent-soft);
}

.ghost-button.danger {
  color: #b13f35;
}

.outfit-card {
  min-height: 220px;
  overflow: hidden;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.look-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.look-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.look-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.look-item {
  display: grid;
  gap: 8px;
  min-height: 168px;
  padding: 12px;
  background: #fff;
}

.look-item img,
.cloth-card img {
  width: 100%;
  height: 112px;
  object-fit: contain;
  border-radius: 12px;
  background:
    linear-gradient(45deg, #f0eee9 25%, transparent 25%),
    linear-gradient(-45deg, #f0eee9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0eee9 75%),
    linear-gradient(-45deg, transparent 75%, #f0eee9 75%);
  background-color: #fff;
  background-size: 22px 22px;
  background-position:
    0 0,
    0 11px,
    11px -11px,
    -11px 0;
}

.look-item strong,
.cloth-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.look-item span,
.cloth-meta,
.item-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.look-item .item-reason {
  color: #27665f;
  line-height: 1.45;
}

.item-lock {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.item-lock.active {
  color: #155f57;
  border-color: #7fc2ba;
  background: var(--accent-soft);
}

.section-heading,
.history-row,
.history-main {
  display: flex;
  align-items: center;
}

.section-heading,
.history-row {
  justify-content: space-between;
  gap: 10px;
}

.section-heading .section-title {
  margin: 0;
}

.section-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.candidate-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.candidate-option {
  min-width: 0;
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.candidate-option.active {
  border-color: #56aaa0;
  background: #f0faf7;
  box-shadow: inset 0 0 0 1px #56aaa0;
}

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

.candidate-images img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 5px;
  object-fit: contain;
  background: #f5f4f0;
}

.candidate-option strong,
.candidate-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-option strong {
  font-size: 13px;
}

.candidate-option span {
  color: var(--muted);
  font-size: 11px;
}

.history-row {
  width: 100%;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.history-main {
  min-width: 0;
  gap: 9px;
}

.history-thumbs {
  display: flex;
  flex: 0 0 auto;
}

.history-thumbs img {
  width: 36px;
  height: 42px;
  margin-right: -8px;
  border: 2px solid #fff;
  border-radius: 6px;
  object-fit: contain;
  background: #f5f4f0;
}

.history-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.history-copy strong,
.history-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-copy span,
.history-date {
  color: var(--muted);
  font-size: 12px;
}

.look-actions,
.card-actions,
.preview-actions {
  display: flex;
  gap: 8px;
  padding: 12px 14px 14px;
}

.look-actions button,
.card-actions button {
  flex: 1;
}

.reason-grid,
.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.reason-grid button,
.category-strip button {
  min-height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: white;
  padding: 0 12px;
}

.category-strip button.active {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

.subcategory-strip {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8f7;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar h2 {
  margin-bottom: 0;
}

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

.closet-tools {
  display: grid;
  gap: 9px;
}

.closet-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.idle-reminder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
  padding: 10px;
}

.idle-reminder > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.idle-reminder span {
  color: var(--muted);
  font-size: 12px;
}

.idle-reminder select,
.idle-reminder button {
  width: auto;
  min-height: 38px;
}

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

.cloth-card .image-wrap {
  position: relative;
  padding: 10px 10px 0;
}

.card-actions .tryon-button {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.profile-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-photo-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.profile-photo-card > img {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: block;
  object-fit: cover;
}

.profile-photo-card > img[hidden] {
  display: none !important;
}

.profile-photo-card .dropzone {
  min-height: 92px;
  border: 0;
  border-radius: 0;
  padding: 10px 6px;
  cursor: pointer;
}

.profile-photo-card.has-photo .dropzone {
  min-height: 52px;
}

.profile-photo-card .dropzone span {
  color: var(--muted);
  font-size: 11px;
}

.profile-photo-card .photo-clear {
  width: calc(100% - 12px);
  min-height: 34px;
  margin: 0 6px 6px;
  padding: 6px;
}

.favorite-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  border-radius: 999px;
  color: white;
  background: rgba(32, 33, 36, 0.72);
  padding: 4px 7px;
  font-size: 11px;
}

.cloth-body {
  display: grid;
  gap: 5px;
  padding: 10px;
}

.idle {
  color: #785f2b;
  font-size: 12px;
}

.dropzone {
  min-height: 136px;
  display: grid;
  place-items: center;
  gap: 5px;
  border: 1px dashed #b9aea0;
  border-radius: 16px;
  color: var(--accent);
  background: #fbfaf7;
  text-align: center;
}

.dropzone.compact {
  min-height: 62px;
}

.dropzone input {
  display: none;
}

.dropzone small {
  color: var(--muted);
}

.batch-status {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.batch-status progress {
  width: 100%;
  height: 8px;
  accent-color: var(--accent);
}

.import-button {
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: white;
  font-weight: 800;
  cursor: pointer;
}

.backup-status {
  display: grid;
  gap: 4px;
  border: 1px solid #b9d9d3;
  border-radius: 8px;
  padding: 11px 12px;
  background: #f0faf7;
}

.backup-status span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.import-button input {
  display: none;
}

.preview-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(45deg, #f0eee9 25%, transparent 25%),
    linear-gradient(-45deg, #f0eee9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0eee9 75%),
    linear-gradient(-45deg, transparent 75%, #f0eee9 75%);
  background-color: #fff;
  background-size: 24px 24px;
  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;
}

.preview-card img {
  width: 100%;
  max-height: 310px;
  object-fit: contain;
  display: block;
  padding: 12px;
}

.preview-card p {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 13px;
}

.cutout-meter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 14px 14px;
  padding: 10px 12px;
  border: 1px solid rgba(18, 127, 117, 0.22);
  border-radius: 12px;
  color: var(--muted);
  background: var(--accent-soft);
  font-size: 13px;
}

.cutout-meter strong {
  color: var(--accent);
}

.auto-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auto-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.fit-stage {
  display: grid;
  place-items: center;
  min-height: 530px;
  background:
    radial-gradient(circle at 50% 20%, rgba(18, 127, 117, 0.08), transparent 35%),
    #fff;
}

#fitCanvas {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
}

.slider-grid {
  display: grid;
  gap: 12px;
}

.slider-grid label {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
}

input[type="range"] {
  min-height: auto;
  padding: 0;
  accent-color: var(--accent);
}

.danger-zone {
  margin-bottom: 12px;
}

.edit-dialog {
  width: min(calc(100% - 24px), 520px);
  max-height: min(88vh, 760px);
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: #fffdf9;
  box-shadow: 0 24px 80px rgba(32, 33, 36, 0.24);
}

.edit-dialog::backdrop {
  background: rgba(32, 33, 36, 0.48);
  backdrop-filter: blur(3px);
}

.edit-form {
  display: grid;
  gap: 14px;
  max-height: min(88vh, 760px);
  overflow-y: auto;
  padding: 18px;
}

.edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.edit-header h2 {
  margin-bottom: 0;
}

.edit-close {
  width: 40px;
  min-height: 40px;
  flex: 0 0 40px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.edit-preview {
  width: 100%;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background:
    linear-gradient(45deg, #f0eee9 25%, transparent 25%),
    linear-gradient(-45deg, #f0eee9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0eee9 75%),
    linear-gradient(-45deg, transparent 75%, #f0eee9 75%);
  background-color: #fff;
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.edit-actions {
  position: sticky;
  bottom: -18px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin: 2px -18px -18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.96);
  padding: 12px 18px calc(env(safe-area-inset-bottom) + 14px);
  backdrop-filter: blur(12px);
}

.reanalyze-button {
  width: 100%;
}

.tryon-dialog {
  width: min(calc(100% - 20px), 560px);
}

.tryon-form {
  gap: 12px;
}

.tryon-item-summary {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  background: #fff;
}

.tryon-item-summary img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: contain;
  background: #f5f3ee;
}

.tryon-item-summary div {
  display: grid;
  gap: 4px;
}

.tryon-item-summary span,
.tryon-status,
.tryon-privacy {
  color: var(--muted);
  font-size: 12px;
}

.tryon-angle-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.tryon-angle-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
}

.tryon-angle-tabs button.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.tryon-stage {
  min-height: 350px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f5f3ee;
}

.tryon-stage > img {
  width: 100%;
  max-height: 58vh;
  display: block;
  object-fit: contain;
}

.tryon-stage [hidden] {
  display: none !important;
}

.tryon-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tryon-actions-grid > * {
  width: 100%;
}

@media (max-width: 420px) {
  .profile-photo-grid {
    grid-template-columns: 1fr;
  }

  .profile-photo-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: stretch;
  }

  .profile-photo-card > img {
    width: 92px;
    height: 118px;
    grid-row: 1 / span 2;
  }

  .profile-photo-card .photo-clear {
    align-self: end;
  }
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 8px 10px calc(env(safe-area-inset-bottom) + 8px);
  background: rgba(255, 253, 249, 0.92);
  border-top: 1px solid var(--line);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.tab {
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.tab.active {
  color: var(--ink);
  background: var(--accent-soft);
}

.tab.plus {
  color: white;
  background: var(--ink);
}

.tab.plus.active {
  background: var(--accent);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 82px);
  z-index: 50;
  width: min(calc(100% - 30px), 440px);
  padding: 12px 14px;
  border-radius: 14px;
  color: white;
  background: rgba(32, 33, 36, 0.92);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 780px) {
  body {
    background:
      radial-gradient(circle at 20% 12%, rgba(18, 127, 117, 0.12), transparent 28%),
      radial-gradient(circle at 86% 20%, rgba(233, 104, 86, 0.1), transparent 26%),
      var(--bg);
  }

  .app {
    padding-top: 24px;
  }

  .app-header {
    border-radius: 0 0 22px 22px;
  }
}

@media (max-width: 520px) {
  .closet-grid {
    grid-template-columns: 1fr;
  }

  .weather-row {
    grid-template-columns: 1fr;
  }

  .weather-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .form-row.two,
  .look-items,
  .closet-grid {
    grid-template-columns: 1fr;
  }

  .weather-row {
    grid-template-columns: 1fr;
  }

  .weather-actions {
    grid-template-columns: 1fr 1fr;
  }

  .weather-spotlight {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .weather-alert {
    grid-column: 1 / -1;
    max-width: none;
  }

  .closet-filters,
  .idle-reminder {
    grid-template-columns: 1fr;
  }

  .idle-reminder select,
  .idle-reminder button {
    width: 100%;
  }
}
