/* Body is a fixed-height flex column so .edit-body takes all remaining space. */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

header input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  background: var(--border);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  transition: border-color var(--transition);
}
header input[type="text"]:focus { outline: none; border-color: var(--accent); }

.ink-btn-amber    { background: var(--ink-amber); }
.ink-btn-amethyst { background: var(--ink-amethyst); }
.ink-btn-emerald  { background: var(--ink-emerald); }
.ink-btn-ruby     { background: var(--ink-ruby); }
.ink-btn-sapphire { background: var(--ink-sapphire); }
.ink-btn-steel    { background: var(--ink-steel); }

.edit-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* ---- Mobile tabs ---- */
.mobile-tabs {
  display: none;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.mobile-tab {
  flex: 1;
  padding: 4px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.mobile-tab.active           { border-bottom-color: var(--accent); color: var(--text); }
.mobile-tab.drag-over-add    { background: color-mix(in srgb, var(--blue) 25%, transparent);   box-shadow: inset 0 0 0 2px var(--blue);   color: #fff; }
.mobile-tab.drag-over-remove { background: color-mix(in srgb, var(--accent) 25%, transparent); box-shadow: inset 0 0 0 2px var(--accent); color: #fff; }

.mobile-filter-toggle {
  display: inline-block;
  flex-shrink: 0;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text-mid);
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.mobile-filter-toggle:hover { border-color: var(--accent); color: var(--text); }

/* ---- Touch drag ghost ---- */
.touch-drag-ghost {
  position: fixed;
  z-index: 1000;
  width: 80px;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.5);
  opacity: 0.85;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.touch-drag-ghost img {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
}

@media (max-width: 767px) {
  header input[type="text"] { width: auto; flex: 1; min-width: 0; font-size: 16px; }
  #deck-count-label         { display: none; }

  body          { height: 100dvh; }
  .edit-body    { flex: 1; min-height: 0; }

  .mobile-tabs  { display: flex; }
  .mobile-tab   { min-height: 32px; padding: 4px; font-size: 0.75rem; }

  .card-browser              { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-right: none; border-bottom: none; }
  .card-browser.tab-inactive { display: none; }

  .resize-handle { display: none; }

  .deck-panel            { display: none; flex: 1; min-height: 0; }
  .deck-panel.tab-active { display: flex; }

  /* Reset min-height on small filter/toolbar buttons overridden by base.css. */
  button.filter-type-btn, button.filter-rarity-btn, button.filter-set-btn,
  button.filter-reset-btn, button.filter-toggle-btn,
  button.search-mode-btn, button.search-hint-btn,
  button.stats-toggle, button.mobile-filter-toggle,
  button.deck-copy-btn, button.deck-delete-btn,
  button.btn, .pagination button { min-height: 0; }

  .deck-gallery { padding-bottom: max(144px, calc(env(safe-area-inset-bottom) + 120px)); }
}
