/* Codex Horologicus — sand / auction-catalog */
:root {
  --sand-0: #faf6ef;
  --sand-1: #f4ebe0;
  --sand-2: #e8dcc8;
  --sand-3: #c9b396;
  --ink: #2c2418;
  --ink-soft: #5c4a32;
  --ink-mute: #8a7660;
  --line: #d6c7b0;
  --card: #fffdf8;
  --accent: #8a6f4a;
  --accent-strong: #5c4a32;
  --danger: #8b3a2a;
  --ok: #3d6b4f;
  --radius: 14px;
  --tap: 48px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--sand-1);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
}

body {
  padding-top: var(--safe-t);
}

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(64px + var(--safe-b));
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}

.hidden { display: none !important; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, var(--sand-2), var(--sand-1));
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 10px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent-strong);
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-size: 18px;
  background: var(--sand-0);
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-strong);
}

.subtitle {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--ink-mute);
}

/* Views */
.view { display: none; padding: 12px 16px 24px; }
.view.active { display: block; }

.view-title {
  font-family: var(--font);
  font-size: 1.25rem;
  margin: 8px 0 16px;
  color: var(--accent-strong);
}

/* Search */
.search-bar { margin-bottom: 8px; }

#searchInput {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  outline: none;
}

#searchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(138, 111, 74, 0.2);
}

.count {
  margin: 4px 0 10px;
  font-size: 0.85rem;
  color: var(--ink-mute);
}

/* List */
.watch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.watch-item {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: var(--tap);
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.watch-item:active {
  background: var(--sand-2);
}

.thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--sand-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--ink-mute);
  font-family: var(--font);
  font-size: 0.85rem;
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-body { flex: 1; min-width: 0; }

.item-name {
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

.item-id {
  font-size: 0.75rem;
  color: var(--ink-mute);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.empty {
  text-align: center;
  color: var(--ink-mute);
  padding: 32px 8px;
}

/* Detail */
.btn-back {
  min-height: var(--tap);
  padding: 10px 4px;
  border: none;
  background: transparent;
  color: var(--accent-strong);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin: 4px 16px 0;
  display: inline-flex;
  align-items: center;
}

.detail-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 20px;
  box-shadow: 0 2px 10px rgba(44, 36, 24, 0.06);
}

.detail-hero {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-thumb {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  background: var(--sand-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-mute);
  font-family: var(--font);
  flex-shrink: 0;
  overflow: hidden;
}
.detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-title {
  margin: 0;
  font-family: var(--font);
  font-size: 1.35rem;
  color: var(--accent-strong);
  line-height: 1.25;
}

.detail-sub {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.fields {
  display: grid;
  gap: 12px;
}

.field dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin: 0 0 2px;
}

.field dd {
  margin: 0;
  font-size: 1.02rem;
  color: var(--ink);
  word-break: break-word;
}

.notes {
  margin-top: 4px;
  padding: 12px;
  background: var(--sand-0);
  border-radius: 10px;
  border-left: 3px solid var(--sand-3);
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* Settings */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 8px;
}

.settings-form input {
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 1rem;
  color: var(--ink);
}

.settings-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(138, 111, 74, 0.2);
}

.hint {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: var(--ink-mute);
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  min-height: var(--tap);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--sand-2);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { filter: brightness(0.96); }

.btn.primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #faf6ef;
}

.btn.ghost {
  background: transparent;
  margin-top: 8px;
}

.status {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  min-height: 1.4em;
}

.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }

/* Tab bar */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--sand-0);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + var(--safe-b));
  max-width: 560px;
  margin: 0 auto;
}

.tab {
  flex: 1;
  max-width: 160px;
  min-height: 52px;
  border: none;
  background: transparent;
  color: var(--ink-mute);
  font-size: 0.72rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  border-radius: 10px;
}

.tab.active {
  color: var(--accent-strong);
  font-weight: 600;
}

.tab-icon {
  font-size: 1.15rem;
  line-height: 1;
}

@media (min-width: 561px) {
  .tabbar {
    left: 50%;
    transform: translateX(-50%);
    width: 560px;
    right: auto;
  }
}


/* Detail sections */
.detail-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.section-title {
  margin: 0 0 10px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-strong);
  letter-spacing: 0.02em;
}
.fields {
  display: grid;
  gap: 12px;
}
.gal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gal-tile {
  margin: 0;
  width: 72px;
}
.gal-tile img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}
.gal-tile figcaption {
  font-size: 0.65rem;
  color: var(--ink-mute);
  text-align: center;
  margin-top: 2px;
}
.thumb-ph {
  font-size: 1.25rem;
  line-height: 1;
}


/* Add form */
.view-title {
  margin: 12px 16px 4px;
  font-family: var(--font);
  font-size: 1.25rem;
  color: var(--accent-strong);
}
.add-form textarea {
  min-height: 96px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 1rem;
  color: var(--ink);
  font-family: inherit;
  resize: vertical;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
}
.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.photo-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--sand-2);
}
#addPhotos {
  padding: 10px 0;
}

.add-form select {
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 1rem;
  color: var(--ink);
}
.add-form .section-title {
  margin: 18px 0 4px;
}
.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 8px;
}
.check-row input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
}

/* Fullscreen gallery */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 14, 8, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 12px 24px;
}
.lightbox.hidden { display: none !important; }
.lightbox-img {
  max-width: 100%;
  max-height: calc(100dvh - 100px);
  object-fit: contain;
  border-radius: 8px;
}
.lightbox-cap {
  margin: 12px 0 0;
  color: #f4ebe0;
  font-size: 0.9rem;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: calc(8px + var(--safe-t));
  right: 12px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.gal-tile { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gal-tile:active { opacity: 0.85; }
#detailHeroImg { cursor: pointer; }

.danger-zone {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.btn.danger {
  width: 100%;
  background: #f3e4de;
  border-color: #c48a7a;
  color: var(--danger);
}


/* ===== v24: 5 pozycji w dolnym menu ===== */
.tabbar { padding-left: 2px; padding-right: 2px; }
.tab {
  min-width: 0;
  padding: 0 1px;
  font-size: 0.66rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ===== v24: siatki zdjęć ===== */
.ph-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.ph-tile {
  position: relative;
  display: block;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--sand-2);
  aspect-ratio: 1 / 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font: inherit;
}
.ph-tile:active { opacity: 0.8; }
.ph-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--sand-2);
}
.ph-tile img:not([src]) { visibility: hidden; }
.ph-tile.ph-missing::before {
  content: "⌚";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-mute); font-size: 1.4rem;
}
.ph-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 4px 3px;
  font-size: 0.62rem;
  line-height: 1.2;
  color: #fff;
  text-align: left;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.6));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-info { margin: 0 0 10px; }
.photo-status { line-height: 1.4; }
.ph-offline-hint { margin-top: 6px; font-size: 0.8rem; }

