:root {
  color-scheme: light;
  --paper: #f9efe1;
  --edge: #e8d8c3;
  --surface: #fff8ee;
  --ink: #3d191a;
  --muted: #71514e;
  --accent: #a42b36;
  --action-ink: #fff9f0;
  --soft: #ecd2cb;
  --rule: #c19d92;
  --warn: #844715;
  --goal-over: #315a9d;
  --energy-over: #9f1743;
  --energy-over-bg: #f9e1e7;
  --focus: #994d31;
  --shadow: #54251d22;
  --display: 'Instrument Serif', 'Palatino Linotype', Palatino, Georgia, serif;
  --body: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --button-radius: 999px;
  --field-radius: 9px;
  --panel-radius: 14px;
  --title-slant: italic;
  --display-weight: 400;
}

:root[data-effective="dark"] {
  color-scheme: dark;
  --paper: #261d19;
  --edge: #191310;
  --surface: #32251f;
  --ink: #f9e8cc;
  --muted: #dac0a9;
  --accent: #ff967d;
  --action-ink: #361612;
  --soft: #50322c;
  --rule: #806052;
  --warn: #ffbe83;
  --goal-over: #a7ccfa;
  --energy-over: #ff96ac;
  --energy-over-bg: #48242d;
  --focus: #ffba96;
  --shadow: #0005;
}

:root[data-theme="pixel"] {
  --paper: #e0f6ea;
  --edge: #c1e5da;
  --surface: #f1fff8;
  --ink: #082f2e;
  --muted: #315b55;
  --accent: #087369;
  --action-ink: #f2fff8;
  --soft: #c7e8db;
  --rule: #61978e;
  --warn: #794317;
  --goal-over: #4d438b;
  --focus: #825015;
  --shadow: #0c493028;
  --display: 'Bitcount Prop Single', 'Courier New', monospace;
  --button-radius: 0;
  --field-radius: 0;
  --panel-radius: 0;
  --title-slant: normal;
  --display-weight: 600;
}

