/* Proxymaker in the browser: the desktop interface as it is, plus the start-up screen and a way back to the site. */
.brand-link { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.update-pill { display: none !important; }

#web-boot { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: var(--bg);
  transition: opacity 350ms var(--ease); }
#web-boot.done { opacity: 0; pointer-events: none; }
#web-boot .web-boot-box { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 24px; max-width: 460px; }
#web-boot svg { width: 72px; height: 72px; fill: none; stroke: var(--accent); stroke-width: 1.4; animation: web-boot-float 2.4s ease-in-out infinite; }
#web-boot svg rect:first-child { fill: var(--bg); opacity: .65; }
#web-boot svg rect:last-child { fill: var(--accent-soft); }
#web-boot .web-boot-text { font-size: 17px; font-weight: 500; }
#web-boot .web-boot-note { font-size: 13px; color: var(--faint); }
#web-boot.failed svg { animation: none; opacity: .5; }
#web-boot.failed .web-boot-text { color: var(--danger); font-weight: 400; }
@keyframes web-boot-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { #web-boot svg { animation: none; } }

/* Phones and narrow windows: one screen at a time, chosen from the tab bar at the bottom (backend.js adds it and sets
   body[data-pane]): List (search and deck list), Cards, Sheets, Print (settings). Esporta PDF floats above the bar. */
.pane-bar, .export-dock { display: none; }
@media (max-width: 860px) {
  :root { --bar: calc(64px + env(safe-area-inset-bottom)); }
  html, body { height: auto; }
  body.phone { display: block; overflow: visible; min-height: 100dvh; padding-bottom: calc(var(--bar) + 110px); }
  .topbar {
    position: sticky; top: 0; z-index: 40; height: auto; display: flex; align-items: center; gap: 8px;
    padding: 10px 12px calc(10px) 16px; padding-top: max(10px, env(safe-area-inset-top));
    background: rgba(12, 10, 8, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .brand { flex: 1; min-width: 0; }
  .brand .logo { width: 26px; height: 26px; }
  .brand-name { font-size: 18px; }
  .views { display: none; }
  .top-actions { display: flex; gap: 8px; }
  #ui-language { height: 36px; }
  #ui-language button { padding: 0 10px; font-size: 12px; }
  #about-button { width: 38px; height: 38px; }
  .layout { display: block; }
  .sidebar { overflow: visible; border: 0; padding: 0; width: auto; }
  .sidebar > * { display: none; }
  body[data-pane="list"] .sidebar > .pane-list,
  body[data-pane="print"] .sidebar > .pane-print { display: flex; }
  body[data-pane="print"] .sidebar > .print-note.pane-print { display: block; }
  body[data-pane="list"] .workspace, body[data-pane="print"] .workspace { display: none; }
  body[data-pane="cards"] .sidebar, body[data-pane="sheets"] .sidebar { display: none; }
  .sidebar > .group { padding: 20px 16px; border-bottom: 1px solid var(--line); }
  .sidebar > .print-note { padding: 14px 16px 0; }
  .sidebar h2 { font-size: 20px; }
  #deck-input { min-height: 180px; font-size: 16px; }
  #card-search, select, input[type="number"], input[type="search"] { font-size: 16px; } /* no zoom on iPhone */
  #images-button { width: 100%; justify-content: center; margin: 0 0 12px; }
  .group-links { gap: 14px; }
  .workspace { min-height: 0; }
  .toolbar { flex-wrap: wrap; align-items: flex-start; padding: 18px 16px 12px; gap: 10px; }
  .toolbar-title { flex-wrap: wrap; row-gap: 2px; }
  .toolbar-tools { flex-wrap: nowrap; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; width: calc(100% + 32px); }
  .toolbar-tools::-webkit-scrollbar { display: none; }
  .toolbar-tools .button { flex: none; }
  .size-control { display: none; }
  h1 { font-size: 26px; }
  .grid-scroll { overflow: visible; padding: 4px 16px 24px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px 12px; }
  .empty { position: static; padding: 24px 8px; }
  .empty h2 { font-size: 22px; }
  .steps { flex-direction: column; }
  .steps li { width: auto; }
  .sheet-stage { container-type: inline-size; padding: 0 16px 24px; }
  .sheet { width: 100%; }
  .pager { margin-left: auto; }

  .statusbar {
    position: fixed; left: 0; right: 0; bottom: var(--bar); z-index: 30; min-height: 34px; padding: 4px 16px;
    font-size: 12.5px; background: rgba(12, 10, 8, .94); backdrop-filter: blur(10px);
  }
  #status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
  .pane-bar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
    height: var(--bar); padding: 0 6px env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line-strong);
  }
  .pane-bar button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: var(--faint); font: inherit; font-size: 11.5px; font-weight: 500; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .pane-bar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
    padding: 2px 14px; box-sizing: content-box; border-radius: 999px; transition: background var(--m-in) var(--ease); }
  .pane-bar button.active { color: var(--ink); }
  .pane-bar button.active svg { background: var(--accent-soft); color: var(--accent); }
  .pane-count { position: absolute; top: 7px; left: calc(50% + 10px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-size: 10.5px; font-weight: 600; line-height: 18px; text-align: center; }
  .pane-count[hidden] { display: none; }
  .export-dock { display: block; position: fixed; right: 14px; bottom: calc(var(--bar) + 44px); z-index: 35; }
  .export-dock .button.primary { height: 50px; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .9); }
  .export-dock .button.primary:disabled { display: none; }
  body[data-pane="list"] .export-dock { display: none; }

  /* Dialogs rise from the bottom over everything, like a phone sheet. */
  .modal { z-index: 60; padding: 0; place-items: end stretch; }
  .modal-window { width: 100% !important; max-width: none; max-height: calc(100dvh - 24px); border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom); }
  .modal-head { padding: 18px 16px 12px; }
  .modal-head h2 { font-size: 22px; }
  .modal-foot { padding: 12px 16px; flex-wrap: wrap; }
  /* Choosing a print: a compact top (name, source, filter, language and copies), then the prints fill the screen. */
  .prints { height: calc(100dvh - 12px); max-height: calc(100dvh - 12px); }
  .prints .modal-head { padding: 14px 12px 10px 16px; align-items: center; }
  .prints .modal-head h2 { font-size: 20px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .prints .modal-head > div { min-width: 0; }
  .prints .modal-head .summary { margin-top: 2px; font-size: 12px; }
  .prints-source { margin: 0 16px 10px; }
  .prints-source button { padding: 8px 6px; font-size: 13px; line-height: 1.2; }
  .prints-source small { display: none; }
  .prints-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 0 16px 12px; }
  .prints-filters .search { grid-column: 1 / -1; }
  .prints-filters select { width: 100%; min-width: 0; height: 40px; }
  .prints-filters .stepper { padding-left: 0; gap: 6px; }
  .prints-filters .stepper .label { font-size: 13px; }
  .prints-filters .stepper .icon-button { width: 36px; height: 36px; }
  .prints-scroll { padding: 14px 16px 18px; overscroll-behavior: contain; }
  .prints-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .print { min-width: 0; touch-action: manipulation; -webkit-touch-callout: none; }
  .print .art { box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .9); }
  .print .set-name { font-size: 13px; }
  .print .set-code { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .print .in-use, .print .lowres { top: 6px; height: 22px; padding: 0 8px; font-size: 12px; }
  .print .in-use { left: 6px; }
  .print .lowres { right: 6px; }
  .prints .modal-foot { padding: 10px 16px; gap: 10px; flex-wrap: nowrap; }
  .prints .modal-foot .hint { font-size: 12px; line-height: 1.35; }
  .prints .modal-foot .button { flex: none; }
  .lightbox { z-index: 70; padding: 16px; }
}
@media (max-width: 420px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-name { font-size: 17px; }
}
