:root {
  --sc-bg: #faf8f3;
  --sc-surface: #ffffff;
  --sc-surface-muted: #f4f1ea;
  --sc-surface-elevated: #fdfcf8;
  --sc-border: #e3ddd0;
  --sc-border-strong: #d3cab9;
  --sc-text: #2c2c2c;
  --sc-text-soft: #6b6b6b;
  --sc-primary: #ff6b35;
  --sc-primary-strong: #e25723;
  --sc-primary-soft: #fff1ec;
  --sc-muted-btn: #7b879b;
  --sc-muted-btn-hover: #667487;
  --sc-danger: #cc5252;
  --sc-danger-strong: #b63d3d;
  --sc-success-bg: #eaf8f1;
  --sc-success-text: #0f6a45;
  --sc-error-bg: #fdeff0;
  --sc-error-text: #8d1e2b;
  --sc-warning-bg: #fff7e6;
  --sc-warning-text: #8a5a10;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 2px 6px rgba(44, 44, 44, 0.05);
  --shadow-md: 0 14px 30px rgba(44, 44, 44, 0.08);
}

#storycar-app-root {
  margin: var(--space-5) 0;
  color: var(--sc-text);
  line-height: 1.45;
  font-size: 14px;
}

.storycar-box {
  border: none;
  border-radius: var(--radius-lg);
  background: #faf8f3;
  padding: var(--space-6);
  box-shadow: none;
}

.storycar-topbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 var(--space-3);
}

.storycar-title {
  margin: 0 0 var(--space-2);
  font-size: clamp(26px, 2vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.storycar-section {
  margin: var(--space-3) 0 var(--space-2);
  font-size: 12px;
  color: #676257;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.storycar-sub {
  margin: 0 0 var(--space-3);
  color: var(--sc-text-soft);
  font-size: 14px;
}

#storycar-global-state {
  margin: 0 0 var(--space-3);
}

.storycar-auth,
.storycar-settings {
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: var(--space-3) 0;
  background: var(--sc-surface-muted);
  box-shadow: none;
}

.storycar-view-car #storycar-cars-shell {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin-top: 0;
}

