
  :root {
    --bg: #101114;
    --panel: #181a1f;
    --panel-2: #202228;
    --text: #ffffff;
    --muted: #9ea3ad;
    --red: #ed1f24;
    --line: rgba(255,255,255,.10);
  }

  * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }

  html,
  body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  body {
    min-height: 100dvh;
  }

  button {
    font: inherit;
  }

  .app {
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
    background: rgba(16,17,20,.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 30;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
  }

  .brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 16px rgba(237,31,36,.55);
  }

  .status {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
  }

  .main {
    display: grid;
    place-items: center;
    padding: 14px;
  }

  .editor {
    width: min(100%, 740px);
    margin: auto;
  }

  .camera-shell {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: calc(100dvh - 190px);
    overflow: hidden;
    border-radius: 24px;
    background: #050506;
    border: 1px solid var(--line);
    box-shadow: 0 24px 70px rgba(0,0,0,.35);
  }

  video,
  .preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  video.mirrored {
    transform: scaleX(-1);
  }

  .preview {
    display: none;
  }

  .frame-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: none;
  }

  .frame-layer.active {
    display: block;
  }

  .frame-edge {
    position: absolute;
    inset: 0;
    /* El marco se superpone a la foto. La curva pertenece al borde interior,
       por lo que el marco cubre las esquinas de la imagen en vez de recortarla. */
    --frame-thickness: 8px;
    --frame-color: #050506;
  }

  .frame-edge::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: var(--frame-thickness) solid var(--frame-color);
    border-bottom-width: 0;
    border-radius: 0;
    /* El radio visual queda hacia el hueco interior del marco. */
    box-shadow: inset 0 0 0 0 var(--frame-color);
  }

  .frame-edge::after {
    content: "";
    position: absolute;
    top: var(--frame-thickness);
    left: var(--frame-thickness);
    right: var(--frame-thickness);
    height: 36px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -18px 0 18px var(--frame-color);
    pointer-events: none;
  }

  .bottom-strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 18%;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    transition: background .2s ease;
  }

  .bottom-strip img {
    width: auto;
    height: 88%;
    max-width: 62%;
    object-fit: contain;
    display: block;
  }

  /* FILTRO 1 - TIRA NEGRA */
  .frame-black .frame-edge {
    --frame-color: #1f140f;
  }

  .frame-black .bottom-strip {
    background: #1f140f;
  }

  /* FILTRO 2 - TIRA BLANCA */
  .frame-white .frame-edge {
    --frame-color: rgba(255,255,255,.98);
  }

  .frame-white .bottom-strip {
    background: #ffffff;
  }

  /* FILTRO 3 - TIRA MARFIL */
  .frame-cream .frame-edge {
    --frame-color: #efe8df;
  }

  .frame-cream .bottom-strip {
    background: #efe8df;
  }

  .flash {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    background: #fff;
    opacity: 0;
  }

  .flash.go {
    animation: flash .22s ease;
  }

  @keyframes flash {
    0% { opacity: 0; }
    45% { opacity: .95; }
    100% { opacity: 0; }
  }

  .capture-panel {
    padding-top: 14px;
  }

  .capture-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
  }

  .icon-btn {
    width: 54px;
    height: 54px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--panel-2);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
  }

  .icon-btn:active {
    transform: scale(.96);
  }

  .icon-btn svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .shutter {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 5px solid #fff;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
  }

  .shutter::after {
    content: "";
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s ease;
  }

  .shutter:active::after {
    transform: scale(.90);
  }

  .placeholder {
    width: 54px;
    height: 54px;
  }

  .note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
  }

  .hidden {
    display: none !important;
  }

  .filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 14px 0 10px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex: 0 0 auto;
    min-width: 122px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    color: #fff;
    padding: 10px;
    text-align: left;
    cursor: pointer;
  }

  .filter-btn.active {
    border-color: var(--red);
    box-shadow: 0 0 0 2px rgba(237,31,36,.16);
  }

  .filter-thumb {
    height: 74px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
    background:
      linear-gradient(135deg, #3a3d45 0%, #1e2025 60%, #111216 100%);
  }

  .filter-thumb .mini-strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 24px;
    display: grid;
    place-items: center;
  }

  .filter-thumb .mini-strip img {
    width: auto;
    height: 20px;
    max-width: 74%;
    object-fit: contain;
  }

  .mini-black {
    background: #050506;
  }

  .mini-white {
    background: #fff;
  }

  .mini-cream {
    background: #efe8df;
  }

  .thumb-white {
    box-shadow: inset 0 0 0 3px #fff;
  }

  .thumb-cream {
    box-shadow: inset 0 0 0 3px #efe8df;
  }

  .filter-name {
    font-size: 13px;
    font-weight: 800;
  }

  .filter-sub {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
  }

  .secondary-btn,
  .primary-btn {
    border-radius: 14px;
    padding: 13px 16px;
    font-weight: 750;
    cursor: pointer;
  }

  .secondary-btn {
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: #fff;
  }

  .primary-btn {
    border: 0;
    background: var(--red);
    color: #fff;
  }

  .footer {
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--bg);
  }

  canvas {
    display: none;
  }

  @media (orientation: landscape) and (min-width: 800px) {
    .main {
      padding: 18px;
    }

    .editor {
      max-width: 1020px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 270px;
      gap: 18px;
      align-items: center;
    }

    .camera-shell {
      aspect-ratio: 4 / 3;
      max-height: calc(100dvh - 130px);
    }

    .side {
      align-self: stretch;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .filters {
      display: grid;
      overflow: visible;
    }

    .actions {
      grid-template-columns: 1fr;
    }
  }

  /* DONATELLA · REDISEÑO MINIMAL */
  :root {
    --bg: #f2eadf;
    --panel: #fffaf3;
    --panel-2: #efe3d4;
    --text: #402114;
    --muted: #8b7465;
    --red: #6d3518;
    --line: rgba(64,33,20,.13);
    --coffee: #5a260d;
    --cream: #f7efe5;
  }

  html, body {
    background: var(--bg);
    color: var(--text);
    font-family: Georgia, 'Times New Roman', serif;
  }

  .app {
    min-height: 100dvh;
    background: var(--bg);
  }

  .topbar {
    min-height: 68px;
    padding: calc(8px + env(safe-area-inset-top)) 18px 8px;
    background: rgba(242,234,223,.96);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    backdrop-filter: blur(12px);
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--coffee);
  }

  .brand-logo {
    width: 92px;
    height: 52px;
    object-fit: contain;
    display: block;
  }

  .brand-dot,
  .brand::after {
    display: none;
    content: none;
  }

  .status {
    color: var(--muted);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 12px;
    letter-spacing: .01em;
  }

  .main {
    padding: 18px 14px 22px;
  }

  .editor {
    width: min(100%, 700px);
  }

  .camera-shell {
    border-radius: 20px;
    border: 1px solid rgba(64,33,20,.10);
    background: #18110e;
    box-shadow: 0 12px 32px rgba(67,38,24,.10);
  }

  .camera-shell::after {
    display: none;
  }

  .frame-black .frame-edge { --frame-color: #1f140f; }
  .frame-black .bottom-strip { background: #1f140f; }
  .frame-white .frame-edge { --frame-color: #fff; }
  .frame-white .bottom-strip { background: #fff; }
  .frame-cream .frame-edge { --frame-color: #eee0ce; }
  .frame-cream .bottom-strip { background: #eee0ce; }

  .bottom-strip img {
    height: 82%;
    max-width: 68%;
    filter: none;
  }

  .capture-panel {
    padding-top: 16px;
  }

  .capture-row {
    gap: 20px;
  }

  .icon-btn {
    width: 50px;
    height: 50px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--coffee);
    box-shadow: none;
  }

  .shutter {
    width: 72px;
    height: 72px;
    border: 2px solid var(--coffee);
    box-shadow: none;
  }

  .shutter::after {
    width: 58px;
    height: 58px;
    background: var(--coffee);
    box-shadow: none;
  }

  .note {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0;
    line-height: 1.45;
  }

  .frame-picker {
    margin-top: 12px;
    width: 100%;
  }

  .frame-picker-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 14px;
    color: var(--coffee);
    margin-bottom: 2px;
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    overflow: visible;
    padding: 8px 0 8px;
  }

  .filter-btn {
    width: 100%;
    min-width: 0;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    padding: 8px;
    box-shadow: none;
  }

  .filter-btn.active {
    border-color: var(--coffee);
    box-shadow: none;
    background: rgba(90,38,13,.045);
  }

  .filter-thumb {
    height: 66px;
    border-radius: 8px;
    margin-bottom: 7px;
    background: linear-gradient(145deg,#baa48f,#75604f 58%,#3f2c22);
    filter: none;
  }

  .mini-black { background: #1f140f; }
  .mini-white { background: #fff; }
  .mini-cream { background: #eee0ce; }
  .thumb-white { box-shadow: inset 0 0 0 2px #fff; }
  .thumb-cream { box-shadow: inset 0 0 0 2px #eee0ce; }

  .filter-name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
  }

  .filter-sub {
    color: var(--muted);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
  }

  .actions {
    gap: 8px;
    margin-top: 8px;
  }

  .secondary-btn,
  .primary-btn {
    border-radius: 12px;
    padding: 12px 14px;
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: 0;
    box-shadow: none;
  }

  .secondary-btn {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--coffee);
  }

  .primary-btn {
    background: var(--coffee);
    color: #fffaf3;
  }

  /* Mobile first: navegación compacta y crédito discreto */
  .topbar {
    min-height: 62px;
    padding-left: 14px;
    padding-right: 14px;
    gap: 10px;
  }

  .brand-logo {
    width: 82px;
    height: 46px;
  }

  .status {
    max-width: 92px;
    font-size: 11px;
    line-height: 1.2;
  }

  .main {
    padding-top: 12px;
  }

  .footer {
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--line);
    text-align: center;
  }

  .footer-brand {
    color: var(--muted);
    font-size: 9px;
    line-height: 1.35;
    letter-spacing: .10em;
    text-transform: uppercase;
  }

  .footer-credit {
    margin-top: 4px;
    color: rgba(64,33,20,.52);
    font-size: 10px;
    line-height: 1.35;
    letter-spacing: .01em;
  }

  .footer-credit strong {
    color: rgba(64,33,20,.70);
    font-weight: 600;
  }

  /* Escala progresivamente en tablet/escritorio; el diseño base es móvil. */
  @media (min-width: 521px) {
    .topbar {
      min-height: 68px;
      padding-left: 18px;
      padding-right: 18px;
    }

    .brand-logo {
      width: 92px;
      height: 52px;
    }

    .status {
      max-width: none;
      font-size: 12px;
    }

    .main {
      padding-top: 18px;
    }

    .footer {
      padding-left: 20px;
      padding-right: 20px;
    }
  }

