/* Стиль iOS: системные цвета, сгруппированные списки, large title, полупрозрачная таб-панель, шторки снизу. */
:root {
  --bg: #F2F2F7;            /* systemGroupedBackground */
  --card: #FFFFFF;          /* secondarySystemGroupedBackground */
  --fill: rgba(118,118,128,.12);   /* tertiarySystemFill */
  --text: #000000; --muted: #8E8E93; --sep: rgba(60,60,67,.18);
  --blue: #007AFF; --green: #34C759; --red: #FF3B30; --orange: #FF9500; --pink: #FF2D55;
  --bar: rgba(249,249,249,.82); --seg-on: #FFFFFF;
  --radius: 12px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000000; --card: #1C1C1E; --fill: rgba(118,118,128,.24); --text: #FFFFFF; --muted: #8E8E93;
          --sep: rgba(84,84,88,.6); --blue: #0A84FF; --green: #30D158; --red: #FF453A; --orange: #FF9F0A;
          --pink: #FF375F; --bar: rgba(22,22,24,.82); --seg-on: #636366; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.29 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; letter-spacing: -.01em; }
body { padding-bottom: calc(84px + var(--safe-b)); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
img { display: block; max-width: 100%; }
.muted { color: var(--muted); font-size: 15px; }
.hidden { display: none !important; }

/* Large title */
.top { padding: calc(10px + var(--safe-t)) 20px 6px; background: var(--bg); }
.top h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: .01em; line-height: 1.2; }
.top .muted { display: block; font-size: 15px; margin-top: 2px; }
main { padding: 8px 16px 24px; max-width: 720px; margin: 0 auto; }
h2 { font-size: 13px; font-weight: 400; text-transform: uppercase; color: var(--muted); margin: 26px 16px 7px; letter-spacing: 0; }
h2:first-child { margin-top: 8px; }
.footnote { font-size: 13px; color: var(--muted); margin: 7px 16px 0; }

/* Таб-бар */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex;
  padding: 6px 4px calc(4px + var(--safe-b)); background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep); }
.tabs button { flex: 1; border: 0; background: none; padding: 2px 0; font-size: 10px; font-weight: 500;
  color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tabs button span { font-size: 23px; line-height: 1; filter: grayscale(1) opacity(.55); }
.tabs button.active { color: var(--blue); }
.tabs button.active span { filter: none; }

/* Сгруппированные карточки и строки, как в «Настройках» */
.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 0; }
.group { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.cell { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 16px; position: relative;
  width: 100%; border: 0; background: none; text-align: left; }
.cell + .cell::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep); }
.cell.icon + .cell.icon::before { left: 60px; }
.cell .grow { flex: 1; min-width: 0; }
.cell .value { color: var(--muted); }
.cell.link { color: var(--blue); }
.cell.danger { color: var(--red); justify-content: center; }
.cell .chev::after { content: "›"; color: var(--muted); font-size: 22px; opacity: .6; }
.ic { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-size: 17px; flex: none; color: #fff; }
.cell img.mini, .cell .mini { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--fill); flex: none; }

/* Сегмент-контрол */
.seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin: 4px 0 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 6px; border-radius: 7px; font-size: 13px; font-weight: 500; }
.seg button.on { background: var(--seg-on); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); font-weight: 600; }

/* Чипсы-фильтры */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { border: 0; background: var(--card); padding: 7px 14px; border-radius: 999px; white-space: nowrap; font-size: 15px; }
.chip.on { background: var(--blue); color: #fff; }

/* Кнопки */
.btn { border: 0; border-radius: 12px; padding: 14px 16px; font-size: 17px; font-weight: 600; background: var(--fill);
  color: var(--blue); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.block { width: 100%; }
.btn:active { opacity: .7; }
.btn:disabled { opacity: .4; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* Сетка фото */
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .grid2 { grid-template-columns: repeat(3, 1fr); } }
.thumb { position: relative; background: var(--card); border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 4; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 44px; }
.thumb .badge { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.5); color: #fff; font-size: 12px;
  font-weight: 600; padding: 3px 8px; border-radius: 999px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tile { border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
.tile:active { opacity: .7; }
.tile .name { font-size: 15px; font-weight: 500; margin: 7px 2px 0; line-height: 1.25; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .sub { font-size: 13px; color: var(--muted); margin: 1px 2px; }

/* Образ */
.outfit-head { font-size: 15px; color: var(--muted); margin: 0 0 12px; }
.outfit-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.notes { margin: 0; padding: 0; list-style: none; }
.notes li { padding: 10px 16px; position: relative; font-size: 15px; }
.notes li + li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.advice { background: var(--card); border-radius: var(--radius); padding: 14px 16px; font-size: 15px; }
.advice .lbl { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.advice.loading { color: var(--muted); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.render { margin-top: 12px; border-radius: var(--radius); overflow: hidden; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .big { font-size: 54px; margin-bottom: 10px; }
.empty b { display: block; color: var(--text); font-size: 20px; margin-bottom: 6px; }

.fab { position: fixed; right: 20px; bottom: calc(92px + var(--safe-b)); z-index: 9; width: 54px; height: 54px;
  border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 30px; font-weight: 300;
  box-shadow: 0 6px 20px rgba(0,122,255,.35); }

/* Шторка (sheet) */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); animation: fade .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 93vh; overflow-y: auto; background: var(--bg);
  border-radius: 14px 14px 0 0; padding: 8px 16px calc(24px + var(--safe-b)); animation: up .3s cubic-bezier(.2,.8,.2,1); }
.sheet::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--muted);
  opacity: .4; margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.sheet-head h3 { margin: 0; font-size: 20px; font-weight: 700; }
.sheet-head .x { border: 0; background: var(--fill); width: 30px; height: 30px; border-radius: 50%; color: var(--muted); font-size: 15px; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } }

/* Формы */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); text-transform: uppercase; margin: 0 16px 7px; }
.input { width: 100%; border: 0; background: var(--card); border-radius: var(--radius); padding: 12px 16px; font-size: 17px; outline: none; }
select.input { -webkit-appearance: none; appearance: none; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.strip img { width: 90px; height: 120px; object-fit: cover; border-radius: 10px; border: 3px solid transparent; flex: none; }
.strip img.on { border-color: var(--blue); }

/* Ароматы */
.bars .bar { border-radius: 6px; padding: 4px 10px; margin: 4px 0; font-size: 13px; font-weight: 500; white-space: nowrap; }
.stars { color: var(--orange); font-weight: 600; }

/* Переключатель iOS */
.switch { position: relative; width: 51px; height: 31px; border-radius: 16px; background: var(--fill); border: 0; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .2s; }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(20px); }

.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); z-index: 30;
  background: rgba(30,30,30,.9); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; max-width: 90vw;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); text-align: center; }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--fill); border-top-color: var(--muted); border-radius: 50%;
  animation: spin .9s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.login { max-width: 420px; margin: 36px auto; text-align: center; }
.login .input { text-align: center; font-size: 28px; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
