:root {
  --bg: #dcdcd9;
  --dot: #c3c3bf;
  --ink: #2c2c2e;
  --ink-soft: #5a5a5e;
  --accent: #8a8a8e;
  --dim: #7d7d80;
  --paper: #fdfdfb;
  --card: #fbfbf9;
  --card-alt: #f5f5f2;
  --card-future: #ebebe8;
  --card-future-alt: #e6e6e3;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  user-select: none;
  -webkit-user-select: none;
  font: 14px/1.4 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 16px 16px;
  -webkit-font-smoothing: antialiased;
}

.btn {
  font: 13px/1 var(--mono);
  color: var(--ink);
  background: #f2f2ef;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.btn:hover { background: #fff; }
.btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.icon { width: 30px; height: 30px; padding: 0; font-size: 16px; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.seg .btn:last-child { border-radius: 0 8px 8px 0; }
.spacer { flex: 1; }
.dim { color: var(--dim); }
textarea, input, .settings { user-select: text; -webkit-user-select: text; }
.panel { background: var(--paper); border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16); }

/* ---- login ---- */

.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; }
.login form {
  width: min(300px, 100%);
  background: var(--paper);
  border-radius: 12px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
.login-title { font: 600 18px var(--mono); text-align: center; }
.login input { font: 15px var(--mono); padding: 9px 11px; border: 1px solid rgba(0, 0, 0, 0.18); border-radius: 8px; background: #fff; }
.login-err { min-height: 1.2em; color: #b8324a; font: 12px var(--mono); text-align: center; }

/* ---- chrome ---- */

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 16px;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.brand { font: 600 15px/30px var(--mono); color: var(--ink-soft); }

.settings { max-height: calc(100vh - 68px); overflow: auto; position: fixed; top: 52px; right: 16px; z-index: 9; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; font: 13px var(--mono); }
.settings label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.panel-sub { margin-top: 6px; font-size: 11px; color: var(--dim); }

/* ---- timeline ---- */

.overview { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.viewport { position: fixed; inset: 0; z-index: 1; overflow: hidden; touch-action: none; }
#app.editing .viewport { z-index: 6; } /* the open card sits above the axis and fades */
.viewport.panning, .viewport.panning .cell { cursor: grabbing; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; --px: 1px; }
.wcol { position: absolute; top: 0; width: 88px; height: 700px; }

.cell {
  position: absolute;
  left: 0;
  width: 88px;
  height: 88px;
  cursor: pointer;
  --u: 0.88px; /* 1% of a card, the unit everything on a board is sized in */
}
.ci {
  position: absolute;
  inset: 0;
  border-radius: var(--r, 9px);
  background: var(--card);
  box-shadow: 0 0 0 var(--px) rgba(0, 0, 0, 0.05);
  overflow: hidden;
  text-align: left;
}
.cell.alt .ci { background: var(--card-alt); }
.cell.future .ci { background: var(--card-future); }
.cell.future.alt .ci { background: var(--card-future-alt); }
.cell.filled .ci { background: #fff; box-shadow: 0 var(--px) calc(var(--px) * 3) rgba(0, 0, 0, 0.13); }
.cell.future.filled .ci { background: var(--card-future); } /* plans don't make a day look lived */
.cell.future.alt.filled .ci { background: var(--card-future-alt); }
.cell.colored .ci { background-color: color-mix(in srgb, var(--day) 55%, #fff); }
#world[data-lv="full"] .cell.colored .ci { background-color: color-mix(in srgb, var(--day) 20%, #fff); }
.cell:hover .ci { box-shadow: 0 0 0 var(--px) rgba(0, 0, 0, 0.12), 0 calc(var(--px) * 2) calc(var(--px) * 8) rgba(0, 0, 0, 0.12); }
.cell.today .ci { box-shadow: 0 0 0 calc(var(--px) * 2) var(--accent); }
.cell.editing { cursor: default; z-index: 2; }
.cell.editing .ci {
  overflow: visible;
  background-image: radial-gradient(#dcdcd7 calc(var(--px) * 1.2), transparent calc(var(--px) * 1.4));
  background-size: 5.5px 5.5px;
  box-shadow: 0 calc(var(--px) * 4) calc(var(--px) * 30) rgba(0, 0, 0, 0.18);
}
.cell.editing.drawing .ci { cursor: crosshair; }
/* The square board inside each card. Only the open card is wider than its board. */
.sq { position: absolute; left: 0; top: 0; width: 88px; height: 88px; }

/* Day number, a constant ~10 screen px (but never tiny next to a zoomed-in board). */
.dn {
  position: absolute;
  left: 7%;
  top: 6%;
  z-index: 4;
  font: 300 calc(var(--px) * var(--dn, 10)) / 1 "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.02em;
  color: #a3a3a6;
  pointer-events: none;
  white-space: nowrap;
}
.cell.today .dn { color: var(--ink-soft); }
#world.tiny .dn, #world.nodates .dn { display: none; }
/* The doodle, on top of everything on a card. */
.ci .cd { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }

/* Month and year boundaries, drawn in screen space (crisp at any zoom). */
.lines { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; /* behind the cards */ pointer-events: none; overflow: visible; }
.lines path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.lines .m { stroke: #a9a9a5; stroke-width: 1.4; }
.lines .y { stroke: #7c7c79; stroke-width: 2.4; }

.left-fade { position: fixed; left: 0; top: 0; bottom: 0; width: 84px; z-index: 4; pointer-events: none; background: linear-gradient(to right, var(--bg) 30%, rgba(220, 220, 217, 0)); }
.weekdays { position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none; }
.weekdays span { position: absolute; left: 12px; transform: translateY(-50%); font: 11px var(--mono); color: var(--dim); }

.axis { position: fixed; left: 0; right: 0; z-index: 2; pointer-events: none; transition: opacity 0.25s; }
#app.editing .axis, #app.editing .lines { opacity: 0; }
.lines { transition: opacity 0.25s; }
.lanes { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; transition: opacity 0.25s; }
#app.editing .lanes, #app.editing .lane-uis { opacity: 0; pointer-events: none; }
.lane-uis { position: fixed; left: 0; right: 0; top: 0; z-index: 3; pointer-events: none; transition: opacity 0.25s; }
.lane-ui { position: absolute; left: 4px; right: 4px; pointer-events: none; }
.lane-grip { position: absolute; left: 30%; right: 30%; top: -5px; height: 10px; cursor: ns-resize; pointer-events: auto; border-radius: 5px; }
.lane-grip::after { content: ""; position: absolute; left: 50%; top: 4px; width: 36px; margin-left: -18px; height: 3px; border-radius: 2px; background: rgba(0, 0, 0, 0.12); opacity: 0; transition: opacity 0.15s; }
.lane-ui:hover .lane-grip::after, .lane-grip:active::after { opacity: 1; }
.lane-gear { position: absolute; right: 6px; top: 3px; width: 24px; height: 24px; border: 0; border-radius: 7px; background: none; color: #8a8a8d; font-size: 14px; cursor: pointer; pointer-events: auto; }
.lane-gear:hover { background: rgba(0, 0, 0, 0.06); color: var(--ink); }
.lane-panel { position: fixed; z-index: 9; width: 260px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; font: 12px var(--mono); }
.lp-title { font-weight: 600; color: var(--ink-soft); }
body.censor .lp-title.nsfw .nm { filter: blur(4px); }
.lp-field { display: flex; flex-direction: column; gap: 4px; color: var(--dim); }
.lp-field select, .lane-panel input[type="number"] { font: 13px var(--mono); padding: 5px 7px; border: 1px solid rgba(0, 0, 0, 0.16); border-radius: 7px; background: #fff; color: var(--ink); min-width: 0; }
.lp-row { display: flex; gap: 8px; }
.lp-row > * { flex: 1; min-width: 0; }
.lp-row .btn { justify-content: center; text-align: center; font-size: 12px; padding: 6px 8px; }
.lane-settings { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow: auto; }
body.censor .lane-settings .nsfw .nm { filter: blur(4px); }
.settings a.btn, .bar a.btn, .lane-panel a.btn { text-decoration: none; }
.ax { position: absolute; white-space: nowrap; font: 10px var(--mono); color: var(--dim); }
.ax.w { top: 0; transform: translateX(-50%); color: #9a9a9d; font-size: 9px; }

/* Month / year / life bands; with progress on they fill up to now. */
.band { position: absolute; height: 16px; border-radius: 4px; overflow: hidden; white-space: nowrap; font: 600 10px/16px var(--mono); }
.band.past { background: #85858a; color: #f4f4f2; }
.band.cur { background: #b2b2af; color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.band.fut { background: #cececb; color: #808083; }
.band.plain { background: none; color: var(--dim); font-weight: 500; }
.band .fill { position: absolute; left: 0; top: 0; bottom: 0; background: #48484c; }
.band .lab, .band .pct { position: absolute; top: 0; z-index: 1; }
.band .pct { font-weight: 500; }
.band .pct.out { color: #5a5a5e; }
.band .tk { position: absolute; top: 0; transform: translateX(-50%); font-weight: 400; font-size: 9px; color: #8e8e91; }
.band .tk.in { color: #b9b9bc; }
.band .mt { position: absolute; bottom: 0; height: 4px; border-left: 1px solid #8e8e91; opacity: 0.45; }
.band .mt.in { border-color: #d0d0d3; }
.band .lab.sm { font-size: 8px; font-weight: 500; }
.ax.yl { transform: translateX(-50%); font-size: 9px; color: #9a9a9d; }
.ax.yl.dec { color: var(--ink-soft); font-weight: 600; }
.band .tk::before { content: ""; position: absolute; left: 50%; top: 0; height: 3px; border-left: 1px solid currentColor; }

/* ---- editing toolbar ---- */

/* Toolbar in the middle, close island on the right, in one row so they can't overlap: the
   toolbar stays centred while there's room, then gets pushed left and finally wraps. */
.edit-top { position: fixed; top: 12px; left: 12px; right: 16px; z-index: 8; display: flex; align-items: flex-start; gap: 10px; pointer-events: none; }
.edit-top > * { pointer-events: auto; }
.et-side { flex: 1 1 0; min-width: 0; pointer-events: none; }
.et-right { display: flex; justify-content: flex-end; min-width: max-content; }
.toolbar {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 14px;
  background: rgba(253, 253, 251, 0.95);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
  animation: toolbar-in 0.25s ease-out;
}
@keyframes toolbar-in { from { opacity: 0; transform: translateY(-8px); } }
@media (max-width: 760px) {
  .edit-top { flex-direction: column; align-items: stretch; gap: 8px; left: 12px; right: 12px; }
  .et-side:first-child { display: none; }
  .et-right { order: -1; flex: none; }
  .save-state { width: 4.5em; }
}
.toolbar .spacer { display: none; }
.tb-head { display: flex; align-items: center; gap: 6px; }
.tb-sec { display: flex; flex-wrap: wrap; flex: none; max-width: 100%; gap: 6px; align-items: center; }
.tb-label { display: none; }
.day-title { flex: 1; font: 13px/1.35 var(--mono); text-align: center; }
.close-island {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  background: rgba(253, 253, 251, 0.95);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
}
.save-state { width: 7.5em; text-align: right; font: 11px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette, .day-colors { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.swatch { width: 20px; height: 20px; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 4px; cursor: pointer; padding: 0; }
.swatch.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.day-colors .swatch { width: 22px; height: 22px; border-radius: 50%; }
.day-colors .none { background: #fff linear-gradient(135deg, transparent 45%, #b3b3b3 45% 55%, transparent 55%); }

.sticker-picker {
  position: fixed;
  z-index: 10;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: repeat(5, 48px);
  gap: 6px;
  padding: 10px;
}
.sticker-picker button { width: 48px; height: 48px; padding: 4px; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.sticker-picker button:hover { background: #ececea; }
.sticker-picker img { width: 100%; height: 100%; image-rendering: pixelated; }

/* ---- board items (same markup zoomed-in read-only and while editing) ---- */

#paint { position: absolute; z-index: 3; image-rendering: pixelated; pointer-events: none; touch-action: none; } /* size: see life.js, it reaches past the board */
/* The open card's contents, unscaled, laid over its board (see placeEditor). */
.editor { position: fixed; z-index: 7; --px: 1px; }
.editor.drawing { cursor: crosshair; }
.editor.drawing #paint { pointer-events: auto; }
.editor.drawing .item { pointer-events: none; }
.item { user-select: none; -webkit-user-select: none; }
.cell .item, .cell .mi { pointer-events: none; }

/* Zoomed-out map of a board. Sizes are in card px (a card is 88 wide). */
.mi { position: absolute; transform: rotate(var(--rot, 0deg)); }
.mi.note { box-shadow: 0 0.4px 1px rgba(0, 0, 0, 0.18); padding: 4% 6%; }
.mi.text { padding: 1%; }
.mi .ml { width: 100%; background: repeating-linear-gradient(to bottom, #bdbdbd 0 2.4px, transparent 2.4px 4.36px); }
.mi.note .ml { background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0 2px, transparent 2px 4.36px); margin-top: 8%; }
.mi.photo { background: #fff; padding: 1%; box-shadow: 0 0.4px 1.2px rgba(0, 0, 0, 0.25); }
.mi.photo img { display: block; width: 100%; }
.mi.sticker { aspect-ratio: 1; }
.mi.sticker img { width: 100%; height: 100%; image-rendering: pixelated; }

.item { position: absolute; transform: rotate(var(--rot, 0deg)); touch-action: none; }
/* Borders/outlines thinner than a world px get snapped up to one (= huge when zoomed), so
   anything hairline inside a card is a box-shadow instead. */
.item.sel { box-shadow: 0 0 0 calc(var(--px) * 1.5) rgba(0, 0, 0, 0.32) !important; }
.item.note { display: flex; flex-direction: column; box-shadow: 0 calc(var(--u) * 0.4) calc(var(--u) * 1.2) rgba(0, 0, 0, 0.18); }
.note .grip { height: calc(var(--u) * 3.5); flex: none; cursor: grab; background: rgba(0, 0, 0, 0.05); }
.item.text { display: flex; flex-direction: column; border-radius: calc(var(--u) * 1); }
.editor .item.text:hover, .editor .item.text.sel { background: rgba(0, 0, 0, 0.025); }
.text .grip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: calc(var(--u) * 2.6);
  cursor: grab;
  border-radius: calc(var(--u) * 1) calc(var(--u) * 1) 0 0;
  background: rgba(0, 0, 0, 0.06);
  display: none;
}
.editor .text:hover .grip, .text.sel .grip { display: block; }
.item textarea, .item .nt {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  padding: calc(var(--u) * 1.2) calc(var(--u) * 1.6);
  color: var(--ink);
  user-select: text;
  -webkit-user-select: text;
}
.note textarea, .note .nt { font: calc(var(--u) * 3 * var(--fs, 1)) / 1.3 "Inter", system-ui, sans-serif; }
.text textarea, .text .nt { font: calc(var(--u) * 3.3 * var(--fs, 1)) / 1.5 "Inter", system-ui, sans-serif; color: #4a4a4d; }
.item textarea::placeholder { color: #b0b0b0; }
.item .nt { white-space: pre-wrap; overflow: hidden; overflow-wrap: anywhere; }
.item.photo { background: #fff; padding: calc(var(--u) * 1.2); box-shadow: 0 calc(var(--u) * 0.4) calc(var(--u) * 1.6) rgba(0, 0, 0, 0.22); cursor: grab; }
.photo img { display: block; width: 100%; pointer-events: none; user-select: none; }
.photo .cap { font-size: calc(var(--u) * 2.6); text-align: center; padding-top: calc(var(--u) * 1); color: #444; }
.item.sticker { aspect-ratio: 1; cursor: grab; }
.sticker img { width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; user-select: none; filter: drop-shadow(0 calc(var(--u) * 0.2) calc(var(--u) * 0.2) rgba(0, 0, 0, 0.25)); }

.item .del, .item .recolor, .item .resize { display: none; position: absolute; z-index: 2; padding: 0; cursor: pointer; }
.item.sel .del, .item.sel .recolor, .item.sel .resize { display: block; }
.item .del {
  top: calc(var(--px) * -11);
  right: calc(var(--px) * -11);
  width: calc(var(--px) * 22);
  height: calc(var(--px) * 22);
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  font: calc(var(--px) * 14) / calc(var(--px) * 22) var(--mono);
}
.item .recolor {
  top: calc(var(--px) * -11);
  left: calc(var(--px) * -11);
  width: calc(var(--px) * 22);
  height: calc(var(--px) * 22);
  border-radius: 50%;
  border: 0;
  background: conic-gradient(#fff1a8, #ffd3de, #cfe6ff, #d7f3c8, #ffdcb5, #fff1a8);
  box-shadow: 0 0 0 calc(var(--px) * 2) #fff, 0 0 0 calc(var(--px) * 3) rgba(0, 0, 0, 0.3);
}
.item .resize {
  right: calc(var(--px) * -9);
  bottom: calc(var(--px) * -9);
  width: calc(var(--px) * 18);
  height: calc(var(--px) * 18);
  border-radius: calc(var(--px) * 4);
  border: 0;
  box-shadow: inset 0 0 0 calc(var(--px) * 1.5) var(--accent);
  background: #fff;
  cursor: nwse-resize;
}


/* While a card is open the dotted backdrop all but disappears. */
body:has(#app.editing) { background-image: radial-gradient(rgba(195, 195, 191, 0.25) 1px, transparent 1.3px); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn:disabled:hover { background: #f2f2ef; }

/* Fingers: bigger handles. */
@media (pointer: coarse) {
  .item .del, .item .recolor { width: calc(var(--px) * 30); height: calc(var(--px) * 30); top: calc(var(--px) * -15); font-size: calc(var(--px) * 17); line-height: calc(var(--px) * 30); }
  .item .del { right: calc(var(--px) * -15); }
  .item .recolor { left: calc(var(--px) * -15); }
  .item .resize { width: calc(var(--px) * 30); height: calc(var(--px) * 30); right: calc(var(--px) * -15); bottom: calc(var(--px) * -15); border-radius: calc(var(--px) * 7); }
  .text .grip { height: calc(var(--px) * 22); }
}

/* "hide card contents": closed cards show anonymous shapes instead of art, photos and text. */
body.hide-art .cell:not(.editing) .cd { display: none; }
body.hide-art .cell:not(.editing) .photo img { visibility: hidden; }
body.hide-art .cell:not(.editing) .photo { background: #e2e2df; }
body.hide-art .cell:not(.editing) .sticker img { display: none; }
body.hide-art .cell:not(.editing) .sticker { background: #d9d9d6; border-radius: 50%; transform: rotate(0) scale(0.6); }
body.hide-art .cell:not(.editing) .nt { color: transparent; text-shadow: 0 0 calc(var(--u, 1px) * 2.2) rgba(0, 0, 0, 0.35); }
body.hide-art .cell:not(.editing) .photo .cap { visibility: hidden; }

/* Closed cards: the board, shifted to fit if things sit out on the wings (fitBoard). */

/* Colour picker */
.swatch.current { width: 28px; height: 28px; border-radius: 8px; }
.color-picker { position: fixed; z-index: 10; width: 220px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.sv-box { position: relative; height: 150px; border-radius: 8px; cursor: crosshair; touch-action: none; background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent); }
.sv-box i, .hue-bar i { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, 0.35); pointer-events: none; }
.hue-bar { position: relative; height: 14px; border-radius: 7px; cursor: pointer; touch-action: none; background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.hue-bar i { top: 50%; background: #fff; }
.hex-in { font: 16px var(--mono); padding: 5px 8px; border: 1px solid rgba(0, 0, 0, 0.16); border-radius: 7px; background: #fff; color: var(--ink); min-width: 0; user-select: text; -webkit-user-select: text; }

/* Videos */
.video-panel { position: fixed; z-index: 10; transform: translate(-50%, -50%); padding: 12px; width: min(320px, calc(100vw - 32px)); }
.video-panel form { display: flex; flex-direction: column; gap: 8px; }
.video-panel input { font: 16px var(--mono); padding: 7px 9px; border: 1px solid rgba(0, 0, 0, 0.16); border-radius: 7px; background: #fff; color: var(--ink); min-width: 0; user-select: text; -webkit-user-select: text; }
.video-panel .btn { justify-content: center; }
.item.video { background: #fff; padding: calc(var(--u) * 1.2); box-shadow: 0 calc(var(--u) * 0.4) calc(var(--u) * 1.6) rgba(0, 0, 0, 0.22); cursor: grab; }
.mi.video { background: #fff; padding: 1%; box-shadow: 0 0.4px 1.2px rgba(0, 0, 0, 0.25); }
.vframe.tall { aspect-ratio: 9 / 16; }
.vframe { position: relative; aspect-ratio: 16 / 9; background: #1d1d1f; overflow: hidden; }
.vframe img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.vframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vframe::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-30%, -50%); border-style: solid; border-color: transparent transparent transparent rgba(255, 255, 255, 0.9); border-width: 0.5em 0 0.5em 0.85em; font-size: calc(var(--u) * 4); pointer-events: none; filter: drop-shadow(0 0 calc(var(--u) * 0.6) rgba(0, 0, 0, 0.5)); }
.vframe:has(.play)::after, .vframe:has(iframe)::after { display: none; }
.vframe .play { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; padding: 0 0 0 3px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 20px; cursor: pointer; }
.vframe .play:hover { background: rgba(0, 0, 0, 0.8); }
.vcap { display: flex; align-items: center; gap: calc(var(--u) * 1); padding-top: calc(var(--u) * 0.8); font: calc(var(--u) * 2.6) / 1.3 var(--mono); color: #555; }
.vcap .vt { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: inherit; text-decoration: none; }
.vcap a.vt:hover { text-decoration: underline; }
.vchip { flex: none; padding: 0 calc(var(--u) * 0.8); border-radius: calc(var(--u) * 0.8); background: #ececea; color: #777; }
.vtags { flex: none; width: 34%; min-width: 0; border: 0; outline: none; border-radius: 5px; padding: 1px 5px; background: #ececea; color: #666; font: inherit; user-select: text; -webkit-user-select: text; }
.mi.video .vframe::after { font-size: 6px; }

body.hide-art .cell:not(.editing) .video img { visibility: hidden; }
body.hide-art .cell:not(.editing) .vframe { background: #e2e2df; }
body.hide-art .cell:not(.editing) .vframe::after { display: none; }
body.hide-art .cell:not(.editing) .vcap { visibility: hidden; }
.item .flip { font-size: calc(var(--u) * 2.6); }

/* Events: a column down the right of a card, on top of whatever is there. */
.evs { position: absolute; right: 3%; top: 3%; bottom: 3%; width: 40%; z-index: 4; display: flex; flex-direction: column; overflow: hidden; gap: calc(var(--u, 0.88px) * 0.7); pointer-events: none; }
.ev { --cal: #8a8a8e; flex: none; display: flex; flex-direction: column; min-height: calc(var(--u, 0.88px) * 2); padding: 0 calc(var(--u, 0.88px) * 1); border: 0; border-left: calc(var(--u, 0.88px) * 0.7) solid var(--cal); border-radius: calc(var(--u, 0.88px) * 0.8); background: color-mix(in srgb, var(--cal) 24%, #fff); color: #333; text-align: left; font: max(calc(var(--u, 0.88px) * 3.6), calc(var(--px, 0.1px) * 9.5)) / 1.3 var(--mono); overflow: hidden; }
.ev .tm { flex: none; color: #666; }
.ev .tt { min-width: 0; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.ev.more { background: none; border: 0; color: #777; }
.evs.mini, #world.evbars .evs { width: auto; flex-direction: row-reverse; }
.evs.mini .ev, #world.evbars .evs .ev { flex: none; min-height: 0; width: calc(var(--u, 0.88px) * 3.4); padding: 0; background: var(--cal); border: 0; }
#world.evbars .evs .ev > *, #world.evbars .evs .more { display: none; }
.editor > .evs { pointer-events: auto; bottom: auto; width: 26%; min-width: 96px; max-height: 94%; overflow-y: auto; z-index: 6; }
.editor > .evs .ev { cursor: pointer; max-width: 100%; font-size: max(11px, calc(var(--u) * 2.5)); padding: 1px 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14); }
.editor.drawing > .evs { pointer-events: none; opacity: 0.4; }
body.hide-art .cell:not(.editing) .ev .tm, body.hide-art .cell:not(.editing) .ev .tt { visibility: hidden; }
.event-panel { position: fixed; z-index: 10; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 12px; width: min(340px, calc(100vw - 32px)); }
.event-panel form { display: flex; flex-direction: column; gap: 8px; }
.event-panel input:not([type="checkbox"]), .event-panel textarea, .event-panel select { font: 16px var(--mono); padding: 7px 9px; border: 1px solid rgba(0, 0, 0, 0.16); border-radius: 7px; background: #fff; color: var(--ink); min-width: 0; width: 100%; box-sizing: border-box; user-select: text; -webkit-user-select: text; resize: vertical; }
.ev-row { display: flex; gap: 8px; align-items: center; }
.ev-row input { flex: 1; }
.ev-row .spacer { flex: 1; }
.ev-allday { display: flex; gap: 8px; align-items: center; font: 13px var(--mono); cursor: pointer; }
.event-panel .btn.primary { background: var(--ink, #333); color: #fff; }
.event-panel #evInfo { font: 12px var(--mono); }
.event-panel #evInfo:empty { display: none; }
.gcal-box { display: flex; flex-direction: column; gap: 6px; max-width: 280px; }
.gcal-box .cal-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.gcal-box select { font: 12px var(--mono); padding: 4px; min-width: 0; max-width: 100%; }
.gcal-box .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gcal-box .btn { justify-content: center; font-size: 12px; padding: 4px 8px; }
.gcal-box .err { color: #b4452f; font-size: 11px; }
.gcal-box .hint { color: var(--dim); font-size: 11px; line-height: 1.4; }

.login-google { justify-content: center; text-decoration: none; padding: 10px; }
.login-email { display: flex; flex-direction: column; gap: 8px; }
.hint-line { font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }
