/* PDF Studio - Pages screen (organize.js). Tokens come from app.css. */

/* side panels: each its own tint + 2px darker border */
.og-side { display: flex; flex-direction: column; gap: 12px; }
.og-panel { border-radius: var(--radius); padding: 12px; }
.og-panel h3 { margin: 0 0 8px; font-size: 15px; color: var(--ink); }
.og-panel .hint { margin: 0 0 8px; color: #3d4a59; }
.og-p-green { background: var(--t-green); border: 2px solid var(--b-green); }
.og-p-gold { background: var(--t-gold); border: 2px solid var(--b-gold); }
.og-p-violet { background: var(--t-violet); border: 2px solid var(--b-violet); }
.og-p-blue { background: var(--t-blue); border: 2px solid var(--b-blue); }
.og-col { display: flex; flex-direction: column; gap: 8px; }
.og-sbtn { justify-content: flex-start; width: 100%; min-height: 44px; text-align: left; }
.og-sbtn span { flex: 1 1 auto; }
.og-deco:empty { display: none; }
.og-deco { margin-top: 10px; }
.og-on {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  background: #fff; border: 1.5px solid var(--b-blue); border-left: 6px solid var(--bar-blue);
  border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; font-size: 13px; color: var(--ink);
}
.og-on span { overflow-wrap: anywhere; }
.og-off { min-height: 40px; padding: 0 10px; flex: 0 0 auto; }
.og-deco .hint { margin: 2px 0 0; }

/* stage column must be allowed to shrink (phone: side panel sits below) */
.og-stagewrap { min-height: 0; }

/* toolbar */
.og-bar .og-tb { padding: 0 10px; }
.og-bar .og-del { color: var(--danger); }

/* status strip */
.og-status {
  flex: 0 0 auto; padding: 6px 12px; font-size: 13px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line-strong); border-width: 0 0 1.5px 0;
}
.og-status:empty { display: none; }

/* page grid on a dark stage */
.og-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; background: var(--stage); padding: 16px; }
.og-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px;
  align-items: start; outline: none;
}
.og-empty { grid-column: 1 / -1; background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--radius); color: var(--ink); }
.og-empty .btn { margin-top: 8px; }
.og-tile {
  position: relative; background: #fff; border: 1.5px solid var(--line-strong); border-radius: 8px;
  padding: 8px 8px 0; cursor: pointer; user-select: none; -webkit-user-select: none;
  outline: 3px solid transparent; outline-offset: 2px;
}
.og-tile:nth-child(even) { background: #f6f8fb; }
.og-tile:focus-visible { outline-color: #f2c14e; }
.og-tile.on { outline: 3px solid var(--accent); outline-offset: 2px; background: var(--accent-soft); }
.og-thumb { display: flex; align-items: center; justify-content: center; height: 170px; }
.og-thumb canvas, .og-cv { display: block; max-width: 100%; max-height: 170px; width: auto; height: auto; box-shadow: 0 0 0 1px var(--line); background: #fff; }
.og-ph { max-width: 100%; max-height: 170px; height: 100%; background: #fff; box-shadow: 0 0 0 1px var(--line); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.og-foot { display: flex; align-items: center; gap: 4px; min-height: 40px; }
.og-no { flex: 1 1 auto; text-align: center; font-weight: 700; font-size: 14px; color: var(--ink); }
.og-rot { font-size: 12px; color: var(--muted); min-width: 0; }
.og-tick {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px; border: 1.5px solid var(--line-strong);
  background: #fff; color: transparent; display: inline-flex; align-items: center; justify-content: center;
}
.og-tick svg { width: 18px; height: 18px; }
.og-tile.on .og-tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.og-handle {
  flex: 0 0 auto; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: grab; touch-action: none; border-radius: 6px;
}
.og-handle:hover { background: var(--t-slate); }
.og-dragging .og-tile { cursor: grabbing; }

/* drop markers: a gold bar where the pages will land */
.og-before::before, .og-after::after {
  content: ''; position: absolute; top: 4px; bottom: 4px; width: 5px; border-radius: 3px; background: #f2c14e;
}
.og-before::before { left: -11px; }
.og-after::after { right: -11px; }
.og-ghost {
  position: fixed; z-index: 1000; pointer-events: none; padding: 8px 12px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; box-shadow: var(--shadow);
}

/* dialogs */
.ps-modal .field[hidden], .og-sub[hidden], .og-side [hidden] { display: none; }
.og-lead { margin: 0 0 12px; color: var(--ink); }
.og-note { margin: 8px 0 0; color: var(--ink); }
.og-warn { margin: 8px 0 0; padding: 8px 10px; border: 2px solid var(--b-gold); border-radius: 8px; background: var(--t-gold); color: #4d3500; }
.og-fhint { display: block; margin-top: 3px; }
.og-flabel { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.og-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.og-chip {
  position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px;
  border: 2px solid var(--btnline); border-radius: 20px; background: var(--btnfill); color: var(--ink); /* r367: chips with words are buttons */
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.og-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.og-chip:has(input:checked) { background: var(--accent); border-color: #123764; color: #fff; }
.og-chip:has(input:focus-visible) { outline: 3px solid #f2c14e; outline-offset: 1px; }
.og-check { display: flex; align-items: center; gap: 10px; min-height: 40px; color: var(--ink); cursor: pointer; }
.og-check input { width: 22px; height: 22px; flex: 0 0 auto; }
.og-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.og-sub { margin-top: 4px; padding: 10px; border: 2px solid var(--b-violet); border-radius: 8px; background: var(--t-violet); }
.og-sizes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.og-size { border-radius: 8px; padding: 10px; text-align: center; color: var(--ink); }
.og-size small { display: block; color: #3d4a59; }
.og-size b { font-size: 20px; }
.og-sz-a { background: var(--t-slate); border: 2px solid var(--b-slate); }
.og-sz-b { background: var(--t-green); border: 2px solid var(--b-green); }

@media (max-width: 760px) {
  .og-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .og-bar { gap: 4px; padding: 6px; }
  .og-bar .og-tb { padding: 0; width: 40px; min-width: 40px; }
  .og-bar .sep { display: none; }
  .og-scroll { padding: 10px; }
  .og-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .og-thumb { height: 120px; }
  .og-thumb canvas, .og-cv, .og-ph { max-height: 120px; }
  .og-tile { padding: 6px 6px 0; }
  .og-before::before { left: -8px; }
  .og-after::after { right: -8px; }
  .og-side { gap: 10px; }
  /* r367 fix rounds (10/27/2026): every side-panel action button (Combine files, Take pages out,
     Size and pictures, Add to every page) is one uniform 260px, centered; only the one primary
     (Download as one PDF) stays full width. */
  .og-col { align-items: center; }
  .og-col > .og-sbtn:not(.primary) { width: 100%; max-width: 260px; }
}
@media (max-width: 400px) {
  .og-two { grid-template-columns: 1fr; }
}
