/* DezoCloud — Google Photos uslubidagi interfeys */
:root {
  --bg: #ffffff; --bg-2: #f1f3f4; --bg-3: #e3e6ea; --fg: #202124; --muted: #5f6368; --line: #dadce0;
  --accent: #1a73e8; --accent-bg: #e8f0fe; --accent-fg: #ffffff; --danger: #d93025; --ok: #188038;
  --shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
  --warn-bg: #fce8e6; --warn-fg: #5f2120; --warn-btn: #b3261e; --warn-btn-fg: #fff;
  --bar-bg: #f1f3f4;
  --h: 176px;               /* surat qatori balandligi */
  --head: 64px; --tabbar: 56px; --side: 256px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #202124; --bg-2: #2d2e31; --bg-3: #3c4043; --fg: #e8eaed; --muted: #9aa0a6; --line: #3c4043;
    --accent: #8ab4f8; --accent-bg: #394457; --accent-fg: #202124; --danger: #f28b82; --ok: #81c995;
    --warn-bg: #8c1d18; --warn-fg: #ffdad6; --warn-btn: #f2b8b5; --warn-btn-fg: #601410;
    --bar-bg: #1d1f27;
    --shadow: 0 1px 3px rgba(0,0,0,.6), 0 4px 8px 3px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #202124; --bg-2: #2d2e31; --bg-3: #3c4043; --fg: #e8eaed; --muted: #9aa0a6; --line: #3c4043;
  --accent: #8ab4f8; --accent-bg: #394457; --accent-fg: #202124; --danger: #f28b82; --ok: #81c995;
    --warn-bg: #8c1d18; --warn-fg: #ffdad6; --warn-btn: #f2b8b5; --warn-btn-fg: #601410;
    --bar-bg: #1d1f27;
  --shadow: 0 1px 3px rgba(0,0,0,.6), 0 4px 8px 3px rgba(0,0,0,.4);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 14px/1.45 "Google Sans", Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
svg.i { width: 24px; height: 24px; fill: currentColor; flex: none; }

/* Tugmalar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 20px; border-radius: 20px; border: 1px solid var(--line);
  background: transparent; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--bg-2); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 1px 2px rgba(60,64,67,.3); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent;
  display: inline-grid; place-items: center; color: var(--muted); flex: none;
}
.icon-btn:hover { background: var(--bg-2); color: var(--fg); }
.icon-btn.on { color: var(--accent); }

/* ── Kirish sahifasi ─────────────────────────────────────────── */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--bg-2); }
.auth {
  width: min(400px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px 28px 28px; display: grid; gap: 14px;
}
.logo-img { height: 28px; width: auto; display: block; }
/* Oq mavzuda to'q yozuvli, qora mavzuda oq yozuvli logotip */
.logo-img.on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-img.on-light { display: none; }
  :root:not([data-theme="light"]) .logo-img.on-dark { display: block; }
}
:root[data-theme="dark"] .logo-img.on-light { display: none; }
:root[data-theme="dark"] .logo-img.on-dark { display: block; }
.auth .logo-img { height: 32px; margin: 0 auto 4px; }
.auth h1 { margin: 0; font-size: 20px; font-weight: 500; text-align: center; }
.auth .sub { margin: -6px 0 4px; color: var(--muted); text-align: center; font-size: 13px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-2); border-radius: 22px; padding: 3px; }
.tabs button { border: 0; background: transparent; height: 36px; border-radius: 18px; font-weight: 500; color: var(--muted); }
.tabs button.on { background: var(--bg); color: var(--fg); box-shadow: 0 1px 2px rgba(60,64,67,.3); }
.field { display: grid; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); }
.field input {
  height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); outline: none;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.field small { color: var(--muted); font-size: 12px; }
.msg { min-height: 18px; font-size: 13px; color: var(--danger); text-align: center; }
.auth .btn { height: 44px; width: 100%; }

/* ── Asosiy tuzilma ──────────────────────────────────────────── */
.app { height: 100%; display: grid; grid-template-rows: var(--head) 1fr; grid-template-columns: var(--side) minmax(0, 1fr); grid-template-areas: "head head" "side main"; }
header.top {
  grid-area: head; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 8px;
  border-bottom: 1px solid transparent; background: var(--bg); z-index: 30;
}
header.top.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 4px; width: calc(var(--side) - 16px); flex: none; }
.search {
  flex: 1; min-width: 0; max-width: 720px; height: 46px; border-radius: 24px; background: var(--bg-2);
  display: flex; align-items: center; padding: 0 6px 0 4px;
}
.search:focus-within { background: var(--bg); box-shadow: var(--shadow); }
.search input { flex: 1; border: 0; background: transparent; outline: none; height: 100%; min-width: 0; font-size: 16px; }
.top .spacer { flex: 1; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-fg);
  border: 0; font-weight: 600; font-size: 15px; text-transform: uppercase;
}

