/* Wizard Mini App — iOS-стиль из утверждённых макетов v3 */
:root {
  --bg: #F2F2F7; --card: #fff; --ink: #000; --sub: #8e8e93;
  --hair: rgba(0,0,0,.09); --blue: #0A84FF; --dark: #111;
  --warn: #FF9500; --red: #FF3B30; --green: #34C759;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Roboto, sans-serif; }
body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
main { padding: 10px 14px 20px; max-width: 560px; margin: 0 auto; }

h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 8px 2px 12px; }
.h1row { display: flex; align-items: center; justify-content: space-between; }
.addbtn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--dark); color: #fff;
  font-size: 22px; line-height: 1; padding: 0 0 2px; }
h1 small { font-size: 13px; font-weight: 400; color: var(--sub); display: block; margin-top: 2px; }

.stats { display: flex; gap: 8px; margin-bottom: 10px; }
.stat { flex: 1; background: var(--card); border-radius: 12px; padding: 9px 11px 8px; }
.stat b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 10.5px; color: var(--sub); }
.stat .warn { color: var(--warn); }

.cats { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button { flex: none; font-size: 13px; font-weight: 500; color: #3c3c43; background: #E4E4E9;
  border: 0; padding: 7px 14px; border-radius: 16px; }
.cats button.on { background: var(--dark); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: var(--card); border-radius: 14px; padding: 6px; text-align: center; border: 0; font: inherit; color: inherit; }
.tile.archived { opacity: .45; }
.tile .ph { width: 100%; aspect-ratio: 3/4; border-radius: 10px; background: #EDEDF2 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 30px; }
.tile b { display: block; font-size: 11px; font-weight: 600; margin-top: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile span { font-size: 10px; color: var(--sub); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .flag { color: var(--warn); }

.empty { text-align: center; color: var(--sub); padding: 40px 20px; }
.empty b { display: block; font-size: 17px; color: var(--ink); margin-bottom: 6px; }

/* карточка вещи */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; z-index: 50; }
.modal.hidden { display: none; }
.sheet { background: var(--bg); border-radius: 18px 18px 0 0; width: 100%; max-width: 560px; margin: 0 auto;
  max-height: 88vh; overflow-y: auto; padding: 14px 14px calc(20px + env(safe-area-inset-bottom)); }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: #C7C7CC; margin: 0 auto 12px; }
.hero { background: var(--card); border-radius: 16px; padding: 12px; display: flex; gap: 12px; align-items: center; }
.hero .ph { flex: none; width: 96px; height: 120px; border-radius: 12px; background: #EDEDF2 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 40px; }
.hero .t { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.hero .s { font-size: 12px; color: var(--sub); margin-top: 2px; }

.gcap { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: #6d6d72; margin: 14px 6px 6px; }
.group { background: var(--card); border-radius: 12px; overflow: hidden; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 10px 14px;
  border-bottom: .5px solid var(--hair); font-size: 14px; }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--ink); flex: none; }
.row .v { color: var(--sub); text-align: right; overflow-wrap: anywhere; }
.row .v b { color: var(--ink); font-weight: 600; }
.row .v.warn { color: var(--warn); }
.arow { display: block; width: 100%; text-align: left; padding: 11px 14px; font: inherit; font-size: 15px;
  color: var(--blue); background: none; border: 0; border-bottom: .5px solid var(--hair); }
.arow:last-child { border-bottom: 0; }
.arow.red { color: var(--red); }

.field { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: .5px solid var(--hair); }
.field:last-child { border-bottom: 0; }
.field label { font-size: 14px; flex: none; }
.field input { border: 0; background: none; font: inherit; font-size: 14px; text-align: right; color: var(--blue);
  width: 110px; outline: none; }

.btn { display: block; width: 100%; border: 0; font: inherit; font-size: 16px; font-weight: 600; padding: 13px;
  border-radius: 13px; background: var(--dark); color: #fff; margin-top: 12px; }
.btn.sec { background: #E4E4E9; color: var(--ink); }
.btn:disabled { opacity: .5; }

textarea.ask, input.ask { width: 100%; border: 0; border-radius: 13px; padding: 13px 14px; font: inherit; font-size: 15px;
  background: var(--card); outline: none; resize: none; }

.lookcard { background: var(--card); border-radius: 16px; padding: 12px; margin-top: 12px; }
.lookcard .lt { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.litem { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: .5px solid var(--hair); }
.litem:last-of-type { border-bottom: 0; }
.litem .ph { flex: none; width: 44px; height: 54px; border-radius: 8px; background: #EDEDF2 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 20px; }
.litem .n { font-size: 13.5px; }
.litem .id { margin-left: auto; font-size: 12px; color: var(--sub); }
.lookcard .why { font-size: 13px; color: #55555c; margin-top: 8px; line-height: 1.45; }
.lookrow { display: flex; gap: 8px; margin-top: 10px; }
.lookrow .btn { margin-top: 0; padding: 11px; font-size: 14.5px; }

.icard { background: var(--card); border-radius: 14px; padding: 12px 14px; margin-top: 10px; }
.icard .ih { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.icard .ih b { font-size: 14.5px; }
.icard .ih span { font-size: 11.5px; color: var(--sub); }
.icard p { font-size: 13px; color: #55555c; margin: 4px 0 0; }
.bar { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 12.5px; }
.bar i { font-style: normal; width: 40%; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .tr { flex: 1; height: 5px; border-radius: 3px; background: #EDEDF2; position: relative; }
.bar .tr b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--dark); }
.bar span { flex: none; min-width: 56px; text-align: right; color: var(--sub); font-variant-numeric: tabular-nums; }
.mini { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.mini .ph { flex: none; width: 30px; height: 36px; border-radius: 6px; background: #EDEDF2 center/cover no-repeat; }
.mini span { margin-left: auto; color: var(--sub); font-size: 12px; }

.howto { background: var(--card); border-radius: 12px; padding: 11px 14px; font-size: 13px; color: #55555c; }
.howto summary { font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; list-style: none; }
.howto summary::-webkit-details-marker { display: none; }
.howto p { margin: 7px 0; line-height: 1.45; }
.howto b { color: var(--ink); }

.seg { display: flex; background: #E4E4E9; border-radius: 10px; padding: 2px; margin-bottom: 8px; }
.seg button { flex: 1; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 500;
  padding: 7px 0; border-radius: 8px; color: #3c3c43; }
.seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }

.loading { text-align: center; color: var(--sub); padding: 30px; }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid #d0d0d6; border-top-color: var(--dark);
  border-radius: 50%; animation: sp 0.8s linear infinite; vertical-align: -4px; margin-right: 8px; }
@keyframes sp { to { transform: rotate(360deg); } }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: rgba(249,249,249,.94);
  backdrop-filter: blur(16px); border-top: .5px solid var(--hair); padding-bottom: env(safe-area-inset-bottom); z-index: 40; }
.tabbar button { flex: 1; border: 0; background: none; font: inherit; font-size: 10.5px; color: var(--sub);
  padding: 7px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tabbar button .ic { font-size: 21px; filter: grayscale(1) opacity(.55); }
.tabbar button.on { color: var(--ink); font-weight: 600; }
.tabbar button.on .ic { filter: none; }