:root[data-theme="pixel"][data-effective="dark"] {
  --paper: #0b2431;
  --edge: #061520;
  --surface: #112e3c;
  --ink: #e6fcfb;
  --muted: #b9dcdd;
  --accent: #62e1d7;
  --action-ink: #072525;
  --soft: #214452;
  --rule: #67808a;
  --warn: #ffbf7e;
  --goal-over: #c7baff;
  --focus: #ffcc8a;
  --shadow: #0007;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--edge); }
body { margin: 0; color: var(--ink); font: 1rem/1.5 var(--body); }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button[disabled] { cursor: wait; opacity: .55; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
a { color: var(--accent); }

.skip { position: fixed; z-index: 5; left: 1rem; top: -8rem; background: var(--surface); padding: 1rem; }
.skip:focus { top: 1rem; }
.shell { min-height: 100svh; width: min(100%, 43rem); margin: auto; background: var(--paper); box-shadow: 0 0 60px var(--shadow); }
.masthead {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-height: 4.15rem;
  margin-inline: clamp(1rem, 5vw, 2rem);
  padding: max(.45rem, env(safe-area-inset-top)) 0 .45rem;
  border-bottom: 1px solid var(--rule);
}
.wordmark { border: 0; background: none; padding: 0; color: var(--ink); font: var(--display-weight) var(--title-slant) 1.8rem/1.1 var(--display); letter-spacing: -.025em; }
.wordmark span { color: var(--accent); }
.connection { margin-left: auto; font-size: .85rem; color: var(--warn); text-align: right; }
.icon-button { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--ink); padding: .35rem .6rem; border-radius: var(--field-radius); font-size: 1.2rem; }
.icon-button:hover { background: var(--soft); }
#view { padding: 0 clamp(1rem, 5vw, 2rem) calc(var(--nav-height, 3.75rem) + 1rem); min-height: 60vh; min-height: 60svh; outline: none; }
h1, h2, h3 { font-family: var(--display); font-weight: var(--display-weight); line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.65rem, 9vw, 4.25rem); font-style: var(--title-slant); letter-spacing: -.05em; }
h2 { font-size: clamp(1.55rem, 5.9vw, 2.1rem); letter-spacing: -.025em; }
h3 { font-size: 1.3rem; letter-spacing: -.01em; }
p { margin: 0; }
.muted, .help { color: var(--muted); }
.help { font-size: .9rem; }
.warning { color: var(--warn); font-weight: 650; }
.page-title { padding-block: 1.2rem 1.05rem; display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.date-band { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: .16rem; }
.date-band::before, .date-band::after { content: ''; height: 1px; background: var(--rule); }
.date-button { font: var(--title-slant) var(--display-weight) 1.25rem/1.3 var(--display); border: 0; padding: .65rem .55rem; min-height: 44px; background: none; white-space: nowrap; }
.date-button:hover { color: var(--accent); }
.diary-title { text-align: center; padding-block: 1.25rem .1rem; }
.hero { padding: .8rem 0 1.15rem; border-bottom: 1px solid var(--rule); }
.hero-value {
  color: var(--accent);
  font: var(--display-weight) var(--title-slant) clamp(4rem, 16vw, 7rem)/.94 var(--display);
  letter-spacing: -.045em;
  font-variant-numeric: lining-nums tabular-nums;
  overflow-wrap: anywhere;
}
.hero-value span { font-size: .45em; letter-spacing: -.045em; }
.hero-notes { color: var(--muted); display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .7rem; margin-top: .7rem; font-size: .94rem; }
.hero-notes strong { color: var(--ink); }
.hero.over-goal .hero-value, .hero-notes .energy-alert { color: var(--energy-over); }
.energy-alert {
  padding: .15rem .58rem;
  border: 1px solid currentColor;
  border-radius: var(--button-radius);
  background: var(--energy-over-bg);
}
.macro-list {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(2rem, 1fr) minmax(0, max-content);
  column-gap: .7rem;
  padding: 0;
  list-style: none;
  margin: 0;
}
.macro {
  --goal-fill: var(--accent);
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(2rem, 1.2fr) minmax(0, 1.4fr);
  grid-template-columns: subgrid;
  column-gap: inherit;
  align-items: center;
  padding: .65rem 0;
  border-bottom: 1px solid var(--rule);
}
.macro.over-goal { --goal-fill: var(--goal-over); }
.macro strong { font: var(--display-weight) 1.28rem/1.25 var(--display); overflow-wrap: anywhere; }
.macro-values { text-align: right; font-size: .94rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.macro-values small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.25; }
.macro.over-goal .macro-values { color: var(--goal-over); }
.macro.over-goal .macro-values small { color: inherit; font-weight: 700; }
.track { height: .45rem; border-radius: 999px; background: var(--soft); overflow: hidden; }
.fill { width: 0; height: 100%; border-radius: inherit; background: var(--goal-fill); }
.fill.partial { background: repeating-linear-gradient(135deg, var(--goal-fill) 0 4px, var(--soft) 4px 6px); }
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .45rem; margin: 1.15rem 0 .55rem; }
.section-head h2 { padding-block: .2rem; }
.diary-tools { display: flex; align-items: center; flex-wrap: wrap; gap: .05rem; margin-inline-start: auto; }
.diary-list { margin: 0; padding: 0; list-style: none; }
.diary-row { position: relative; padding-left: .95rem; }
.diary-row:not(:last-child)::before { content: ''; position: absolute; left: .22rem; width: 1px; top: 1.6rem; bottom: -1.55rem; background: var(--rule); }
.diary-row::after { content: ''; position: absolute; top: 1.45rem; left: 0; width: .48rem; height: .48rem; border-radius: 50%; background: var(--accent); }
.diary-row + .diary-row .entry-button { border-top: 1px solid var(--rule); }
.entry-button { border: 0; background: transparent; width: 100%; text-align: left; padding: .9rem .2rem .9rem 0; display: grid; grid-template-columns: 3.6rem 1fr auto; align-items: baseline; gap: .6rem; min-height: 3.6rem; }
.entry-button:hover .row-title { color: var(--accent); }
.entry-button time, .entry-hour { color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums; }
.row-title { display: block; font: var(--display-weight) 1.28rem/1.25 var(--display); overflow-wrap: anywhere; }
.row-detail { display: block; font-size: .84rem; color: var(--muted); margin-top: .18rem; }
.row-detail.warning { color: var(--warn); }
.entry-kcal { font-size: .83rem; color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.diary-actions { margin-top: .6rem; position: sticky; z-index: 1; bottom: var(--nav-height, 3.75rem); display: flex; gap: .55rem; padding: .7rem 0 .55rem; background: var(--paper); }
.diary-actions .primary { flex: 1; }
.date-band button[disabled] { cursor: default; }
.button, .primary, .secondary, .link-button, .danger {
  border: 1px solid var(--rule);
  border-radius: var(--button-radius);
  min-height: 44px;
  padding: .6rem 1.05rem;
  background: transparent;
  text-decoration: none;
  text-align: center;
  font-weight: 630;
}
.primary { border-color: var(--accent); background: var(--accent); color: var(--action-ink); }
.primary:hover { filter: brightness(.92); }
.secondary { background: var(--surface); }
.secondary:hover { background: var(--soft); }
.link-button { border-color: transparent; padding-inline: .55rem; color: var(--accent); }
.link-button:hover { text-decoration: underline; }
.danger { color: var(--accent); }
.full { width: 100%; }
.compact { padding-inline: .75rem; font-size: .86rem; }
.empty { padding: 1.4rem 0; color: var(--muted); }
.mini-empty { padding: .75rem 0; color: var(--muted); font-size: .9rem; }
.navigation {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; z-index: 2; inset: auto 0 0;
  width: min(100%, 43rem); margin-inline: auto; background: var(--paper);
  padding: .18rem .4rem max(.22rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--rule);
}
.navigation button { min-height: 44px; border: 0; background: transparent; padding: .35rem .25rem; font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.navigation button[aria-current="page"] { color: var(--accent); font-weight: 750; text-decoration: underline; text-underline-offset: .27em; }

.tabs { display: flex; flex-wrap: wrap; gap: .35rem; padding: .25rem; border: 1px solid var(--rule); border-radius: var(--panel-radius); margin-bottom: .9rem; }
.tabs button { border: 0; flex: 1; min-height: 44px; background: transparent; padding: .4rem .65rem; border-radius: var(--field-radius); white-space: nowrap; font-weight: 650; }
.tabs button[aria-pressed="true"] { color: var(--action-ink); background: var(--accent); }
.panel { border: 1px solid var(--rule); border-radius: var(--panel-radius); background: var(--surface); padding: 1rem; margin-bottom: .9rem; }
.panel > * + * { margin-top: .7rem; }
.stack { display: grid; gap: .85rem; }
.inline { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.list { border-top: 1px solid var(--rule); }
.list-row { border: 0; border-bottom: 1px solid var(--rule); background: transparent; display: block; text-align: left; width: 100%; padding: .8rem .15rem; min-height: 54px; }
.list-row:hover { background: var(--soft); }
.list-row strong { color: var(--ink); display: block; overflow-wrap: anywhere; }
.list-row small { display: block; color: var(--muted); }
.typed-row, .typed-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .6rem; }
.type-tag {
  --type-color: var(--muted);
  width: max-content;
  padding: .15rem .46rem;
  border: 1px solid color-mix(in srgb, var(--type-color) 50%, transparent);
  border-radius: var(--button-radius);
  background: color-mix(in srgb, var(--type-color) 9%, var(--surface));
  color: var(--type-color);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.3;
}
.type-tag[data-kind="recipes"] { --type-color: var(--goal-over); }
.type-tag[data-kind="habits"] { --type-color: var(--accent); }
.type-tag:is([data-kind="preparations"], [data-kind="tuppers"]) { --type-color: var(--warn); }
.history-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .25rem .7rem; }
.history-row small { grid-column: 1 / -1; }

dialog { margin: auto; padding: 0; width: min(100%, 35rem); max-width: none; max-height: 93svh; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--panel-radius); overflow: auto; box-shadow: 0 15px 80px var(--shadow); }
dialog::backdrop { background: #220d12a0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .85rem 1.15rem; background: var(--paper); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 2; }
.modal-head h2 { font-size: clamp(1.5rem, 5vw, 2.2rem); overflow-wrap: anywhere; }
.modal-head-actions { display: flex; align-items: center; gap: .35rem; }
.modal-body { padding: 1.05rem; }
.modal-actions { display: flex; flex-wrap: wrap; gap: .55rem; padding: .85rem 1.05rem max(.85rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); position: sticky; bottom: 0; z-index: 2; background: var(--paper); }
.modal-actions .primary { flex: 1; }
.form-error { color: var(--warn); padding: .6rem 1.05rem; font-weight: 650; }
label.field { display: flex; flex-direction: column; min-width: 0; gap: .28rem; font-size: .92rem; font-weight: 640; }
input:not([type="checkbox"]), select, textarea {
  appearance: none;
  border: 1px solid var(--rule);
  border-radius: var(--field-radius);
  background: var(--surface);
  min-height: 46px;
  width: 100%;
  max-width: 100%;
  padding: .55rem .65rem;
  font-weight: 450;
  font-size: 1rem;
}
input[type="checkbox"] { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }
select { appearance: auto; }
textarea { min-height: 6rem; resize: vertical; }
fieldset { min-width: 0; padding: .7rem; border: 1px solid var(--rule); border-radius: var(--panel-radius); }
legend { padding-inline: .3rem; font-weight: 650; }
.nutri-fields { display: grid; gap: .35rem; }
.nutri-fields label { display: grid; grid-template-columns: 1fr 6.25rem minmax(1.2rem, auto); align-items: center; gap: .38rem; font-size: .95rem; }
.nutri-fields small { color: var(--muted); grid-column: 2/-1; font-weight: 450; }
.nutri-fields input { text-align: right; }
.ingredient { border-bottom: 1px solid var(--rule); padding-block: .65rem; scroll-margin-block: 5rem calc(var(--modal-footer-height, 0px) + 4rem); }
.ingredient:last-child { border-bottom: 0; }
.ingredient-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .35rem; align-items: center; }
.ingredient-heading > strong { overflow-wrap: anywhere; }
.ingredient-tools { position: sticky; bottom: var(--modal-footer-height, 0px); z-index: 1; display: grid; padding-block: .25rem; background: var(--paper); }
.panel .ingredient-tools { background: var(--surface); }
.ingredient-picker, .tupper-card { scroll-margin-block: 5rem calc(var(--modal-footer-height, 0px) + 4rem); }
.ingredient .split { margin-top: .35rem; }
.check { display: flex; align-items: center; gap: .5rem; min-height: 44px; }
.scroll-list { max-height: min(36svh, 20rem); overflow: auto; }
.toolbar { display: flex; gap: .55rem; align-items: center; }
.toolbar > :first-child { flex: 1; }
.dialog-video { width: 100%; max-height: 40svh; object-fit: contain; background: var(--edge); }
.toast { position: fixed; z-index: 6; right: max(1rem, calc((100vw - 41rem) / 2)); top: max(.65rem, env(safe-area-inset-top)); max-width: min(22rem, calc(100vw - 2rem)); background: var(--ink); color: var(--paper); padding: .75rem 1rem; border-radius: var(--field-radius); box-shadow: 0 5px 18px var(--shadow); pointer-events: none; }
.pair { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: .55rem; padding: .4rem 0; border-bottom: 1px solid var(--rule); }
.selection-note { border-left: 3px solid var(--accent); padding-left: .65rem; font-size: .9rem; color: var(--muted); }

