/* iPhone Mockups – layout from the Claude Design prototype (360px control rail +
   stage), re-skinned onto the hub tokens (hub/styles.css) and page.css primitives.
   Class names the engine hooks (.seg, .bg-sw, .drop, .batch-*, .badge …) are kept. */

[hidden] { display: none !important; }
input[type=file] { display: none; }

.im-root { max-width: none; }
.im-app { flex: 1; display: grid; grid-template-columns: 360px 1fr; min-height: 0; }

/* ── Control rail ── */
.im-side { background: var(--paper); border-right: 1px solid var(--rule); padding: 28px 24px; display: flex; flex-direction: column; gap: 22px; }
.im-side .A-page-obj { margin-bottom: 18px; }
.im-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; text-transform: uppercase; margin: 0 0 10px; }
.im-sub { font-size: 13px; line-height: 1.5; color: var(--ink-mid); margin: 0; }
.row { display: flex; flex-direction: column; }
.row .A-label { margin-bottom: 8px; }

.drop { display: block; border: 1px dashed var(--ink-faint); background: var(--paper-soft); padding: 24px 18px; text-align: center; cursor: pointer; color: var(--ink); transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--ink); }
.drop.drag { border-color: var(--braun-yellow); background: var(--paper-deep); }
.drop svg { width: 26px; height: 26px; color: var(--ink-soft); margin-bottom: 6px; }
.drop strong { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.drop span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; color: var(--ink-soft); }

/* Square hairline segment – same control as Product Mockups' filter */
.seg { display: grid; border: 1px solid var(--rule); min-height: 34px; }
.seg.c2 { grid-template-columns: 1fr 1fr; }
.seg.c3 { grid-template-columns: 1fr 1fr 1fr; }
.seg button { background: transparent; border: 0; border-right: 1px solid var(--rule); border-radius: 0; padding: 0 8px; cursor: pointer; font-family: var(--mono); font-size: 8px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-mid); transition: background .15s, color .15s; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--paper-deep); color: var(--ink); }

.bg-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.bg-sw { aspect-ratio: 1; border: 1px solid var(--rule); cursor: pointer; position: relative; }
.bg-sw.on { outline: 1px solid var(--ink); outline-offset: 2px; border-color: var(--ink); }
.bg-sw[data-val="transparent"] {
  background:
    linear-gradient(45deg, #cfcfcf 25%, transparent 25%),
    linear-gradient(-45deg, #cfcfcf 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #cfcfcf 75%),
    linear-gradient(-45deg, transparent 75%, #cfcfcf 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
  background-color: #fff;
}
.im-color { width: 100%; height: 32px; margin-top: 10px; padding: 0; border: 1px solid var(--rule); border-radius: 0; background: var(--paper); cursor: pointer; }

.hint { font-family: var(--mono); font-size: 9px; line-height: 1.8; color: var(--ink-soft); border-top: 1px solid var(--rule-soft); padding-top: 16px; }
.hint strong { font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; font-size: 8px; color: var(--ink); }
.hint kbd { font-family: var(--mono); font-size: 9px; border: 1px solid var(--rule); padding: 0 4px; background: var(--paper-soft); }

.actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 8px; }
.im-wide { width: 100%; justify-content: center; }
.actions .A-progress { margin: 10px 0 0; }

/* ── Stage: near-neutral surround so a warm paper cast never biases the screenshot ── */
.im-main { position: relative; background: #EAE8E4; padding: 40px; display: flex; align-items: center; justify-content: center; overflow: auto; min-width: 0; }
:root[data-paper="white"] .im-main { background: #EDEDED; }
/* The rail can be taller than the viewport; the stage pins so the device stays in view
   while the page scrolls (the engine sets align-items inline, hence !important). */
.im-main { align-items: flex-start !important; }
.stage { position: sticky; top: 40px; max-width: 100%; display: flex; align-items: center; justify-content: center; }
.stage canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 80px); object-fit: contain; }
.empty { padding-top: 18vh; }
.empty { color: var(--ink-soft); text-align: center; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.8; }
.empty svg { width: 80px; color: var(--ink-faint); margin-bottom: 14px; }

.badge { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 2; display: none; align-items: center; gap: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--braun-yellow); animation: im-pulse 1s infinite; }
@keyframes im-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ── Batch grid ── */
.batch-wrap { width: 100%; align-self: stretch; padding: 0 0 20px; }
.batch-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.batch-head strong { color: var(--ink); font-weight: 500; }
.batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
/* No card fill: a transparent mockup shows the stage through it, as in single mode. */
.batch-item { background: transparent; border: 1px solid var(--rule); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.batch-item .thumb-wrap { aspect-ratio: 435 / 884; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.batch-item canvas { max-width: 100%; max-height: 100%; display: block; }
.batch-item .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--rule-soft); padding-top: 10px; }
.batch-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 9px; letter-spacing: 0.04em; color: var(--ink-mid); }
.batch-item .remove { background: transparent; border: 0; padding: 2px 6px; cursor: pointer; font-size: 12px; color: var(--ink-faint); }
.batch-item .remove:hover { color: var(--braun-red); }
.batch-empty { border: 1px dashed var(--ink-faint); padding: 80px 40px; text-align: center; color: var(--ink-soft); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.9; }
.batch-empty svg { width: 64px; color: var(--ink-faint); margin-bottom: 16px; }

@media (max-width: 860px) {
  .im-app { grid-template-columns: 1fr; }
  .im-side { border-right: 0; border-bottom: 1px solid var(--rule); }
  .im-main { padding: 24px; min-height: 70vh; }
  .stage { position: static; }
  .stage canvas { max-height: 80vh; }
  .empty { padding-top: 0; }
  .A-bar .A-meta { display: none; }
}
