/* gear module styles — use tokens from app.css (var(--surface), var(--red-ink)…), never raw hex. */

.gear-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gear-stats { gap: 12px; }
.gear-stale { margin-top: -4px; }

/* "you have overdue gear" banner */
.gear-alert {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px;
  border-radius: var(--radius); background: var(--red-soft);
  border: 1px solid color-mix(in srgb, var(--red) 38%, transparent);
}
.gear-alert > .icon { color: var(--red-ink); flex: none; }
.gear-alert .grow { min-width: 200px; }

/* toolbar */
.gear-toolbar .toolbar { margin-bottom: 0; }
.gear-toolbar .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.gear-toolbar .segmented::-webkit-scrollbar { display: none; }
.gear-cat-select { width: auto; min-width: 150px; flex: 0 0 auto; }
.gear-toolbar .chip-toggle .count { margin-left: 2px; }

/* category icon tiles */
.gear-cat-icon {
  flex: none; width: 36px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.gear-cat-icon[class*='tone-'] { border-color: transparent; }
.gear-cat-icon.xs { width: 24px; height: 24px; border-radius: 6px; }

/* shoots coming up */
.gear-shoots { display: flex; flex-direction: column; }
.gear-shoot { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.gear-shoot:last-child { border-bottom: 0; }
.gear-shoot-date {
  flex: none; width: 50px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
}
.gear-shoot-dow, .gear-shoot-mon { font: 500 10px/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.gear-shoot-day { font-size: 18px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.gear-shoot-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.gear-shoot-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gear-shoot-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--text-2); min-width: 0; }

/* cards */
.gear-groups { display: flex; flex-direction: column; gap: 22px; }
.gear-group-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font: 600 12px/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted);
}
.gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.gear-card {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; min-width: 0; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.12s, background 0.12s;
}
.gear-card:hover, .gear-card:focus-within { border-color: var(--border-strong); }
.gear-card.is-mine { border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); }
.gear-card.is-overdue { border-color: color-mix(in srgb, var(--red) 55%, transparent); box-shadow: inset 3px 0 0 var(--red); }
.gear-card.is-out { opacity: 0.72; }
.gear-card-top { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.gear-card-title { flex: 1; min-width: 0; }
.gear-name { display: block; font-weight: 700; font-size: 14px; line-height: 1.3; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.gear-name:hover { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
.gear-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.gear-serial { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.gear-card-body { display: flex; flex-direction: column; gap: 6px; font-size: 13px; min-width: 0; }
.gear-card-body:empty { display: none; }
.gear-holder { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gear-project { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--text-2); font-size: 12.5px; min-width: 0; }
.gear-project > .icon { color: var(--muted); flex: none; }
.gear-note { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; min-width: 0; }
.gear-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.gear-card-actions:empty { display: none; }

/* table cells */
.gear-cell-item { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.gear-cell-text { min-width: 0; }
.gear-cell-project { max-width: 200px; }

/* check-out / check-in modals */
.gear-pick-list { max-height: min(340px, 42vh); overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.gear-pick-group {
  position: sticky; top: 0; z-index: 1; padding: 8px 10px 6px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font: 600 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted);
}
.gear-pick-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; min-width: 0; }
.gear-pick-item:last-child { border-bottom: 0; }
.gear-pick-item:hover { background: var(--surface-2); }
.gear-pick-item input { width: 16px; height: 16px; flex: none; accent-color: var(--red); }
.gear-pick-empty { padding: 18px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.gear-chosen { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.gear-chosen-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); min-width: 0; }
.gear-chosen-item:last-child { border-bottom: 0; }
.gear-due-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gear-due-chips .chip-toggle { height: 28px; padding: 0 11px; font-size: 12.5px; }
.gear-tip { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--green-soft); color: var(--text-2); font-size: 13px; }
.gear-tip > .icon { color: var(--green-ink); flex: none; margin-top: 2px; }

/* detail */
.gear-status-panel { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.gear-status-panel.is-overdue { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.gear-quote { margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--violet); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.gear-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.gear-note-form { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.gear-note-form .input { flex: 1; min-width: 0; }

/* core kit quick-start */
.gear-kit { display: flex; flex-direction: column; }
.gear-kit-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 170px 76px; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.gear-kit-row:last-child { border-bottom: 0; }
.gear-kit-row input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--red); }
.gear-kit-row.is-off .input { opacity: 0.55; }
.gear-kit-head { padding-bottom: 6px; }

.gear-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

@media (max-width: 640px) {
  .gear-grid { grid-template-columns: minmax(0, 1fr); }
  .gear-shoot { flex-wrap: wrap; }
  .gear-shoot .btn { margin-left: 62px; }
  .gear-cat-select { flex: 1 1 140px; }
  .gear-kit-row { grid-template-columns: 22px minmax(0, 1fr) 64px; }
  .gear-kit-cat { display: none; }
  .gear-note-form { flex-wrap: wrap; }
}