aside.side { grid-area: side; padding: 8px 8px 12px 0; overflow-y: auto; display: flex; flex-direction: column; }
.side-brand { display: none; padding: 8px 26px 18px; }
.nav { display: grid; gap: 2px; }
.nav button {
  display: flex; align-items: center; gap: 18px; height: 48px; padding: 0 24px 0 26px; border: 0;
  background: transparent; border-radius: 0 24px 24px 0; text-align: left; font-size: 14px; font-weight: 500;
}
.nav button:hover { background: var(--bg-2); }
.nav button.on { background: var(--accent-bg); color: var(--fg); font-weight: 600; border-radius: 24px; }
.nav button.on span[data-icon] { color: var(--accent); }
.nav button:first-child { border-radius: 24px; margin-bottom: 4px; }
.nav .count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
.nav hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.meter { margin: 8px 12px 0 24px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: grid; gap: 10px; }
.meter { cursor: pointer; }
.meter:hover .mtitle { color: var(--accent); }
.meter .btn { cursor: pointer; }
.meter .mtitle { display: flex; align-items: center; gap: 18px; color: var(--fg); font-size: 14px; font-weight: 500; height: 40px; margin-left: 2px; }
.meter .btn { width: 100%; color: var(--accent); }
.meter .bar { height: 4px; border-radius: 2px; background: var(--bg-3); overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--accent); width: 0; border-radius: 2px; }
.meter.full .bar i { background: var(--danger); }
.meter a { font-size: 12px; }