.storycar-row {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.storycar-lang-switch {
  flex: 0 0 auto;
  min-width: 94px;
  max-width: 150px;
  height: 32px;
  padding: 6px 30px 6px 11px;
  font-weight: 600;
  border-radius: 5px;
  border-color: var(--sc-border);
  font-size: 12px;
  background-color: #fff;
}

.storycar-lang-toggle-btn {
  min-width: 54px;
  height: 32px;
  padding: 0 12px;
}

.storycar-input {
  flex: 1 1 220px;
  min-width: 180px;
  border: 1px solid var(--sc-border-strong);
  border-radius: 5px;
  padding: 6px 10px;
  background: #fff;
  font-size: 13px;
  line-height: 1.2;
  min-height: 30px;
  height: 30px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.storycar-input:focus {
  outline: none;
  border-color: var(--sc-primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.16);
}

.storycar-input-with-action {
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  min-width: 180px;
  border: 1px solid var(--sc-border-strong);
  border-radius: 5px;
  background: #fff;
  padding: 2px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.storycar-input-with-action:focus-within {
  border-color: var(--sc-primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.16);
}

.storycar-input-action {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  box-shadow: none;
  padding: 4px 8px;
  min-height: 26px;
  height: 26px;
}

.storycar-input-action:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

.storycar-inline-btn {
  border: 1px solid var(--sc-border-strong);
  background: #f5f2ea;
  color: #555046;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1;
  padding: 3px 10px;
  margin-left: 6px;
  min-height: 30px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.storycar-inline-btn:hover {
  background: #eee8db;
  border-color: #c9beaa;
}

.storycar-btn {
  border: 1px solid var(--sc-primary);
  background: var(--sc-primary);
  color: #fff;
  border-radius: 5px;
  padding: 3px 10px;
  min-height: 30px;
  height: 30px;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.storycar-btn:hover {
  background: var(--sc-primary-strong);
  border-color: var(--sc-primary-strong);
  color: #fff;
}

.storycar-btn:active {
  transform: translateY(1px);
}

.storycar-btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  pointer-events: none;
}

.storycar-btn[aria-busy='true'] {
  opacity: 0.82;
}

.storycar-btn-muted {
  border-color: var(--sc-muted-btn);
  background: var(--sc-muted-btn);
  color: #fff;
}

.storycar-btn-muted:hover {
  background: var(--sc-muted-btn-hover);
  border-color: var(--sc-muted-btn-hover);
  color: #fff;
}

.storycar-btn-danger {
  border-color: var(--sc-danger);
  background: var(--sc-danger);
  color: #fff;
}

.storycar-btn-danger:hover {
  background: var(--sc-danger-strong);
  border-color: var(--sc-danger-strong);
  color: #fff;
}

.storycar-btn:focus-visible,
.storycar-inline-btn:focus-visible,
.storycar-image-link:focus-visible,
.storycar-share-open-btn:focus-visible,
.storycar-bulk-unassigned-checkbox:focus-visible {
  outline: 2px solid var(--sc-primary);
  outline-offset: 1px;
}

.storycar-route-nav {
  margin-bottom: var(--space-4);
  align-items: center;
  border-bottom: 1px solid var(--sc-border);
  padding-bottom: var(--space-3);
}

.storycar-list-search-wrap {
  margin-bottom: var(--space-3);
}

.storycar-cars-toolbar {
  justify-content: flex-end;
  margin-bottom: var(--space-2);
}

.storycar-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8a5a10;
  background: #fff2df;
  border: 1px solid #f2d4a1;
  margin-bottom: var(--space-2);
}

.storycar-btn-active {
  background: var(--sc-primary);
  border-color: var(--sc-primary);
  color: #fff;
}

.storycar-car-subview-btn {
  min-width: 110px;
}

.storycar-list {
  display: grid;
  gap: var(--space-4);
}

.storycar-card {
  border: none;
  border-radius: 10px;
  padding: var(--space-4);
  background: var(--sc-surface);
  box-shadow: none;
  transition: none;
}

.storycar-card:hover {
  border-color: transparent;
}

.storycar-car-card {
  overflow: hidden;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: #fffdf8;
  cursor: pointer;
}

.storycar-list-section .storycar-car-card + .storycar-car-card {
  margin-top: 8px;
}

.storycar-car-hero {
  display: block;
  position: relative;
  height: 210px;
  border-radius: 10px;
  border: none;
  background: #d4dbe8;
  margin-bottom: 0;
}

.storycar-car-hero-has-image {
  background-size: cover;
  background-position: center;
}

.storycar-detail-hero.storycar-car-hero-has-image {
  height: 220px;
  margin-bottom: 0;
}

.storycar-car-hero-inner {
  position: absolute;
  left: 22px;
  bottom: 22px;
  max-width: min(68%, 620px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(227, 221, 208, 0.95);
  border-radius: 8px;
  padding: 10px 14px;
}

.storycar-car-hero-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.storycar-car-hero-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.storycar-hero-add-event-btn.storycar-btn {
  min-height: 30px;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.storycar-btn-full {
  width: 100%;
}

.storycar-timeline-add-event-btn.storycar-btn {
  min-height: 34px;
}

.storycar-head {
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: #222;
  font-size: 20px;
  line-height: 1.2;
}

.storycar-meta {
  font-size: 13px;
  color: var(--sc-text-soft);
  margin: 3px 0;
}

.storycar-car-hero-specs {
  margin: 2px 0 0;
  font-size: 12px;
}

.storycar-car-hero-cta {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.storycar-car-hero-cta .storycar-btn {
  min-height: 36px;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--sc-primary);
  border-color: var(--sc-primary);
  color: #fff;
}

.storycar-car-hero-cta .storycar-btn:hover {
  background: var(--sc-primary-strong);
  border-color: var(--sc-primary-strong);
  color: #fff;
}

.storycar-car-card > .storycar-badge,
.storycar-car-card > .storycar-bulk-select-label,
.storycar-car-card > .storycar-meta,
.storycar-car-card > .storycar-row,
.storycar-car-card > .storycar-transfer-inline {
  margin-left: 12px;
  margin-right: 12px;
}

.storycar-car-card > .storycar-meta,
.storycar-car-card > .storycar-row,
.storycar-car-card > .storycar-transfer-inline,
.storycar-car-card > .storycar-bulk-select-label,
.storycar-car-card > .storycar-badge {
  margin-top: 8px;
}

.storycar-car-card-actions {
  padding-bottom: 10px;
}

.storycar-create-car-trigger.storycar-btn-muted {
  width: 100%;
  justify-content: center;
  background: #d5dceb;
  border-color: #d5dceb;
  color: #4e5d74;
  min-height: 34px;
  height: 34px;
  font-size: 13px;
}

.storycar-create-car-trigger.storycar-btn-muted:hover {
  background: #c6d0e2;
  border-color: #c6d0e2;
  color: #445269;
}

.storycar-create-car-modal-content {
  width: min(760px, 96vw);
  padding: 18px;
  overflow-x: hidden;
}

.storycar-create-car-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 6px;
}

.storycar-create-car-field {
  display: grid;
  gap: 4px;
}

.storycar-create-car-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #676257;
  font-weight: 700;
}

.storycar-create-car-field .storycar-input {
  display: block;
  flex: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.storycar-create-car-actions {
  margin-top: 12px;
  margin-bottom: 0;
  justify-content: flex-end;
}

.storycar-share-output {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-2);
  flex-wrap: wrap;
}

.storycar-bulk-controls {
  border: 1px solid var(--sc-border);
  border-radius: var(--radius-md);
  background: #fff8f4;
  padding: var(--space-3);
  margin: var(--space-2) 0 var(--space-3);
}

.storycar-admin-tools-box {
  margin-bottom: var(--space-3);
  background: #f8f4ea;
}

.storycar-admin-tools-shell,
.storycar-cars-shell {
  margin-top: var(--space-3);
}

.storycar-view-list #storycar-cars-shell {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.storycar-cars-shell .storycar-section {
  margin-top: 0;
}

.storycar-cars-subsection {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--sc-border);
}

.storycar-assigned-box,
.storycar-unassigned-box {
  margin-top: var(--space-3);
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.storycar-assigned-box .storycar-section,
.storycar-unassigned-box .storycar-section {
  margin-top: 0;
}

.storycar-assigned-box .storycar-list-search-wrap {
  margin-bottom: var(--space-3);
}

.storycar-list-section + .storycar-list-section {
  margin-top: var(--space-4);
}

.storycar-view-list .storycar-list-search-wrap {
  border: 1px solid #e1d9c9;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fffdf8;
}

.storycar-view-list .storycar-list-search-wrap .storycar-row {
  margin-bottom: 0;
}

.storycar-admin-tools-header-row {
  justify-content: space-between;
  align-items: center;
}

.storycar-admin-tools-title {
  margin: 0;
}

.storycar-bulk-controls .storycar-row {
  align-items: center;
}

.storycar-bulk-primary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-2);
}

.storycar-bulk-primary .storycar-input {
  flex: 1 1 320px;
  min-width: 220px;
  max-width: 100%;
  width: auto;
  height: 34px;
}

.storycar-bulk-primary .storycar-btn {
  flex: 1 1 150px;
  min-width: 140px;
  width: auto;
  height: 34px;
}

.storycar-bulk-controls .storycar-row:last-child {
  margin-bottom: 0;
}

.storycar-bulk-count {
  margin: 0;
  font-weight: 700;
}

.storycar-admin-tools-help {
  margin: var(--space-3) 0 0;
  font-size: 13px;
  line-height: 1.45;
  padding: var(--space-3);
  background: #fff;
  border: 1px solid var(--sc-border);
  border-radius: var(--radius-sm);
}

.storycar-admin-tools-help span {
  display: block;
  margin: 0 0 var(--space-1);
}

.storycar-admin-tools-help span:last-child {
  margin-bottom: 0;
}

.storycar-admin-tools-help.storycar-admin-tools-help-collapsed {
  display: none;
}

.storycar-bulk-select-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #334a68;
  margin: 0 0 var(--space-2);
}

.storycar-bulk-unassigned-checkbox {
  accent-color: var(--sc-primary);
}

.storycar-transfer-inline {
  margin-top: var(--space-3);
  border-top: 1px dashed var(--sc-border-strong);
  background: #fdf8f1;
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}

.storycar-transfer-inline .storycar-row:last-child {
  margin-bottom: 0;
}

.storycar-transfer-inline .storycar-btn {
  min-width: 120px;
}

.storycar-share-input {
  flex: 1 1 280px;
}

.storycar-share-open-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.storycar-empty {
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--sc-warning-bg);
  color: #8d4f0a;
  border: 1px solid #f4d7ab;
}

.storycar-error {
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--sc-error-bg);
  color: var(--sc-error-text);
  border: 1px solid #f6ccd1;
}

.storycar-success {
  background: var(--sc-success-bg);
  color: var(--sc-success-text);
  border: 1px solid #cdeedc;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
}

#storycar-state.storycar-sub,
#storycar-state.storycar-error,
#storycar-state.storycar-success {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin: var(--space-3) 0;
}

#storycar-state.storycar-sub {
  background: #f7f2e7;
  color: #645c4f;
}

#storycar-state.storycar-error {
  background: var(--sc-error-bg);
  color: var(--sc-error-text);
}

.storycar-image-grid {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.storycar-image-link {
  display: inline-flex;
  border: 1px solid var(--sc-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  background: #fff;
}

.storycar-image-thumb {
  width: 120px;
  height: 88px;
  object-fit: cover;
  display: block;
  background: #f3efe7;
  transition: transform 0.18s ease;
}

.storycar-image-link:hover .storycar-image-thumb {
  transform: scale(1.04);
}

.storycar-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.storycar-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 23, 18, 0.82);
}

.storycar-lightbox-figure {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(1100px, 95vw);
  max-height: 92vh;
  display: grid;
  gap: var(--space-2);
}

.storycar-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 46px);
  border-radius: var(--radius-md);
  border: 1px solid #e2d8c5;
  box-shadow: 0 18px 34px rgba(18, 15, 10, 0.35);
  background: #fff;
}

.storycar-lightbox-caption {
  color: #f7f4ee;
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
}

.storycar-lightbox-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  border: 1px solid #ded3bf;
  background: #fff;
  color: #2c2c2c;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.storycar-lightbox-close:hover {
  background: #f5f0e6;
}

.storycar-lightbox-counter {
  position: absolute;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  background: rgba(28, 24, 18, 0.72);
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1;
}

.storycar-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 5px;
  border: 1px solid #ded3bf;
  background: rgba(255, 255, 255, 0.94);
  color: #2c2c2c;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.storycar-lightbox-nav:hover {
  background: #f5f0e6;
}

.storycar-lightbox-prev {
  left: 10px;
}

.storycar-lightbox-next {
  right: 10px;
}

.storycar-recent-images-strip {
  margin: var(--space-3) 0 var(--space-2);
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.storycar-recent-image-grid {
  gap: 6px;
}

.storycar-recent-image-link {
  border-radius: 5px;
}

.storycar-recent-image-thumb {
  width: 220px;
  height: 165px;
}

.storycar-heading-lines {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-3);
}

.storycar-heading-lines span {
  height: 1px;
  background: var(--sc-border);
  flex: 1 1 auto;
}

.storycar-heading-lines .storycar-section {
  margin: 0;
  flex: 0 0 auto;
}

.storycar-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px var(--space-3);
}

.storycar-share-hero {
  margin-bottom: var(--space-3);
  padding: 14px;
}

.storycar-share-narrow {
  max-width: 1120px;
  margin: 0 auto;
}

.storycar-share-hero .storycar-head {
  font-size: 24px;
  margin-bottom: 8px;
}

.storycar-share-hero .storycar-meta {
  font-size: 13px;
}

.storycar-subtle-label {
  color: var(--sc-text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.storycar-timeline-filters {
  margin-bottom: var(--space-3);
}

.storycar-timeline-shell {
  padding: 0;
  background: transparent;
  border: none;
}

.storycar-timeline {
  position: relative;
  display: grid;
  gap: var(--space-5);
}

.storycar-timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #d7cfbf;
  transform: translateX(-50%);
  z-index: 0;
}

.storycar-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 64px;
  row-gap: 6px;
  align-items: start;
  z-index: 1;
  min-height: 40px;
}

.storycar-timeline-dot {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #cebfa4;
  background: #fffdf8;
  margin-top: 0;
  z-index: 2;
}

.storycar-timeline-date {
  grid-row: 1;
  font-size: 14px;
  font-weight: 600;
  color: #5f584d;
  line-height: 1.1;
  padding-top: 1px;
  width: max-content;
  max-width: calc(50vw - 120px);
  letter-spacing: 0.01em;
}

.storycar-timeline-item-right .storycar-timeline-date {
  grid-column: 2;
  justify-self: start;
  text-align: left;
  padding-left: 16px;
}

.storycar-timeline-item-right .storycar-timeline-card {
  grid-column: 2;
  grid-row: 2;
}

.storycar-timeline-item-left .storycar-timeline-date {
  grid-column: 1;
  justify-self: end;
  text-align: right;
  padding-right: 16px;
}

.storycar-timeline-item-left .storycar-timeline-card {
  grid-column: 1;
  grid-row: 2;
}

.storycar-timeline-card {
  box-shadow: none;
  border: none;
  background: #fffefb;
  padding: 14px 14px 12px;
  width: min(100%, 560px);
}

.storycar-timeline-item-right .storycar-timeline-card {
  justify-self: start;
}

.storycar-timeline-item-left .storycar-timeline-card {
  justify-self: end;
}

.storycar-timeline-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  margin-bottom: var(--space-2);
}

.storycar-chip-icon {
  font-size: 12px;
  line-height: 1;
}

.storycar-tone-maintenance { background: #3B82F6; }
.storycar-tone-restoration { background: #FF6B35; }
.storycar-tone-event { background: #10B981; }
.storycar-tone-photos { background: #8B5CF6; }
.storycar-tone-mileage { background: #64748B; }
.storycar-tone-notes { background: #D0CCBF; color: #2c2c2c; }
.storycar-tone-other { background: #6B7280; }

.storycar-timeline-title {
  font-size: 18px;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.storycar-timeline-mileage {
  color: #FF6B35;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 300;
  margin-bottom: 4px;
}

.storycar-timeline-actions {
  margin-top: 6px;
  gap: 4px;
}

.storycar-timeline-actions .storycar-btn {
  min-height: 24px;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 5px;
}

.storycar-timeline-actions .storycar-btn.storycar-btn-muted {
  background: transparent;
  border-color: transparent;
  color: var(--sc-text-soft);
  box-shadow: none;
}

.storycar-timeline-actions .storycar-btn.storycar-btn-muted:hover {
  background: #f3efe5;
  border-color: #e3dccd;
  color: var(--sc-text);
}

.storycar-timeline-filters .storycar-row {
  margin-bottom: 4px;
}

.storycar-timeline-filters .storycar-sub {
  margin-bottom: 6px;
  font-size: 12px;
}

.storycar-timeline-filters {
  padding: var(--space-4);
  border-radius: var(--radius-md);
}

.storycar-timeline-filters .storycar-btn {
  min-height: 32px;
}

.storycar-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.storycar-filter-bar .storycar-btn {
  min-width: auto;
  flex-basis: auto;
  flex: 0 0 auto;
}

.storycar-filter-label {
  flex: 0 0 auto;
  font-size: 14px;
  color: var(--sc-text-soft);
  font-weight: 600;
}

.storycar-filter-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.storycar-filter-btn.storycar-btn {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 13px;
  border-radius: 5px;
  white-space: nowrap;
}

.storycar-filter-btn.storycar-btn-muted {
  background: #f0ece3;
  border-color: #e2dccf;
  color: #5a5a5a;
}

.storycar-filter-btn.storycar-btn-muted:hover {
  background: #e8e2d5;
  border-color: #d7cfbe;
  color: #3f3f3f;
}

.storycar-filter-btn.storycar-btn-active {
  background: #707988;
  border-color: #707988;
  color: #fff;
}

.storycar-filter-btn.storycar-btn-active:hover {
  background: #627289;
  border-color: #627289;
}

@media (max-width: 700px) {
  .storycar-filter-bar {
    gap: 8px;
  }
  .storycar-filter-label {
    font-size: 12px;
  }
  .storycar-filter-btn.storycar-btn {
    font-size: 12px;
    padding: 3px 10px;
    min-height: 30px;
  }
}

.storycar-detail-top-card .storycar-head {
  font-size: 26px;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.storycar-detail-top-card .storycar-meta {
  font-size: 12px;
}

.storycar-recent-images-strip .storycar-section {
  margin: 0 0 6px;
}

.storycar-recent-image-grid {
  margin-top: 0;
}

.storycar-hero-control-strip {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  gap: 6px;
}

.storycar-hero-control-strip .storycar-btn {
  min-height: 24px;
  height: 24px;
  min-width: 64px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 1;
}

.storycar-hero-popover {
  position: absolute;
  top: 12px;
  right: 52px;
  z-index: 5;
  width: min(360px, calc(100% - 88px));
  background: rgba(255, 253, 248, 0.97);
  border: 1px solid #ddd2bf;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(30, 26, 20, 0.18);
  padding: 10px;
  padding-top: 22px;
}

.storycar-hero-popover-close {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  color: #8f8777;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.storycar-hero-popover-close:hover {
  color: #5f584d;
}

.storycar-hero-popover .storycar-row {
  margin-bottom: 6px;
}

.storycar-hero-popover .storycar-row:last-child {
  margin-bottom: 0;
}

.storycar-hero-popover .storycar-section {
  margin: 0 0 4px;
}

.storycar-hero-popover .storycar-sub {
  margin-bottom: 6px;
  font-size: 12px;
}

.storycar-hero-popover .storycar-btn {
  min-height: 28px;
  height: 28px;
  padding: 2px 8px;
  font-size: 12px;
}

.storycar-detail-top-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 0;
  align-items: start;
}

.storycar-detail-meta-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.storycar-detail-hero-shell {
  margin-bottom: 10px;
  padding: 0;
  overflow: hidden;
}

.storycar-detail-fields-card,
.storycar-mileage-panel {
  background: #fff;
  border: none;
}

.storycar-compact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 24px;
}

.storycar-compact-grid.storycar-compact-grid-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
}

.storycar-mileage-panel {
  background: #fff;
  border: none;
  padding: 14px;
}

.storycar-mileage-panel .storycar-section {
  margin-top: 0;
}

.storycar-mileage-history {
  display: grid;
  gap: 6px;
}

.storycar-mileage-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--sc-border);
}

.storycar-compact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--sc-border);
}

.storycar-compact-value-wrap,
.storycar-compact-edit-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.storycar-compact-inline-input {
  flex: 0 1 170px;
  width: 170px;
  min-width: 0;
  max-width: 170px;
}

.storycar-inline-field-edit-btn,
.storycar-inline-field-save-btn,
.storycar-inline-field-cancel-btn {
  min-width: 22px;
  width: 22px;
  padding: 0;
  min-height: 22px;
  height: 22px;
  border-radius: 5px;
  flex: 0 0 auto;
  background: transparent;
  border-color: transparent;
  color: #7a869b;
  box-shadow: none;
}

.storycar-inline-field-edit-btn:hover,
.storycar-inline-field-save-btn:hover,
.storycar-inline-field-cancel-btn:hover {
  background: #f3efe5;
  border-color: #e3dccd;
  color: var(--sc-text);
}

.storycar-compact-label {
  color: var(--sc-text-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.storycar-compact-value {
  color: var(--sc-text);
  font-weight: 600;
  text-align: right;
  font-size: 13px;
}

.storycar-detail-top-card .storycar-btn-danger {
  background: #c95a5a;
  border-color: #c95a5a;
}

.storycar-detail-top-card .storycar-btn-danger:hover {
  background: #b84b4b;
  border-color: #b84b4b;
}

.storycar-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.storycar-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 44, 44, 0.46);
}

.storycar-modal-content {
  position: relative;
  width: min(920px, 96vw);
  max-height: 90vh;
  overflow: auto;
  box-sizing: border-box;
  background: #fffdfa;
  border: none;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 14px;
}

.storycar-confirm-modal-content {
  width: min(460px, calc(100vw - 24px));
  max-height: none;
}

.storycar-confirm-actions {
  justify-content: flex-end;
  margin-top: 10px;
  margin-bottom: 0;
}

.storycar-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e9e2d3;
}

.storycar-modal-header .storycar-section {
  margin: 0;
}

.storycar-event-type-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.storycar-type-btn {
  border: 1px solid var(--sc-border-strong);
  background: #f8f3e8;
  color: #2c2c2c;
  border-radius: 5px;
  min-height: 44px;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

.storycar-type-btn:hover {
  border-color: #b8c5d7;
}

.storycar-type-btn-active {
  border-color: var(--sc-primary);
  background: #fff1eb;
  box-shadow: inset 0 0 0 1px rgba(255, 107, 53, 0.15);
}

.storycar-modal-content .storycar-row {
  margin-bottom: 6px;
}

.storycar-modal-content .storycar-row:last-child {
  margin-bottom: 0;
}

.storycar-event-form-grid {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
  gap: 10px 12px;
  margin-bottom: 10px;
}

.storycar-event-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.storycar-event-field-wide {
  grid-column: 1 / -1;
}

.storycar-event-form-grid.storycar-event-form-mileage #storycar-detail-mileage-field {
  order: 2;
  grid-column: 2;
}

.storycar-event-form-grid.storycar-event-form-mileage #storycar-detail-title-field {
  order: 3;
  grid-column: 1 / -1;
}

.storycar-event-textarea {
  min-height: 74px;
  line-height: 1.35;
  resize: vertical;
}

#storycar-detail-event-date.storycar-input {
  width: 150px;
  min-width: 150px;
}

.storycar-event-images-block {
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 10px;
  background: transparent;
}

.storycar-event-images-toolbar {
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 8px;
}

.storycar-event-images-toolbar .storycar-create-car-label {
  margin: 0;
}

.storycar-upload-dropzone {
  border: 2px dashed #ff6b35;
  border-radius: 8px;
  background: #fff;
  min-height: 126px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
  margin-bottom: 10px;
}

.storycar-upload-dropzone:focus-visible {
  outline: 2px solid #ff6b35;
  outline-offset: 2px;
}

.storycar-upload-dropzone.is-dragover,
.storycar-upload-dropzone.is-uploading {
  background: #fff8f3;
  border-color: #ff5a20;
}

.storycar-upload-dropzone-icon {
  font-size: 28px;
  line-height: 1;
  color: #6b6b6b;
}

.storycar-upload-dropzone-main {
  font-size: 26px;
  font-weight: 600;
  color: #4a4a4a;
  line-height: 1.15;
}

.storycar-upload-dropzone-sub {
  font-size: 15px;
  color: #7a7a7a;
}

.storycar-draft-image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.storycar-draft-image-item {
  position: relative;
  border: 1px solid #d9cfbb;
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}

.storycar-draft-image-thumb {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: cover;
}

