/* GreenCloud: dark, green-tinted, iOS-like. Glass only on floating controls; content stays flat.
   Colours, radii and shadows live in the tokens below; other stylesheets reuse them.
   Motion uses spring curves (CSS linear()) shared with app.js. */

:root {
  --bg: #060908;
  --fill: #101512;              /* cards, lists */
  --fill-hi: #171d19;           /* raised: sheets, hovered rows */
  --fill-2: rgba(130, 160, 140, .14);   /* controls: chips, search, segmented */
  --text: #eef3ef;
  --muted: rgba(225, 238, 229, .62);
  --subtle: rgba(225, 238, 229, .36);
  --hairline: rgba(140, 170, 150, .16);
  --edge: inset 0 0 0 .5px rgba(160, 200, 175, .10);   /* thin outline on dark cards */
  --glass-bg: rgba(22, 30, 25, .55);
  --accent: #30d158;
  --accent-soft: rgba(48, 209, 88, .14);
  --accent-ink: #04210d;   /* text on an accent fill */
  --r: 14px; --r-lg: 20px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --danger: #ff453a;
  --ok: #30d158;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --nav-h: 52px;
  --top: max(10px, env(safe-area-inset-top));

  /* Springs. Fallbacks first; real spring curves below where linear() exists. */
  --ease-smooth: cubic-bezier(.22, .9, .3, 1);
  --ease-bouncy: cubic-bezier(.3, 1.35, .5, 1);
  --ease-snappy: cubic-bezier(.25, .85, .3, 1);
  color-scheme: dark;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    /* response .5s, damping .9 */
    --ease-smooth: linear(0, 0.0145, 0.0496, 0.1011, 0.1601, 0.2269, 0.2935, 0.3601, 0.4273, 0.4892, 0.5495, 0.6034, 0.653, 0.6996, 0.7401, 0.7776, 0.8097, 0.839, 0.8637, 0.8853, 0.9047, 0.9208, 0.935, 0.9467, 0.9567, 0.9653, 0.9723, 0.9783, 0.9831, 0.9872, 0.9904, 0.993, 0.9952, 0.9968, 0.9981, 0.9991, 0.9999, 1.0004, 1.0008, 1.0011, 1.0013, 1.0013, 1.0014, 1.0014, 1.0013, 1.0013, 1.0012, 1.0011, 1);
    /* response .42s, damping .68 */
    --ease-bouncy: linear(0, 0.025, 0.0882, 0.1762, 0.2784, 0.386, 0.4927, 0.5938, 0.6862, 0.768, 0.8382, 0.8968, 0.9429, 0.9804, 1.0085, 1.0287, 1.042, 1.0498, 1.0532, 1.0532, 1.0507, 1.0466, 1.0414, 1.0358, 1.0302, 1.0246, 1.0194, 1.0147, 1.0106, 1.0071, 1.0043, 1.002, 1.0002, 0.999, 0.9981, 0.9975, 0.9972, 0.9971, 0.9972, 0.9974, 0.9976, 0.9979, 0.9982, 0.9985, 0.9988, 0.9991, 0.9993, 0.9995, 1);
    /* response .32s, damping .85 */
    --ease-snappy: linear(0, 0.0199, 0.0663, 0.1302, 0.2083, 0.2876, 0.3677, 0.4495, 0.5232, 0.5915, 0.6538, 0.7123, 0.7614, 0.8043, 0.8431, 0.8746, 0.9012, 0.9234, 0.9427, 0.9576, 0.9696, 0.9796, 0.9871, 0.9928, 0.9973, 1.0005, 1.0027, 1.0042, 1.0052, 1.0057, 1.0058, 1.0057, 1.0055, 1.0051, 1.0047, 1.0042, 1.0037, 1.0033, 1.0028, 1.0024, 1.0021, 1.0017, 1.0014, 1.0012, 1.0009, 1.0008, 1.0006, 1.0005, 1);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--font);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 420px at 15% -120px, rgba(48, 209, 88, .09), transparent 70%),
    radial-gradient(700px 380px at 100% -80px, rgba(40, 160, 140, .06), transparent 70%);
}
::selection { background: rgba(48, 209, 88, .35); }
:focus-visible { outline: 2px solid rgba(48, 209, 88, .7); outline-offset: 2px; }
* { scrollbar-color: rgba(160, 190, 170, .25) transparent; }
button { font: inherit; color: inherit; }
a.btn { color: inherit; text-decoration: none; }

.icon {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---------- glass ---------- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 .5px 0 rgba(255, 255, 255, .18), inset 0 0 0 .5px rgba(255, 255, 255, .08);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(36, 36, 40, .96); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border: 0; border-radius: 999px;
  background: transparent; cursor: pointer;
  font-weight: 600; white-space: nowrap;
  transition: transform .45s var(--ease-bouncy), background .2s, opacity .2s;
}
.btn:active { transform: scale(.9); transition-duration: .12s; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px rgba(48, 209, 88, .22); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.wide { width: 100%; height: 50px; font-size: 17px; border-radius: var(--r); }
.btn.wide:active { transform: scale(.97); }
.btn.round { width: 40px; padding: 0; }
.btn.small { width: 28px; height: 28px; }
.btn.small .icon { width: 15px; height: 15px; }
.btn.round:hover { background: rgba(255, 255, 255, .08); }

/* ---------- login ---------- */
.login {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px 20px;
}
.login-form {
  width: 100%; max-width: 360px;
  display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  padding: 32px 24px 22px; border-radius: 26px;
  background: linear-gradient(180deg, rgba(23, 31, 26, .85), rgba(14, 19, 16, .85));
  box-shadow: var(--edge), var(--shadow);
}
.login-logo {
  width: 64px; height: 64px; padding: 14px; margin: 0 auto 4px; border-radius: 18px;
  fill: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 40px rgba(48, 209, 88, .25), inset 0 0 0 .5px rgba(48, 209, 88, .35);
}
.login-form h1 { margin: 0 0 10px; font-size: 28px; font-weight: 750; text-align: center; letter-spacing: -.03em; }
.inset-group { border-radius: var(--r); background: rgba(0, 0, 0, .28); box-shadow: var(--edge); overflow: hidden; }
.inset-group:focus-within { box-shadow: inset 0 0 0 1px rgba(48, 209, 88, .45); }
.inset-group input {
  display: block; width: 100%; height: 50px; padding: 0 16px;
  border: 0; outline: none; background: transparent;
  color: var(--text); font: inherit; font-size: 17px;
}
.inset-group input + input { border-top: .5px solid var(--hairline); }
.inset-group input::placeholder { color: var(--subtle); }
.login-error { color: var(--danger); font-size: 14px; text-align: center; }
.btn.login-tg { margin-top: 10px; background: #2aabee; color: #fff; }
.btn.login-tg:disabled { opacity: .6; }
.login-tg-wait { margin-top: 12px; color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- nav: transparent at top, glass once content scrolls under it ---------- */
.nav {
  position: fixed; z-index: 20;
  top: var(--top); left: 50%; transform: translateX(-50%);
  width: min(1576px, calc(100% - 20px));
  height: var(--nav-h);
  border-radius: 999px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 6px 0 18px;
  transition: background .35s ease, box-shadow .35s ease, -webkit-backdrop-filter .35s, backdrop-filter .35s;
}
.nav.scrolled {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 .5px 0 rgba(255, 255, 255, .18), inset 0 0 0 .5px rgba(255, 255, 255, .08);
}
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 7px; transition: opacity .25s; letter-spacing: -.01em; }
.brand-logo { width: 22px; height: 22px; fill: var(--accent); filter: drop-shadow(0 0 8px rgba(48, 209, 88, .45)); }
.demo-chip { font-size: 11px; font-weight: 500; color: var(--subtle); }
.nav-title {
  position: absolute; left: 50%; top: 50%;
  translate: -50% -50%;
  font-weight: 600; font-size: 17px;
  opacity: 0; scale: .96;
  transition: opacity .25s ease, scale .45s var(--ease-smooth);
  pointer-events: none;
}
.nav.titled .nav-title { opacity: 1; scale: 1; }
@media (min-width: 721px) { .nav-title { display: none; } }   /* desktop has the segmented control there */
.actions { display: flex; gap: 4px; margin-left: auto; }
.actions .glass:hover { background: rgba(60, 60, 66, .6); }

/* Sliding thumb shared by the segmented control and the tab bar.
   `translate` moves it with a spring; `scale` stretches it like liquid while moving. */
.thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 .5px 0 rgba(255, 255, 255, .22);
  transition: translate .55s var(--ease-bouncy), opacity .25s ease, scale .35s var(--ease-smooth);
}
.seg:not(.static) > .thumb { width: calc(25% - 1.5px); }
[data-active="files"] > .thumb, [data-active="crop"] > .thumb { translate: 100% 0; }
[data-active="notes"] > .thumb { translate: 200% 0; }
[data-active="settings"] > .thumb { translate: 300% 0; }
[data-active="trash"] > .thumb { opacity: 0; scale: .7; }
.thumb.stretch { animation: stretch .45s ease; }
@keyframes stretch {
  35% { scale: 1.16 .9; }
  70% { scale: .97 1.03; }
}

.seg {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: grid; grid-template-columns: repeat(4, 1fr);
  width: 384px; height: 36px; padding: 3px;
  border-radius: 999px;
  background: var(--fill-2);
}
.seg .tab {
  position: relative; z-index: 1;
  border: 0; background: transparent; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--muted);
  transition: color .25s;
}
.seg .tab:hover { color: var(--text); }
.seg .tab.active { color: var(--text); }
.seg.static { position: relative; left: auto; transform: none; grid-template-columns: 1fr 1fr; width: 220px; }
#trash-btn.active { color: var(--accent); }

.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.btn.link { height: auto; padding: 4px 0; color: var(--accent); font-weight: 500; font-size: 17px; }
.btn.link:active { opacity: .5; transform: none; }
.btn.link.small-text { font-size: 15px; }
#head-action { font-size: 15px; white-space: nowrap; }

/* ---------- page header ---------- */
.page-head {
  max-width: 1600px; margin: 0 auto;
  padding: calc(var(--nav-h) + var(--top) + 22px) 24px 10px;
}
.large-title {
  margin: 0; font-size: 34px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1;
  transform-origin: left center;
}
.summary { color: var(--subtle); font-size: 13px; margin-top: 4px; min-height: 18px; }
.summary.warn { color: var(--danger); }
.search {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  height: 38px; padding: 0 12px; border-radius: 12px;
  background: var(--fill-2); color: var(--subtle); cursor: text;
  transition: box-shadow .2s, background .2s;
  max-width: 420px;
}
.search .icon { width: 17px; height: 17px; }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent;
  color: var(--text); font: inherit; font-size: 17px;   /* under 16px iOS zooms the page on focus */
}
.search input::placeholder { color: var(--subtle); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); cursor: pointer; }
.search:focus-within { background: var(--fill); box-shadow: 0 0 0 1.5px rgba(48, 209, 88, .6), 0 0 0 5px rgba(48, 209, 88, .12); }
.search-key {
  font: 600 11px var(--mono); color: var(--subtle);
  border: .5px solid rgba(255, 255, 255, .2); border-radius: 5px; padding: 1px 6px;
}
.search:focus-within .search-key { display: none; }
@media (pointer: coarse) { .search-key { display: none; } }
.content { padding: 0 24px 120px; max-width: 1600px; margin: 0 auto; }

/* ---------- photo groups ---------- */
.month-block { position: relative; }
.month {
  position: sticky; z-index: 6;
  top: calc(var(--nav-h) + var(--top) + 8px);
  display: flex; padding: 14px 0 8px;
  pointer-events: none;
}
.month-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
}
.month-chip .count { font-weight: 400; color: var(--subtle); }

.grid {
  display: grid; gap: 2px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.tile {
  position: relative; aspect-ratio: 1; padding: 0; border: 0;
  overflow: hidden; cursor: pointer;
  background: var(--fill);
  transition: transform .5s var(--ease-bouncy), opacity .2s;
}
.tile:active { transform: scale(.95); transition-duration: .15s; }
.tile.lifted { opacity: 0; transition: none; }  /* its photo is open in the viewer */
.tile img, .tile video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity .35s ease;
}
.tile img.loaded, .tile video { opacity: 1; }
.tile .badge {
  position: absolute; right: 6px; bottom: 5px;
  display: flex; align-items: center;
  color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}
.tile .badge .icon { width: 14px; height: 14px; fill: #fff; stroke: none; }
.tile .placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px;
  color: var(--subtle); font-size: 11px; font-weight: 600; letter-spacing: .04em;
}
.tile .placeholder .icon { width: 26px; height: 26px; stroke-width: 1.4; }

