:root {
  --bg: #FBF7F9;
  --surface: #FFFFFF;
  --ink: #2A1E2C;
  --muted: #6E5F70;
  --line: #EBDFE8;
  --coral: #C9472F;
  --coral-soft: #FCE6E1;
  --lilac: #EFE6F6;
  --peach: #FBE3D1;
  --ok: #2F6B3A;
  --ok-soft: #E2F0E4;
  --warn: #8A5A00;
  --warn-soft: #FBEFD6;
  --wood-1: #D8B27F;
  --wood-2: #C39664;
  --wood-ink: #6B4424;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --quote: "Newsreader", Georgia, "Times New Roman", serif;
  --body: "Figtree", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17121A; --surface: #211A24; --ink: #F3EAF1; --muted: #B7A6B6; --line: #3A2F3D;
    --coral: #F28B79; --coral-soft: #3B2320; --lilac: #2B2234; --peach: #36271F;
    --ok: #86C98F; --ok-soft: #1A2E1D; --warn: #E8B75A; --warn-soft: #33280F;
    --wood-1: #9C7650; --wood-2: #86623F; --wood-ink: #2E1C0E;
  }
}
:root[data-theme="dark"] {
  --bg: #17121A; --surface: #211A24; --ink: #F3EAF1; --muted: #B7A6B6; --line: #3A2F3D;
  --coral: #F28B79; --coral-soft: #3B2320; --lilac: #2B2234; --peach: #36271F;
  --ok: #86C98F; --ok-soft: #1A2E1D; --warn: #E8B75A; --warn-soft: #33280F;
  --wood-1: #9C7650; --wood-2: #86623F; --wood-ink: #2E1C0E;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.55; padding-inline: 20px; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
a { color: var(--coral); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.shell { max-width: 560px; margin-inline: auto; padding-block: 28px 64px; display: grid; gap: 24px; }
.shell.wide { max-width: 1080px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.brand-dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink); background: radial-gradient(circle at 35% 40%, var(--peach) 0 45%, transparent 46%), radial-gradient(circle at 65% 55%, var(--coral) 0 38%, transparent 39%), var(--lilac); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.eyebrow { font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--coral); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 5vw, 32px); display: grid; gap: 18px; }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: 10px; font: 600 1rem var(--body); text-decoration: none; padding: 13px 22px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--bg); cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { padding: 7px 14px; font-size: 0.88rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .hint { font-size: 0.85rem; color: var(--muted); }
input[type="text"], input[type="password"], input[type="file"], select, textarea {
  font: inherit; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
input.pin { font-family: var(--mono); font-size: 1.6rem; letter-spacing: 0.4em; text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }

.alert { border-radius: 12px; padding: 12px 14px; font-size: 0.95rem; }
.alert.error { background: var(--coral-soft); color: var(--coral); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }

.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--coral); transition: width .2s ease; }

.plaque { border-radius: 18px; padding: 28px 24px; color: var(--wood-ink); display: grid; gap: 10px; text-align: center;
  background: repeating-linear-gradient(97deg, rgba(0,0,0,.035) 0 2px, transparent 2px 9px), linear-gradient(160deg, var(--wood-1), var(--wood-2)); }
.engraved { font-family: var(--quote); font-style: italic; font-size: clamp(1.5rem, 6vw, 2rem); line-height: 1.2; text-shadow: 0 1px 0 rgba(255,255,255,.25), 0 -1px 0 rgba(0,0,0,.15); }
.plaque .sub { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }

audio, video { width: 100%; border-radius: 14px; background: #000; }
audio { background: transparent; }
.footer-note { text-align: center; font-size: .85rem; color: var(--muted); }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--bg); }
tr:last-child td { border-bottom: 0; }
.mono { font-family: var(--mono); font-size: .88rem; }
.chip { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.pending { background: var(--warn-soft); color: var(--warn); }
.chip.muted { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
dialog { border: 1px solid var(--line); border-radius: 20px; padding: 0; max-width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(23, 18, 26, .45); }
dialog .card { border: 0; }
.linkbox { display: grid; gap: 6px; }
.linkbox code { display: block; font-family: var(--mono); font-size: .82rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; overflow-wrap: anywhere; }

/* Pestañas y miniaturas del panel de Instagram */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); }
.tab { font: 600 .95rem var(--body); background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--muted); cursor: pointer; }
.tab.activa { color: var(--ink); border-bottom-color: var(--coral); }
.mini { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.mini img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.mini .orden { position: absolute; top: 6px; left: 6px; background: var(--ink); color: var(--surface); font-size: .7rem; padding: 1px 7px; border-radius: 999px; }
.mini .quitar { position: absolute; top: 6px; right: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; width: 22px; height: 22px; cursor: pointer; line-height: 1; }
.mini .mover { display: flex; gap: 4px; padding: 6px; justify-content: center; }
.mini .mover button { font-size: .75rem; padding: 2px 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; cursor: pointer; }