.storycar-draft-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(44, 44, 44, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.storycar-draft-image-remove:hover {
  background: rgba(44, 44, 44, 0.9);
}

.storycar-modal-content .storycar-input {
  min-height: 34px;
  font-size: 13px;
}

.storycar-modal-content textarea.storycar-input {
  min-height: 76px;
  line-height: 1.35;
}

.storycar-modal-content .storycar-btn {
  min-height: 30px;
  padding: 3px 10px;
  font-size: 12px;
}

.storycar-modal-content .storycar-add-detail-event-btn {
  box-shadow: 0 4px 10px rgba(255, 107, 53, 0.22);
}

.storycar-type-maintenance { border-left: 4px solid #3B82F6; }
.storycar-type-restoration { border-left: 4px solid #FF6B35; }

@media (max-width: 700px) {
  .storycar-upload-dropzone-main {
    font-size: 20px;
  }
  .storycar-upload-dropzone-sub {
    font-size: 13px;
  }
}
.storycar-type-event { border-left: 4px solid #10B981; }
.storycar-type-mileage { border-left: 4px solid #64748B; }
.storycar-type-photos { border-left: 4px solid #8B5CF6; }
.storycar-type-notes { border-left: 4px solid #D0CCBF; }

@media (max-width: 980px) {
  .storycar-box {
    padding: var(--space-5);
  }

  .storycar-head {
    font-size: 20px;
  }

  .storycar-timeline-shell {
    padding: 0;
  }

  .storycar-detail-hero.storycar-car-hero-has-image {
    height: 180px;
  }

  .storycar-car-hero-title {
    font-size: 28px;
  }

  .storycar-detail-meta-grid {
    grid-template-columns: 1fr;
  }

  .storycar-compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .storycar-car-hero-has-image {
    height: 180px;
  }

  .storycar-car-hero-inner {
    max-width: calc(100% - 150px);
  }

  .storycar-car-hero-cta {
    right: 12px;
  }

  .storycar-car-hero-cta .storycar-btn {
    min-height: 30px;
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .storycar-event-type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .storycar-box {
    padding: var(--space-4);
    border-radius: var(--radius-md);
  }

  .storycar-title {
    font-size: 24px;
  }

  .storycar-section {
    font-size: 11px;
  }

  .storycar-route-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-2);
  }

  .storycar-route-nav .storycar-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .storycar-row {
    gap: 6px;
  }

  .storycar-create-car-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .storycar-create-car-actions {
    justify-content: stretch;
  }

  .storycar-create-car-actions .storycar-btn {
    width: 100%;
  }

  .storycar-event-form-grid {
    grid-template-columns: 1fr;
  }

  .storycar-event-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .storycar-car-hero-cta {
    position: static;
    transform: none;
    margin: 8px 10px 10px;
  }

  .storycar-car-hero-inner {
    max-width: calc(100% - 20px);
  }

  .storycar-car-hero-title-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .storycar-compact-grid {
    grid-template-columns: 1fr;
  }

  .storycar-input,
  .storycar-input-with-action,
  .storycar-btn,
  .storycar-inline-btn {
    min-width: 100%;
    flex-basis: 100%;
  }

  .storycar-filter-group .storycar-btn {
    min-width: auto;
    flex-basis: auto;
  }

  .storycar-lang-switch {
    min-width: 110px;
    flex-basis: auto;
  }

  .storycar-share-output .storycar-btn,
  .storycar-share-output .storycar-share-open-btn,
  .storycar-transfer-inline .storycar-btn {
    width: 100%;
    justify-content: center;
  }

  .storycar-bulk-primary {
    flex-direction: column;
    align-items: stretch;
  }

  .storycar-bulk-primary .storycar-input,
  .storycar-bulk-primary .storycar-btn {
    width: 100%;
    min-width: 0;
  }

  .storycar-detail-top-actions {
    justify-content: flex-start;
  }

  .storycar-detail-top-grid {
    grid-template-columns: 1fr;
  }

  .storycar-heading-lines {
    gap: var(--space-2);
    margin-top: var(--space-4);
  }

  .storycar-timeline-line {
    left: 9px;
    transform: none;
  }

  .storycar-timeline-item {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: var(--space-2);
    padding-left: 18px;
  }

  .storycar-timeline-dot {
    left: 9px;
    top: 14px;
    margin-top: 0;
  }

  .storycar-timeline-date,
  .storycar-timeline-item-right .storycar-timeline-date,
  .storycar-timeline-item-left .storycar-timeline-date {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    width: auto;
    max-width: none;
    text-align: left;
    padding-top: 0;
    padding-right: 0;
    padding-left: 0;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--sc-text-soft);
  }

  .storycar-timeline-item-right .storycar-timeline-card,
  .storycar-timeline-item-left .storycar-timeline-card {
    grid-column: 1;
    grid-row: 2;
  }

  .storycar-image-thumb {
    width: 94px;
    height: 72px;
  }

  .storycar-car-hero-has-image {
    height: 138px;
    margin-bottom: 8px;
  }

  .storycar-detail-hero.storycar-car-hero-has-image {
    height: 148px;
  }

  .storycar-car-hero-inner {
    left: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    padding: 6px 8px;
  }

  .storycar-car-hero-title {
    font-size: 22px;
  }

  .storycar-recent-image-thumb {
    width: 132px;
    height: 99px;
  }

  .storycar-lightbox-nav {
    width: 34px;
    height: 34px;
    font-size: 22px;
  }

  .storycar-lightbox-close {
    top: -6px;
    right: -6px;
  }

  .storycar-modal-content {
    padding: var(--space-3);
    width: min(980px, 98vw);
  }

  .storycar-event-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

