:root {
  --navy-950: #0b1f38;
  --navy-900: #102a4c;
  --navy-800: #173c67;
  --blue-600: #1769e0;
  --blue-700: #1257bd;
  --blue-50: #edf5ff;
  --teal-600: #0f867f;
  --teal-50: #e9f8f5;
  --amber-50: #fff8e9;
  --amber-200: #f1d391;
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --text: #152238;
  --muted: #66758a;
  --line: #dfe5ed;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --success: #13764a;
  --success-soft: #eaf8f0;
  --shadow-sm: 0 4px 16px rgba(16, 42, 76, .06);
  --shadow-md: 0 14px 34px rgba(16, 42, 76, .15);
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--navy-950); }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button { touch-action: manipulation; }
button, label[for], select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(23, 105, 224, .28);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.app-shell {
  width: 100%;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: var(--safe-top);
  color: #fff;
  background: rgba(16, 42, 76, .98);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 5px 20px rgba(11, 31, 56, .16);
  backdrop-filter: blur(18px);
}
.topbar__inner {
  width: min(100%, 720px);
  min-height: 62px;
  margin: auto;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.brand > span:last-child { min-width: 0; }
.brand strong { display: block; font-size: 16px; letter-spacing: .01em; }
.brand small {
  display: block;
  max-width: 200px;
  margin-top: 1px;
  overflow: hidden;
  color: rgba(255, 255, 255, .65);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar__actions { display: flex; align-items: center; gap: 7px; }
.washer-mark {
  flex: 0 0 auto;
  position: relative;
  width: 41px;
  height: 41px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 13px;
  background: linear-gradient(145deg, #2467a8, #0d7e88);
  box-shadow: 0 7px 16px rgba(0, 0, 0, .2);
}
.washer-mark::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 7px;
  height: 4px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .84);
}
.washer-mark span {
  position: absolute;
  left: 10px;
  bottom: 5px;
  width: 21px;
  height: 21px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .17);
}
.washer-mark--large { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 22px; }
.washer-mark--large::before { left: 14px; right: 14px; top: 12px; height: 6px; }
.washer-mark--large span { left: 17px; bottom: 9px; width: 38px; height: 38px; border-width: 5px; }
.ai-pill {
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .68);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.ai-pill.active { border-color: rgba(135, 233, 214, .25); background: rgba(21, 160, 137, .2); color: #a9f1df; }
.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 25px;
  cursor: pointer;
}
.topbar .icon-btn { border-color: rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .08); color: #fff; }
.icon-btn svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.main {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 18px 12px calc(104px + var(--safe-bottom));
}
.panel { display: none; animation: panel-in .2s ease; }
.panel.active { display: block; }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(25px, 7.2vw, 34px); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin-bottom: 4px; font-size: 18px; line-height: 1.2; letter-spacing: -.015em; }
h3 { font-size: 15px; line-height: 1.25; }
.eyebrow { margin: 0 0 5px; color: var(--teal-600); font-size: 10px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.muted { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.screen-heading { margin: 3px 3px 17px; }
.home-heading h1 { max-width: 390px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 3px 3px 15px; }
.section-heading h1 { margin-bottom: 5px; }

.wash-start-card {
  position: relative;
  overflow: hidden;
  padding: 19px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(140deg, var(--navy-900) 0%, #174b7d 64%, #0c7b7e 145%);
  box-shadow: var(--shadow-md);
}
.wash-start-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -78px;
  top: -80px;
  border: 25px solid rgba(255, 255, 255, .055);
  border-radius: 50%;
  pointer-events: none;
}
.wash-start-card__icon {
  width: 49px;
  height: 49px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 15px;
  background: rgba(255, 255, 255, .11);
  display: grid;
  place-items: center;
}
.wash-start-card__icon svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wash-start-card .eyebrow { color: #a9f1df; }
.wash-start-card h2 { margin-bottom: 7px; font-size: 23px; }
.wash-start-card__copy > p:last-child { max-width: 500px; margin-bottom: 17px; color: rgba(255, 255, 255, .77); font-size: 13px; line-height: 1.5; }
.wash-start-card .btn { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; background: #fff; color: var(--navy-900); box-shadow: none; }

.btn {
  min-height: 49px;
  padding: 12px 15px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 820;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .14s ease, filter .14s ease, background .14s ease;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn--primary { color: #fff; background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); box-shadow: 0 7px 18px rgba(23, 105, 224, .2); }
.btn--soft { color: var(--navy-900); background: var(--blue-50); border-color: #d4e6ff; }
.btn--ghost { background: #fff; border-color: var(--line); }
.btn--danger { color: var(--danger); background: var(--danger-soft); border-color: #f2c3bf; }
.btn--ai { color: #4d3a83; background: #f4efff; border-color: #ddcffd; }
.btn--large { min-height: 52px; }
.btn--compact { min-height: 42px; padding: 9px 13px; font-size: 13px; }
.btn--block { width: 100%; margin-top: 12px; }
.btn--grow { flex: 1; }

.stats { margin: 12px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat {
  min-width: 0;
  min-height: 96px;
  padding: 11px 7px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
  cursor: pointer;
}
.stat__label { color: var(--muted); font-size: 9px !important; font-weight: 850 !important; text-transform: uppercase; letter-spacing: .05em; }
.stat strong { display: block; margin: 3px 0 1px; color: var(--navy-900); font-size: 25px; line-height: 1; }
.stat span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; }

.home-actions { display: grid; gap: 8px; margin: 12px 0; }
.home-action {
  width: 100%;
  min-height: 72px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  text-align: left;
  cursor: pointer;
}
.home-action__icon { width: 45px; height: 45px; border-radius: 14px; background: var(--blue-50); color: var(--blue-600); display: grid; place-items: center; }
.home-action__icon--teal { background: var(--teal-50); color: var(--teal-600); }
.home-action__icon svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-action b, .home-action small { display: block; }
.home-action b { font-size: 14px; }
.home-action small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.home-action__arrow { color: #8a97a8; font-size: 27px; font-weight: 300; }
.how-it-works { margin-top: 11px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255, 255, 255, .72); overflow: hidden; }
.how-it-works summary { min-height: 51px; padding: 14px 15px; list-style: none; display: flex; align-items: center; color: var(--navy-900); font-size: 13px; font-weight: 850; cursor: pointer; }
.how-it-works summary::-webkit-details-marker { display: none; }
.how-it-works summary::after { content: "+"; margin-left: auto; color: var(--blue-600); font-size: 20px; }
.how-it-works[open] summary::after { content: "−"; }
.how-it-works .steps { padding: 0 15px 15px; border-top: 1px solid var(--line); }

.card, .form-section, .filter-card, .check-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card { padding: 16px; margin-bottom: 12px; }
.card-title { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 15px; }
.card-title h2, .card-title p { margin: 0; }
.card-title p { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.number-dot { width: 33px; height: 33px; flex: 0 0 33px; border-radius: 11px; background: var(--blue-50); color: var(--navy-900); display: grid; place-items: center; font-size: 13px; font-weight: 900; }
.steps { list-style: none; padding: 0; margin: 13px 0 0; display: grid; gap: 13px; }
.steps li { display: flex; gap: 11px; align-items: flex-start; }
.steps li > span { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; background: var(--teal-50); color: var(--teal-600); display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.steps b, .steps small { display: block; }
.steps b { font-size: 13px; }
.steps small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; }

.filter-card { position: sticky; top: calc(63px + var(--safe-top)); z-index: 20; padding: 10px; margin-bottom: 12px; box-shadow: 0 7px 22px rgba(16, 42, 76, .11); }
.search-box { position: relative; display: block; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 19px; fill: none; stroke: #738096; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search-box input { padding-left: 41px; margin-top: 0; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 7px; }
.filter-grid select { min-height: 43px; margin-top: 0; padding-block: 9px; font-size: 12px; }
.bulk-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; }
.link-btn { min-height: 38px; padding: 7px 3px; border: 0; background: transparent; color: var(--blue-600); font-size: 12px; font-weight: 850; cursor: pointer; }
.link-btn--danger { color: var(--danger); }

label { color: #354258; font-size: 12px; font-weight: 800; }
input, select, textarea {
  width: 100%;
  min-height: 50px;
  margin-top: 6px;
  padding: 12px 13px;
  border: 1px solid #cbd4e0;
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
}
select { padding-right: 35px; }
textarea { min-height: 100px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #97a3b2; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.field { min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field-help { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.35; }
#categoriaPersonalizada { margin-top: 8px; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.photo-picker {
  position: relative;
  min-height: 155px;
  padding: 14px 8px;
  overflow: hidden;
  border: 1.5px dashed #b7c4d5;
  border-radius: 17px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}
.photo-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-picker__icon { margin-bottom: 5px; font-size: 26px; }
.photo-picker b { font-size: 12px; }
.photo-picker small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.piece-preview { position: absolute; inset: 4px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; }
.piece-preview:empty { display: none; }
.piece-preview > span { position: relative; min-width: 0; min-height: 0; overflow: hidden; border-radius: 10px; background: #edf1f5; }
.piece-preview > span:first-child:nth-last-child(1) { grid-column: 1 / -1; }
.piece-preview > span:first-child:nth-last-child(3) { grid-row: 1 / span 2; }
.piece-preview img { width: 100%; height: 100%; min-height: 66px; object-fit: cover; }
.piece-preview b { position: absolute; left: 5px; bottom: 5px; padding: 3px 6px; border-radius: 99px; color: #fff; background: rgba(7, 27, 50, .78); font-size: 9px; }
.label-preview { position: absolute; inset: 4px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; }
.label-preview:empty { display: none; }
.label-preview > span { position: relative; min-width: 0; min-height: 0; overflow: hidden; border-radius: 10px; background: #edf1f5; }
.label-preview > span:first-child:nth-last-child(1) { grid-column: 1 / -1; }
.label-preview img { width: 100%; height: 100%; min-height: 66px; object-fit: cover; border-radius: 10px; }
.label-preview b { position: absolute; left: 5px; bottom: 5px; padding: 3px 6px; border-radius: 99px; color: #fff; background: rgba(7, 27, 50, .78); font-size: 8px; }
.photo-preview-actions { position: absolute; top: 5px; right: 5px; z-index: 3; display: flex; gap: 4px; }
.photo-action { width: 29px; height: 29px; min-height: 0; padding: 0; border: 1px solid rgba(255,255,255,.75); border-radius: 9px; color: #fff; background: rgba(7,27,50,.82); display: grid; place-items: center; font-size: 17px; font-weight: 900; line-height: 1; box-shadow: 0 2px 7px rgba(7,27,50,.2); }
.photo-action--delete { background: rgba(166,36,25,.9); }
.photo-help { margin: 8px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.35; text-align: center; }
.ai-result { margin-top: 10px; padding: 12px; border: 1px solid #ddcffd; border-radius: 14px; background: #fbf9ff; font-size: 12px; line-height: 1.5; }
.ai-confidence { margin-bottom: 4px; color: #4d3a83; font-weight: 900; }

.form-section { margin-bottom: 11px; overflow: hidden; }
.form-section summary { min-height: 61px; padding: 14px 15px; list-style: none; display: flex; align-items: center; gap: 11px; cursor: pointer; }
.form-section summary::-webkit-details-marker { display: none; }
.form-section summary::after { content: "+"; width: 29px; height: 29px; margin-left: auto; border-radius: 9px; background: #f0f3f7; color: var(--muted); display: grid; place-items: center; font-size: 19px; }
.form-section[open] summary::after { content: "−"; }
.form-section summary > span { font-size: 22px; }
.form-section summary b, .form-section summary small { display: block; }
.form-section summary b { font-size: 14px; }
.form-section summary small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.form-section__body { padding: 5px 15px 16px; border-top: 1px solid #edf0f4; }
.check-card { min-height: 62px; padding: 12px 13px; display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check-card input, .check-line input, .check-stack input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--blue-600); flex: 0 0 22px; }
.check-card span, .check-card b, .check-card small { display: block; }
.check-card b { font-size: 13px; }
.check-card small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.form-actions {
  position: sticky;
  bottom: calc(73px + var(--safe-bottom));
  z-index: 25;
  margin-top: 14px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 10px 30px rgba(16, 42, 76, .17);
  display: flex;
  gap: 8px;
  backdrop-filter: blur(16px);
}
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.wardrobe { display: grid; grid-template-columns: 1fr; gap: 9px; }
.item {
  position: relative;
  min-width: 0;
  min-height: 108px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  cursor: pointer;
  transition: transform .14s ease, border .14s ease, box-shadow .14s ease;
}
.item:active { transform: scale(.99); }
.item.selected { border: 2px solid var(--blue-600); box-shadow: 0 0 0 3px rgba(23, 105, 224, .12); }
.item__image { position: relative; min-height: 108px; background: #e8edf3; overflow: hidden; }
.item__image img { width: 100%; height: 100%; min-height: 108px; object-fit: cover; display: block; }
.image-error { opacity: .17; }
.item__body { min-width: 0; padding: 12px 11px; align-self: center; }
.item h3 { margin: 0 34px 4px 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.item p { margin: 0 0 8px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.item__check { position: absolute; z-index: 3; right: 10px; top: 10px; width: 31px; height: 31px; border-radius: 50%; background: rgba(255, 255, 255, .97); box-shadow: 0 3px 12px rgba(0, 0, 0, .17); display: grid; place-items: center; }
.item__check input { width: 21px; height: 21px; min-height: 0; margin: 0; accent-color: var(--blue-600); }
.badge-row { display: flex; flex-wrap: wrap; gap: 4px; }
.badge { max-width: 100%; padding: 4px 7px; overflow: hidden; border-radius: 999px; background: #eef2f6; color: #59677a; font-size: 9px; font-weight: 820; text-overflow: ellipsis; white-space: nowrap; }
.badge--ok { color: var(--success); background: var(--success-soft); }
.badge--bad { color: var(--danger); background: var(--danger-soft); }
.empty-state { grid-column: 1 / -1; padding: 35px 20px; border: 1px dashed #c6d0dc; border-radius: 19px; background: rgba(255, 255, 255, .66); color: var(--muted); text-align: center; }
.empty-state b { display: block; margin-bottom: 5px; color: var(--text); }
.dry-toggle { margin-bottom: 12px; }

.basket-action {
  position: fixed;
  z-index: 35;
  left: 10px;
  right: 10px;
  bottom: calc(73px + var(--safe-bottom));
  width: min(calc(100% - 20px), 690px);
  margin: auto;
  padding: 9px 9px 9px 14px;
  border: 1px solid #d6dfeb;
  border-radius: 17px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 13px 36px rgba(16, 42, 76, .22);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  backdrop-filter: blur(18px);
}
#cesto.active .basket-action { display: flex; }
.basket-action strong { display: block; color: var(--navy-900); font-size: 21px; line-height: 1; }
.basket-action span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.basket-action .btn { min-height: 45px; padding-inline: 13px; }

.status { display: none; padding: 12px 13px; margin-bottom: 12px; border-radius: 14px; font-size: 13px; font-weight: 700; line-height: 1.4; }
.status.info, .status.ok, .status.err { display: block; }
.status.info { border: 1px solid #d2e2ff; background: var(--blue-50); color: #24539c; }
.status.ok { border: 1px solid #bfe8d3; background: var(--success-soft); color: var(--success); }
.status.err { border: 1px solid #f3c0bc; background: var(--danger-soft); color: var(--danger); }
.plan-result { display: grid; gap: 12px; margin-top: 13px; }
.load-card { overflow: hidden; padding: 0; }
.load-card__head { padding: 15px 16px; color: #fff; background: linear-gradient(135deg, var(--navy-900), var(--navy-800)); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.load-card__head h2 { margin: 0; }
.load-card__head span { color: rgba(255, 255, 255, .74); font-size: 10px; }
.load-card__body { padding: 15px; }
.piece-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.piece-chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; max-width: 175px; padding: 5px 8px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: #f6f8fb; display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 750; }
.chip img { width: 28px; height: 28px; border-radius: 50%; background: #e8ecf2; object-fit: cover; }
.machine-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 8px 0 12px; }
.machine-setting { min-width: 0; padding: 10px; border: 1px solid #e1e7ef; border-radius: 13px; background: #f8fafc; }
.machine-setting small, .machine-setting b { display: block; }
.machine-setting small { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.machine-setting b { margin-top: 3px; font-size: 13px; word-break: break-word; }
.instruction { padding: 10px 0; border-top: 1px solid #edf0f4; font-size: 12px; line-height: 1.5; }
.instruction b { color: var(--navy-900); }
.drying-box { margin-top: 10px; padding: 12px; border: 1px solid var(--amber-200); border-radius: 15px; background: var(--amber-50); font-size: 12px; line-height: 1.5; }
.drying-box h3 { margin: 0 0 6px; }
.drying-step + .drying-step { margin-top: 7px; }
.manual-warning { padding: 14px; border: 1px solid #f3c0bc; border-radius: 16px; background: var(--danger-soft); color: #7d211a; font-size: 12px; line-height: 1.5; }
.manifest-box { max-height: 180px; overflow: auto; margin-top: 9px; padding: 10px; border-radius: 12px; background: #101827; color: #dce7f6; font: 10px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; white-space: pre-wrap; }

.history { display: grid; gap: 9px; }
.history-card { padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.history-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.history-card h2 { margin-bottom: 4px; font-size: 14px; }
.history-card p { margin: 0; color: var(--muted); font-size: 11px; }
.logout-btn { display: block; margin: 24px auto 0; }

.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-end; justify-content: center; }
.modal.open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(7, 19, 36, .62); backdrop-filter: blur(3px); }
.modal__sheet { position: relative; z-index: 1; width: min(100%, 720px); max-height: 92dvh; overflow-y: auto; padding: 8px 15px calc(22px + var(--safe-bottom)); border-radius: 24px 24px 0 0; background: #fff; box-shadow: 0 -12px 40px rgba(5, 16, 31, .25); }
.modal__handle { width: 42px; height: 5px; margin: 1px auto 10px; border-radius: 99px; background: #d9dee7; }
.modal__header { position: sticky; top: -8px; z-index: 2; padding: 6px 0 11px; background: #fff; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal__header h2 { margin: 0; font-size: 20px; }
.detail-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.detail-gallery img { width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; background: #f0f2f6; object-fit: contain; }
.detail-gallery img:first-child:only-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.detail-photo-section + .detail-photo-section { margin-top: 13px; }
.detail-photo-section h3 { margin: 0 0 7px; color: var(--navy-900); font-size: 13px; }
.detail-card { margin-top: 11px; }
.detail-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.check-stack { display: grid; gap: 10px; align-content: center; }
.check-stack label { display: flex; align-items: center; gap: 8px; }

.bottom-nav {
  position: fixed;
  z-index: 50;
  left: 50%;
  right: auto;
  bottom: 0;
  width: min(100%, 720px);
  min-height: calc(69px + var(--safe-bottom));
  padding: 7px max(7px, env(safe-area-inset-right)) var(--safe-bottom) max(7px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -8px 26px rgba(16, 42, 76, .1);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}
.bottom-nav__item { position: relative; min-width: 0; min-height: 58px; padding: 5px 2px; border: 0; border-radius: 13px; background: transparent; color: #778497; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
.bottom-nav__item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav__item > span:last-child { font-size: 9px; font-weight: 850; }
.bottom-nav__item.active { background: var(--blue-50); color: var(--blue-600); }
.bottom-nav__item--add { overflow: visible; }
.add-circle { width: 37px; height: 37px; margin-top: -18px; border: 4px solid #fff; border-radius: 50%; background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); color: #fff; box-shadow: 0 6px 16px rgba(23, 105, 224, .3); display: grid; place-items: center; font-size: 25px; line-height: 1; }
.nav-icon-wrap { position: relative; display: grid; place-items: center; }
.nav-badge { position: absolute; top: -7px; right: -11px; min-width: 19px; height: 19px; padding: 0 5px; border: 2px solid #fff; border-radius: 99px; background: var(--danger); color: #fff; display: grid; place-items: center; font-size: 9px; }

.login-screen { min-height: 100dvh; padding: calc(30px + var(--safe-top)) 17px calc(30px + var(--safe-bottom)); background: radial-gradient(circle at 50% 0, #d7e9ff 0, #eef2f6 50%); display: grid; place-items: center; }
.login-card { width: min(100%, 410px); padding: 27px 20px; border: 1px solid rgba(255, 255, 255, .85); border-radius: 27px; background: rgba(255, 255, 255, .96); box-shadow: var(--shadow-md); text-align: center; }
.login-card h1 { margin-bottom: 7px; }
.login-copy { margin-bottom: 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.login-card form { text-align: left; }
.pin-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.pin-row input { margin-top: 6px; }
.pin-row .btn { align-self: end; }
.check-line { margin-top: 12px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.login-card .status { margin: 14px 0 0; text-align: left; }

.toast { position: fixed; z-index: 200; left: 50%; bottom: calc(82px + var(--safe-bottom)); width: min(calc(100% - 24px), 500px); padding: 12px 14px; border-radius: 14px; background: #17243a; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-size: 13px; font-weight: 750; opacity: 0; transform: translate(-50%, 18px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #8f251d; }
.loading-spinner { width: 17px; height: 17px; margin-right: 7px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; vertical-align: -3px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 560px) {
  .main { padding-inline: 18px; }
  .home-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wardrobe { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .item { min-height: 0; display: block; }
  .item__image { aspect-ratio: 4 / 3; min-height: 0; }
  .item__image img { min-height: 0; }
  .item__body { padding: 11px; }
  .item h3 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .machine-settings { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .photo-picker { min-height: 190px; }
}

@media (min-width: 760px) {
  body { background: var(--navy-950); }
  .app-shell { max-width: 720px; box-shadow: 0 0 70px rgba(0, 0, 0, .22); }
  .bottom-nav { border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 20px 20px 0 0; }
}

@media (max-width: 374px) {
  .main { padding-inline: 8px; }
  .topbar__inner { padding-inline: 10px; }
  .ai-pill { display: none; }
  .photo-grid { grid-template-columns: 1fr; }
  .photo-picker { min-height: 126px; }
  .basket-action { left: 7px; right: 7px; width: calc(100% - 14px); }
  .basket-action .btn { font-size: 12px; }
  .stat { min-height: 90px; }
}

@media (max-width: 430px) {
  .history-card__top { flex-direction: column; }
  .history-card__top .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
