/* MPMA · estilos base de las apps web: los mismos tokens y componentes que el Panel del encargado. */
html { -webkit-text-size-adjust: 100% } body { margin: 0 } [hidden] { display: none !important }
:root {
  /* Tono renacentista contenido: piedra cálida, tinta sepia, rojo veneciano y oro viejo para filetes. */
  --bg: #F4EFE7; --surface: #FFFDF9; --sunk: #EBE3D6; --ink: #2A1F1A; --muted: #6A5C52; --line: #DED3C3;
  --accent: #7A2420; --accent-ink: #FFFFFF; --accent-soft: #F3E2DC; --pen: #1F3FB0; --pen-soft: #E4EAFB;
  --gold: #A8843A; --gold-soft: #EADDBE;
  --u1: #B3261E; --u1-soft: #FBE6E4; --u2: #9A5B00; --u2-soft: #FBEFD9; --u3: #2F5D8A; --u3-soft: #E3EDF7; --u4: #5F5A5A; --u4-soft: #EAE6E4;
  --ok: #2E6B3E; --ok-soft: #E2F1E5; --warn: #9A5B00; --warn-soft: #FBEFD9;
  --display: "Cormorant Garamond", Garamond, Georgia, serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
  --r: 6px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #16110D; --surface: #201913; --sunk: #2A211A; --ink: #F1E9DF; --muted: #AD9F92; --line: #3B3027;
  --accent: #E39A8C; --accent-ink: #2A0F0D; --accent-soft: #3A231F; --pen: #A9BCFF; --pen-soft: #222C4A;
  --gold: #D6B36A; --gold-soft: #3A2F1C;
  --u1: #FF8A80; --u1-soft: #44201E; --u2: #F0B45A; --u2-soft: #3D2E12; --u3: #8DB8E6; --u3-soft: #1D2E40; --u4: #B5ADAB; --u4-soft: #322A29;
  --ok: #8FCC9B; --ok-soft: #1E3324; --warn: #F0B45A; --warn-soft: #3D2E12; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #16110D; --surface: #201913; --sunk: #2A211A; --ink: #F1E9DF; --muted: #AD9F92; --line: #3B3027;
  --accent: #E39A8C; --accent-ink: #2A0F0D; --accent-soft: #3A231F; --pen: #A9BCFF; --pen-soft: #222C4A;
  --gold: #D6B36A; --gold-soft: #3A2F1C;
  --u1: #FF8A80; --u1-soft: #44201E; --u2: #F0B45A; --u2-soft: #3D2E12; --u3: #8DB8E6; --u3-soft: #1D2E40; --u4: #B5ADAB; --u4-soft: #322A29;
  --ok: #8FCC9B; --ok-soft: #1E3324; --warn: #F0B45A; --warn-soft: #3D2E12; color-scheme: dark }
* { box-sizing: border-box }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.45 }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg) }
.wrap { max-width: 760px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
header.top { padding-block: 18px 6px }
.top .row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap }
h1 { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: -0.01em }
.brand { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0 0 4px }
.today { color: var(--muted); font-size: 13px }
.sync { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--u4); display: inline-block }
.sync.on i { background: var(--ok) } .sync.local i { background: var(--warn) }
nav.tabs { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line) }
nav.tabs .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 8px }
nav.tabs .wrap::-webkit-scrollbar { display: none }
nav.tabs a { flex: none; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 999px; white-space: nowrap }
nav.tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink) }
nav.tabs a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
main { padding-block: 18px 56px; display: flex; flex-direction: column; gap: 18px }
h2 { font-family: var(--display); font-weight: 700; font-size: 20px; margin: 0; text-wrap: balance }
h3 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 600 }
p { margin: 0 } .lead { color: var(--muted); font-size: 14px; max-width: 62ch }
.stack { display: flex; flex-direction: column; gap: 12px }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px }
textarea, input[type="text"], input[inputmode], select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; min-width: 0 }
textarea { resize: vertical; min-height: 68px }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 12px; font-weight: 600; font-size: 14px }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent) }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); padding: 6px 8px; font-weight: 500 }
button.danger { color: var(--u1); border-color: var(--u1) }
button[disabled] { opacity: .55; cursor: default }
.seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px }
.seg label { display: block; text-align: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); background: var(--bg) }
.seg input { position: absolute; opacity: 0; pointer-events: none }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px }
.seg label:has(input:checked)[data-u="1"] { background: var(--u1-soft); color: var(--u1); border-color: var(--u1) }
.seg label:has(input:checked)[data-u="2"] { background: var(--u2-soft); color: var(--u2); border-color: var(--u2) }
.seg label:has(input:checked)[data-u="3"] { background: var(--u3-soft); color: var(--u3); border-color: var(--u3) }
.seg label:has(input:checked)[data-u="4"] { background: var(--u4-soft); color: var(--u4); border-color: var(--u4) }
.formrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.formrow select { width: auto; flex: 1 1 140px } .formrow .primary { flex: 1 1 140px }
.group-h { display: flex; align-items: center; gap: 8px; margin-top: 6px }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em }
.pill[data-u="1"] { background: var(--u1-soft); color: var(--u1) } .pill[data-u="2"] { background: var(--u2-soft); color: var(--u2) }
.pill[data-u="3"] { background: var(--u3-soft); color: var(--u3) } .pill[data-u="4"] { background: var(--u4-soft); color: var(--u4) }
.count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums }
.idea { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; border-left: 4px solid var(--u4) }
.idea[data-u="1"] { border-left-color: var(--u1) } .idea[data-u="2"] { border-left-color: var(--u2) } .idea[data-u="3"] { border-left-color: var(--u3) }
.idea.done { border-left-color: var(--ok) } .idea.done .txt { text-decoration: line-through; color: var(--muted) }
.idea .tick { width: 26px; height: 26px; border-radius: 50%; padding: 0; display: grid; place-items: center; font-size: 14px; line-height: 1; color: transparent }
.idea.done .tick { background: var(--ok); border-color: var(--ok); color: var(--surface) }
.idea .txt { white-space: pre-wrap; overflow-wrap: anywhere }
.idea .meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--muted) }
.idea .meta select { width: auto; padding: 4px 8px; font-size: 12px; background: var(--bg) }
.idea .meta button { font-size: 12px }
.tag { background: var(--sunk); padding: 2px 8px; border-radius: 6px; font-weight: 600 }
.empty { border: 1px dashed var(--line); border-radius: var(--r); padding: 22px 16px; text-align: center; color: var(--muted) }
.empty b { display: block; color: var(--ink); font-family: var(--display); font-size: 17px; margin-bottom: 4px }
.bar { height: 8px; background: var(--sunk); border-radius: 999px; overflow: hidden }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s }
@media (prefers-reduced-motion: reduce) { .bar i { transition: none } }
.progress { display: flex; align-items: center; gap: 10px } .progress .bar { flex: 1 } .progress .count { min-width: 5ch; text-align: right }
.item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--line) }
.sec .item:first-of-type { border-top: 0 }
.item input[type="checkbox"] { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent) }
.item label { cursor: pointer } .item.checked > label, .subitem.checked > label { color: var(--muted); text-decoration: line-through }
.item.plain > .ttl { grid-column: 1 / -1; font-weight: 600 }
.item .more { grid-column: 2; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px }
.item.plain .more { grid-column: 1 / -1; font-size: 14px; color: var(--ink) }
.item ul { margin: 0; padding-left: 18px } .item li { margin: 1px 0 }
.item.off { opacity: .55 }
.subitem { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px 10px; padding: 5px 0 }
.noterow { grid-column: 2; display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
.notechip { background: var(--pen-soft); color: var(--pen); border-color: transparent; font-style: italic; font-weight: 600; padding: 3px 9px; font-size: 13px; text-align: left; overflow-wrap: anywhere }
.notebtn { font-size: 12px; padding: 2px 6px }
.noteinp { padding: 6px 10px !important; font-size: 14px !important; color: var(--pen) !important }
.day { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 5px; background: var(--sunk); color: var(--muted); margin-right: 6px }
.day.today { background: var(--warn-soft); color: var(--warn) }
.mark { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; white-space: nowrap }
.note { font-size: 13px; padding: 10px 12px; border-radius: 8px; background: var(--sunk); color: var(--ink) }
.note.warn { background: var(--warn-soft); border-left: 4px solid var(--warn) }
.note.alert { background: var(--u1-soft); border-left: 4px solid var(--u1) }
.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end }
.calc label, .fld { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 4px }
.result { font-family: var(--display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums }
.result small { display: block; font-family: var(--body); font-size: 12px; font-weight: 500; color: var(--muted) }
.result.bad { color: var(--u1) } .result.good { color: var(--ok) }
.tablewrap { overflow-x: auto } table { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 520px }
th, td { text-align: left; vertical-align: top; padding: 8px; border-top: 1px solid var(--line) } th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-size: 13px; z-index: 20; max-width: calc(100% - 32px) }
.head-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap }
.sheets { display: flex; flex-direction: column; gap: 14px }
.sheet { display: flex; flex-direction: column; gap: 8px }
.sheet img { width: 100%; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; display: block }
.sheet .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap }
.inv-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start }
.sec .inv-row:first-of-type { border-top: 0 }
.inv-tog { min-width: 66px; padding: 6px 10px; font-size: 13px; color: var(--ok); border-color: var(--ok); background: var(--ok-soft) }
.inv-row.falta .inv-tog { color: var(--u1); border-color: var(--u1); background: var(--u1-soft) }
.inv-name { font-weight: 600; overflow-wrap: anywhere }
.inv-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; color: var(--muted) }
.inv-meta .ghost { font-size: 12px; padding: 2px 6px }
.nosup { font-style: italic }
.inv-qty { grid-column: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px }
.inv-qty input, .inv-edit input, .inv-edit select { padding: 7px 10px; font-size: 14px }
.inv-edit { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px }
details.panel > summary { cursor: pointer; font-weight: 600 }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); cursor: pointer }
.chk input { width: 18px; height: 18px; accent-color: var(--accent) }
.falt-g { padding-top: 8px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px }
.falt-g ul { margin: 0; padding-left: 18px }
.invcount { font-family: var(--display); font-size: 18px; font-weight: 700 }
.invcount.has { color: var(--u1) }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.foto-pick { display: flex; gap: 8px; flex-wrap: wrap }
.btnlike { display: inline-flex; align-items: center; justify-content: center; flex: 1 1 160px; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 12px; font-weight: 600; font-size: 15px }
.btnlike.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent) }
.btnlike:focus-within { outline: 2px solid var(--accent); outline-offset: 2px }
.picker { position: relative; overflow: hidden; min-height: 48px }
.picker input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 100px; z-index: 1 }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px }
.thumbs:empty { display: none }
.thumb { position: relative }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block }
.thumb button { position: absolute; top: 4px; right: 4px; padding: 2px 8px; font-size: 12px }
.prop { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--u4); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 10px }
.prop[data-t="pendiente"] { border-left-color: var(--u2) } .prop[data-t="idea"] { border-left-color: var(--u3) } .prop[data-t="faltante"] { border-left-color: var(--u1) }
.prop.saved { flex-direction: row; align-items: center; gap: 8px; color: var(--ok); font-weight: 600; border-left-color: var(--ok) }
.prop .desc { font-size: 13px; color: var(--muted); overflow-wrap: anywhere }
.tipos { display: flex; gap: 6px; flex-wrap: wrap }
.tipos button { padding: 6px 12px; font-size: 13px }
.tipos button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent) }
.ask-box { background: var(--pen-soft); color: var(--pen); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px }
.ask-box .opts { display: flex; flex-wrap: wrap; gap: 6px }
.ask-box .opts button { border-color: var(--pen); color: var(--pen); background: var(--surface) }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px }
.prop .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap }
.conf { font-size: 12px; color: var(--muted) } .conf.low { color: var(--warn); font-weight: 600 }
/* Solo web */
.brand a { color: inherit; text-decoration: none }
.brand a::before { content: "← "; }
.hub { display: grid; gap: 12px }
.hub a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: var(--r); padding: 16px }
.hub a b { font-family: var(--display); font-size: 20px }
.hub a span { color: var(--muted); font-size: 14px }
.hub a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.segtabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding-block: 8px; border-bottom: 1px solid var(--line) }
.segtabs a { text-align: center; text-decoration: none; font-weight: 600; padding: 10px; border-radius: 999px; color: var(--muted); border: 1px solid var(--line) }
.segtabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent) }
/* En taller y barra el título ya está en la cabecera de la página. */
#app > .stack:first-child > h2:first-child { display: none }
@media (min-width: 700px) { .hub { grid-template-columns: 1fr 1fr } }
