/* Photo Edit Studio — styles (mirrors the Ink palette of the iOS app) */
:root {
  --paper: #f9f6f1;
  --card: #ffffff;
  --line: #e0dbd1;
  --text: #1a1a1c;
  --muted: #7a7873;
  --gold: #d6a338;
  --gold-soft: #faebc7;
  --sky: #dbebf7;
  --blush: #fae5e0;
  --sage: #e0f0e0;
  --lavender: #ebe5f7;
  --content: 720px;
  --serif: "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--paper); color: var(--text); font-family: var(--sans); overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; font-size: 15px; line-height: 1.3; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; }
button:disabled { cursor: default; }
img, canvas { display: block; }
[hidden] { display: none !important; }
.serif { font-family: var(--serif); font-weight: 600; }
.muted { color: var(--muted); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; }
.centered { max-width: var(--content); margin: 0 auto; width: 100%; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ─── App shell ─── */
#app { position: fixed; inset: 0; overflow: hidden; }
.deck { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding-top: var(--sat); scrollbar-width: none; }
.deck::-webkit-scrollbar { display: none; }
.deck-inner { max-width: var(--content); margin: 0 auto; display: flex; flex-direction: column; gap: 26px; padding-top: 8px; }
.deck-inner.tight { gap: 20px; }
.deck-inner.tighter { gap: 18px; }
.spacer { height: 100px; flex: none; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 22px 0; gap: 12px; }
.topbar h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; margin: 0; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heading { font-family: var(--serif); font-weight: 600; font-size: 21px; padding: 0 22px; }
.section { display: flex; flex-direction: column; gap: 14px; }
.px22 { padding-left: 22px; padding-right: 22px; }

.round-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; transition: transform .12s; }
.round-btn:active { transform: scale(.94); }

.card { background: var(--card); border: 1px solid var(--line); }
.card-btn { display: flex; align-items: center; gap: 14px; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px; transition: transform .12s; }
.card-btn:active { transform: scale(.985); }
.card-btn .lead { width: 54px; height: 54px; border-radius: 16px; background: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.card-btn .lead .icon svg { stroke-width: 3; }
.card-btn .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card-btn .title { font-family: var(--serif); font-weight: 600; font-size: 20px; }
.card-btn .sub { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-btn .chev { color: var(--muted); font-size: 15px; }
.card-btn.sm { border-radius: 20px; padding: 12px; }
.card-btn.sm .title { font-family: var(--sans); font-size: 16px; }
.card-btn .thumb { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; }

/* Tools grid */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 0 22px; }
.tool-card { border-radius: 22px; border: 1px solid var(--line); overflow: hidden; background: var(--card); display: flex; flex-direction: column; transition: transform .12s; }
.tool-card:active { transform: scale(.975); }
.tool-card .wash { aspect-ratio: 1.2; padding: 14px; }
.tool-card .meta { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; background: var(--card); }
.tool-card .name { font-weight: 600; font-size: 15px; }
.tool-card .blurb { font-size: 12px; color: var(--muted); }
.split { position: relative; width: 100%; height: 100%; border-radius: 14px; overflow: hidden; background: var(--line); }
.split img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.split img.after { clip-path: inset(0 0 0 50%); }
.split .bar { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; }
.split .knob { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 8px; }
.split .knob .icon svg { stroke-width: 3; }

.recent-row { display: flex; gap: 12px; overflow-x: auto; padding: 0 22px; scrollbar-width: none; }
.recent-row::-webkit-scrollbar { display: none; }
.recent-row button { flex: none; }
.recent-row img { width: 120px; height: 120px; border-radius: 18px; object-fit: cover; }

/* Looks */
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 0 22px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--text); white-space: nowrap; transition: background .15s, color .15s, transform .12s; }
.pill.on { background: var(--text); color: var(--paper); }
.pill:active { transform: scale(.95); }
.pill .icon { font-size: 11px; }
.looks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 14px; padding: 0 22px; }
.look-tile { display: flex; flex-direction: column; gap: 8px; align-items: stretch; transition: transform .12s; }
.look-tile:active { transform: scale(.96); }
.look-tile .pic { aspect-ratio: .85; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; background: var(--line); position: relative; }
.look-tile .pic img { width: 100%; height: 100%; object-fit: cover; }
.look-tile .name { font-size: 13px; font-weight: 600; text-align: center; }
.look-tile .note { font-size: 11px; color: var(--muted); text-align: center; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(0,0,0,.12); border-top-color: var(--muted); animation: spin .8s linear infinite; position: absolute; left: 50%; top: 50%; margin: -10px 0 0 -10px; }
.spinner.dark { border-color: rgba(0,0,0,.12); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Saved */
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 90px 30px 0; text-align: center; }
.empty .big { font-size: 42px; color: var(--muted); }
.empty .big svg { stroke-width: 1.2; }
.empty h2 { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 0; }
.empty p { margin: 0; font-size: 14px; color: var(--muted); }
.primary-pill { background: var(--text); color: var(--paper); font-size: 15px; font-weight: 600; padding: 12px 22px; border-radius: 999px; margin-top: 6px; }
.pieces { display: flex; flex-direction: column; gap: 10px; padding: 0 22px; }
.piece-row { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 10px; width: 100%; transition: transform .12s; }
.piece-row:active { transform: scale(.985); }
.piece-row img { width: 74px; height: 74px; border-radius: 14px; object-fit: cover; flex: none; }
.piece-row .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.piece-row .title { font-size: 16px; font-weight: 600; }
.piece-row .date { font-size: 13px; color: var(--muted); }