/* ---------- file list ---------- */
.files { border-radius: var(--r); overflow: hidden; background: var(--fill); box-shadow: var(--edge); }
.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 6px 10px 14px; cursor: pointer;
  position: relative;
  transition: background .2s;
}
.file-row + .file-row::before {
  content: ""; position: absolute; top: 0; left: 62px; right: 0;
  border-top: .5px solid var(--hairline);
}
.file-row:active { background: rgba(255, 255, 255, .06); transition-duration: 0s; }
.file-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--fill-2);
  font-family: var(--mono); font-size: 9.5px; font-weight: 600; color: var(--muted);
  text-transform: lowercase;
}
.file-main { min-width: 0; flex: 1; }
.file-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { color: var(--subtle); font-size: 12px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.file-row .btn { width: 36px; height: 36px; color: var(--subtle); }
.file-row .btn:hover { color: var(--text); }
.file-size::after { content: " · "; }

/* Mouse: rows and tiles answer the pointer. */
@media (hover: hover) and (pointer: fine) {
  .file-row:hover, .note-row:hover { background: rgba(255, 255, 255, .045); }
  .tile:hover img { filter: brightness(1.08); }
  .tile img { transition: opacity .35s ease, filter .2s; }
}

/* Wide screens: size and date get their own columns instead of one grey line. */
@media (min-width: 900px) {
  .file-main { display: flex; align-items: center; gap: 24px; }
  .file-name { flex: 1; min-width: 0; }
  .file-meta { display: flex; gap: 24px; margin: 0; flex-shrink: 0; font-size: 13px; }
  .file-size { width: 80px; text-align: right; }
  .file-size::after { content: none; }
  .file-date { width: 210px; }
  .file-row { padding-top: 8px; padding-bottom: 8px; }
  .file-snippet { flex: 2; min-width: 0; margin: 0; -webkit-line-clamp: 1; }
}

.empty { text-align: center; color: var(--muted); padding: 100px 16px; }
.empty .icon { width: 44px; height: 44px; margin-bottom: 12px; stroke-width: 1.3; color: var(--subtle); }
.empty .hint { color: var(--subtle); font-size: 14px; margin-top: 4px; }
.loading { height: 40vh; }

/* ---------- dock (phone) ---------- */
.dock { display: none; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; overflow: hidden; touch-action: none; }
.lb-bg { position: absolute; inset: 0; background: #000; }
.lb-stage { position: absolute; inset: 0; }
.lb-frame { position: absolute; will-change: transform; transform-origin: 50% 50%; }
.lb-frame img, .lb-frame video {
  width: 100%; height: 100%; display: block;
  object-fit: contain;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
}
.lb-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 24px; text-align: center; }

.lb-chrome { transition: opacity .25s ease; }
.lightbox.bare .lb-chrome { opacity: 0; pointer-events: none; }
.lb-bar {
  position: absolute; z-index: 2;
  top: var(--top); left: 12px; right: 12px;
  display: flex; align-items: center; gap: 10px;
}
.lb-info { min-width: 0; max-width: min(460px, 60%); padding: 7px 16px; border-radius: 999px; }
.lb-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.lb-actions { margin-left: auto; display: flex; padding: 3px; border-radius: 999px; }
.lb-bar .glass { background: rgba(20, 20, 24, .55); }
.lb-nav {
  position: absolute; z-index: 2; top: 50%; margin-top: -22px;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  color: #fff; cursor: pointer; display: grid; place-items: center;
  background: rgba(20, 20, 24, .55);
  transition: transform .45s var(--ease-bouncy), opacity .2s;
}
.lb-nav:active { transform: scale(.88); transition-duration: .12s; }
.lb-nav.prev { left: 16px; }
.lb-nav.next { right: 16px; }
.lb-nav:disabled { opacity: 0; pointer-events: none; }

/* ---------- uploads ---------- */
.uploads {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  width: min(340px, calc(100vw - 32px));
  border-radius: 20px; overflow: hidden;
}
.uploads-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 8px 8px 16px; font-weight: 600; font-size: 14px;
}
.uploads-list { max-height: 240px; overflow-y: auto; }
.up-row { padding: 8px 16px 10px; font-size: 13px; border-top: .5px solid rgba(255, 255, 255, .08); }
.up-top { display: flex; justify-content: space-between; gap: 8px; }
.up-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-status { color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.up-status.ok { color: var(--ok); }
.up-status.err { color: var(--danger); }
.up-bar { height: 3px; background: rgba(255, 255, 255, .1); border-radius: 2px; margin-top: 7px; overflow: hidden; }
.up-bar > div { height: 100%; width: 0; background: var(--accent); border-radius: 2px; transition: width .4s var(--ease-smooth); }

/* ---------- alert ---------- */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .4); display: grid; place-items: center; padding: 16px; }
.alert { width: min(270px, 100%); border-radius: 16px; overflow: hidden; text-align: center; background: rgba(40, 40, 44, .75); }
.alert-title { font-weight: 600; font-size: 17px; padding: 19px 16px 2px; }
.alert-text { font-size: 13px; color: var(--muted); padding: 2px 16px 18px; word-break: break-word; }
.alert-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: .5px solid rgba(255, 255, 255, .14); }
.alert-actions button { height: 44px; border: 0; background: transparent; cursor: pointer; font-size: 17px; color: var(--accent); }
.alert-actions button + button { border-left: .5px solid rgba(255, 255, 255, .14); }
.alert-actions button:active { background: rgba(255, 255, 255, .08); }
.alert-actions .destructive { color: var(--danger); font-weight: 600; }
.alert-actions .strong { font-weight: 600; }
.alert-field { padding: 0 16px 16px; }
.alert-field input {
  width: 100%; height: 36px; padding: 0 10px;
  border: .5px solid rgba(255, 255, 255, .16); border-radius: 8px; outline: none;
  background: rgba(0, 0, 0, .35); color: var(--text); font: inherit; font-size: 15px;
}

/* ---------- drop & toast ---------- */
.drop { position: fixed; inset: 0; z-index: 75; pointer-events: none; display: grid; place-items: center; background: rgba(0, 0, 0, .5); }
.drop-card { padding: 16px 26px; border-radius: 999px; font-size: 17px; font-weight: 600; }
.toast-action {
  border: 0; background: transparent; cursor: pointer; padding: 0 0 0 14px;
  color: var(--accent); font-weight: 600; font-size: 14px;
}
.toast {
  display: flex; align-items: center;
  position: fixed; z-index: 80;
  bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; translate: -50% 0;
  padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  max-width: calc(100vw - 32px);
}

/* ---------- phone ---------- */
@media (max-width: 720px) {
  :root { --nav-h: 48px; }
  .nav { width: calc(100% - 16px); padding: 0 4px 0 16px; }
  .seg:not(.static), .hide-sm, .lb-nav { display: none; }
  .seg.static { width: 190px; }
  .nav.titled .brand { opacity: 0; }
  /* The buttons fill the middle of a phone's bar: the small title takes the brand's place. */
  .nav-title {
    left: 16px; translate: 0 -50%; transform-origin: left center;
    max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .page-head { padding-left: 16px; padding-right: 16px; }
  .search { max-width: none; }
  /* The sort menu yields to "Выбрать" on a narrow screen instead of pushing it off the edge. */
  .title-row { min-width: 0; }
  .large-title { flex-shrink: 0; }
  .head-buttons { min-width: 0; gap: 10px; }
  /* Block, not the centred flex of .btn: otherwise the start of the text is cut, with no "…". */
  #head-action { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  #select-btn { flex-shrink: 0; }
  .content { padding: 0 0 140px; }
  .month { padding-left: 10px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .files { margin: 0 12px; }
  .uploads { right: 12px; left: 12px; width: auto; bottom: calc(96px + env(safe-area-inset-bottom)); }
  .lb-info { max-width: 52%; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }   /* above the tab bar */

  .dock {
    display: flex; align-items: center; gap: 10px;
    position: fixed; z-index: 20;
    left: 16px; right: 16px;
    bottom: max(14px, env(safe-area-inset-bottom));
  }
  .tabbar {
    position: relative;
    flex: 1; height: 62px; border-radius: 999px;
    display: grid; grid-template-columns: repeat(4, 1fr); padding: 4px;
  }
  .tabbar .thumb { top: 4px; bottom: 4px; left: 4px; width: calc(25% - 2px); background: rgba(255, 255, 255, .1); }
  .tabbar .tab {
    position: relative; z-index: 1;
    border: 0; background: transparent; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: 10px; font-weight: 600; color: var(--muted);
    transition: color .25s;
  }
  .tabbar .tab .icon { width: 24px; height: 24px; }
  .tabbar .tab.active { color: var(--accent); }
  .fab {
    width: 62px; height: 62px; border-radius: 50%; flex-shrink: 0; border: 0;
    display: grid; place-items: center; cursor: pointer;
    transition: transform .5s var(--ease-bouncy);
  }
  .fab:active { transform: scale(.88); transition-duration: .12s; }
  .fab .icon { width: 26px; height: 26px; stroke-width: 2.2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- tiles in the trash ---------- */
.days-left {
  position: absolute; left: 6px; bottom: 5px;
  font-size: 11px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}
.file-icon .icon { width: 18px; height: 18px; }

/* ---------- notes list ---------- */
.note-row { padding: 11px 16px; cursor: pointer; position: relative; transition: background .2s; }
.note-row + .note-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--hairline); }
.note-row:active { background: rgba(255, 255, 255, .06); transition-duration: 0s; }
.note-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-meta { display: flex; gap: 8px; font-size: 14px; margin-top: 1px; min-width: 0; }
.note-date { color: var(--muted); flex-shrink: 0; }
.note-preview { color: var(--subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- action sheet ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 65;
  background: rgba(0, 0, 0, .4);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 8px max(8px, env(safe-area-inset-bottom));
}
.sheet-wrap { width: min(420px, 100%); display: flex; flex-direction: column; gap: 8px; }
.sheet-panel { border-radius: var(--r); overflow: hidden; background: rgba(28, 36, 31, .82); box-shadow: var(--edge); }
.sheet-title { padding: 13px 16px; text-align: center; font-size: 13px; color: var(--muted); border-bottom: .5px solid rgba(255, 255, 255, .12); word-break: break-word; }
.sheet-actions { display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; }
.sheet-actions button {
  min-height: 56px; padding: 6px 16px; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 18px; color: var(--accent);
}
.sheet-actions button + button { border-top: .5px solid rgba(255, 255, 255, .12); }
.sheet-actions button:active { background: rgba(255, 255, 255, .08); }
.sheet-actions .destructive { color: var(--danger); }
.sheet-actions .hint { font-size: 12px; color: var(--subtle); margin-top: 1px; }
.sheet-cancel {
  height: 56px; border: 0; border-radius: 14px; cursor: pointer;
  font-size: 18px; font-weight: 600; color: var(--accent);
  background: rgba(40, 40, 44, .9);
}
.sheet-cancel:active { background: rgba(60, 60, 64, .9); }

/* ---------- photo editor ---------- */
.editor {
  position: fixed; inset: 0; z-index: 55; background: #000;
  display: flex; flex-direction: column;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.ed-bar, .doc-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: max(8px, env(safe-area-inset-top)) 8px 8px;
}
.ed-bar > :last-child, .doc-right { justify-self: end; }
.ed-title { font-size: 13px; color: var(--muted); max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-btn {
  border: 0; background: transparent; cursor: pointer;
  padding: 8px 10px; font-size: 17px; color: var(--accent);
  display: inline-flex; align-items: center; gap: 4px;
  transition: opacity .2s;
}
.doc-btn:active { opacity: .5; }
.doc-btn.strong { font-weight: 600; }
.doc-btn:disabled { color: var(--subtle); cursor: default; }
.doc-btn.icon-only .icon { width: 22px; height: 22px; }

.ed-stage { flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; min-height: 0; }
#ed-canvas { display: block; }
.ed-crop {
  position: absolute; cursor: move;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .6);
  outline: 1px solid rgba(255, 255, 255, .85);
  background:
    linear-gradient(rgba(255, 255, 255, .35), rgba(255, 255, 255, .35)) 33.33% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(255, 255, 255, .35), rgba(255, 255, 255, .35)) 66.66% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(255, 255, 255, .35), rgba(255, 255, 255, .35)) 0 33.33% / 100% 1px no-repeat,
    linear-gradient(rgba(255, 255, 255, .35), rgba(255, 255, 255, .35)) 0 66.66% / 100% 1px no-repeat;
  transition: box-shadow .25s ease;
}
.ed-crop.dragging { box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); }
.ed-crop .h { position: absolute; width: 30px; height: 30px; }
.ed-crop .h::before {
  content: ""; position: absolute; width: 20px; height: 20px;
  border: 0 solid #fff;
}
.ed-crop .nw { left: -8px; top: -8px; cursor: nwse-resize; }
.ed-crop .ne { right: -8px; top: -8px; cursor: nesw-resize; }
.ed-crop .sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.ed-crop .se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.ed-crop .nw::before { left: 5px; top: 5px; border-left-width: 3px; border-top-width: 3px; }
.ed-crop .ne::before { right: 5px; top: 5px; border-right-width: 3px; border-top-width: 3px; }
.ed-crop .sw::before { left: 5px; bottom: 5px; border-left-width: 3px; border-bottom-width: 3px; }
.ed-crop .se::before { right: 5px; bottom: 5px; border-right-width: 3px; border-bottom-width: 3px; }

