:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #1f2329;
  color: #f4f5f6;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --shell-top-spacing: 8px;
  --shell-bottom-spacing: 48px;
}

html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #1f2329; }
body.app-loading { background: #1f2329; }
body.auth-page { position: relative; overflow: hidden; background: #0b0d0f; }
body.auth-page { --shell-top-spacing: 32px; }
body.auth-page::before,
body.auth-page::after { content: ""; position: fixed; pointer-events: none; z-index: 0; }
body.auth-page::before {
  inset: 0;
  opacity: .2;
  background:
    linear-gradient(90deg, transparent 0 14%, #35404a 14% 14.12%, transparent 14.12% 100%),
    linear-gradient(0deg, transparent 0 24%, #35404a 24% 24.12%, transparent 24.12% 100%),
    linear-gradient(32deg, transparent 0 47%, #35404a 47% 47.1%, transparent 47.1% 100%),
    linear-gradient(148deg, transparent 0 62%, #35404a 62% 62.1%, transparent 62.1% 100%);
  background-size: 168px 168px, 168px 168px, 280px 280px, 320px 320px;
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
}
body.auth-page::after {
  top: 9%;
  right: -18%;
  width: min(76vw, 540px);
  aspect-ratio: 1;
  opacity: .13;
  border: 1px solid #59646e;
  border-radius: 50%;
  box-shadow: 0 0 0 22px #2d363e22, 0 0 0 44px #2d363e16;
  background:
    radial-gradient(circle at 28% 20%, #fed32c 0 1px, transparent 2px),
    radial-gradient(circle at 20% 28%, #fed32c 0 1px, transparent 2px),
    radial-gradient(circle at 32% 31%, #fed32c 0 1px, transparent 2px);
}
button, input, select, textarea { font: inherit; }
button { border: 0; border-radius: 10px; padding: 11px 16px; background: #fed32c; color: #17191c; font-weight: 700; cursor: pointer; }
button.secondary { background: #343b44; color: #f4f5f6; }
button.danger { background: #8f3f3c; color: #fff; }
button:disabled { opacity: .6; cursor: wait; }
.shell {
  width: min(100% - 32px, 820px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(var(--shell-top-spacing) + var(--safe-top))
           var(--safe-right)
           calc(var(--shell-bottom-spacing) + var(--safe-bottom))
           var(--safe-left);
}
.app-loading-screen {
  min-height: calc(100dvh - var(--safe-top) - var(--safe-bottom));
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: #aeb6c1;
  text-align: center;
}
.app-loading-screen strong { color: #c7ccd4; font-size: 14px; letter-spacing: .12em; }
.app-loading-screen span { font-size: 13px; }
.app-loading-screen button { margin-top: 6px; }
.app-loading #login-screen,
.app-loading #app-screen { display: none !important; }
.card { background: #272c33; border: 1px solid #414a56; border-radius: 16px; padding: 24px; box-shadow: 0 10px 28px #11151a55; }
.auth-screen {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 12px), 480px);
  min-height: calc(100dvh - var(--safe-top) - var(--safe-bottom));
  margin: 0 auto;
  padding: clamp(8px, 2vh, 18px) 0 8px;
  display: flex;
  flex-direction: column;
}
.auth-brand { margin: 0 auto clamp(18px, 4vh, 32px); text-align: center; }
.brand-name { margin: 0; color: #f4f5f6; font-size: 15px; font-weight: 800; letter-spacing: .14em; }
.brand-tagline { margin: 7px 0 0; color: #87919d; font-size: 12px; }
.auth-card {
  width: 100%;
  max-width: 480px;
  margin: 0;
  padding: clamp(20px, 5vw, 30px);
  background: #15191d;
  border: 1px solid #2d343b;
  border-radius: 20px;
  box-shadow: 0 12px 30px #00000022;
}
.auth-card h1 { margin: 0 0 22px; color: #c7ccd4; font-size: clamp(22px, 6vw, 26px); line-height: 1.2; text-align: center; }
.auth-field { display: grid; gap: 8px; margin-bottom: 14px; color: #c8ced5; font-size: 13px; }
.input-shell { position: relative; display: flex; align-items: center; min-width: 0; }
.input-shell > input {
  min-height: 52px;
  margin: 0;
  padding: 13px 48px 13px 44px;
  background: #1a1f24;
  border-color: #343c44;
  border-radius: 14px;
}
.input-shell > input:focus { border-color: #fed32c; outline: 2px solid #fed32c33; }
.field-icon { position: absolute; left: 15px; width: 20px; height: 20px; color: #8f99a5; pointer-events: none; }
.password-toggle {
  position: absolute;
  right: 6px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: #9da7b2;
  border-radius: 10px;
}
.password-toggle:hover, .password-toggle:focus-visible { background: #fed32c14; color: #fed32c; outline: none; }
.password-toggle svg { width: 20px; height: 20px; }
.auth-submit { width: 100%; min-height: 52px; margin-top: 8px; border-radius: 14px; font-size: 16px; }
.auth-passkey { width: 100%; min-height: 48px; margin-top: 10px; border: 1px solid #343c44; background: transparent !important; color: #c8ced5 !important; }
.auth-access-note { margin: 18px 0 0; color: #c8ced5; font-size: 13px; line-height: 1.45; text-align: center; }
.auth-public-note { margin: 8px 0 0; color: #7f8a96; font-size: 12px; text-align: center; }
.auth-error { margin: 14px 0 0; padding: 10px 12px; border: 1px solid #7b3b3b; border-radius: 10px; background: #351c20; color: #ffb7a9; font-size: 13px; line-height: 1.4; }
.auth-secure-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 18px 0 0; color: #7f8a96; font-size: 12px; }
.auth-secure-note svg { width: 15px; height: 15px; color: #fed32c; }
.topbar, .section-heading, .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar { position: relative; margin-bottom: 16px; }
.topbar-title { min-width: 0; }
.app-title-switcher { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 0; background: transparent; color: #f4f5f6; font-size: 18px; line-height: 1.2; font-weight: 700; text-align: left; }
.app-title-switcher:hover, .app-title-switcher:focus-visible { background: transparent; color: #fed32c; outline: none; }
.app-title-switcher.has-erp-selector::after { content: "⌄"; color: #fed32c; font-size: 12px; line-height: 1; }
.topbar.home-topbar { justify-content: center; }
.topbar.home-topbar .topbar-title { text-align: center; }
.topbar.home-topbar .app-title-switcher { color: #c7ccd4; font-size: 15px; letter-spacing: .08em; }
.update-notice { position: sticky; top: calc(var(--safe-top) + var(--shell-top-spacing)); z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 10px 12px; border: 1px solid #fed32c; border-radius: 10px; background: #272c33; }
.update-notice span { min-width: 0; }
.update-notice button { flex: 0 0 auto; padding: 8px 12px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(26px, 6vw, 36px); }
h2 { margin-bottom: 12px; font-size: 22px; }
.eyebrow { margin-bottom: 8px; color: #fed32c; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: #aeb6c1; }
.erp-name { font-weight: 700; word-break: break-word; }
.erp-selector-menu { position: absolute; top: calc(100% + 8px); left: 50%; z-index: 20; width: min(calc(100% - 16px), 300px); max-height: min(60vh, 320px); overflow-y: auto; transform: translateX(-50%); padding: 6px; background: #15191d; border: 1px solid #414a56; border-radius: 14px; box-shadow: 0 10px 28px #11151acc; }
.erp-selector-option { display: block; width: 100%; min-width: 0; overflow: hidden; padding: 11px 12px; background: transparent; color: #c7ccd4; font-size: 14px; font-weight: 600; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.erp-selector-option:hover, .erp-selector-option:focus-visible { background: #272c33; color: #fed32c; outline: none; }
.erp-selector-option[aria-selected="true"] { background: #343b44; color: #fed32c; }
.app-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.app-nav button { padding: 9px 12px; background: #343b44; color: #cbd1d8; font-size: 14px; }
.app-nav button.active { background: #fed32c; color: #17191c; }
#app-screen { padding-bottom: calc(92px + var(--safe-bottom)); }
#app-nav { display: none; margin: 0 0 14px; padding: 12px; background: #15191d; border: 1px solid #343c44; border-radius: 16px; }
#app-nav.is-open { display: flex; }
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100%, 820px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  padding: 8px 12px calc(8px + var(--safe-bottom));
  border-top: 1px solid #343c44;
  background: #15191df2;
  backdrop-filter: blur(14px);
}
.bottom-nav > button { min-width: 0; min-height: 46px; display: grid; justify-items: center; align-content: center; gap: 4px; padding: 4px 2px; background: transparent; color: #7f8a96; font-size: 10px; font-weight: 700; }
.bottom-nav > button svg { width: 21px; height: 21px; }
.bottom-nav > button.active { color: #fed32c; }
.bottom-nav > button:focus-visible { outline: 2px solid #fed32c; outline-offset: -2px; }
.screen-action-button { position: fixed; left: 14px; bottom: calc(64px + var(--safe-bottom) + 12px); z-index: 110; width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: #2b3138; color: #f4f5f7; font-size: 28px; line-height: 1; box-shadow: none; }
.screen-action-button:active { transform: scale(.92); }
.journals-index-list { display: grid; gap: 8px; margin-top: 16px; }
.journal-index-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid #414a56; border-radius: 12px; background: #1a1f24; color: #f4f5f6; text-align: left; }
.journal-index-item > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.journal-index-item > span:last-child { flex: 0 0 auto; color: #7f8a96; font-size: 22px; line-height: 1; }
.journal-index-item:hover, .journal-index-item:focus-visible { border-color: #fed32c; outline: none; }
.content { min-width: 0; }
label { display: grid; gap: 7px; margin-bottom: 14px; color: #c4cbd4; font-size: 14px; }
input, select, textarea { width: 100%; border: 1px solid #4b5663; border-radius: 9px; background: #20252b; color: #f4f5f6; padding: 11px 12px; font-size: 16px; }
textarea { resize: vertical; min-height: 74px; }
form > button { width: 100%; margin-top: 4px; }
.message { margin: 12px 0 0; color: #ffb7a9; }
.content > .card { margin-bottom: 20px; }
.welcome { padding: 32px 24px; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.kpi { display: grid; gap: 5px; padding: 13px; border: 1px solid #414a56; border-radius: 10px; }
.kpi strong { font-size: 18px; }
.entity-list, .users-list { display: grid; gap: 10px; }
.entity-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid #414a56; border-radius: 10px; cursor: pointer; }
.entity-row:hover, .entity-row:focus { border-color: #fed32c; outline: none; }
.entity-main { display: grid; gap: 5px; min-width: 0; }
.entity-main strong { overflow-wrap: anywhere; }
.entity-row time { flex: 0 0 auto; color: #aeb6c1; font-size: 12px; text-align: right; }
.empty-state { margin: 12px 0 0; padding: 24px 12px; color: #aeb6c1; text-align: center; border: 1px dashed #414a56; border-radius: 10px; }
.entity-form { margin-top: 20px; }
.checkbox { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
.form-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 18px; }
.admin-form { margin: 18px 0; padding-top: 18px; border-top: 1px solid #414a56; }
.user-row { display: grid; gap: 4px; padding: 14px; border: 1px solid #414a56; border-radius: 10px; }
.user-row strong { overflow-wrap: anywhere; }
.member-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 0; border-top: 1px solid #414a56; }
.member-row > span { flex: 1 1 180px; min-width: 0; }
.member-row label { margin: 0; }
.permission-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex-basis: 100%; }
.more-logout-button { flex-basis: 100%; margin-top: 4px; background: #351c20 !important; color: #ffb7a9 !important; border: 1px solid #7b3b3b; }
.dashboard-home { display: grid; gap: 12px; max-width: 760px; margin: 0 auto; }
.dashboard-month { padding: 4px 4px 2px; }
.dashboard-month .eyebrow { margin-bottom: 4px; }
.dashboard-month h2 { margin: 0; color: #f4f5f6; font-size: clamp(24px, 7vw, 30px); }
.dashboard-card { padding: 16px; background: #15191d; border: 1px solid #2d343b; border-radius: 16px; box-shadow: 0 8px 20px #00000018; }
.dashboard-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dashboard-card-head h2 { margin: 0; color: #f4f5f6; font-size: 17px; }
.dashboard-card-head > span { color: #7f8a96; font-size: 12px; }
.dashboard-metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dashboard-metric { min-width: 0; display: grid; gap: 5px; padding: 11px 12px; border: 1px solid #2d343b; border-radius: 12px; background: #1a1f24; }
.dashboard-metric span { color: #8f99a5; font-size: 12px; }
.dashboard-metric strong { min-width: 0; overflow-wrap: anywhere; color: #f4f5f6; font-size: 16px; }
.dashboard-metric.positive strong { color: #79d6a5; }
.dashboard-metric.negative strong { color: #e99a91; }
.dashboard-metric.pending strong { color: #fed32c; }
.dashboard-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dashboard-kpi-grid .dashboard-metric { padding: 10px; }
.dashboard-kpi-grid .dashboard-metric strong { font-size: 19px; }
.dashboard-vehicle-head { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: 12px; }
.dashboard-vehicle-head > div:last-child { min-width: 0; display: grid; gap: 3px; }
.dashboard-vehicle-head strong { overflow-wrap: anywhere; color: #f4f5f6; }
.dashboard-vehicle-head span { color: #8f99a5; font-size: 12px; }
.dashboard-vehicle-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: #272c33; color: #fed32c; }
.dashboard-vehicle-icon svg { width: 22px; height: 22px; }
.dashboard-vehicle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) {
  .shell { width: min(100% - 20px, 820px); --shell-top-spacing: 0px; }
  body.auth-page .shell { --shell-top-spacing: 5px; }
  .card { padding: 18px; }
  .topbar { align-items: flex-start; }
  .section-heading { align-items: flex-start; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entity-row { display: grid; }
  .entity-row time { text-align: left; }
}
@media (max-width: 480px) {
  .auth-screen { width: min(calc(100% - 12px), 480px); padding-top: clamp(4px, 1.2vh, 10px); }
  .auth-brand { margin-bottom: 18px; }
  .auth-card { padding: 20px 18px; }
  .dashboard-card { padding: 14px; }
  .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-height: 700px) and (max-width: 480px) {
  .auth-brand { margin-bottom: 10px; }
  .auth-card { padding-top: 16px; padding-bottom: 16px; }
  .auth-card h1 { margin-bottom: 16px; }
  .auth-field { margin-bottom: 10px; }
  .auth-access-note { margin-top: 12px; }
  .auth-secure-note { margin-top: 10px; }
}

/* Legacy visual contract for the server UI.  Data and navigation remain REST-backed. */
#app-screen {
  color: #f4f5f7;
}

#app-screen .topbar {
  min-height: 52px;
  margin: 0 -4px 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: #202329;
}

#app-screen .app-title-switcher {
  max-width: min(78vw, 520px);
  overflow: hidden;
  color: #f4f5f7;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app-screen .content {
  width: 100%;
  overflow-x: hidden;
}

#app-screen .card,
#app-screen .dashboard-main-card {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  background: linear-gradient(135deg, #232830, #2b3138);
  box-shadow: none;
}

#app-screen .dashboard {
  width: 100%;
  display: grid;
  gap: 14px;
  padding: 4px 0 20px;
}

#app-screen .dashboard-main-card {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 18px 16px;
}

#app-screen .dashboard-month-card {
  padding-top: 16px;
  padding-bottom: 14px;
}

#app-screen .dashboard-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
}

#app-screen .dashboard-period {
  color: #929aa8;
  font-size: 13px;
  font-weight: 650;
}

#app-screen .dashboard-profit {
  display: grid;
  gap: 6px;
  margin: 12px 0 18px;
}

#app-screen .dashboard-profit-label,
#app-screen .dashboard-section-title {
  color: #929aa8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

#app-screen .dashboard-profit-value {
  color: #f4f5f7;
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1;
  letter-spacing: -.7px;
}

#app-screen .dashboard-finance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#app-screen .dashboard-metric {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(32,35,41,.62);
}

#app-screen .dashboard-metric span {
  color: #737c8a;
  font-size: 11px;
  line-height: 1.2;
}

#app-screen .dashboard-metric strong {
  min-width: 0;
  overflow: hidden;
  color: #f4f5f7;
  font-size: 14px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app-screen .dashboard-finance-grid .dashboard-metric.positive strong { color: #43d17a; }
#app-screen .dashboard-finance-grid .dashboard-metric.negative strong { color: #e9a09a; }
#app-screen .dashboard-finance-grid .dashboard-metric.pending strong { color: #fed32c; }

#app-screen .dashboard-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

#app-screen .dashboard-progress-card .dashboard-metric strong {
  font-size: 18px;
}

#app-screen .dashboard-vehicle-card-premium .dashboard-section-title,
#app-screen .dashboard-activity-card .dashboard-section-title {
  margin-bottom: 14px;
}

#app-screen .dashboard-vehicle {
  min-width: 0;
}

#app-screen .dashboard-vehicle-grid {
  margin-top: 14px;
}

#app-screen .dashboard-activity-card {
  padding-bottom: 14px;
}

/* RecentActivityList — компактный список событий без карточки на каждый элемент. */
#app-screen .dashboard-activity-card .recent-activity-list {
  display: grid;
  gap: 0;
  min-width: 0;
  margin-top: -2px;
}

#app-screen .dashboard-activity-card .recent-activity-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  gap: 10px;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid rgba(199,204,212,.10);
  border-radius: 0;
  background: transparent;
  cursor: default;
}

#app-screen .dashboard-activity-card .recent-activity-item:last-child { border-bottom: 0; }
#app-screen .dashboard-activity-card .recent-activity-item.is-clickable { cursor: pointer; }
#app-screen .dashboard-activity-card .recent-activity-item.is-clickable:hover,
#app-screen .dashboard-activity-card .recent-activity-item.is-clickable:focus {
  outline: none;
  background: rgba(199,204,212,.035);
}

#app-screen .recent-activity-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  color: #b79a36;
  background: rgba(183,154,54,.10);
}

#app-screen .recent-activity-icon svg { width: 16px; height: 16px; }
#app-screen .recent-activity-main { display: grid; gap: 2px; min-width: 0; }
#app-screen .recent-activity-main strong {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #c7ccd4;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
#app-screen .recent-activity-subtitle {
  min-width: 0;
  overflow: hidden;
  color: #8d95a0;
  font-size: 10.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#app-screen .recent-activity-side {
  display: grid;
  justify-items: end;
  min-width: 38px;
  color: #8d95a0;
}
#app-screen .recent-activity-side time { font-size: 10.5px; line-height: 1.2; white-space: nowrap; }
#app-screen .recent-activity-chevron { width: 15px; height: 15px; margin-top: 2px; }
#app-screen .recent-activity-empty { margin: 0; padding: 10px 0 2px; color: #8d95a0; font-size: 10.5px; }

#app-screen .journals-screen,
#app-screen .journal-list-screen {
  width: 100%;
  min-width: 0;
  padding: 12px 0 22px;
}

#app-screen .journals-header,
#app-screen .journal-screen-header {
  margin: 0 0 16px;
}

#app-screen .journals-header h1,
#app-screen .journal-screen-header h1 {
  margin: 0;
  color: #f4f5f7;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -.6px;
}

#app-screen .journals-intro {
  margin: 8px 0 0;
  color: #929aa8;
  font-size: 12px;
  line-height: 1.45;
}

#app-screen .journals-list,
#app-screen .journal-entries {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#app-screen .journals-item {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  background: linear-gradient(135deg, #232830, #2b3138);
  color: #f4f5f7;
  font-size: 13px;
  text-align: left;
}

#app-screen .journals-item-label {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

#app-screen .journals-item-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(254,211,44,.09);
  color: #fed32c;
}

#app-screen .journals-item-icon svg {
  width: 16px;
  height: 16px;
}

#app-screen .journals-item-arrow {
  flex: 0 0 auto;
  color: #737c8a;
  font-size: 21px;
  line-height: 1;
}

#app-screen .journal-entry {
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  background: linear-gradient(135deg, #232830, #2b3138);
}

#app-screen .journal-entry-marker {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #fed32c;
}

#app-screen .journal-entry .entity-main {
  gap: 4px;
}

#app-screen .journal-entry .entity-main strong,
#app-screen .journal-entry .entity-main .muted {
  min-width: 0;
  overflow-wrap: anywhere;
}

#app-screen .journal-entry time {
  color: #737c8a;
  font-size: 11px;
}

#app-screen .screen-action-glyph {
  display: block;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

#app-screen .form-screen {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 18px 16px 20px;
}

#app-screen .form-screen-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

#app-screen .form-screen-header h1 {
  min-width: 0;
  margin: 0;
  color: #f4f5f7;
  font-size: 24px;
  line-height: 1.12;
}

#app-screen .entity-form {
  margin-top: 20px;
}

#app-screen label {
  gap: 7px;
  margin-bottom: 14px;
  color: #929aa8;
  font-size: 12px;
  font-weight: 650;
}

#app-screen input,
#app-screen select,
#app-screen textarea {
  border-color: rgba(255,255,255,.10);
  border-radius: 12px;
  background: #202329;
  padding: 12px;
}

#app-screen input:focus,
#app-screen select:focus,
#app-screen textarea:focus {
  border-color: rgba(254,211,44,.7);
  outline: 2px solid rgba(254,211,44,.16);
}

#app-screen .form-actions {
  margin-top: 20px;
  gap: 8px;
}

#app-screen .form-actions button {
  min-height: 44px;
}

@media (max-width: 560px) {
  #app-screen .dashboard-finance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #app-screen .dashboard-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #app-screen .journal-entry {
    align-items: flex-start;
  }

  #app-screen .journal-entry time {
    flex: 0 0 auto;
    max-width: 34%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

#app-screen .vehicle-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px;
}

#app-screen .vehicle-card .vehicle-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(254,211,44,.15);
  border-radius: 15px;
  background: rgba(254,211,44,.08);
  color: #fed32c;
}

#app-screen .vehicle-card .vehicle-icon svg {
  width: 24px;
  height: 24px;
}

#app-screen .vehicle-main {
  min-width: 0;
  flex: 1;
}

#app-screen .vehicle-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

#app-screen .vehicle-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #f4f5f7;
  font-size: 17px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app-screen .vehicle-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

#app-screen .vehicle-status.active {
  border: 1px solid rgba(67,209,122,.14);
  background: rgba(67,209,122,.10);
  color: #43d17a;
}

#app-screen .vehicle-status.inactive {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.06);
  color: #737c8a;
}

#app-screen .vehicle-model {
  min-width: 0;
  margin: 6px 0 0;
  overflow: hidden;
  color: #929aa8;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app-screen .vehicle-registration {
  display: inline-flex;
  max-width: 100%;
  margin-top: 8px;
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(255,255,255,.06);
  color: #d9dde3;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app-screen .vehicle-metrics {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.07);
}

#app-screen .vehicle-metrics span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

#app-screen .vehicle-metrics small {
  overflow: hidden;
  color: #737c8a;
  font-size: 10px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app-screen .vehicle-metrics strong {
  overflow: hidden;
  color: #f4f5f7;
  font-size: 13px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app-screen .object-card {
  align-items: center;
  gap: 12px;
}

#app-screen .object-entry-main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 5px;
}

#app-screen .object-entry-main strong,
#app-screen .object-entry-main span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#app-screen .object-entry-status {
  flex: 0 0 auto;
  color: #43d17a;
  font-size: 11px;
  white-space: nowrap;
}

#app-screen #app-nav.is-open {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: #202329;
}

#app-screen #app-nav button {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  background: linear-gradient(135deg, #232830, #2b3138);
  color: #f4f5f7;
  font-size: 13px;
  text-align: left;
}

#app-screen #app-nav button.active,
#app-screen #app-nav button:focus-visible {
  border-color: rgba(254,211,44,.4);
  color: #fed32c;
  outline: none;
}

#app-screen #app-nav .more-logout-button {
  border-color: rgba(255,120,110,.22);
  background: rgba(128,55,54,.35);
  color: #ffb7a9;
}

@media (max-width: 420px) {
  #app-screen .vehicle-metrics {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}

/* Mobile UX contract: settings, compact journal rows, and fullscreen forms. */
#app-screen .journal-screen-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
#app-screen .journal-screen-header > div { min-width: 0; }
#app-screen .journal-create-button { flex: 0 0 40px; width: 40px; height: 40px; min-height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(254,211,44,.35); border-radius: 12px; background: rgba(254,211,44,.10); color: #fed32c; font-size: 25px; font-weight: 400; line-height: 1; }
#app-screen .journal-create-button:focus-visible, #app-screen .journal-create-button:hover { border-color: #fed32c; outline: none; }
#app-screen .journal-entries { gap: 0; }
#app-screen .journal-entries .journal-entry { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; min-height: 56px; padding: 9px 0; border: 0; border-bottom: 1px solid rgba(199,204,212,.10); border-radius: 0; background: transparent; }
#app-screen .journal-entries .journal-entry:last-child { border-bottom: 0; }
#app-screen .journal-entries .journal-entry:hover, #app-screen .journal-entries .journal-entry:focus-visible { background: rgba(199,204,212,.035); outline: none; }
#app-screen .journal-row-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: rgba(254,211,44,.09); color: #fed32c; }
#app-screen .journal-row-icon svg { width: 16px; height: 16px; }
#app-screen .journal-row-main { display: grid; gap: 2px; min-width: 0; }
#app-screen .journal-row-main strong { min-width: 0; overflow: hidden; color: #c7ccd4; font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
#app-screen .journal-row-main .muted { min-width: 0; overflow: hidden; color: #8d95a0; font-size: 10.5px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
#app-screen .journal-row-side { display: grid; justify-items: end; gap: 2px; min-width: 42px; color: #8d95a0; }
#app-screen .journal-row-side time { max-width: 92px; overflow: hidden; font-size: 10.5px; line-height: 1.2; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
#app-screen .journal-row-chevron { font-size: 20px; line-height: .75; }

#app-screen .settings-screen { width: 100%; min-width: 0; padding: 12px 0 24px; }
#app-screen .settings-header { margin-bottom: 16px; }
#app-screen .settings-header h1 { margin: 0; color: #c7ccd4; font-size: 24px; line-height: 1.1; }
#app-screen .settings-section { min-width: 0; margin-bottom: 14px; padding: 14px; border: 1px solid rgba(199,204,212,.10); border-radius: 16px; background: #202329; }
#app-screen .settings-section h2 { margin: 0; color: #c7ccd4; font-size: 15px; }
#app-screen .settings-caption { margin: 5px 0 12px; font-size: 10.5px; }
#app-screen .settings-form { margin: 0; }
#app-screen .settings-inline-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#app-screen .settings-list { display: grid; gap: 0; }
#app-screen .settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; padding: 11px 0; border-top: 1px solid rgba(199,204,212,.10); background: transparent; color: #c7ccd4; text-align: left; }
#app-screen .settings-row:first-child { border-top: 0; }
#app-screen .settings-row > span:first-child { display: grid; min-width: 0; gap: 3px; }
#app-screen .settings-row strong { font-size: 13px; }
#app-screen .settings-row small, #app-screen .backup-status-row small { color: #8d95a0; font-size: 10.5px; line-height: 1.3; }
#app-screen .settings-row > span:last-child { flex: 0 0 auto; color: #8d95a0; font-size: 22px; }
#app-screen .backup-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
#app-screen .backup-status-row > div { display: grid; min-width: 0; gap: 4px; }
#app-screen .backup-status-row strong { font-size: 12px; }
#app-screen .backup-status-row > span { flex: 0 0 auto; font-size: 10.5px; text-align: right; }
#app-screen .settings-logout { width: 100%; min-height: 44px; margin-top: 4px; }

#app-screen .form-screen { min-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 110px); max-width: 640px; margin: 0 auto; padding: 8px 0 24px; }
#app-screen .form-screen-header { position: sticky; top: 0; z-index: 5; min-height: 48px; padding: 4px 0 10px; background: #202329; }
#app-screen .form-screen-heading { min-width: 0; flex: 1; text-align: center; }
#app-screen .form-screen-heading .eyebrow { margin-bottom: 2px; }
#app-screen .form-screen-header h1 { overflow: hidden; color: #c7ccd4; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
#app-screen .form-back-button, #app-screen .form-save-button { flex: 0 0 auto; min-height: 44px; padding: 8px 0; background: transparent; color: #c7ccd4; font-size: 14px; }
#app-screen .form-back-button { color: #8d95a0; }
#app-screen .form-save-button { color: #fed32c; }
#app-screen .form-back-button:hover, #app-screen .form-save-button:hover { background: transparent; }
#app-screen .form-screen .entity-form { margin-top: 14px; }

#pull-refresh-indicator { position: fixed; top: calc(var(--safe-top) + 8px); left: 50%; z-index: 120; display: flex; align-items: center; gap: 7px; transform: translate(-50%, calc(-100% + var(--pull-distance, 0px))); padding: 7px 10px; border: 1px solid rgba(254,211,44,.30); border-radius: 999px; background: #202329; color: #c7ccd4; font-size: 10.5px; pointer-events: none; transition: transform .16s ease, opacity .16s ease; }
#pull-refresh-indicator[hidden] { display: none !important; }
.pull-refresh-spinner { width: 13px; height: 13px; border: 2px solid rgba(199,204,212,.25); border-top-color: #fed32c; border-radius: 50%; }
#pull-refresh-indicator:not([hidden]) .pull-refresh-spinner { animation: pull-refresh-spin .8s linear infinite; }
@keyframes pull-refresh-spin { to { transform: rotate(360deg); } }

#app-screen .security-screen { display: grid; gap: 14px; min-width: 0; padding: 12px 0 24px; }
#app-screen .security-password-section { min-width: 0; padding: 14px; border: 1px solid rgba(199,204,212,.10); border-radius: 16px; background: #202329; }
#app-screen .security-password-section h2 { margin: 0; color: #c7ccd4; font-size: 15px; }
#app-screen .security-password-form { margin-top: 14px; }
#app-screen .security-password-form label { margin-bottom: 12px; color: #8d95a0; font-size: 12px; }
#app-screen .password-field { position: relative; display: flex; align-items: center; min-width: 0; }
#app-screen .password-field input { min-width: 0; padding-right: 44px; font-size: 16px; }
#app-screen .password-reveal { position: absolute; right: 2px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; background: transparent; color: #8d95a0; font-size: 14px; }
#app-screen .password-reveal:hover, #app-screen .password-reveal:focus-visible { background: transparent; color: #fed32c; outline: none; }
#app-screen .security-password-form > button[type="submit"] { width: 100%; min-height: 44px; margin-top: 2px; }
#app-screen .security-form-message { margin: 10px 0; padding: 0; border: 0; color: #d15048; font-size: 10.5px; line-height: 1.35; }
#app-screen .security-form-message.success { color: #49884e; }
#app-screen .security-passkeys-section { min-width: 0; }

@media (max-width: 480px) {
  #app-screen .settings-inline-fields { grid-template-columns: 1fr 1fr; gap: 8px; }
  #app-screen .settings-section { padding: 12px; }
  #app-screen .journal-entries .journal-entry { gap: 8px; }
}
