/* ============================================================
   VidaRent — the phone, the camera, and what the handover left
   on the return sheet.

   Same tokens, same type, same black-and-white base. Below 900px the sidebar
   becomes a drawer behind a menu button, every grid folds to one column,
   tables scroll sideways inside their card, and the sheet editor stacks:
   frames as a strip, the car, then the panels. Nothing here applies to the
   printed documents.
   ============================================================ */

/* ---------- the handover's marks on the return editor ---------- */

.ink-s--prev { stroke: rgba(var(--ph-ink-rgb), .5); stroke-width: 4; stroke-dasharray: 10 8; }
.pin--prev { cursor: help; }
.pin--prev .pin-c { fill: var(--ph-paper); stroke: var(--ph-ink); stroke-width: 2.5; stroke-dasharray: 5 4; }
.pin--prev .pin-t { fill: var(--ph-ink); }
.dmg-n--prev { background: var(--paper); color: var(--ink); border: 1.5px dashed var(--ink); }
.dmg-row--prev { cursor: default; }
.dmg-row--prev:hover { background: var(--paper); }
.thumb__n--prev { right: auto; left: 4px; top: auto; bottom: 28px; background: var(--paper); color: var(--ink); border: 1.5px dashed var(--ink); }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--g-60); white-space: nowrap; }
.lg { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.lg--prev { border: 1.5px dashed var(--ink); background: var(--paper); }
.lg--now { background: var(--alert); }

/* ---------- adding a photo: camera or files ---------- */

.picker {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, .45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
}
.picker__box {
  width: min(420px, 100%);
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--g-25);
  padding: 14px;
  display: grid; gap: 8px;
  box-shadow: 0 10px 30px var(--shadow);
}
.picker__hd { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--g-60); margin-bottom: 2px; }
.picker__opt { justify-content: center; min-height: 46px; font-size: 14px; }
@media (min-width: 700px) { .picker { align-items: center; } }

.cam { width: min(960px, 100%); background: #000; border: 1px solid var(--g-25); display: grid; }
.cam__video { width: 100%; max-height: 70vh; object-fit: contain; background: #000; display: block; }
.cam__bar { display: flex; gap: 8px; justify-content: center; padding: 10px; background: var(--paper); }
.cam__bar .btn { min-height: 44px; }

/* ---------- the drawer ---------- */

.btn--menu { display: none; padding: 6px 8px; line-height: 0; }
.scrim { display: none; position: fixed; inset: 0; z-index: 79; background: rgba(0, 0, 0, .45); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 80;
    width: min(300px, 84vw);
    transform: translateX(-100%);
    transition: transform .22s ease;
  }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px var(--shadow); }
  body.nav-open .scrim { display: block; }
  body.nav-open { overflow: hidden; }
  .acct-pop { left: 12px; right: 12px; bottom: 12px; width: auto; }

  .btn--menu { display: inline-flex; }
  .topbar { height: auto; min-height: 54px; padding: 8px 12px; gap: 8px; }
  .topbar h1 { font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .spacer { display: none; }
  .btn--tut .lbl { display: none; }
  .btn--tut { padding: 6px 8px; }

  .view { padding: 14px; overflow-x: hidden; }
  .fbar { top: -14px; margin: -14px -14px 12px; padding: 14px 14px 10px; }

  /* a grid cell or a card never grows past the screen because of its content */
  .grid > *, .sheet > *, .form2 > *, .form3 > * { min-width: 0; }
  .card { max-width: 100%; }
  .card__bd, .dhead .meta { overflow-wrap: anywhere; }
  .veh-pick > div { min-width: 0; }

  /* one column everywhere; the four counters keep two */
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .form2, .form3 { grid-template-columns: 1fr; }
  .form2 > [style*="grid-column"], .form3 > [style*="grid-column"] { grid-column: auto !important; }
  .card > .card__bd > [style*="grid-column:1/-1"], .grid > [style*="grid-column:1/-1"] { grid-column: auto !important; }
  .eq--cols { columns: 1; }
  .help { grid-template-columns: 1fr; }
  .int-grid { grid-template-columns: 1fr; }
  .ba { grid-template-columns: 1fr; }
  .ba__col--after { border-left: 0; padding-left: 0; border-top: 1px solid var(--g-12); padding-top: 10px; }

  .dhead { gap: 12px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 16px; }
  .dhead .meta h1 { font-size: 20px; }
  .dhead .acts { width: 100%; }
  .dhead .acts > *, .card__hd > * { max-width: 100%; }
  .pill { white-space: normal; max-width: 100%; }
  .toolbar .field--search { flex: 1 1 100%; width: auto; }
  .card__hd { flex-wrap: wrap; row-gap: 6px; }
  .card__bd { padding: 14px; }

  /* tables scroll inside their card instead of widening the page */
  .card:has(> .tbl), .card:has(> table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl th, .tbl td { padding: 10px 10px; }
  .tbl { min-width: 560px; }

  /* the sheet editor stacks: frames as a strip, the car, then the panels */
  .sheet { grid-template-columns: 1fr; gap: 12px; }
  .sheet__rail .thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .sheet__rail .thumb { flex: 0 0 104px; }
  .sheet__side { order: 3; }
  .canvas-wrap { padding: 8px; }
  .cv-note { flex-wrap: wrap; }
  .cv-hint { margin-left: 0; flex: 1 1 100%; }
  .tools .btn { min-height: 36px; }

  .savebar { padding-bottom: 8px; }
  #toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .tour__tip { width: min(360px, calc(100vw - 24px)); }
  .login { grid-template-columns: 1fr; min-height: 100%; }
  .login__brand { padding: 26px 22px; gap: 20px; justify-content: flex-start; }
  .login__brand img { width: 150px; }
  .login__tag { font-size: 22px; }
  .login__foot { display: none; }
  .login__panel { padding: 24px 22px 40px; max-width: none; }
  .login__form { max-width: none; }
}

@media (max-width: 560px) {
  h1 { font-size: 22px; }
  .stat .v { font-size: 26px; }
  .vgrid { grid-template-columns: 1fr; }
  .dhead .id { width: 44px; height: 44px; font-size: 14px; }
  .btn { min-height: 38px; }
  .btn--sm { min-height: 34px; }
  .seg { flex-wrap: wrap; }
  .seg button + button { border-left: 0; }
  .lang button { padding: 5px 8px; }
  .sync { margin-right: 0; }
}

/* fingers get bigger targets, without changing the look with a mouse */
@media (pointer: coarse) {
  .chk { width: 22px; height: 22px; }
  .plist__row, .dmg-row { padding-top: 10px; padding-bottom: 10px; }
  .nav a { padding: 12px 22px; }
  .thumb__lb { padding: 7px 7px; }
}

/* ---------- the crop editor ---------- */
.cropper { align-items: center; }
.cropper__box { width: min(960px, 100%); max-height: 100%; background: var(--paper); border: 1px solid var(--g-25); display: grid; gap: 8px; padding: 10px; box-sizing: border-box; }
.cropper__hd { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--g-60); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cropper__hd .sub { font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 12px; }
.cropper__stage { height: min(58vh, 560px); background: #111; display: grid; place-items: center; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.cropper__img { position: relative; line-height: 0; }
.cropper__cv { display: block; }
.crop { position: absolute; border: 1px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); cursor: move; touch-action: none; box-sizing: border-box; }
.crop::before { content: ""; position: absolute; inset: 33.33% 0; border-top: 1px solid rgba(255, 255, 255, .35); border-bottom: 1px solid rgba(255, 255, 255, .35); pointer-events: none; }
.crop::after { content: ""; position: absolute; inset: 0 33.33%; border-left: 1px solid rgba(255, 255, 255, .35); border-right: 1px solid rgba(255, 255, 255, .35); pointer-events: none; }
.crop__h { position: absolute; width: 32px; height: 32px; touch-action: none; }
.crop__h::after { content: ""; position: absolute; left: 9px; top: 9px; width: 14px; height: 14px; background: #fff; border: 1px solid #000; box-sizing: border-box; }
.crop__h--nw { left: -16px; top: -16px; cursor: nwse-resize; }
.crop__h--ne { right: -16px; top: -16px; cursor: nesw-resize; }
.crop__h--sw { left: -16px; bottom: -16px; cursor: nesw-resize; }
.crop__h--se { right: -16px; bottom: -16px; cursor: nwse-resize; }
.cropper__bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cropper__bar--acts { justify-content: flex-end; }
.cropper__bar .btn { min-height: 42px; }
.cropper__seg { flex: 1; min-width: 0; overflow-x: auto; }
.cropper__seg button { min-height: 40px; white-space: nowrap; }
@media (max-width: 699px) {
  .cropper__box { padding: 8px; gap: 6px; }
  .cropper__stage { height: min(50vh, 420px); }
  .cropper__bar--acts .btn { flex: 1; }
}