/* Dock */
#dock { position: absolute; left: 0; right: 0; bottom: calc(12px + var(--sab)); display: flex; justify-content: center; pointer-events: none; z-index: 20; }
.dock { pointer-events: auto; display: flex; gap: 4px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 36px rgba(0,0,0,.10); }
.dock button { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text); transition: background .25s cubic-bezier(.2,.8,.2,1), padding .25s; }
.dock button .icon { font-size: 15px; }
.dock button .icon svg { stroke-width: 2.4; }
.dock button.on { background: var(--text); color: var(--paper); padding: 11px 16px; }
.dock button span.lbl { display: none; white-space: nowrap; }
.dock button.on span.lbl { display: inline; }

/* ─── Overlays ─── */
.layer { position: fixed; inset: 0; z-index: 50; }
.dim { position: absolute; inset: 0; background: rgba(0,0,0,.25); opacity: 0; transition: opacity .25s; }
.layer.in .dim { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--paper); border-radius: 22px 22px 0 0; max-height: 92%; overflow-y: auto; transform: translateY(100%); transition: transform .32s cubic-bezier(.2,.8,.2,1); padding-bottom: calc(16px + var(--sab)); box-shadow: 0 -10px 40px rgba(0,0,0,.12); scrollbar-width: none; }
.sheet::-webkit-scrollbar { display: none; }
.layer.in .sheet { transform: translateY(0); }
.sheet .inner { max-width: var(--content); margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.grab { width: 40px; height: 5px; border-radius: 999px; background: var(--line); margin: 10px auto 0; flex: none; }
.sheet h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 0; padding: 0 22px; }
.settings-group { margin: 0 22px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; font-size: 15px; width: 100%; }
.settings-row + .settings-row { border-top: 1px solid var(--line); margin-left: 16px; padding-left: 0; width: calc(100% - 16px); }
.settings-row .lbl { display: flex; align-items: center; gap: 10px; }
.settings-row .lbl .icon { font-size: 17px; color: var(--text); }
.settings-row.danger .lbl { color: #e0342c; }
.settings-row.disabled .lbl { color: var(--muted); }
.settings-row .count { font-size: 13px; color: var(--muted); }
.settings-note { font-size: 13px; color: var(--muted); padding: 0 22px; }
.toggle { width: 51px; height: 31px; border-radius: 999px; background: #e9e9ea; position: relative; transition: background .2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15); transition: transform .2s; }
.toggle.on { background: var(--gold); }
.toggle.on::after { transform: translateX(20px); }

/* Alert / confirm */
.alert-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(1.1); opacity: 0; width: min(280px, 86vw); background: rgba(250,250,250,.96); backdrop-filter: blur(20px); border-radius: 16px; overflow: hidden; text-align: center; transition: transform .2s, opacity .2s; }
.layer.in .alert-box { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.alert-box .txt { padding: 20px 16px 16px; }
.alert-box .t { font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.alert-box .m { font-size: 13px; color: #333; }
.alert-box .btns { display: flex; border-top: 1px solid rgba(0,0,0,.12); }
.alert-box .btns button { flex: 1; padding: 12px; text-align: center; font-size: 17px; color: #0a7bff; }
.alert-box .btns button + button { border-left: 1px solid rgba(0,0,0,.12); }
.alert-box .btns button.bold { font-weight: 600; }
.confirm { position: absolute; left: 8px; right: 8px; bottom: calc(8px + var(--sab)); max-width: 500px; margin: 0 auto; transform: translateY(110%); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.layer.in .confirm { transform: translateY(0); }
.confirm .group { background: rgba(250,250,250,.94); backdrop-filter: blur(20px); border-radius: 14px; overflow: hidden; }
.confirm .ttl { padding: 14px; text-align: center; font-size: 13px; color: #6d6d72; font-weight: 600; border-bottom: 1px solid rgba(0,0,0,.1); }
.confirm button { width: 100%; text-align: center; padding: 16px; font-size: 20px; color: #0a7bff; }
.confirm button.destructive { color: #ff3b30; }
.confirm .cancel { margin-top: 8px; background: #fff; border-radius: 14px; font-weight: 600; }

/* Loading overlay */
#loading { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; }
#loading .box { background: var(--card); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 13px; font-weight: 500; color: var(--muted); }
#loading .spinner { position: static; margin: 0; width: 26px; height: 26px; border-width: 3px; }

/* ─── Full-screen views (Workroom / Piece) ─── */
.fullscreen { position: fixed; inset: 0; z-index: 40; background: var(--paper); display: flex; flex-direction: column; transform: translateY(100%); transition: transform .38s cubic-bezier(.2,.8,.2,1); }
.fullscreen.in { transform: translateY(0); }
.wr-header { height: 56px; margin-top: var(--sat); display: flex; align-items: center; gap: 8px; padding: 8px 20px 0; flex: none; }
.wr-header .mid { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.wr-header .ttl { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-header .sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-header .save { height: 40px; padding: 0 18px; border-radius: 999px; background: var(--gold); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex: none; transition: opacity .2s, transform .12s; }
.wr-header .save:active { transform: scale(.95); }
.wr-header .save:disabled { opacity: .6; }
.wr-header .save .spinner { position: static; margin: 0; width: 14px; height: 14px; }

.wr-canvas { flex: 1; min-height: 90px; padding: 10px 18px; display: flex; align-items: center; justify-content: center; position: relative; }
.wr-canvas.compact { padding: 6px 12px; }
.compare { position: relative; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.12); touch-action: none; background: var(--line); }
.compare canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.compare .bar { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.4); margin-left: -1px; }
.compare .knob { position: absolute; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; font-size: 12px; transition: transform .15s ease-out; }
.compare .knob .icon svg { stroke-width: 3; }
.compare.dragging .knob { transform: scale(1.15); }
.compare .tag { position: absolute; top: 10px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0,0,0,.45); padding: 4px 8px; border-radius: 999px; }
.compare .tag.before { right: 10px; }
.compare .tag.after { left: 10px; }

.wr-panel { flex: none; background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0; padding: 12px 0 var(--sab); display: flex; flex-direction: column; gap: 10px; }
.rail { height: 136px; overflow: hidden; }
.rail.compact { height: 120px; }
.rail-inner { max-width: var(--content); margin: 0 auto; height: 100%; }
.rail-scroll { height: 100%; overflow-y: auto; padding: 0 22px; scrollbar-width: none; }
.rail-scroll::-webkit-scrollbar { display: none; }
.rail-col { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.looks-rail { display: flex; flex-direction: column; gap: 8px; }
.looks-rail .pills { padding: 0 18px; gap: 6px; }
.tiles { display: flex; gap: 10px; overflow-x: auto; padding: 0 18px 4px; scrollbar-width: none; }
.tiles::-webkit-scrollbar { display: none; }
.tile { flex: none; width: 74px; display: flex; flex-direction: column; align-items: center; gap: 5px; transition: transform .12s; }
.tile:active { transform: scale(.95); }
.tile .pic { width: 66px; height: 66px; border-radius: 16px; overflow: hidden; background: var(--line); border: 1px solid var(--line); box-sizing: border-box; }
.tile.on .pic { border: 3px solid var(--gold); }
.tile .pic img { width: 100%; height: 100%; object-fit: cover; }
.tile .name { font-size: 10px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 74px; }
.tile.on .name { font-weight: 700; color: var(--text); }

.knob-row { display: flex; align-items: center; gap: 10px; height: 30px; }
.knob-row .lbl { width: 70px; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.knob-row .val { width: 30px; text-align: right; font-size: 11px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; cursor: pointer; }
.knob-row input[type=range] { flex: 1; -webkit-appearance: none; appearance: none; height: 28px; background: transparent; margin: 0; min-width: 0; }
.knob-row input[type=range]:focus { outline: none; }
.knob-row input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--gold) 0 var(--p, 50%), #e5e5ea var(--p, 50%) 100%); }
.knob-row input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: #e5e5ea; }
.knob-row input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--gold); }
.knob-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); margin-top: -11px; }
.knob-row input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }

.wide-row { display: flex; gap: 10px; padding: 0 22px; }
.wide { flex: 1; min-width: 0; height: 52px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 0 6px; transition: transform .12s; }
.wide:active { transform: scale(.96); }
.wide.filled { background: var(--text); color: var(--paper); border-color: transparent; }
.wide .icon { font-size: 14px; }
.wide .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wide.square { flex: none; width: 52px; padding: 0; font-size: 17px; }

.panel-tabs { display: flex; padding: 0 12px; max-width: var(--content); margin: 0 auto; width: 100%; }
.panel-tabs button { flex: 1; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; transition: color .2s; }
.panel-tabs button .icon { font-size: 17px; }
.panel-tabs button.on { color: var(--text); }
.panel-tabs button::after { content: ""; position: absolute; bottom: 0; left: 50%; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: transparent; transition: background .2s; }
.panel-tabs button.on::after { background: var(--gold); }

/* Toast */
.toast { position: absolute; left: 30px; right: 30px; display: flex; justify-content: center; z-index: 45; pointer-events: none; transition: opacity .3s, transform .35s cubic-bezier(.2,.8,.2,1); opacity: 0; transform: translateY(20px); }
.toast.in { opacity: 1; transform: translateY(0); }
.toast span { background: var(--text); color: var(--paper); font-size: 14px; font-weight: 600; padding: 12px 18px; border-radius: 999px; text-align: center; }

/* Render curtain */
.curtain { position: absolute; inset: 0; z-index: 44; background: rgba(249,246,241,.94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.curtain.in { opacity: 1; pointer-events: auto; }
.curtain .stage { position: relative; display: flex; align-items: center; justify-content: center; animation: breathe 1.4s ease-in-out infinite alternate; }
@keyframes breathe { from { transform: scale(.98); } to { transform: scale(1.02); } }
.curtain .tileimg { border-radius: 26px; overflow: hidden; position: relative; }
.curtain .tileimg img { width: 100%; height: 100%; object-fit: cover; filter: blur(6px); transform: scale(1.06); }
.curtain .grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.35) .5px, transparent .5px), linear-gradient(90deg, rgba(255,255,255,.35) .5px, transparent .5px); background-size: 24px 24px; }
.curtain .scan { position: absolute; left: 0; right: 0; height: 70px; background: linear-gradient(to bottom, rgba(214,163,56,0), rgba(214,163,56,.85), rgba(214,163,56,0)); animation: scan 1.6s linear infinite; }
@keyframes scan { from { top: -30%; } to { top: 105%; } }
.curtain svg.ring { position: absolute; }
.curtain svg.ring .track { stroke: var(--line); }
.curtain svg.ring .prog { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 2.3s ease-in-out; }
.curtain .txt { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 30px; text-align: center; }
.curtain .h { font-family: var(--serif); font-weight: 600; font-size: 22px; }
.curtain .s { font-size: 15px; color: var(--muted); transition: opacity .3s, transform .3s; }
.curtain .s.swap { opacity: 0; transform: translateY(8px); }

/* Piece view */
.piece-view { display: flex; flex-direction: column; gap: 18px; height: 100%; }
.piece-view .hd { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--sat)) 20px 0; }
.piece-view .hd .mid { text-align: center; display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; padding: 0 10px; }
.piece-view .hd .ttl { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piece-view .hd .date { font-size: 12px; color: var(--muted); }
.piece-view .pic { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px 20px; }
.piece-view .pic img { max-width: 100%; max-height: 100%; border-radius: 20px; box-shadow: 0 12px 48px rgba(0,0,0,.15); object-fit: contain; }
.piece-view .acts { padding: 0 20px calc(16px + var(--sab)); max-width: var(--content); margin: 0 auto; width: 100%; display: flex; gap: 10px; }

/* Kept sheet */
.kept { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-bottom: 8px; }
.kept img { max-height: 180px; max-width: calc(100% - 44px); border-radius: 18px; box-shadow: 0 8px 32px rgba(0,0,0,.12); object-fit: contain; }
.kept .h { font-family: var(--serif); font-weight: 600; font-size: 24px; }
.kept .m { font-size: 14px; color: var(--muted); text-align: center; padding: 0 22px; }
.kept .wide-row { width: 100%; }

@media (min-width: 720px) {
  .fullscreen, .sheet .inner { }
}