.ed-tools { padding: 10px 16px max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.chips { display: flex; gap: 8px; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding: 2px; }
/* Centred when everything fits; when it doesn't, the first chip stays reachable by scrolling. */
.chips > :first-child { margin-left: auto; }
.chips > :last-child { margin-right: auto; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; border: 0; cursor: pointer;
  padding: 7px 13px; border-radius: 999px;
  background: var(--fill-2); color: var(--muted);
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .25s, color .25s, transform .4s var(--ease-bouncy);
}
.chip:active { transform: scale(.92); transition-duration: .1s; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 .5px rgba(48, 209, 88, .4); }
.chip-value { font-variant-numeric: tabular-nums; font-size: 12px; display: none; }
.chip.changed .chip-value, .chip.active .chip-value { display: inline; }
.chip.changed:not(.active) { color: var(--text); }

.slider { -webkit-appearance: none; appearance: none; width: min(520px, 100%); margin: 0 auto; display: block; height: 28px; background: transparent; }
.slider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,.5) 50%, rgba(255,255,255,.18)); }
.slider::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.slider::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; }
.ed-crop-actions { display: flex; justify-content: center; gap: 12px; }
.ed-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.ed-bottom .btn.link { justify-self: start; }

/* ---------- text editor & notes ---------- */
.doc {
  position: fixed; inset: 0; z-index: 56; background: #000;
  display: flex; flex-direction: column;
}
.doc-bar { border-bottom: .5px solid rgba(255, 255, 255, .08); }
.doc-mid { text-align: center; min-width: 0; max-width: 50vw; }
.doc-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-status { font-size: 12px; color: var(--subtle); min-height: 15px; }
.doc-right { display: flex; align-items: center; }
#doc-text {
  flex: 1; width: min(860px, 100%); margin: 0 auto;
  border: 0; outline: none; resize: none;
  background: transparent; color: var(--text);
  padding: 18px 20px max(30px, env(safe-area-inset-bottom));
  font: 17px/1.5 var(--font);
}
.doc-body { flex: 1; min-height: 0; position: relative; overflow: hidden; display: flex; }

/* Code: a transparent textarea over its highlighted copy. Both must share every metric. */
.code-bar {
  display: flex; align-items: center; gap: 4px; min-height: 38px;
  padding: 0 max(10px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  border-bottom: .5px solid rgba(255, 255, 255, .08);
  font-size: 12px; color: var(--subtle); white-space: nowrap; overflow-x: auto; scrollbar-width: none;
}
.code-bar::-webkit-scrollbar { display: none; }
.code-lang { font-weight: 600; color: var(--muted); }
.code-pos { font-variant-numeric: tabular-nums; margin-left: 8px; overflow: hidden; text-overflow: ellipsis; }
.code-tool {
  border: 0; background: transparent; color: var(--accent); cursor: pointer;
  font: 600 13px var(--font); height: 30px; min-width: 34px; padding: 0 9px; border-radius: 8px; flex-shrink: 0;
}
.code-tool:hover { background: rgba(255, 255, 255, .08); }
.code-tool.on { background: rgba(48, 209, 88, .2); }
.touch-only { display: none; }
@media (pointer: coarse) {
  .touch-only { display: inline-block; }
  .code-tool { height: 36px; min-width: 42px; }
}

.doc.code #doc-text, .doc.code .code-hl, .code-gutter {
  font-family: var(--mono); font-size: var(--code-size, 13.5px); line-height: 1.6;
  font-weight: 400; font-style: normal; letter-spacing: 0; font-variant-ligatures: none; tab-size: 4;
  margin: 0; border: 0;
  padding-top: 12px; padding-bottom: max(40px, env(safe-area-inset-bottom));
}
.doc.code #doc-text, .doc.code .code-hl {
  padding-left: calc(var(--gut, 0px) + 12px); padding-right: 16px;
  white-space: pre; overflow-wrap: normal; word-break: normal;
}
.doc.code.wrap #doc-text, .doc.code.wrap .code-hl { white-space: pre-wrap; overflow-wrap: break-word; padding-left: 14px; }
.doc.code #doc-text {
  width: 100%; max-width: none; position: relative; z-index: 2;
  color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--text);
  overflow: auto; overscroll-behavior: contain;
}
.doc.code #doc-text::selection { background: rgba(48, 209, 88, .38); }
.code-hl {
  position: absolute; top: 0; left: 0; min-width: 100%; z-index: 0;
  color: var(--text); pointer-events: none; will-change: transform;
}
.code-gutter {
  position: absolute; top: 0; left: 0; z-index: 1; width: var(--gut, 0px);
  padding-right: 8px; text-align: right; white-space: pre;
  color: rgba(255, 255, 255, .26); background: #000; pointer-events: none; user-select: none;
  border-right: .5px solid rgba(255, 255, 255, .07);
}
@media (max-width: 720px) {
  .doc.code #doc-text, .doc.code .code-hl { padding-right: 10px; }
}

/* ---------- find & replace ---------- */
.find-bar {
  display: flex; flex-direction: column; gap: 6px;
  padding: 6px max(10px, env(safe-area-inset-right)) 6px max(14px, env(safe-area-inset-left));
  border-bottom: .5px solid rgba(255, 255, 255, .08); background: #0b0b0d;
}
.find-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.find-row input {
  flex: 1; min-width: 0; height: 32px; padding: 0 10px; margin-right: 6px;
  border: 0; border-radius: 8px; outline: none;
  background: var(--fill-2); color: var(--text); font: 15px var(--font);
}
.find-row input.bad { box-shadow: inset 0 0 0 1px var(--danger); }
.find-count { font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; margin-right: 4px; white-space: nowrap; }
.find-hl { color: transparent; -webkit-text-fill-color: transparent; }
.find-hl mark { background: rgba(255, 214, 10, .28); color: transparent; border-radius: 2px; }
.find-hl mark.cur { background: rgba(255, 159, 10, .65); }
@media (pointer: coarse) {
  .find-row input { height: 38px; font-size: 16px; }   /* 16px: iOS doesn't zoom in */
  .find-bar .code-tool { min-width: 36px; padding: 0 6px; }
}

/* ---------- code runner ---------- */
.code-run {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  height: 30px; padding: 0 14px 0 11px; margin-right: 8px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ok); color: #000; font: 600 13px var(--font);
  transition: transform .4s var(--ease-bouncy), background .2s;
}
.code-run .icon { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.code-run:active { transform: scale(.92); transition-duration: .1s; }
.code-run.stop { background: var(--danger); color: #fff; }
@media (pointer: coarse) { .code-run { height: 36px; padding: 0 16px 0 13px; font-size: 14px; } }

.run-panel {
  flex: 0 0 var(--run-h, 40%); min-height: 0; position: relative;
  display: flex; flex-direction: column;
  background: #0b0b0d; border-top: .5px solid rgba(255, 255, 255, .14);
}
.doc.run-full .doc-body, .doc.run-full .code-bar { display: none; }
.doc.run-full .run-panel { flex: 1; }
.doc.resizing { user-select: none; cursor: ns-resize; }
.run-grip { position: absolute; top: -6px; left: 0; right: 0; height: 12px; cursor: ns-resize; z-index: 3; touch-action: none; }
.run-grip::after {
  content: ""; position: absolute; left: 50%; top: 4px; width: 36px; height: 4px; margin-left: -18px;
  border-radius: 2px; background: rgba(255, 255, 255, .22);
}
@media (pointer: coarse) { .run-grip { display: none; } }
.run-head {
  display: flex; align-items: center; gap: 4px; min-height: 38px; flex-shrink: 0;
  padding: 0 max(8px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  border-bottom: .5px solid rgba(255, 255, 255, .07);
}
.run-status { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; min-width: 0; }
.run-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-right: 6px; background: var(--subtle); }
.run-dot[data-state="busy"] { background: var(--accent); animation: run-pulse 1s ease-in-out infinite; }
.run-dot[data-state="ok"] { background: var(--ok); }
.run-dot[data-state="error"] { background: var(--danger); }
@keyframes run-pulse { 50% { opacity: .3; } }
.run-stdin {
  flex: 0 0 auto; height: 72px; resize: vertical; min-height: 40px; max-height: 40%;
  margin: 8px 10px 0; padding: 8px 10px; border-radius: 8px; outline: none;
  border: .5px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .05); color: var(--text);
  font: 13px/1.5 var(--mono);
}
@media (pointer: coarse) { .run-stdin { font-size: 16px; } }   /* no iOS zoom on focus */
.run-out {
  flex: 1; min-height: 0; margin: 0; overflow: auto; overscroll-behavior: contain;
  padding: 10px max(14px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-bottom));
  font: 13px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text);
  user-select: text; -webkit-user-select: text;
}
.run-err { color: #ff7a70; }
.run-info { color: var(--subtle); }

.sym-bar {
  flex-shrink: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 6px 8px max(6px, env(safe-area-inset-bottom)); background: #1c1c1f;
  border-top: .5px solid rgba(255, 255, 255, .1);
}
.sym-bar::-webkit-scrollbar { display: none; }
.sym {
  flex-shrink: 0; min-width: 38px; height: 38px; padding: 0 8px; border: 0; border-radius: 8px;
  background: rgba(255, 255, 255, .1); color: var(--text); font: 500 17px var(--mono); cursor: pointer;
}
.sym:active { background: rgba(255, 255, 255, .25); }

/* Code highlighting (highlight.js classes), dark. Colours only: bold or italic glyphs could shift the caret. */
.code-hl .hljs-keyword, .code-hl .hljs-selector-tag, .code-hl .hljs-literal, .code-hl .hljs-meta .hljs-keyword { color: #fc5fa3; }
.code-hl .hljs-string, .code-hl .hljs-meta .hljs-string, .code-hl .hljs-regexp, .code-hl .hljs-char { color: #fc6a5d; }
.code-hl .hljs-number, .code-hl .hljs-symbol { color: #d0bf69; }
.code-hl .hljs-comment, .code-hl .hljs-quote, .code-hl .hljs-doctag { color: #7f8c98; }
.code-hl .hljs-type, .code-hl .hljs-built_in, .code-hl .hljs-title.class_, .code-hl .hljs-tag, .code-hl .hljs-name,
.code-hl .hljs-selector-id { color: #5dd8ff; }
.code-hl .hljs-title, .code-hl .hljs-title.function_, .code-hl .hljs-section { color: #67b7a4; }
.code-hl .hljs-attr, .code-hl .hljs-attribute, .code-hl .hljs-property, .code-hl .hljs-selector-class,
.code-hl .hljs-selector-attr, .code-hl .hljs-selector-pseudo, .code-hl .hljs-variable.language_ { color: #a167e6; }
.code-hl .hljs-meta, .code-hl .hljs-template-variable, .code-hl .hljs-subst, .code-hl .hljs-escape { color: #fd8f3f; }
.code-hl .hljs-bullet, .code-hl .hljs-link { color: #5dd8ff; }
.code-hl .hljs-emphasis, .code-hl .hljs-strong { color: #fff; }
.code-hl .hljs-addition { color: #67d26f; background: rgba(48, 209, 88, .15); }
.code-hl .hljs-deletion { color: #ff7a70; background: rgba(255, 69, 58, .15); }

/* ---------- selecting several ---------- */
.head-buttons { display: flex; align-items: baseline; gap: 14px; }
.btn.pill {
  height: 30px; padding: 0 14px; font-size: 14px;
  background: var(--fill-2); color: var(--text);
}
.selecting .btn.pill { background: var(--accent); color: var(--accent-ink); }
.selecting .large-title { font-size: 26px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#select-btn { align-self: center; }

.check {
  position: absolute; right: 6px; bottom: 6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  display: none; place-items: center;
  border: 1.5px solid rgba(255, 255, 255, .9);
  background: rgba(0, 0, 0, .25);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.check .icon { width: 14px; height: 14px; stroke-width: 3; opacity: 0; color: #fff; }
.selecting .check { display: grid; }
.selected .check { background: var(--accent); border-color: #fff; }
.selected .check .icon { opacity: 1; }
.selecting .tile .badge { right: auto; left: 6px; }
.tile.selected::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: rgba(255, 255, 255, .22);
}
.selecting .tile, .selecting .file-row { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.tile img { -webkit-touch-callout: none; }
.file-row .check { position: static; flex-shrink: 0; }
.file-row.selected { background: rgba(48, 209, 88, .12); }
.selecting .file-row .btn { display: none; }

.selbar {
  position: fixed; z-index: 30; left: 50%; translate: -50% 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; gap: 4px; padding: 6px; border-radius: 999px;
}
.sel-btn {
  border: 0; background: transparent; cursor: pointer;
  min-width: 92px; height: 50px; padding: 0 16px; border-radius: 999px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: var(--accent);
  transition: background .2s, opacity .2s, transform .4s var(--ease-bouncy);
}
.sel-btn:active { transform: scale(.92); transition-duration: .1s; }
.sel-btn:hover { background: rgba(255, 255, 255, .08); }
.sel-btn.danger { color: var(--danger); }
.sel-btn:disabled { opacity: .35; pointer-events: none; }
.dock.away { pointer-events: none; }

/* ---------- own folders ---------- */
.folders {
  display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none;
  padding-bottom: 2px;
}
.folders::-webkit-scrollbar { display: none; }
.folder-chip {
  flex-shrink: 0; border: 0; cursor: pointer; white-space: nowrap;
  padding: 5px 12px; border-radius: 999px; font-size: 14px;
  background: var(--fill-2); color: var(--muted);
  transition: background .2s, color .2s;
}
.folder-chip.own::before { content: "▸ "; color: var(--subtle); }
.folder-chip.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 .5px rgba(48, 209, 88, .4); }
.folder-chip.active.own::before { content: "⋯ "; color: rgba(48, 209, 88, .6); }
.folder-chip.add { padding: 5px 13px; font-weight: 600; }
/* Files: the path of the open folder ("Файлы › Работа") and folder rows in the list. */
.crumb-sep { flex-shrink: 0; align-self: center; color: var(--subtle); font-size: 15px; }
.folder-chip.crumb.own:not(.active)::before { content: none; }
.folder-icon { background: rgba(48, 209, 88, .16); color: #5aaeff; }
.folder-icon .icon { width: 20px; height: 20px; }
.folder-rows { margin-top: 12px; margin-bottom: 6px; }
.folder-row .file-size:has(+ .file-date:empty)::after { content: none; }
.selecting .folder-row { opacity: .4; }

/* A match inside a file, under its name. */
.file-snippet {
  color: var(--muted); font-size: 12.5px; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.login-lang { margin-top: 14px; color: var(--subtle); font-size: 14px; }

/* ---------- audio player ---------- */
.player {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 45;
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(440px, calc(100vw - 24px)); border-radius: 20px; padding: 8px 8px 12px 16px;
}
.player-head { display: flex; align-items: center; gap: 4px; }
.player-info { flex: 1; min-width: 0; }
.player-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-meta { color: var(--subtle); font-size: 12px; }
.player audio { width: calc(100% - 8px); margin-top: 6px; height: 36px; }

/* ---------- rendered Markdown ---------- */
.md-view {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  width: min(820px, 100%); margin: 0 auto; padding: 18px 20px calc(40px + env(safe-area-inset-bottom));
  font-size: 16px; line-height: 1.6; overflow-wrap: anywhere;
}
.md-view h1, .md-view h2, .md-view h3, .md-view h4, .md-view h5, .md-view h6 { line-height: 1.25; margin: 1.3em 0 .5em; }
.md-view h1 { font-size: 28px; } .md-view h2 { font-size: 22px; } .md-view h3 { font-size: 18px; }
.md-view > :first-child { margin-top: 0; }
.md-view a { color: var(--accent); }
.md-view code { font: 14px var(--mono); background: var(--fill-2); padding: 1px 5px; border-radius: 5px; }
.md-view pre { background: var(--fill); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.md-view pre code { background: none; padding: 0; font-size: 13.5px; }
.md-view blockquote { margin: 0; padding: 2px 14px; border-left: 3px solid var(--hairline); color: var(--muted); }
.md-view hr { border: 0; border-top: .5px solid var(--hairline); margin: 24px 0; }
.md-view ul, .md-view ol { padding-left: 24px; }
.md-view li.task { list-style: none; margin-left: -22px; }
.md-view li.task input { margin: 0 8px 0 0; vertical-align: -2px; }
.md-view table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 14px; }
.md-view th, .md-view td { border: .5px solid var(--hairline); padding: 6px 10px; }
.md-view th { background: var(--fill); }
.md-view .align-center { text-align: center; } .md-view .align-right { text-align: right; }

/* ---------- iPhone: top edge and bottom bar ---------- */
/* Safari tints the status-bar area with the colour of a fixed bar at the top edge. Without
   this strip it took the nav's dark glass and smeared it over the top of the screen; a
   page-coloured strip there also keeps scrolled content from showing under the clock.
   Home-screen app: status bar style is "black" (solid), not "black-translucent" — with the
   translucent bar iOS laid its dark tint over the top of the page. */
.top-edge {
  position: fixed; z-index: 19; top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top); background: var(--bg); pointer-events: none;
}
/* A page shorter than the screen bounces as a whole on iOS, fixed bars included (Files and
   Notes with few items; Photos is long enough to scroll normally). */
#app { min-height: 100vh; min-height: 100dvh; }
@media (display-mode: standalone) {
  html, body { overscroll-behavior: none; }
}
/* Phone: links, language and logout move into "⋯", so the nav title has room. */
#more-btn { display: none; }
@media (max-width: 720px) {
  #links-btn, #devices-btn, #lang-btn, #logout-btn { display: none; }
  #more-btn { display: inline-flex; }
}

/* «Повторы» in Photos (dupes.js): each group side by side, ticked = stays. */
.folder-chip.dupes-chip:not(.active) { color: var(--accent); }
.dupe-note { color: var(--subtle); font-size: 13px; margin: 6px 0 2px; }
.dupe-group { padding: 14px 0 16px; border-bottom: .5px solid var(--fill-2); }
.dupe-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.dupe-match { font-weight: 600; font-size: 15px; }
.dupe-match.similar { color: #ffd60a; }
.dupe-hint { color: var(--subtle); font-size: 12px; }
.dupe-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.dupe-row::-webkit-scrollbar { display: none; }
.dupe-item { margin: 0; flex: 0 0 auto; width: min(42vw, 190px); }
.dupe-item .tile { width: 100%; border-radius: 10px; }
.dupe-tile .check { display: grid; }
.dupe-tile.dupe-keep .check { background: var(--accent); border-color: #fff; }
.dupe-tile.dupe-keep .check .icon { opacity: 1; }
.dupe-tile.dupe-keep { box-shadow: 0 0 0 2px var(--accent); }
.dupe-tile.dupe-drop img, .dupe-tile.dupe-drop .placeholder { opacity: .45; }
.dupe-item figcaption { padding: 6px 2px 0; font-size: 12px; line-height: 1.35; }
.dupe-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dupe-info { color: var(--subtle); font-variant-numeric: tabular-nums; }
.dupe-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dupe-actions .btn { height: 34px; padding: 0 14px; font-size: 14px; background: var(--fill-2); color: var(--text); }
.dupe-actions .btn.strong { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 720px) {
  /* The content has no side padding on a phone (the photo grid goes edge to edge). */
  .dupe-group, .dupe-note { margin: 0 14px; }
  .dupe-item { width: calc(50vw - 24px); }
}

/* ---------- Photos: views, filters, albums, year rail (photos.js) ---------- */
.chip-sep { flex-shrink: 0; width: 1px; margin: 4px 2px; background: var(--fill-2); }
.folder-chip.filter.active { background: var(--accent); color: var(--accent-ink); }

.albums {
  display: grid; gap: 18px 14px; padding: 6px 0 20px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.album-card {
  display: flex; flex-direction: column; gap: 2px; padding: 0; border: 0; background: none;
  color: inherit; text-align: left; cursor: pointer; min-width: 0;
  transition: transform .45s var(--ease-bouncy);
}
.album-card:active { transform: scale(.96); transition-duration: .12s; }
.album-cover {
  aspect-ratio: 1; border-radius: 12px; overflow: hidden; margin-bottom: 6px;
  display: grid; place-items: center; background: var(--fill); color: var(--subtle);
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.album-cover img.loaded { opacity: 1; }
.album-card.new .album-cover { background: var(--fill-2); }
.album-plus { font-size: 44px; font-weight: 300; color: var(--muted); }
.album-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-count { font-size: 12px; color: var(--subtle); }

.year-rail {
  position: fixed; right: 8px; top: 50%; transform: translateY(-50%); z-index: 30;
  display: flex; flex-direction: column; gap: 1px; padding: 6px 4px; border-radius: 999px;
  max-height: calc(100vh - 220px); overflow-y: auto; scrollbar-width: none;
}
.year-rail::-webkit-scrollbar { display: none; }
.year-rail button {
  border: 0; background: none; cursor: pointer; padding: 3px 6px; border-radius: 999px;
  font: 600 11px var(--mono, inherit); color: var(--subtle); font-variant-numeric: tabular-nums;
}
.year-rail button:hover { color: var(--text); }
.year-rail button.active { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 720px) {
  .albums { grid-template-columns: repeat(2, 1fr); margin: 0 14px; }
  .year-rail { right: 3px; padding: 4px 2px; top: 52%; }
  .year-rail button { padding: 3px 4px; font-size: 10px; }
}

/* ♥ favourites (photos.js) */
.tile .fav-badge {
  position: absolute; left: 6px; bottom: 4px; z-index: 1; pointer-events: none;
  color: #fff; font-size: 14px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7));
}
.selecting .tile .fav-badge { display: none; }
#lb-fav.on .icon { fill: #ff375f; stroke: #ff375f; }
@media (max-width: 720px) {
  /* Room for the title on a phone: edit and details are also in "⋯". */
  #lb-edit, #lb-info { display: none; }
}

/* The square tile shown while the viewer's photo loads covers the frame instead of letterboxing. */
.lb-frame img.ph { object-fit: cover; }
/* Months far off screen are not laid out or painted until they come near: a timeline of
   thousands of photos opens and scrolls like a short one. `auto` remembers the real height. */
.month-block { content-visibility: auto; contain-intrinsic-size: auto 900px; }

/* ---------- «Настройки»: grouped rows like iOS Settings ---------- */
.back-link { font-size: 15px; margin: 0 0 2px -2px; }
.settings { max-width: 760px; padding: 4px 0 40px; display: grid; gap: 26px; }
.set-group { display: grid; gap: 8px; }
.set-title { margin: 0 0 0 16px; font-size: 12px; font-weight: 600; color: var(--subtle); text-transform: uppercase; letter-spacing: .08em; }
.set-footer { margin: 0 16px; font-size: 13px; color: var(--subtle); }
.set-list { background: var(--fill); border-radius: var(--r); overflow: hidden; box-shadow: var(--edge); }
.set-row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 52px; padding: 9px 16px; position: relative;
  border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; text-decoration: none;
  cursor: pointer; transition: background .2s;
}
.set-row + .set-row::before { content: ''; position: absolute; top: 0; right: 0; left: 60px; border-top: .5px solid var(--hairline); }
.set-row:hover { background: rgba(255, 255, 255, .04); }
.set-row:active { background: rgba(255, 255, 255, .08); transition-duration: 0s; }
.set-row.destructive { justify-content: center; color: var(--danger); font-weight: 500; }
.set-row.destructive .set-icon { display: none; }
.set-row.destructive .set-text { flex: 0 1 auto; }
.set-icon { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; color: #fff; }
.set-icon .icon { width: 18px; height: 18px; stroke-width: 2; }
.c-gray { background: #8e8e93; } .c-blue { background: #0a84ff; } .c-green { background: #30d158; } .c-teal { background: #40c8e0; }
.c-orange { background: #ff9f0a; } .c-red { background: #ff453a; } .c-pink { background: #ff375f; } .c-purple { background: #bf5af2; } .c-indigo { background: #5e5ce6; }
.set-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.set-label { font-size: 16px; }
.set-hint { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-value { font-size: 15px; color: var(--muted); flex-shrink: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-chev { font-size: 22px; line-height: 1; color: var(--subtle); margin-left: -4px; }
.store-card { padding: 16px; display: grid; gap: 12px; cursor: default; }
.store-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.store-used { font-size: 17px; font-weight: 600; }
.store-ours { font-size: 14px; color: var(--muted); }
.store-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: rgba(118, 118, 128, .24); gap: 1.5px; }
.store-seg { height: 100%; transition: width .6s var(--ease-smooth); }
.store-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.store-key { display: inline-flex; align-items: center; gap: 6px; }
.store-key i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.s-photos { background: #30d158; } .s-files { background: #0a84ff; } .s-notes { background: #ffd60a; } .s-trash { background: #8e8e93; } .s-other { background: #48484a; }
@media (max-width: 720px) {
  .settings { padding: 0 16px 40px; gap: 22px; }
}

/* A long press on iPhone must open our menu, not select the whole page or show iOS's own
   callout. Text people type or read stays selectable. */
#app .content, #app .page-head, .nav, .dock, .selbar, #sheet { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#app input, #app textarea, #app [contenteditable], #app .note-text, #app .md-body, #app pre { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* ---------- menus: one look everywhere, the same as «Компьютер» (finder.css .fd-menu) ---------- */
.menu-shade { position: fixed; inset: 0; z-index: 90; }
.menu {
  position: fixed; z-index: 91; display: flex; flex-direction: column;
  padding: 5px; border-radius: 12px; background: rgba(40, 40, 44, .86);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55), inset 0 .5px 0 rgba(255, 255, 255, .18);
  overflow-y: auto; -webkit-user-select: none; user-select: none;
}
.menu-pop { min-width: 230px; max-width: 340px; max-height: calc(100vh - 16px); }
.menu-item {
  display: grid; gap: 1px; width: 100%; padding: 6px 12px; border: 0; border-radius: 7px; background: none;
  color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--accent); color: var(--accent-ink); outline: none; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover, .menu-item.danger:focus-visible { background: var(--danger); color: #fff; }
.menu-hint { font-size: 12px; color: var(--muted); white-space: normal; }
.menu-item:hover .menu-hint, .menu-item:focus-visible .menu-hint { color: inherit; opacity: .75; }
.menu-title { padding: 6px 12px 5px; font-size: 12px; font-weight: 600; color: var(--subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom: .5px solid var(--hairline); margin-bottom: 4px; }
.menu-sheet {
  left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
  max-height: 78vh; padding: 6px; border-radius: 20px;
}
.menu-sheet .menu-item { padding: 13px 14px; font-size: 17px; border-radius: 12px; }
.menu-sheet .menu-item:hover { background: none; color: var(--text); }
.menu-sheet .menu-item.danger:hover { color: var(--danger); }
.menu-sheet .menu-item:active { background: rgba(255, 255, 255, .1); }
.menu-sheet .menu-hint { font-size: 13px; }
.menu-sheet .menu-title { text-align: center; font-size: 13px; padding: 10px 14px 9px; white-space: normal; }
.menu-sheet .menu-cancel { margin-top: 6px; text-align: center; font-weight: 600; background: rgba(255, 255, 255, .08); }
.menu-shade:has(+ .menu-sheet) { background: rgba(0, 0, 0, .4); animation: menu-dim .2s ease; }
@keyframes menu-dim { from { opacity: 0; } }

/* ---------- zoom of the photo grid (photos.js ZOOMS) ---------- */
.content[data-zoom="0"] .grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 3px; }
.content[data-zoom="2"] .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.content[data-zoom="3"] .grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 1px; }
.content[data-zoom="4"] .grid { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 1px; }
.content[data-zoom="3"] .tile .badge, .content[data-zoom="4"] .tile .badge,
.content[data-zoom="3"] .fav-badge, .content[data-zoom="4"] .fav-badge { display: none; }
.content[data-zoom="3"] .tile:active, .content[data-zoom="4"] .tile:active { transform: none; }
.month.year-head .month-chip { font-size: 22px; font-weight: 700; padding: 2px 4px; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.zoom-box { display: inline-flex; gap: 4px; margin-left: auto; padding-left: 8px; }
.zoom-btn { min-width: 34px; font-size: 17px; font-weight: 600; padding: 0 10px; }
.zoom-btn:disabled { opacity: .35; cursor: default; }
@media (max-width: 720px) {
  .content[data-zoom="0"] .grid { grid-template-columns: repeat(2, 1fr); }
  .content[data-zoom="2"] .grid { grid-template-columns: repeat(5, 1fr); }
  .content[data-zoom="3"] .grid { grid-template-columns: repeat(7, 1fr); }
  .content[data-zoom="4"] .grid { grid-template-columns: repeat(11, 1fr); }
  .zoom-box { display: none; }   /* pinch with two fingers instead */
  .month.year-head { padding-left: 14px; }
}
/* Days side by side; each .day-block gets its width from photos.js dayGeometry(). */
.content.days { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 2px; }
.content.days > :not(.day-block) { flex-basis: 100%; }
.day-block { max-width: 100%; }
.day-block .month { padding-left: 2px; }
.day-block .month-chip { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 4px 2px; white-space: nowrap; }
.day-block .month-chip .count { display: none; }
@media (max-width: 720px) { .content.days { padding: 0 0 140px; } .day-block .month { padding-left: 6px; } }
.period-head { flex-basis: 100%; margin: 22px 4px 4px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.period-head:first-child { margin-top: 6px; }
@media (max-width: 720px) { .period-head { margin: 20px 14px 2px; font-size: 20px; } }
/* ---------- memories ---------- */
.memories-block { flex-basis: 100%; margin-bottom: 8px; }
.memories { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 4px; scrollbar-width: none; }
.memories::-webkit-scrollbar { display: none; }
.memory {
  position: relative; flex: 0 0 auto; width: 168px; aspect-ratio: 3 / 4; border: 0; padding: 0; border-radius: 16px; overflow: hidden;
  cursor: pointer; background: var(--fill); color: #fff; text-align: left; transition: transform .45s var(--ease-bouncy);
}
.memory:active { transform: scale(.96); transition-duration: .12s; }
.memory img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.memory img.loaded { opacity: 1; }
.memory-text { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 2px; padding: 30px 12px 11px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); font-size: 12px; }
.memory-text b { font-size: 17px; }
@media (max-width: 720px) { .memories { padding: 6px 14px 4px; } .memory { width: 132px; } }

/* ---------- map of the photos (map.js) ---------- */
.map { position: relative; height: calc(100vh - 260px); min-height: 360px; border-radius: 18px; overflow: hidden; background: #1b1b1d; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
.map.dragging { cursor: grabbing; }
.map-tiles, .map-pins { position: absolute; inset: 0; }
.map-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; pointer-events: none; }
/* OpenStreetMap's light map turned dark to match the site. */
.map-tiles { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
.map-pin {
  position: absolute; left: 0; top: 0; width: 52px; height: 52px; padding: 0; border: 2.5px solid #fff; border-radius: 12px;
  overflow: visible; background: var(--fill); cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
}
.map-pin img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; display: block; }
.map-pin:hover { z-index: 2; }
.map-count { position: absolute; top: -9px; right: -9px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.map-zoom { position: absolute; right: 12px; bottom: 12px; display: grid; border-radius: 12px; overflow: hidden; }
.map-zoom button { width: 40px; height: 40px; border: 0; background: transparent; color: var(--text); font-size: 20px; cursor: pointer; }
.map-zoom button + button { border-top: .5px solid var(--hairline); }
.map-credit { position: absolute; left: 10px; bottom: 6px; font-size: 10px; color: rgba(255, 255, 255, .45); pointer-events: none; }
@media (max-width: 720px) { .map { height: calc(100vh - 300px); border-radius: 0; } .map-zoom { bottom: 96px; } }
.auto-albums { padding-bottom: 4px; }
button.store-card { width: 100%; text-align: left; color: inherit; border: 0; font: inherit; cursor: pointer; }
/* One search: matches in the other sections, above the results. */
.cross-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 auto 6px; padding: 0 24px; max-width: 1600px; }
.cross-label { font-size: 13px; color: var(--subtle); }
@media (max-width: 720px) { .cross-search { padding: 0 16px; } }
/* Live Photos: a small LIVE mark on the tile; in the viewer the video plays over the photo. */
.live-badge {
  position: absolute; left: 6px; top: 6px; padding: 1px 5px; border-radius: 4px; pointer-events: none;
  font-size: 9px; font-weight: 700; letter-spacing: .06em; color: #fff; background: rgba(0, 0, 0, .45);
}
.lb-live { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.lb-live-btn {
  position: absolute; left: 12px; top: 12px; z-index: 2; padding: 3px 9px; border-radius: 999px; border: 0; cursor: pointer;
  font: 700 11px/1.4 inherit; letter-spacing: .08em; color: #fff; background: rgba(0, 0, 0, .45); backdrop-filter: blur(8px);
}
.lb-live-btn.on { background: rgba(255, 204, 0, .85); color: #000; }
/* Office documents in the reader: paragraphs, headings, tables, sheets and slides. */
.doc-office { max-width: 860px; margin: 0 auto; padding: 8px 4px 60px; line-height: 1.55; }
.doc-office .doc-p { margin: 0 0 .7em; white-space: pre-wrap; }
.doc-office h2.doc-p, .doc-office h3.doc-p, .doc-office h4.doc-p { margin: 1.2em 0 .5em; }
.doc-table-wrap { overflow-x: auto; margin: 0 0 1em; }
.doc-table { border-collapse: collapse; font-size: 14px; }
.doc-table td { border: 1px solid var(--line, rgba(255,255,255,.12)); padding: 5px 9px; vertical-align: top; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.doc-slide { background: var(--fill, rgba(255,255,255,.05)); border-radius: 14px; padding: 14px 18px; margin: 0 0 14px; }
.doc-part { margin: 0 0 8px; font-size: 13px; color: var(--subtle); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.doc-sheet { margin: 0 0 20px; }
/* «Компьютер» in the settings. */
.pc-card { gap: 10px; }
.pc-line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 15px; }
.pc-line .set-hint { text-align: right; }
.pc-vol { display: grid; gap: 6px; }
.pc-problem { color: var(--red, #ff453a); font-size: 14px; }
.pc-card .doc-btn { justify-self: start; margin-top: 4px; }
.store-seg.pc-full { background: var(--red, #ff453a); }
/* Receipts and documents list. */
.doc-row { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.doc-row-main, .doc-row-side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-row-side { align-items: flex-end; text-align: right; flex: none; }
.doc-office .doc-part { margin-top: 18px; }
/* «Спросить greencloud». */
.ask-q { font-weight: 700; font-size: 18px; margin: 4px 0 12px; }
.ask-a { font-size: 17px; line-height: 1.55; white-space: pre-wrap; }
.ask-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 3px; margin-top: 14px; }
.ask-tile { aspect-ratio: 1; padding: 0; border: 0; background: var(--fill, rgba(255,255,255,.06)); overflow: hidden; cursor: pointer; }
.ask-tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.ask-tile img.loaded { opacity: 1; }
.guide { padding-left: 1.3em; display: grid; gap: 12px; line-height: 1.5; }
.doc-office code { word-break: break-all; font-size: 14px; }
.memories-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.memories-video { flex: none; }