/* ===== v24: podgląd pełnoekranowy ===== */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  color: #fff;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: contain;
}
.viewer.hidden { display: none !important; }
.viewer-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
.viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  -webkit-user-drag: none;
  pointer-events: none;
}
.viewer-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(8px + var(--safe-t)) 12px 8px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0));
  pointer-events: none;
}
.viewer-count { font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.viewer-close {
  pointer-events: auto;
  width: 44px; height: 44px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  color: #fff; font-size: 1.3rem; line-height: 1;
  cursor: pointer;
}
.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 64px;
  border: none; border-radius: 10px;
  background: rgba(255,255,255,0.10);
  color: #fff; font-size: 2rem; line-height: 1;
  cursor: pointer;
}
.viewer-prev { left: 6px; }
.viewer-next { right: 6px; }
@media (hover: none) { .viewer-nav { display: none; } }
.viewer-bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 14px calc(14px + var(--safe-b));
  background: linear-gradient(0deg, rgba(0,0,0,0.65), rgba(0,0,0,0));
  text-align: center;
  pointer-events: none;
}
.viewer-note {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: #f1d9a8;
  min-height: 1em;
}
.viewer-cap {
  pointer-events: auto;
  border: none;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 18px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* v25: ekran „Połącz z komputerem” */
.ch-connect{position:fixed;inset:0;z-index:9999;background:rgba(244,235,224,.97);display:flex;align-items:flex-start;justify-content:center;overflow:auto;padding:max(1rem,env(safe-area-inset-top)) 1rem 2rem}
.ch-connect[hidden]{display:none}
.ch-connect-box{max-width:28rem;width:100%;background:#fffaf2;border:1px solid #d9c7a8;border-radius:16px;padding:1.25rem;box-shadow:0 6px 24px rgba(60,40,10,.12)}
.ch-connect-box h2{margin:.25rem 0 .5rem;font-family:Georgia,serif;font-weight:normal}
.ch-connect-box input{width:100%;font-size:1.2rem;letter-spacing:.12em;text-align:center;padding:.6rem;margin:.5rem 0;border:1px solid #c9b396;border-radius:10px;box-sizing:border-box}
.ch-steps{padding-left:1.2rem;line-height:1.45}
.ch-logo{text-align:center}
.ch-lang{display:flex;gap:.35rem;justify-content:flex-end}
.ch-lang button{border:1px solid #c9b396;background:transparent;border-radius:8px;padding:.2rem .55rem;font-size:.85rem}
.ch-lang button.active{background:#c9b396;color:#fff}
body.ch-connect-open{overflow:hidden}
/* v27: ukryta okładka (karta bez zdjęć) nie zajmuje miejsca obok symbolu ⌚ */
.detail-thumb[hidden]{display:none}

/* ===== v31 (2026-10-10): miniatury z podglądem, Gabloty, Timegrapher z telefonu ===== */
.tab { font-size: 0.62rem; }
.thumb.thumb-zoom { position: relative; cursor: zoom-in; }
.thumb.thumb-zoom::after {
  content: ""; position: absolute; right: 2px; bottom: 2px; width: 13px; height: 13px; border-radius: 50%;
  background: rgba(255,253,248,.88) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='6.5' cy='6.5' r='4' fill='none' stroke='%235c4a32' stroke-width='1.8'/%3E%3Cpath d='M9.5 9.5l4 4' stroke='%235c4a32' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/9px no-repeat;
  box-shadow: 0 0 0 1px rgba(92,74,50,.25);
}
.thumb img[hidden] { display: none; }

/* Gabloty */
.gb-jumpbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.gb-jump { min-width: 40px; min-height: 36px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; font: inherit; font-family: var(--font); color: var(--accent-strong); font-weight: 600; }
.gb-jump:active { background: var(--sand-2); }
.gb-case { margin: 0 0 22px; }
.gb-title { margin: 0 0 2px; font-family: var(--font); font-weight: 600; font-size: 1.08rem; color: var(--ink); }
.gb-nr { color: var(--accent-strong); }
.gb-name { color: var(--ink-soft); font-weight: 400; }
.gb-meta { margin: 0 0 8px; font-size: 0.8rem; color: var(--ink-mute); }
.gb-wood { background: linear-gradient(180deg, #8a6440, #6e4c2e); border-radius: 12px; padding: 6px; box-shadow: inset 0 0 0 2px #b8955e, 0 2px 8px rgba(60,40,10,.18); }
.gb-shelf { background: #f1e6d3; border-radius: 8px; padding: 4px; }
.gb-shelf + .gb-shelf { margin-top: 6px; }
.gb-shelf-lab { margin: 0 2px 3px; font-size: 0.66rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-mute); }
.gb-row { display: grid; gap: 4px; }
.gb-row + .gb-row { margin-top: 4px; }
.gb-cell { position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 3px 3px 2px; margin: 0; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button.gb-cell { cursor: pointer; }
button.gb-cell:active { background: var(--sand-2); }
.gb-img { display: grid; place-items: center; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; background: var(--sand-2); color: var(--ink-mute); }
.gb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gb-ph { font-size: 1.1rem; }
.gb-n { position: absolute; left: 2px; top: 1px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: rgba(255,253,248,.92); font-size: 0.6rem; line-height: 15px; text-align: center; color: var(--ink-soft); box-shadow: 0 0 0 1px rgba(92,74,50,.2); }
.gb-lab { margin-top: 2px; font-size: 0.6rem; line-height: 1.15; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); }
.gb-empty { background: transparent; border: 1px dashed #c9b396; }
.gb-empty .gb-img { background: transparent; border: 1px dashed #d6c7b0; }
.gb-empty .gb-lab { color: #b3a28a; font-style: italic; }
.gb-extra { margin-top: 6px; font-size: 0.8rem; }
.gb-link { border: none; background: none; padding: 0; color: var(--accent-strong); text-decoration: underline; font: inherit; }

/* Timegrapher */
.tg-entry { width: 100%; margin: 4px 0 10px; }
.tg-results { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tg-res-hint { font-size: 0.85rem; color: var(--ink-mute); padding: 4px 2px; }
.tg-res, .tg-picked { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-align: left; font: inherit; color: inherit; }
.tg-res:active { background: var(--sand-2); }
.tg-picked { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(138,111,74,.15); }
.tg-picked[hidden] { display: none; }
.tg-res .thumb, .tg-picked .thumb { width: 44px; height: 44px; }
.tg-res-txt { flex: 1; min-width: 0; line-height: 1.25; }
.tg-res-txt b { font-family: var(--font); color: var(--accent-strong); }
.tg-res-txt small { display: block; color: var(--ink-mute); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-change { flex-shrink: 0; }
.tg-step { margin-bottom: 6px; }
.tg-shot { position: relative; display: flex; align-items: center; justify-content: center; min-height: 120px; border: 2px dashed var(--sand-3); border-radius: 14px; background: var(--card); color: var(--accent-strong); font-weight: 600; text-align: center; overflow: hidden; cursor: pointer; }
.tg-shot img { display: block; width: 100%; max-height: 260px; object-fit: contain; background: #2c2418; }
.tg-shot img[hidden] { display: none; }
.tg-shot.has { border-style: solid; border-color: var(--accent); }
.tg-shot.has .tg-shot-ph { position: absolute; right: 8px; bottom: 8px; padding: 4px 10px; border-radius: 999px; background: rgba(255,253,248,.92); font-size: 0.8rem; }
.tg-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tg-step-n { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 6px; border-radius: 50%; background: var(--accent-strong); color: #fff; font-size: 0.8rem; font-family: var(--ui); vertical-align: 2px; }
.tg-read { margin-top: 6px; }
.tg-read summary { cursor: pointer; color: var(--ink-soft); font-size: 0.88rem; padding: 4px 0; }
.tg-read-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tg-read-grid label { font-size: 0.72rem; margin: 0; }
.tg-read-grid input { width: 100%; }
.tg-pend { display: flex; align-items: center; gap: 8px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.tg-pend-pics { display: flex; gap: 3px; flex-shrink: 0; }
.tg-pend-pics img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
#tgPending { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tg-card-box { margin: 18px 0 6px; }
.tg-card-box .btn { width: 100%; }
/* v31 + odczyt automatyczny (2026-10-10) */
.tg-tip { margin-top: -4px; }
.tg-auto-st { margin: 6px 0 0; font-size: 0.86rem; color: var(--ink-soft); min-height: 0; }
.tg-auto-st:empty { display: none; }
.tg-auto-st.ok { color: #2f5d2a; }
.tg-auto-st.warn { color: #8a4b00; font-weight: 600; }
.tg-auto-st.err { color: #a12a1a; }
.tg-read-grid .tg-low input { background: #fff3b0; border: 2px solid #e0a000; }
.tg-read-grid .tg-low label { color: #8a4b00; }
.tg-low-hint { display: block; font-size: 0.7rem; line-height: 1.2; color: #8a4b00; font-weight: 600; margin-top: 2px; }
.tg-extra { margin: 4px 0 0; font-size: 0.8rem; color: var(--ink-mute); }

/* v32: trzecia pozycja (opcjonalna) */
.tg-opt { font-weight: 400; font-size: 0.8em; color: var(--ink-mute); }

/* v33: „Dziś noszę” */
.dn-btn-main{display:block;width:calc(100% - 28px);margin:6px 14px 4px;padding:14px;border-radius:14px;border:2px solid var(--accent-strong);background:var(--accent-strong);color:#fff;font:600 18px var(--ui);min-height:var(--tap)}
#view-wear{padding:0 14px 24px;font-family:var(--ui)}
.dn-top{display:flex;align-items:center}.dn-back{border:0;background:none;font-size:17px;color:var(--accent-strong);padding:10px 0;min-height:var(--tap)}
.dn-h{font-family:var(--font);font-size:26px;margin:0 0 2px;color:var(--ink)}
.dn-sub{color:var(--ink-mute);font-size:14px;margin:0 0 10px}
.dn-today{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:10px 12px;margin:0 0 12px}
.dn-today b{font-family:var(--font);font-size:16px}.dn-none{color:var(--ink-mute)}
.dn-chip{display:inline-flex;align-items:center;gap:6px;background:var(--sand-2);border-radius:20px;padding:5px 10px;margin:6px 6px 0 0;font-size:14px}
.dn-chip button{border:0;background:none;color:var(--danger);font-size:15px;padding:2px 4px;min-width:28px;min-height:28px}
.dn-off{font-size:13px;color:var(--danger);margin:6px 0 0}
.dn-search{width:100%;font-size:19px;padding:13px 14px;border:2px solid var(--accent);border-radius:12px;background:#fff;margin:0 0 6px;-webkit-appearance:none}
.dn-hint{font-size:13px;color:var(--ink-mute);margin:0 0 10px}
.dn-sec{font-family:var(--font);font-size:17px;margin:12px 0 8px;color:var(--ink-soft)}
.dn-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.dn-item{display:block;text-align:left;border:1px solid var(--line);background:var(--card);border-radius:var(--radius);padding:0;overflow:hidden;font:inherit;color:inherit;min-height:190px;position:relative;width:100%}
.dn-item .dn-ph{display:flex;width:100%;height:128px;border-radius:0;margin:0;background:var(--sand-2);align-items:center;justify-content:center;overflow:hidden}
.dn-item .dn-ph img{width:100%;height:100%;object-fit:cover}.dn-item .dn-ph .thumb-ph{font-size:40px}
.dn-nm{display:block;font-family:var(--font);font-size:16px;line-height:1.2;padding:8px 10px 2px}.dn-mt{display:block;font-size:12px;color:var(--ink-mute);padding:0 10px 10px}
.dn-item.on{border:3px solid var(--ok)}.dn-on{position:absolute;top:8px;right:8px;background:var(--ok);color:#fff;font-size:12px;font-weight:600;padding:3px 8px;border-radius:12px}
.dn-toast{position:fixed;left:12px;right:12px;bottom:calc(var(--safe-b) + 76px);z-index:60;background:#2c2418;color:#fff;border-radius:14px;padding:12px 14px;display:flex;align-items:center;gap:10px;font-size:15px;box-shadow:0 6px 20px rgba(0,0,0,.25)}
.dn-toast span{flex:1}.dn-toast button{background:#fff;color:#2c2418;border:0;border-radius:10px;padding:10px 14px;font-weight:700;font-size:15px;min-height:40px}
.dn-card{margin:10px 0}.dn-set-h{display:flex;gap:14px;margin:4px 0 6px}.dn-set-h select{font-size:16px;padding:6px}
.wyc-disc-ph{font-size:12px;color:var(--ink-soft);border-left:3px solid #a5521b;padding:4px 8px;margin:4px 0 8px;background:#fdf3ea}
/* v34: adres dla Skrótów */
.dn-sc{margin:10px 0 4px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--card)}
.dn-sc label{display:block;font-size:14px;margin:0 0 4px}
.dn-sc-url{width:100%;box-sizing:border-box;font:15px ui-monospace,Menlo,monospace;padding:10px;border:1px solid var(--accent);border-radius:10px;background:#fff;margin:0 0 8px;-webkit-appearance:none;-webkit-user-select:text;user-select:text;resize:none;word-break:break-all;overflow-wrap:anywhere;line-height:1.35;color:var(--ink)}
.dn-sc .btn{width:100%}