.picker-tools { display: flex; gap: .5rem; }
.picker-tools input { flex: 1; min-width: 0; }
.scan-shortcut { display: inline-flex; align-items: center; gap: .4rem; padding-inline: .7rem; white-space: nowrap; font-size: .9rem; }
.scan-shortcut::before {
  content: '';
  width: .85rem;
  height: .8rem;
  background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 3px, currentColor 3px 5px, transparent 5px 6px);
}
.picker-filters:empty { display: none; }
.picker-filters .tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0; padding: 0; border: 0; scrollbar-width: thin; }
.picker-filters .tabs button { flex: 0 0 auto; padding-inline: .65rem; font-size: .88rem; }
.food-picker > .link-button { justify-self: start; }
.library-page > .link-button { justify-self: start; }
.guided-picker .scroll-list { max-height: min(36svh, 19rem); }
.entry-form { gap: .7rem; }
.entry-selection { padding-inline: .8rem; border: 1px solid var(--rule); border-radius: var(--panel-radius); background: var(--surface); }
.entry-selection .ingredient:last-child { padding-bottom: .85rem; }
.ingredient .ingredient-remove { font-size: 1.4rem; line-height: 1; }
.entry-total { align-self: center; color: var(--accent); font-weight: 750; white-space: nowrap; }
.item-detail-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; align-items: baseline; }
.item-detail-head h3 { overflow-wrap: anywhere; }
.item-detail-head > strong { white-space: nowrap; }
.item-detail > .entry-options { margin-top: .35rem; border-bottom: 0; }
.entry-options { border-bottom: 1px solid var(--rule); }
.entry-options > summary, .settings-disclosure > summary {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font-weight: 650;
}
.entry-options > summary::-webkit-details-marker, .settings-disclosure > summary::-webkit-details-marker { display: none; }
.entry-options > summary::after, .settings-disclosure > summary::after { content: '+'; margin-inline-start: auto; color: var(--muted); }
.entry-options[open] > summary::after, .settings-disclosure[open] > summary::after { content: '−'; }
.entry-options > .stack { padding-block: .15rem .8rem; }
.entry-date summary strong { margin-inline-start: auto; color: var(--muted); font-weight: 550; font-size: .88rem; }
.entry-date summary::after { margin-inline-start: 0; }
.settings-list { display: grid; gap: .55rem; }
.settings-list .panel { margin: 0; }
.settings-link, .settings-disclosure { border: 1px solid var(--rule); border-radius: var(--panel-radius); background: var(--surface); }
.settings-link, .settings-disclosure > summary { padding: .65rem .85rem; min-height: 50px; }
.settings-link { display: flex; justify-content: space-between; align-items: center; text-align: start; font-weight: 650; }
.settings-link > span { color: var(--muted); }
.settings-disclosure > .stack { padding: .1rem .85rem .85rem; }

[data-theme="pixel"] .wordmark, [data-theme="pixel"] .date-button { font-style: normal; }
[data-theme="pixel"] .hero-value { font-family: var(--display); letter-spacing: -.065em; font-size: clamp(3rem, 12vw, 5.95rem); }
[data-theme="pixel"] .macro strong, [data-theme="pixel"] .row-title { font: 640 1rem/1.35 var(--body); }
[data-theme="pixel"] .primary { box-shadow: 3px 3px 0 var(--ink); }
[data-theme="pixel"] .track { border-radius: 0; height: .58rem; border: 1px solid var(--ink); }
[data-theme="pixel"] .fill:not(.partial) { background: repeating-linear-gradient(90deg, var(--goal-fill) 0 7px, var(--soft) 7px 8px); }
[data-theme="pixel"] .diary-row::after { border-radius: 0; }
[data-theme="pixel"] .page-title h1, [data-theme="pixel"] .diary-title { text-shadow: 2px 2px 0 var(--soft); }

@media (min-width: 44rem) {
  .shell { min-height: calc(100svh - 2rem); margin-block: 1rem; border: 1px solid var(--rule); border-radius: var(--panel-radius); }
  .navigation { border-inline: 1px solid var(--rule); }
}
@media (max-width: 35rem) {
  dialog { margin: auto 0 0; width: 100%; border-radius: var(--panel-radius) var(--panel-radius) 0 0; }
  .masthead { min-height: 3.35rem; padding-bottom: .25rem; }
  .diary-title { padding-top: .8rem; font-size: 2.75rem; }
  .hero { padding-top: .55rem; padding-bottom: .75rem; }
  .macro { padding-block: .5rem; }
  .section-head { margin-top: .7rem; }
  .entry-button { padding-block: .7rem; min-height: 3.3rem; }
}
@media (max-width: 24rem) {
  .macro-list { column-gap: .45rem; }
  .macro strong { font-size: 1rem; }
  .entry-button { grid-template-columns: 3.2rem 1fr auto; gap: .35rem; }
}

