:root,:root[data-theme=dark]{--bg: #161616;--surface: #222;--surface-2: #2c2c2c;--text: #f2f2f2;--muted: #9a9a9a;--gold: #d4af37;--gold-dim: #b8860b;--gold-ink: #d4af37;--danger: #e0635a;--border: #3a3a3a;--ph-a: #2a2a2a;--ph-b: #303030;--shadow: rgba(0, 0, 0, .4);--radius: 14px;color-scheme:dark}:root[data-theme=light]{--bg: #faf9f7;--surface: #ffffff;--surface-2: #f1efea;--text: #1c1a17;--muted: #6f6a62;--gold: #d4af37;--gold-dim: #b8860b;--gold-ink: #8a6500;--danger: #c0392b;--border: #ddd8cf;--ph-a: #ece9e3;--ph-b: #e2ded6;--shadow: rgba(0, 0, 0, .12);color-scheme:light}*{box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:var(--bg);color:var(--text);-webkit-tap-highlight-color:transparent}h1{font-size:1.3rem;margin:0}.muted{color:var(--muted)}.error{color:var(--danger);font-size:.9rem}.centered{min-height:100dvh;display:grid;place-items:center;padding:1rem}.page{max-width:720px;margin:0 auto;padding:1rem 1rem 6rem}.topbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1rem}.card{background:var(--surface);border-radius:var(--radius);padding:1.25rem}button{font:inherit;cursor:pointer;border:none;border-radius:10px;padding:.7rem 1rem;background:var(--gold);color:#1a1a1a;font-weight:600}button:disabled{opacity:.5;cursor:default}button.link{background:none;color:var(--gold-ink);padding:.3rem;font-weight:500}.icon-btn{display:inline-flex;align-items:center;justify-content:center;padding:.3rem}.icon-btn svg{width:20px;height:20px}.sync-error{color:var(--danger)}.sync-syncing svg{animation:spin .9s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}[dir=rtl] .sync-syncing svg{animation:spin-rtl .9s linear infinite}@keyframes spin-rtl{to{transform:rotate(-360deg)}}.topbar-actions{display:flex;align-items:center;gap:.5rem}.lang-toggle{font-size:.85rem}.nav-arrow{display:inline-block}[dir=rtl] .nav-arrow{transform:scaleX(-1)}button.danger{background:transparent;color:var(--danger);border:1px solid var(--danger);margin-top:1rem;width:100%}input,select,textarea{font:inherit;width:100%;padding:.65rem .75rem;border-radius:10px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);margin-bottom:.9rem}label{display:block;font-size:.85rem;color:var(--muted);margin-bottom:.3rem}.auth-card{width:min(380px,100%);display:flex;flex-direction:column;gap:.4rem}.auth-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:.5rem}.auth-card h1{color:var(--gold-ink)}.auth-card button[type=submit]{margin-top:.5rem}.auth-card .hint{font-size:.78rem;line-height:1.35}.totals{display:grid;grid-template-columns:repeat(4,1fr);gap:.5rem;margin-bottom:.6rem}.total-chip{background:var(--surface);border-radius:var(--radius);padding:.55rem .6rem;display:flex;flex-direction:column;min-width:0}.total-chip .karat{font-size:.75rem;color:var(--muted)}.total-chip .grams{font-size:1.05rem;font-weight:700;white-space:nowrap}.total-chip .count{font-size:.72rem;white-space:nowrap}.total-chip.silver{background:linear-gradient(135deg,#8e9aa5,#c8cfd6);color:#1a1a1a;flex-direction:row;align-items:baseline;gap:.8rem;margin-bottom:1rem}.total-chip.silver .karat,.total-chip.silver .count{color:#3c454d}.total-chip.silver .grams{font-size:1.2rem}.filter-row{display:flex;gap:.5rem;overflow-x:auto;padding-bottom:.5rem;margin-bottom:.5rem}.chip{background:var(--surface-2);color:var(--text);font-weight:500;padding:.4rem .8rem;white-space:nowrap}.chip.active{background:var(--gold);color:#1a1a1a}.piece-grid{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.8rem}.piece-card a{text-decoration:none;color:inherit;display:block}.thumb{position:relative;aspect-ratio:1;border-radius:12px;overflow:hidden;background:var(--surface-2)}.thumb img{width:100%;height:100%;object-fit:cover}.thumb-ph{width:100%;height:100%;background:repeating-linear-gradient(45deg,var(--ph-a),var(--ph-a) 10px,var(--ph-b) 10px,var(--ph-b) 20px)}.sync-dot{position:absolute;top:8px;right:8px;width:10px;height:10px;border-radius:50%;background:var(--gold);box-shadow:0 0 0 2px var(--surface)}.piece-meta{padding:.5rem .2rem;display:flex;flex-direction:column;gap:.15rem}.piece-meta .muted{font-size:.8rem}.empty{text-align:center;margin-top:3rem}.fab{position:fixed;right:max(1rem,env(safe-area-inset-right));bottom:max(1.5rem,env(safe-area-inset-bottom));width:58px;height:58px;border-radius:50%;background:var(--gold);color:#1a1a1a;font-size:2rem;display:grid;place-items:center;text-decoration:none;box-shadow:0 6px 18px var(--shadow)}[dir=rtl] .fab{right:auto;left:max(1rem,env(safe-area-inset-left))}.form{display:flex;flex-direction:column}.row{display:flex;gap:.8rem}.col{flex:1}.photo-strip{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1rem}.photo-tile{position:relative;width:84px;height:84px;border-radius:10px;overflow:hidden;padding:0;background:var(--surface-2);border:2px solid transparent}.photo-tile img{width:100%;height:100%;object-fit:cover}.photo-tile.primary{border-color:var(--gold)}.primary-star{position:absolute;top:4px;inset-inline-start:4px;width:18px;height:18px;border-radius:50%;background:var(--gold);color:#1a1a1a;font-size:11px;display:grid;place-items:center}.add-tile{border:1px dashed var(--border);background:transparent;color:var(--muted);font-size:1.6rem}.photo-tile.processing{display:grid;place-items:center}.loader{width:22px;height:22px;border:3px solid var(--border);border-top-color:var(--gold);border-radius:50%;animation:spin .8s linear infinite}.photo-menu{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000008c;display:grid;place-items:center;z-index:50;padding:1rem}.menu-card{background:var(--surface);border-radius:14px;padding:1rem;display:flex;flex-direction:column;gap:.6rem;width:min(280px,100%)}.menu-card .menu-preview{width:100%;aspect-ratio:1;object-fit:cover;border-radius:10px}.menu-card .danger{margin-top:0}.title-btn{background:none;color:var(--text);font-size:inherit;font-weight:inherit;padding:.2rem 0;display:inline-flex;align-items:center;gap:.35rem}.title-btn .chevron{font-size:.7em;color:var(--muted)}.collection-sheet{max-height:70dvh;overflow-y:auto}.collection-row{display:flex;align-items:center;gap:.4rem}.collection-item{flex:1;display:flex;align-items:center;justify-content:space-between;gap:.5rem;background:var(--surface-2);color:var(--text);font-weight:500;text-align:start}.collection-item.active{color:var(--gold-ink);font-weight:600}.collection-item .collection-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collection-item.new-collection{background:none;color:var(--gold-ink);justify-content:center}.collection-edit-btn{flex:0 0 auto}.collection-edit input{margin-bottom:.6rem}.collection-edit-actions{display:flex;gap:.5rem}.collection-edit-actions button{flex:1}.collection-edit-actions .danger{margin-top:0;width:auto}.gallery{display:flex;gap:.5rem;overflow-x:auto;scroll-snap-type:x mandatory;margin-bottom:1rem;border-radius:var(--radius)}.gallery .shot{flex:0 0 100%;scroll-snap-align:center;aspect-ratio:4/3;overflow:hidden;border-radius:var(--radius);background:var(--surface-2);border:none;padding:0;cursor:zoom-in}.gallery .shot img{width:100%;height:100%;object-fit:cover}.viewer{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000eb;z-index:60;display:grid;place-items:center;overflow:hidden}.viewer img{max-width:100vw;max-height:100dvh;object-fit:contain;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.viewer .close{position:absolute;top:max(.8rem,env(safe-area-inset-top));inset-inline-end:.8rem;width:42px;height:42px;border-radius:50%;background:#ffffff2e;color:#fff;font-size:1.1rem;padding:0}.detail dl{margin:1rem 0;display:grid;gap:.5rem}.detail dl div{display:flex;justify-content:space-between;border-bottom:1px solid var(--border);padding-bottom:.5rem}.detail dt{color:var(--muted)}.note{background:var(--surface-2);padding:.8rem;border-radius:10px;white-space:pre-wrap}.settings-section{margin-bottom:.9rem}.settings-section h2{font-size:.95rem;margin:0 0 .7rem;color:var(--muted);font-weight:600}.settings-section .danger{width:auto;margin-top:.6rem}.settings-section>button:not(.chip):not(.danger){margin-top:.4rem}.seg-row{display:flex;gap:.5rem;flex-wrap:wrap}.build-id{text-align:center;font-size:.75rem;margin-top:1.5rem}.offline-banner{background:var(--gold-dim);color:#1a1a1a;text-align:center;font-size:.85rem;padding:.4rem}