main.main { grid-area: main; overflow-y: auto; position: relative; padding: 0 16px 120px 8px; scroll-behavior: auto; }
.page-head { display: flex; align-items: center; gap: 8px; padding: 12px 4px 4px; min-height: 52px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 22px; font-weight: 400; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .grow { flex: 1; }
.notice { margin: 4px 4px 8px; padding: 10px 14px; background: var(--bg-2); border-radius: 8px; color: var(--muted); font-size: 13px; }

/* ── Vaqt chizig'i ───────────────────────────────────────────── */
.day { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 18px 4px 8px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.day .daycheck { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; opacity: 0; padding: 0; display: grid; place-items: center; color: transparent; }
.day:hover .daycheck, .selecting .day .daycheck { opacity: 1; }
.day .daycheck.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); opacity: 1; }
.day .daycheck svg { width: 14px; height: 14px; fill: currentColor; }
.group { display: flex; flex-wrap: wrap; gap: 2px; }
.group::after { content: ''; flex-grow: 1000000; }
.month { margin: 0; padding: 28px 4px 4px; font-size: 22px; font-weight: 400; position: sticky; top: 0; z-index: 6; background: var(--bg); }
.days { display: flex; flex-wrap: wrap; gap: 0 28px; align-items: flex-start; }
/* Kun bloki: eni = bir qatordagi suratlar yig'indisi (qisqa kunlar yonma-yon tushadi) */
.dayblock { flex: 0 0 auto; max-width: 100%; width: calc(var(--h) * var(--sar) + var(--n) * 2px + 8px); }
.dayblock .day { position: static; padding: 14px 4px 6px; font-size: 13px; }
.navlabel { padding: 14px 26px 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.storewarn { margin: 8px 4px 4px; padding: 12px 18px; border-radius: 24px; background: var(--warn-bg); color: var(--warn-fg); font-size: 13px; display: flex; align-items: center; gap: 16px; }
.storewarn .sw-t { flex: 1; display: grid; gap: 2px; }
.storewarn .sw-t b { font-weight: 500; }
.storewarn .sw-b { display: flex; gap: 8px; flex: none; }
.storewarn .sw-b button { border: 0; background: transparent; color: var(--warn-fg); height: 36px; padding: 0 16px; border-radius: 18px; font-weight: 500; }
.storewarn .sw-b button.pri { background: var(--warn-btn); color: var(--warn-btn-fg); }
.only-narrow { display: none; }
.coll { padding: 4px 8px 24px; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding-top: 12px; }
.chip { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); text-align: left; }
.chip:hover { background: var(--bg-2); }
.chip span { color: var(--muted); display: grid; }
.chip b { font-weight: 500; flex: 1; line-height: 1.2; }
.chip i { font-style: normal; font-size: 12px; color: var(--muted); }
.coll-h { margin: 22px 4px 4px; font-size: 18px; font-weight: 400; }
.coll-store { padding: 8px 4px; display: grid; gap: 8px; font-size: 13px; color: var(--muted); max-width: 420px; }
.coll-store .bar { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.coll-store .bar i { display: block; height: 100%; background: var(--accent); }
.coll-store .btn { width: fit-content; }

.ph {
  position: relative; flex-grow: var(--ar); width: calc(var(--h) * var(--ar)); max-width: 100%;
  background: var(--bg-3); border-radius: 2px; overflow: hidden; cursor: pointer; outline: none;
}
.ph::before { content: ''; display: block; padding-bottom: calc(100% / var(--ar)); }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .15s; }
.ph .fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.ph .fallback svg { width: 36px; height: 36px; opacity: .6; }
.ph .shade { position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.35), transparent 40%); opacity: 0; transition: opacity .12s; pointer-events: none; }
.ph:hover .shade, .selecting .ph .shade { opacity: 1; }
.ph .chk {
  position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0;
  background: transparent; color: rgba(255,255,255,.85); display: grid; place-items: center; opacity: 0; transition: opacity .12s;
}
.ph .chk svg { width: 24px; height: 24px; fill: currentColor; filter: drop-shadow(0 0 2px rgba(0,0,0,.5)); }
.ph:hover .chk, .selecting .ph .chk { opacity: 1; }
.ph.sel .chk { opacity: 1; color: var(--accent); }
.ph.sel img, .ph.sel .fallback { transform: scale(.82); border-radius: 6px; }
.ph.sel { background: var(--accent-bg); }
.ph .vbadge { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; gap: 2px; color: #fff; font-size: 12px; font-weight: 500; text-shadow: 0 0 3px rgba(0,0,0,.7); }
.ph .vbadge svg { width: 18px; height: 18px; fill: currentColor; }
.ph .fav { position: absolute; left: 6px; bottom: 6px; color: #fff; filter: drop-shadow(0 0 2px rgba(0,0,0,.6)); display: none; }
.ph .fav svg { width: 18px; height: 18px; fill: currentColor; }
.ph.isfav .fav { display: block; }
.ph.sel .vbadge, .ph.sel .fav { display: none; }

.loading, .emptyview { text-align: center; color: var(--muted); padding: 40px 16px; }
.emptyview { padding-top: 12vh; }
.emptyview svg { width: 72px; height: 72px; fill: var(--bg-3); display: block; margin: 0 auto 12px; }
.emptyview h3 { margin: 0 0 6px; color: var(--fg); font-weight: 400; font-size: 20px; }
.emptyview .btn { margin-top: 16px; }
#sentinel { height: 1px; }

/* ── Albomlar ────────────────────────────────────────────────── */
.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px 16px; padding: 12px 4px; }
.album { cursor: pointer; display: grid; gap: 8px; }
.album .cover { aspect-ratio: 1; border-radius: 10px; background: var(--bg-3); overflow: hidden; position: relative; }
.album .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album .cover .fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.album .cover .fallback svg { width: 48px; height: 48px; opacity: .5; }
.album:hover .cover { box-shadow: var(--shadow); }
.album .nm { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album .ct { font-size: 12px; color: var(--muted); margin-top: -6px; }
.album.new .cover { background: var(--bg-2); display: grid; place-items: center; color: var(--accent); border: 2px dashed var(--line); }
.album.new .cover svg { width: 44px; height: 44px; }

/* ── Tanlash paneli ──────────────────────────────────────────── */
.selbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--head); z-index: 40; background: var(--bg);
  display: flex; align-items: center; gap: 4px; padding: 0 12px; box-shadow: 0 1px 3px rgba(60,64,67,.3);
}
.selbar .cnt { font-size: 18px; font-weight: 500; margin-right: auto; padding-left: 4px; }
.selbar .icon-btn { color: var(--fg); }
.selbar .icon-btn:hover { background: var(--bg-2); }