/* Lectura de la etiqueta */
.label-scan { display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: start; border: 1px dashed var(--rule); border-radius: var(--panel-radius); background: var(--surface); padding: .85rem; }
.label-scan[data-state="idle"] { grid-template-columns: 1fr; }
.label-scan[data-state="done"] { border-style: solid; border-color: var(--accent); }
.label-scan-intro, .label-scan-status { display: grid; gap: .35rem; min-width: 0; }
.label-scan-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.label-scan-thumb { width: 4.5rem; height: 6rem; object-fit: cover; border-radius: var(--field-radius); border: 1px solid var(--rule); }
.label-scan progress { width: 100%; height: .5rem; accent-color: var(--accent); }
.label-scan-warnings { margin: 0; padding-left: 1.1rem; color: var(--warn); font-size: .9rem; }
.label-scan-text summary { color: var(--muted); font-size: .86rem; cursor: pointer; }
.label-scan-text pre { white-space: pre-wrap; max-height: 12rem; overflow: auto; font-size: .78rem; background: var(--paper); padding: .5rem; border-radius: var(--field-radius); }
.nutri-fields label.from-label input { border-color: var(--accent); box-shadow: 0 0 0 2px var(--soft); }
.nutri-fields label.from-label > span:first-child::after { content: ' · leído'; color: var(--accent); font-size: .78rem; }
.nutri-fields label.missing-label > span:first-child::after { content: ' · falta'; color: var(--warn); font-size: .78rem; }
.label-scan[data-state="crop"] { grid-template-columns: 1fr; }
.crop-stage { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: var(--field-radius); }
.crop-stage img { display: block; max-width: 100%; max-height: 58vh; pointer-events: none; }
.crop-box { position: absolute; border: 2px solid #fff; outline: 2px solid var(--accent); box-shadow: 0 0 0 100vmax #0008; cursor: move; }
.crop-handle { position: absolute; width: 2.75rem; height: 2.75rem; margin: -1.375rem; touch-action: none; }
.crop-handle::after { content: ''; position: absolute; inset: .9rem; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }
.crop-handle[data-corner="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.crop-handle[data-corner="ne"] { right: 0; top: 0; cursor: nesw-resize; }
.crop-handle[data-corner="sw"] { left: 0; bottom: 0; cursor: nesw-resize; }
.crop-handle[data-corner="se"] { right: 0; bottom: 0; cursor: nwse-resize; }
