/* Link: a small card over a one-line address field. The browser can't fetch a preview here, so the card
   makes what it can from the address itself: a monogram, a title-ish line and the domain. */
.obj.link { display: flex; flex-direction: column; }
.lk-top { flex: 1 0 auto; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px 12px 10px 12px; }   /* a taller card centres it */
.lk-ico {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px;
  background: var(--surface); box-shadow: var(--raise-sm);
  font: 600 14px/1 var(--f-display); color: var(--ink-2);
}
.lk-ico svg { width: 14px; height: 14px; }
.lk-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.lk-title {
  display: flex; align-items: center; gap: 4px; min-width: 0; justify-self: start; max-width: 100%;
  font: 600 14px/19px var(--f-ui); color: var(--ink); text-decoration: none; border-radius: 2px;
}
.lk-title span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lk-title svg { flex: none; width: 11px; height: 11px; color: var(--ink-3); transition: color 120ms ease-out, translate 120ms ease-out; }
a.lk-title[href] { cursor: pointer; }
@media (hover: hover) {
  a.lk-title[href]:hover span { text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
  a.lk-title[href]:hover svg { color: var(--ink); translate: 1px -1px; }
}
.lk-title:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.lk-host { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 500 11px/14px var(--f-mono); color: var(--ink-q); }
.obj.link.blank .lk-title { color: var(--ink-3); }
.obj.link.blank .lk-title svg { display: none; }
.lk-url {
  padding: 7px 12px 8px; border-top: 1px solid var(--rule);
  font: 500 11.5px/16px var(--f-mono); color: var(--ink-2); overflow-wrap: anywhere;
}
.lk-url:not(:focus) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Images go on the canvas raw: no card, no border, transparency kept. The element is the picture's own box,
   so the selection ring and the resize edges sit on the picture itself. */
.obj.image { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.obj.image img {
  display: block; width: 100%; height: 100%; max-width: none;
  pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
}
/* A picture turned a quarter at a time (section 16c): the box is the turned picture's, so a quarter or three turns the
   <img> at the box's height by its width (--ar is the box's width over its height), about the middle. */
.obj.image[data-rot="180"]:not(.lost):not(.pic-try) > img { transform: rotate(180deg); }
.obj.image:is([data-rot="90"], [data-rot="270"]):not(.lost):not(.pic-try) > img {
  position: absolute; left: 50%; top: 50%; width: calc(100% / var(--ar, 1)); height: calc(100% * var(--ar, 1));
  transform: translate(-50%, -50%) rotate(90deg);
}
.obj.image[data-rot="270"]:not(.lost):not(.pic-try) > img { transform: translate(-50%, -50%) rotate(270deg); }
/* A picture whose file didn't come back with the canvas (saving keeps the cards, not yet their files: section 24)
   keeps its place and its shape, drawn as an upload tile with its name, and takes its file again (section 15). */
.obj.image.lost {
  display: grid; align-content: center; justify-items: center; gap: 5px; padding: 10px 14px; overflow: hidden; container-type: size;
  background-color: color-mix(in srgb, var(--surface) 55%, var(--canvas)); border: 1px solid transparent; border-radius: 3px;
}
/* One kept with the account that didn't load and is asked for again (files.js, picRetry) is the same tile with its
   name, saying so and softly pulsing, until it comes, or is lost after the last try. It is no place to drop a file. */
.obj.image.pic-try {
  display: grid; align-content: center; justify-items: center; gap: 5px; padding: 10px 14px; overflow: hidden; container-type: size;
  background-color: color-mix(in srgb, var(--surface) 55%, var(--canvas)); border: 1px solid transparent; border-radius: 3px;
  animation: pic-try 1.2s ease-in-out infinite alternate;
}
@keyframes pic-try { to { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .obj.image.pic-try { animation: none; } }
/* In Safari's engine an animated opacity is a layer of its own (objects.css, html.wk): there the pulse goes through a
   property worked out each frame, and the tile is drawn with the rest of the canvas. */
@property --pulse { syntax: '<number>'; inherits: false; initial-value: 1; }
@keyframes pic-try-wk { to { --pulse: .55; } }
@media (prefers-reduced-motion: no-preference) { html.wk .obj.image.pic-try { animation-name: pic-try-wk; opacity: var(--pulse); } }
.obj.image.lost > img, .obj.image.pic-try > img { position: absolute; inset: 0; visibility: hidden; }
.obj.image.lost::before, .obj.image.lost::after, .obj.image.pic-try::before, .obj.image.pic-try::after { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.obj.image.lost::before, .obj.image.pic-try::before { content: attr(data-name); font: 500 13px/18px var(--f-ui); color: var(--ink-2); }
.obj.image.lost::after, .fc-lost::after, .obj.image.pic-try::after {
  content: "Not saved · drop it here again"; font: 500 9.5px/14px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-q);
}
.obj.image.pic-try::after { content: "Loading…"; }
:root[lang^="zh"] .obj.image.pic-try::after { content: "加载中…"; letter-spacing: 0; }
.fc-lost::after { content: "Drop the file here again"; }
@media (pointer: coarse) {
  .obj.image.lost::after { content: "Not saved · tap twice to add it"; }
  .fc-lost::after { content: "Tap twice to add it again"; }
}
@container (max-width: 240px) { .obj.image.lost::after { content: "Not saved"; } }
@container (max-height: 36px) { .obj.image.lost::after, .obj.image.pic-try::after { content: none; } }      /* then only its name */
@container (max-width: 36px) or (max-height: 17px) { .obj.image.lost::before, .obj.image.pic-try::before { content: none; } }
.obj.image.lost.over { --dz: var(--ink-2); background-color: color-mix(in srgb, var(--ink) 5%, var(--surface)); }
.obj.image.lost.paper { background-color: var(--surface); }
@media (hover: hover) { .obj.image.lost:not(.over):hover { --dz: var(--ink-3); } }

/* File card: a type badge, the name and the size over a little window onto the file — page 1 of a PDF, the start of
   a Word document, a slide, or the first lines of a text file — laid on a sheet of paper. */
.obj.file { display: flex; flex-direction: column; overflow: hidden; }
.fc-top { flex: none; display: flex; align-items: center; gap: 11px; min-width: 0; padding: 10px 12px 9px 14px; }
.fc-badge, .fc-glyph { position: relative; flex: none; width: 24px; height: 28px; color: var(--ft); }
.fc-badge svg, .fc-glyph svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fc-badge .pg, .fc-glyph .pg { fill: color-mix(in srgb, var(--ft) 7%, var(--surface)); }
.fc-badge b, .fc-glyph b {
  position: absolute; left: -5px; bottom: 4px; padding: 2px 3px 1.5px; border-radius: 2px;
  font: 600 7.5px/1 var(--f-mono); letter-spacing: .04em; color: var(--on-tc); background: var(--ft); white-space: nowrap;
}
.fc-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fc-name { display: flex; min-width: 0; font: 600 14px/19px var(--f-ui); color: var(--ink); }
.fc-name span:first-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fc-name span + span { flex: none; font-weight: 500; color: var(--ink-3); }   /* the extension survives a long name */
.fc-info { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 500 11px/14px var(--f-mono); color: var(--ink-q); }
.fc-win {
  position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; border-top: 1px solid var(--rule);
  background: var(--well); box-shadow: var(--sunk);
}
.fc-sheet {
  position: absolute; left: 14px; right: 14px; top: 14px; overflow: hidden; border-radius: 1px;
  background: var(--sheet); color: var(--sheet-ink); filter: var(--sheet-dim);
  box-shadow: 0 0 0 1px var(--sheet-edge), 0 2px 6px var(--drop-2);
}
.fc-sheet > img { display: block; width: 100%; height: auto; max-width: none; }
/* A sheet set here from text (a text file, a document, a slide laid out from its words) is on the look's own paper:
   at night it doesn't glare. A page that is a picture (a PDF's page, a slide's image) stays a page, dimmed, and so
   does the sheet waiting for one (.fc-pg). */
.fc-sheet:not(:has(> img)):not(.fc-pg) { --sheet: var(--sheet-t); --sheet-ink: var(--sheet-t-ink); --sheet-ink-2: var(--sheet-t-ink-2); --sheet-edge: var(--sheet-t-edge); filter: none; }
.fc-win[data-mode="doc"] .fc-sheet, .fc-win[data-mode="text"] .fc-sheet, .fc-wait { bottom: -2px; }   /* the page runs on below the window */
.fc-win[data-mode="slide"] .fc-sheet { right: auto; }                                              /* fitted and centred from script */
.fc-win[data-mode="slide"] .fc-sheet > img { height: 100%; object-fit: cover; }
/* Documents and text slides are laid out at a fixed page width, then scaled to the sheet from script. */
.fc-vp { position: absolute; left: 0; top: 0; transform-origin: 0 0; box-sizing: border-box; }
.fc-doc { width: 612px; padding: 56px 64px; font: 400 15px/1.5 var(--f-ui); overflow-wrap: anywhere; }
.fc-doc > :first-child { margin-top: 0; }
.fc-doc h1, .fc-doc h2, .fc-doc h3, .fc-doc h4, .fc-doc h5, .fc-doc h6 { margin: 1.1em 0 .45em; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.fc-doc h1 { font-size: 28px; } .fc-doc h2 { font-size: 22px; } .fc-doc h3 { font-size: 18px; } .fc-doc h4, .fc-doc h5, .fc-doc h6 { font-size: 16px; }
.fc-doc p, .fc-doc ul, .fc-doc ol, .fc-doc table, .fc-doc blockquote { margin: 0 0 .75em; }
.fc-doc ul, .fc-doc ol { padding-left: 1.5em; }
.fc-doc blockquote { padding-left: 1em; border-left: 3px solid var(--sheet-edge); color: var(--sheet-ink-2); }
.fc-doc table { border-collapse: collapse; }
.fc-doc td, .fc-doc th { padding: 4px 8px; border: 1px solid var(--sheet-edge); vertical-align: top; text-align: left; }
.fc-doc img { max-width: 100%; height: auto; }
.fc-slide { display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 40px 56px; font: 400 22px/1.35 var(--f-ui); overflow: hidden; }
.fc-slide h3 { margin: 0; font: 600 38px/1.15 var(--f-ui); letter-spacing: -.015em; overflow-wrap: anywhere; }
.fc-slide ul { margin: 0; padding-left: 1.1em; color: var(--sheet-ink-2); overflow-wrap: anywhere; }
.fc-slide li + li { margin-top: 6px; }
.fc-txt pre { margin: 0; padding: 10px 12px; font: 500 9.5px/13.5px var(--f-mono); color: var(--sheet-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
/* while the file is being read */
.fc-wait { display: grid; gap: 9px; align-content: start; padding: 16px 14px; }
.fc-wait i { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--sheet-ink) 9%, transparent); animation: fc-wait 1.1s ease-in-out infinite alternate; }
.fc-wait i:first-child { width: 55%; height: 9px; margin-bottom: 4px; }
.fc-wait i:nth-child(3) { width: 86%; }
.fc-wait i:last-child { width: 62%; }
@keyframes fc-wait { to { opacity: .4; } }
@keyframes fc-wait-wk { to { --pulse: .4; } }
html.wk .fc-wait i { animation-name: fc-wait-wk; opacity: var(--pulse); }    /* as .pic-try's (html.wk) */
/* no preview: the type's glyph, large */
.fc-none { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 12px; text-align: center; font: 500 12px/16px var(--f-ui); color: var(--ink-q); }
.fc-none .fc-glyph { width: 40px; height: 47px; }
.fc-none .fc-glyph b { left: -8px; bottom: 7px; padding: 3px 4px 2.5px; font-size: 9.5px; }
/* a preview that didn't come back with the canvas (as a picture, above): the card takes its file again */
.fc-lost { gap: 0; }
.fc-lost > span:not(.fc-glyph) { margin-top: 12px; }
.fc-lost::after { max-width: 100%; margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* a spreadsheet's first rows as its cells read, hairlines between them, numbers set right */
.fc-win[data-mode="grid"] .fc-sheet { bottom: -2px; }
.fc-grid { border-collapse: collapse; table-layout: fixed; width: max-content; min-width: 100%; font: 500 9.5px/13px var(--f-mono); color: var(--sheet-ink); }
.fc-grid td { max-width: 92px; padding: 3px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-right: 1px solid var(--sheet-edge); border-bottom: 1px solid var(--sheet-edge); }
.fc-grid tr:first-child td { font-weight: 600; background: color-mix(in srgb, var(--sheet-ink) 4%, transparent); }
.fc-grid td:last-child { border-right: 0; }
/* a film: a still from it under a play mark (none: one this browser can't play); a sound: a few bars */
.fc-media { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: color-mix(in srgb, var(--ink) 6%, var(--well)); }
.fc-media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: var(--sheet-dim); }
.fc-play { position: relative; width: 44px; height: 44px; fill: rgba(16, 20, 26, .42); stroke: rgba(255, 255, 255, .92); stroke-width: 1.5px; stroke-linejoin: round; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 50%; }
.fc-play path { fill: rgba(255, 255, 255, .95); stroke: none; }
.fc-media:not(:has(> img)) .fc-play { fill: none; stroke: var(--ink-3); -webkit-backdrop-filter: none; backdrop-filter: none; }
html.wk .fc-play { -webkit-backdrop-filter: none; backdrop-filter: none; }   /* a backdrop is a layer of its own (objects.css, html.wk) */
.fc-media:not(:has(> img)) .fc-play path { fill: var(--ink-3); }
.fc-wave { width: 64px; height: 32px; fill: none; stroke: var(--ink-3); stroke-width: 3px; stroke-linecap: round; }
.obj.file.over { border-color: var(--ink-2); }
.obj.file.over > .fc-win { background: color-mix(in srgb, var(--ink) 5%, var(--well)); }

/* Upload tile: what an upload gesture leaves when no file was chosen. Click it, or drop files on it. */
.obj.upload { background-color: color-mix(in srgb, var(--surface) 55%, var(--canvas)); border: 1px solid transparent; border-radius: 3px; box-shadow: none; }   /* quiet but opaque */
.obj.upload, .obj.image.lost { --dz: color-mix(in srgb, var(--ink-3) 55%, var(--rule-2)); --dz-a: 14px; --dz-t: 1.5px; }   /* a tile on the canvas: its marks a step firmer than a column's well */
.obj.upload:focus-within { border-color: transparent; box-shadow: none; --dz: var(--ink-3); }
.obj.upload.over { --dz: var(--ink-2); background-color: color-mix(in srgb, var(--ink) 5%, var(--surface)); }
.up-btn {
  position: relative; container-type: size; display: grid; place-content: center; justify-items: center; gap: 3px;
  width: 100%; height: 100%; padding: 10px; box-sizing: border-box; border: 0; border-radius: 3px;
  background: transparent; color: var(--ink-3); font: inherit; text-align: center; cursor: pointer;
}
.up-btn svg { width: clamp(30px, 22cqmin, 60px); height: auto; aspect-ratio: 1; margin-bottom: 10px; overflow: visible; transition: color 120ms ease-out; }
.up-btn svg path { fill: color-mix(in srgb, currentColor 10%, transparent); stroke: currentColor; stroke-width: 1.5px; stroke-linejoin: round; }
.up-t { font: 500 14px/19px var(--f-ui); color: var(--ink); }
.up-s { font-size: 12px; line-height: 16px; color: var(--ink-q); }
@media (hover: hover) {
  .obj.upload:hover { --dz: var(--ink-3); }
  .up-btn:hover svg { color: var(--ink-2); }
}
.up-btn:has(> .pick-in:focus-visible) { outline: 2px solid var(--ink); outline-offset: 4px; }   /* a ring round the whole tile, clear of its marks */
.obj.upload.over .up-btn svg { color: var(--ink); }