/* ── Ko'rish oynasi ──────────────────────────────────────────── */
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; display: flex; flex-direction: column; height: 100dvh; }
.viewer .vtop {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 2px;
  padding: 8px 10px; background: linear-gradient(rgba(0,0,0,.65), transparent); transition: opacity .2s;
}
.viewer .vtop .icon-btn { color: #fff; }
.viewer .vtop .icon-btn:hover { background: rgba(255,255,255,.15); }
.viewer .vtitle { flex: 1; min-width: 0; padding: 0 8px; }
.viewer .vtitle b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .vtitle span { font-size: 12px; opacity: .75; }
.viewer.idle .vtop, .viewer.idle .vnav { opacity: 0; pointer-events: none; }
.viewer.idle { cursor: none; }
.vstage { flex: 1; display: grid; place-items: center; min-height: 0; position: relative; overflow: hidden; touch-action: pan-y; }
.vstage img, .vstage video { max-width: 100%; max-height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.vstage video { width: 100%; height: 100%; background: #000; }
.vstage img.blur { filter: blur(8px); transform: scale(1.02); }
.vstage .vmsg { text-align: center; max-width: 360px; padding: 20px; color: #c4c7c5; }
.vnav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: rgba(32,33,36,.55); color: #fff; display: grid; place-items: center; transition: opacity .2s;
}
.vnav:hover { background: rgba(32,33,36,.9); }
.vnav.prev { left: 12px; } .vnav.next { right: 12px; }
.vspin { position: absolute; width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.vinfo {
  position: absolute; top: 0; right: 0; bottom: 0; width: 340px; max-width: 100%; z-index: 4;
  background: var(--bg); color: var(--fg); padding: 16px 20px; overflow-y: auto; box-shadow: var(--shadow);
}
.vinfo h3 { margin: 4px 0 16px; font-size: 18px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.vinfo h3 .icon-btn { margin-left: -8px; }
.vinfo dl { margin: 0; display: grid; gap: 14px; }
.vinfo dt { font-size: 12px; color: var(--muted); }
.vinfo dd { margin: 2px 0 0; word-break: break-word; }

/* ── Dialog, menyu, xabar ────────────────────────────────────── */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 16px; }
.modal { width: min(420px, 100%); max-height: 88vh; overflow-y: auto; background: var(--bg); color: var(--fg); border-radius: 14px; padding: 22px 22px 16px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.modal h2 { margin: 0; font-size: 20px; font-weight: 400; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal .list { display: grid; gap: 2px; max-height: 40vh; overflow-y: auto; margin: 0 -8px; }
.modal .list button { text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; display: flex; align-items: center; gap: 12px; }
.modal .list button:hover { background: var(--bg-2); }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--bg); }
.menu { position: fixed; z-index: 90; min-width: 220px; background: var(--bg); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 0; }
.menu .head { padding: 10px 16px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .head b { display: block; }
.menu .head span { font-size: 12px; color: var(--muted); }
.menu button, .menu a { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 16px; border: 0; background: transparent; text-align: left; color: var(--fg); text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--bg-2); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100; background: #323232; color: #fff; padding: 12px 20px; border-radius: 6px; font-size: 14px; max-width: min(92vw, 520px); box-shadow: var(--shadow); }

/* ── Yuklash paneli ──────────────────────────────────────────── */
.upanel { position: fixed; right: 24px; bottom: 0; width: 360px; max-width: calc(100vw - 16px); z-index: 55; background: var(--bg); border-radius: 12px 12px 0 0; box-shadow: var(--shadow); overflow: hidden; }
.upanel .uh { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 18px; background: #323232; color: #fff; font-size: 14px; }
.upanel .uh .t { flex: 1; }
.upanel .uh .icon-btn { color: #fff; width: 36px; height: 36px; }
.upanel .uh .icon-btn:hover { background: rgba(255,255,255,.15); }
.upanel .ul { max-height: 320px; overflow-y: auto; }
.upanel.min .ul { display: none; }
.urow { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.urow .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.urow .s { grid-column: 1; font-size: 12px; color: var(--muted); }
.urow .x { grid-row: 1 / span 2; grid-column: 2; }
.urow .bar { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--bg-3); overflow: hidden; }
.urow .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.urow.done .bar i { background: var(--ok); }
.urow.err .s { color: var(--danger); }
.urow.err .bar i { background: var(--danger); }

.fab { display: none; }
.tabbar { display: none; }
.dropveil { position: fixed; inset: 0; z-index: 75; background: rgba(26,115,232,.18); border: 3px dashed var(--accent); display: grid; place-items: center; font-size: 22px; color: var(--accent); pointer-events: none; }
.scrim { display: none; }

/* ── Telefon va planshet (Google Photos mobil uslubi) ───────── */
@media (max-width: 900px) {
  :root { --head: 56px; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "main"; }
  .brand { width: auto; flex: 1; }
  .brand .logo-img { height: 22px !important; }
  #menu-btn, .top .spacer, .only-wide { display: none !important; }
  .only-narrow { display: inline-grid; }
  .avatar { margin-left: 2px; }
  /* Qidiruv tepada ko'rinmaydi; pastdagi «Qidiruv» tugmasi bosilganda ochiladi */
  .search { display: none; max-width: none; height: 44px; }
  header.top.searching .brand, header.top.searching #upload-icon, header.top.searching .avatar { display: none; }
  header.top.searching .search { display: flex; }
  header.top.searching { padding: 0 8px; }
  header.top.searching .search { background: var(--bg-2); }
  aside.side {
    position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: 280px; background: var(--bg);
    transform: translateX(-100%); transition: transform .2s; padding-top: 12px; box-shadow: none;
  }
  aside.side.open { transform: none; box-shadow: var(--shadow); }
  .side-brand { display: block; }
  .nav button { margin-right: 8px; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.45); }
  main.main { padding: 0 0 calc(var(--tabbar) + 48px) 0; }
  .page-head, .notice, .coll, .albums, .plans, .plans-head { padding-left: 12px; padding-right: 12px; }
  .month { padding: 14px 12px 2px; font-size: 18px; }
  .days { display: block; }
  .dayblock { width: auto; }
  .day, .dayblock .day { position: sticky; top: 42px; z-index: 5; background: var(--bg); padding: 8px 12px 6px; }
  /* Kvadrat katakli to'r: telefonda 3 ustun, chetdan chetgacha */
  .group { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 2px; }
  .group::after { display: none; }
  .ph { width: auto; flex-grow: 0; max-width: none; aspect-ratio: 1; border-radius: 0; }
  .ph::before { display: none; }
  .storewarn { margin: 6px 12px 10px; padding: 20px 20px 14px; border-radius: 28px; display: grid; gap: 12px; font-size: 16px; }
  .storewarn .sw-t b { font-size: 20px; line-height: 1.25; }
  .storewarn .sw-b { justify-content: flex-end; }
  .storewarn .sw-b button { height: 44px; padding: 0 22px; border-radius: 22px; font-size: 15px; }
  .albums { grid-template-columns: repeat(2, 1fr); gap: 16px 10px; }
  /* Pastdagi suzuvchi panel (Google Photos kabi): kapsula + alohida yumaloq qidiruv tugmasi */
  .tabbar {
    display: flex; align-items: center; justify-content: center; gap: 8px; position: fixed; left: 0; right: 0; z-index: 35;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)); padding: 0 10px; background: transparent; box-shadow: none; border-radius: 0;
    pointer-events: none;
  }
  .tabbar > * { pointer-events: auto; }
  .tabs-pill { display: flex; gap: 0; padding: 5px; border-radius: 34px; background: var(--bar-bg); box-shadow: 0 2px 14px rgba(0,0,0,.35); min-width: 0; }
  .tabbar button {
    border: 0; background: transparent; height: 48px; padding: 0 clamp(9px, 3.6vw, 18px); border-radius: 24px; display: flex; align-items: center;
    justify-content: center; gap: 6px; color: var(--fg); font-size: clamp(13px, 4vw, 16px); font-weight: 500; white-space: nowrap; min-width: 0;
  }
  .tabbar button b { display: inline; font-weight: 500; font-size: inherit; }
  .tabbar button span[data-icon] { display: none; }
  .tabbar button.on { background: var(--accent-bg); }
  .tabbar button.on span[data-icon] { display: grid; color: var(--accent); }
  .tabbar .tab-search { width: 58px; height: 58px; flex: none; padding: 0; border-radius: 50%; background: var(--bar-bg); box-shadow: 0 2px 14px rgba(0,0,0,.35); }
  .tabbar .tab-search span[data-icon] { display: grid; color: var(--fg); }
  .tabbar .tab-search svg { width: 26px; height: 26px; }
  .fab { display: none; }
  .upanel { right: 0; left: 0; width: auto; max-width: none; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); border-radius: 12px 12px 0 0; }
  .vinfo { top: auto; width: 100%; max-height: 62%; border-radius: 16px 16px 0 0; }
  .vnav { display: none; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
}

/* Yon panelni yashirish (kompyuterda) */
@media (min-width: 901px) {
  .app.noside { grid-template-columns: 0 minmax(0, 1fr); }
  .app.noside aside.side { display: none; }
  .app.noside .brand { width: auto; }
}

/* ── Tariflar ────────────────────────────────────────────────── */
.plans-head { text-align: center; padding: 28px 8px 8px; }
.plans-head h2 {
  margin: 0 0 8px; font-size: 32px; font-weight: 500; letter-spacing: -.01em;
  background: linear-gradient(90deg, #4285f4, #9b5cf6 35%, #ea4335 70%, #fbbc04); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.plans-head p { margin: 0 0 18px; color: var(--muted); }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 24px; padding: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.seg button { border: 0; background: transparent; height: 38px; padding: 0 26px; border-radius: 20px; font-weight: 500; color: var(--muted); transition: all .15s; }
.seg button.on { background: linear-gradient(135deg, #1a73e8, #7c4dff); color: #fff; box-shadow: 0 2px 10px rgba(26,115,232,.4); }
.plans-save { margin-top: 10px; min-height: 24px; }
.plans-save span { display: inline-block; padding: 3px 14px; border-radius: 14px; background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); font-size: 13px; font-weight: 500; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; padding: 22px 8px 32px; max-width: 1240px; margin: 0 auto; align-items: start; }

.plan { position: relative; border-radius: 20px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); display: grid; transition: transform .18s, box-shadow .18s; }
.plan:hover { transform: translateY(-4px); box-shadow: 0 12px 32px color-mix(in srgb, var(--pc) 28%, transparent); }
.plan.rec { transform: translateY(-6px); border: 0; box-shadow: 0 0 0 2px var(--pc), 0 16px 40px color-mix(in srgb, var(--pc) 38%, transparent); }
.plan.rec:hover { transform: translateY(-9px); }
.plan.cur { box-shadow: 0 0 0 2px var(--pc); }
.plan-tag { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(255,255,255,.95); color: var(--pc); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 12px; }

.plan-top { position: relative; padding: 22px 20px 20px; color: #fff; background: linear-gradient(135deg, var(--pc), var(--pc2)); overflow: hidden; }
.plan-top::after { content: ''; position: absolute; width: 150px; height: 150px; right: -40px; bottom: -60px; border-radius: 50%; background: rgba(255,255,255,.16); }
.plan-top::before { content: ''; position: absolute; width: 90px; height: 90px; right: 50px; top: -45px; border-radius: 50%; background: rgba(255,255,255,.12); }
.plan-ic { width: 36px; height: 36px; border-radius: 12px; background: rgba(255,255,255,.25); display: grid; place-items: center; margin-bottom: 14px; position: relative; z-index: 1; }
.plan-ic svg { width: 22px; height: 22px; fill: #fff; }
.plan-gb { font-size: 34px; font-weight: 600; line-height: 1.1; position: relative; z-index: 1; }
.plan-top h3 { margin: 4px 0 0; font-size: 15px; font-weight: 500; opacity: .92; position: relative; z-index: 1; }

.plan-body { padding: 18px 20px 22px; display: grid; gap: 2px; background: var(--bg); }
.plan-price b { font-size: 28px; font-weight: 600; background: linear-gradient(135deg, var(--pc), var(--pc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan-price span { font-size: 13px; color: var(--muted); }
.plan-sub { font-size: 12px; color: var(--muted); }
.plan-cmp { font-size: 12px; color: var(--muted); min-height: 18px; margin-bottom: 8px; }
.plan-btn { width: 100%; height: 46px; margin: 4px 0 14px; border: 0; color: #fff; font-weight: 600; font-size: 15px; background: linear-gradient(135deg, var(--pc), var(--pc2)); box-shadow: 0 4px 14px color-mix(in srgb, var(--pc) 35%, transparent); transition: filter .15s, transform .1s; }
.plan-btn:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(135deg, var(--pc), var(--pc2)); }
.plan-btn:active:not(:disabled) { transform: scale(.98); }
.plan-btn:disabled { background: var(--bg-3); color: var(--muted); box-shadow: none; opacity: 1; }
.plan.cur .plan-btn:disabled { background: color-mix(in srgb, var(--pc) 16%, transparent); color: var(--pc); }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 13px; }
.plan li { position: relative; padding-left: 26px; }
.plan li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: color-mix(in srgb, var(--pc) 16%, transparent); color: var(--pc); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
@media (max-width: 900px) { .plans-head h2 { font-size: 24px; } .plan.rec { transform: none; } }

/* ── Tepa panel: hisob, sozlamalar, bo'limlar, yordam ─────────── */
.menu { max-width: calc(100vw - 16px); }
.menu.account { width: 340px; padding: 6px 0 10px; border-radius: 24px; }
.menu.account button, .menu.account a { padding: 12px 22px; }
.acc-head { display: flex; align-items: center; gap: 14px; padding: 16px 22px 12px; }
.acc-av { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 600; color: #fff; text-transform: uppercase; background: linear-gradient(135deg, #4285f4, #9b5cf6); flex: none; }
.acc-id { display: grid; min-width: 0; }
.acc-id b { font-size: 17px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.acc-id span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.acc-store { margin: 4px 14px 8px; padding: 16px 18px 12px; border-radius: 18px; background: var(--bg-2); display: grid; gap: 10px; }
.acc-store.warn { background: var(--warn-bg); color: var(--warn-fg); }
.acc-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.acc-row span { display: grid; }
.acc-row b { font-weight: 500; }
.acc-store .bar { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.acc-store.warn .bar { background: rgba(255,255,255,.25); }
.acc-store .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.acc-store.warn .bar i { background: var(--warn-btn); }
.acc-btns { display: flex; justify-content: space-between; gap: 6px; margin: 0 -8px; }
.menu .acc-btns button { width: auto; padding: 8px 12px; border-radius: 16px; color: var(--accent); font-weight: 500; font-size: 13px; }
.acc-store.warn .acc-btns button { color: var(--warn-fg); }
.acc-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 0 0; }
.acc-foot a { color: var(--muted); display: inline; padding: 0; }
.menu.wide { width: 300px; padding-bottom: 8px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.menu-sec { padding: 6px 16px 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.theme-seg { display: flex; margin: 0 14px 6px; }
.theme-seg button { flex: 1; padding: 0 8px; justify-content: center; height: 34px; width: auto; }
.menu.apps { width: 330px; padding: 14px 10px; border-radius: 24px; }
.apps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.menu .app-tile { display: grid; justify-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: 14px; border: 0; background: transparent; position: relative; text-align: center; font-size: 12.5px; }
.app-tile span { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--ac) 16%, transparent); color: var(--ac); }
.app-tile span svg { width: 24px; height: 24px; fill: currentColor; }
.app-tile b { font-weight: 500; }
.app-tile i { position: absolute; top: 6px; right: 12px; font-style: normal; font-size: 11px; background: var(--ac); color: #fff; border-radius: 9px; padding: 0 6px; min-width: 18px; line-height: 18px; }
.help { display: grid; gap: 14px; }
.help-row { display: flex; gap: 14px; align-items: flex-start; }
.help-row > span { width: 36px; height: 36px; border-radius: 12px; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; flex: none; }
.help-row b { display: block; font-weight: 500; }
.help-row small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.help-contact { padding: 10px 14px; background: var(--bg-2); border-radius: 12px; font-size: 14px; }
.help-links { font-size: 12px; color: var(--muted); }
.help-links a { color: var(--muted); }

/* ── Xotirani boshqarish ──────────────────────────────────────── */
.storage { max-width: 780px; margin: 0 auto; padding: 24px 12px 48px; }
.st-title { margin: 0 0 8px; font-size: 32px; font-weight: 400; }
.st-sub, .st-warn { margin: 0 0 18px; color: var(--muted); line-height: 1.5; }
.st-warn { color: var(--fg); }
.st-bar { display: flex; height: 12px; border-radius: 6px; background: var(--bg-3); overflow: hidden; gap: 2px; }
.st-bar i { display: block; height: 100%; min-width: 3px; }
.st-legend-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 14px 0 26px; font-size: 14px; }
.st-legend { display: grid; gap: 8px; }
.lg { display: flex; align-items: center; gap: 10px; }
.lg i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.st-used { color: var(--muted); }
.st-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-radius: 16px; border: 2px solid transparent;
  background: linear-gradient(var(--bg), var(--bg)) padding-box, conic-gradient(from 0deg at 50% 50%, #ea4335, #fbbc04, #34a853, #4285f4, #ea4335) border-box; margin-bottom: 8px; }
.st-banner div { display: grid; gap: 4px; }
.st-banner b { font-weight: 500; font-size: 16px; }
.st-banner span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.st-link { border: 0; background: transparent; color: var(--accent); font-weight: 500; flex: none; }
.st-link:hover { background: var(--accent-bg); }
.st-h { margin: 34px 0 6px; font-size: 18px; font-weight: 500; }
.st-items { display: grid; }
.st-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 16px; align-items: center; padding: 16px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; border-radius: 0; }
.st-item:hover { background: var(--bg-2); }
.st-item b { font-weight: 400; font-size: 15px; display: block; }
.st-item small { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }
.st-item em { font-style: normal; font-size: 14px; color: var(--muted); }
.st-ic { display: grid; place-items: center; color: var(--fg); }
@media (max-width: 900px) { .st-banner { flex-direction: column; align-items: stretch; } .st-title { font-size: 26px; } .storage { padding: 16px 16px 48px; } }

/* ── Qidiruv sahifasi (telefon) ───────────────────────────────── */
.search-page { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.search-page[hidden] { display: none; }
.sp-top { display: flex; align-items: center; gap: 4px; padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px; }
.sp-top input { flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; background: transparent; font-size: 20px; color: var(--fg); }
.sp-top input::placeholder { color: var(--muted); }
.sp-body { flex: 1; overflow-y: auto; padding: 4px 0 calc(24px + env(safe-area-inset-bottom, 0px)); }
.sp-hint { display: flex; gap: 16px; margin: 8px 16px 14px; padding: 18px 20px; border-radius: 20px; background: var(--bg-2); }
.sp-hint > span { color: var(--accent); display: grid; align-content: start; }
.sp-hint b { display: block; font-weight: 500; font-size: 17px; margin-bottom: 4px; }
.sp-hint small { color: var(--muted); font-size: 15px; line-height: 1.5; }
.sp-list { display: grid; }
.sp-row { display: flex; align-items: center; gap: 22px; width: 100%; padding: 20px 28px; border: 0; background: transparent; text-align: left; font-size: 18px; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; }
.sp-row:active { background: var(--bg-2); }
.sp-row > span { display: grid; color: var(--fg); }
.sp-row b { font-weight: 400; flex: 1; }
.sp-row i { font-style: normal; font-size: 13px; color: var(--muted); }
.sp-sec { display: flex; justify-content: space-between; align-items: center; padding: 22px 28px 6px; font-size: 14px; color: var(--muted); font-weight: 500; }
.sp-sec button { border: 0; background: transparent; color: var(--accent); font-size: 14px; font-weight: 500; }
.sp-count { padding: 8px 16px; font-size: 13px; color: var(--muted); }
.sp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.sp-tile { position: relative; aspect-ratio: 1; background: var(--bg-3); overflow: hidden; }
.sp-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-tile .fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.sp-vb { position: absolute; top: 6px; right: 6px; color: #fff; filter: drop-shadow(0 0 3px rgba(0,0,0,.7)); display: grid; }
.sp-vb svg { width: 20px; height: 20px; fill: currentColor; }

/* ── Yuklash / Yaratish sahifasi ──────────────────────────────── */
.create { padding: 0 0 40px; }
.cr-strip { overflow: hidden; border-radius: 0 0 36px 36px; margin-bottom: 8px; background: var(--bg-2); }
.cr-strip-row { display: flex; gap: 10px; padding: 12px 14px 22px; overflow-x: auto; scrollbar-width: none; }
.cr-strip-row::-webkit-scrollbar { display: none; }
.cr-strip-row img { height: 88px; width: 88px; flex: none; object-fit: cover; border-radius: 18px; }
.cr-title { margin: 28px 16px 0; text-align: center; font-size: 48px; line-height: 1.05; font-weight: 700; letter-spacing: -.03em; }
.cr-sub { margin: 6px 16px 22px; text-align: center; font-size: 22px; color: var(--fg); }
.cr-row { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 20px 24px; scrollbar-width: none; }
.cr-row::-webkit-scrollbar { display: none; }
.cr-card {
  position: relative; flex: none; scroll-snap-align: center; width: min(78vw, 330px); height: min(104vw, 440px); border: 0; border-radius: 34px; padding: 0;
  overflow: hidden; text-align: left; color: #fff; background: linear-gradient(160deg, var(--c1), var(--c2));
  display: flex; flex-direction: column; justify-content: flex-end; box-shadow: 0 10px 26px color-mix(in srgb, var(--c1) 35%, transparent); transition: transform .15s;
}
.cr-card:active { transform: scale(.98); }
.cr-shape {
  position: absolute; left: 50%; top: 9%; width: 62%; height: 62%; transform: translateX(-50%); border-radius: 999px;
  background: rgba(255,255,255,.22); display: grid; place-items: center; box-shadow: inset 0 0 0 2px rgba(255,255,255,.28);
}
.cr-ic { width: 84px; height: 84px; border-radius: 28px; background: rgba(255,255,255,.9); color: var(--c1); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.cr-ic svg { width: 46px; height: 46px; fill: currentColor; }
.cr-card b { position: relative; padding: 0 22px; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.cr-card small { position: relative; padding: 4px 22px 24px; font-size: 14.5px; line-height: 1.4; opacity: .94; }
@media (min-width: 901px) {
  .cr-title { font-size: 56px; }
  .cr-row { justify-content: center; flex-wrap: wrap; overflow: visible; }
  .cr-card { width: 270px; height: 360px; }
}

/* ── Offlayn belgisi ──────────────────────────────────────────── */
#offbar { display: none; position: fixed; top: env(safe-area-inset-top, 0px); left: 50%; transform: translateX(-50%); z-index: 45;
  background: #5f6368; color: #fff; font-size: 12px; padding: 3px 14px; border-radius: 0 0 12px 12px; max-width: 94vw; text-align: center; }
.offline #offbar { display: block; }
