/* Local subsets keep the editor and exported image on the same typefaces. */
@font-face {
  font-family: "Melody Hand";
  src: url("../assets/fonts/melody-hand.woff?v=3.3.0") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Melody Rounded";
  src: url("../assets/fonts/melody-rounded-regular.woff?v=3.3.0") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Melody Rounded";
  src: url("../assets/fonts/melody-rounded-semibold.woff?v=3.3.0") format("woff");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

/* Lily stationery: a shared palette for the entrance, editor and export. */
:root.journal-theme {
  color-scheme: light;
  --j-bg: #f8faf2;
  --j-paper: #fffffb;
  --j-ink: #414e3d;
  --j-muted: #77846a;
  --j-green: #71875b;
  --j-green-dark: #4d653e;
  --j-green-soft: #edf2e2;
  --j-pink: #f3e8dd;
  --j-pink-ink: #a27b64;
  --j-line: #e1e7d5;
  --j-field: #f4f6ed;
  --j-shadow: 0 8px 28px #52663306, 0 1px 3px #52663304;
  --j-font: "Melody Rounded", "Melody Hand", "PingFang SC", "Microsoft YaHei", sans-serif;
  --j-heading-font: "Melody Hand", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--j-bg);
  font-family: var(--j-font);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
:root.journal-theme[data-theme="warm"] {
  --j-bg: #fcfaf1;
  --j-paper: #fffef8;
  --j-green: #859064;
  --j-green-dark: #606c44;
  --j-green-soft: #f0f1df;
  --j-pink: #f2e9d7;
  --j-field: #f7f5e9;
  --j-line: #e7e7d4;
}
:root.journal-theme[data-theme="simple"] {
  --j-bg: #f7f8f4;
  --j-paper: #ffffff;
  --j-green: #79846c;
  --j-green-dark: #506044;
  --j-green-soft: #eef2e9;
  --j-pink: #eceee3;
  --j-field: #f5f7f0;
  --j-line: #e2e7dc;
}
.journal-theme *, .journal-theme *::before, .journal-theme *::after { box-sizing: border-box; }
.journal-theme body { margin: 0; color: var(--j-ink); background: var(--j-bg); font-size: 14px; line-height: 1.5; }
.journal-theme button, .journal-theme input, .journal-theme select { font: inherit; color: inherit; }
.journal-theme button, .journal-theme a, .journal-theme input, .journal-theme select, .journal-theme summary { -webkit-tap-highlight-color: transparent; }
.journal-theme button, .journal-theme a, .journal-theme summary { touch-action: manipulation; }
.journal-theme button { cursor: pointer; }
.journal-theme button:disabled { opacity: .6; cursor: wait; }
.journal-theme button:focus-visible, .journal-theme a:focus-visible, .journal-theme summary:focus-visible { outline: 3px solid var(--j-green); outline-offset: 3px; }
.journal-theme [hidden] { display: none !important; }
.journal-theme h1, .journal-theme h2, .journal-theme h3, .journal-theme p { margin: 0; }
.journal-theme h1, .journal-theme h2, .journal-theme h3 { font-family: var(--j-heading-font); }
.j-page img, .j-portal img, .export-dialog img { display: block; max-width: 100%; height: auto; }
.j-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.j-numeric, [data-out] { font-variant-numeric: tabular-nums; }
.j-muted { color: var(--j-muted); }
.j-icon { width: 2.1em; aspect-ratio: 1; object-fit: contain; }
.j-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--j-green); border-radius: 13px; padding: 11px 17px;
  background: var(--j-green); color: #fffffb !important; font-weight: 600;
  box-shadow: 0 4px 12px #566e3214; text-decoration: none;
}
.j-primary:hover { background: var(--j-green-dark); }
.j-primary:active { transform: translateY(1px); box-shadow: none; }
.j-icon-button {
  display: inline-grid; place-items: center; min-width: 44px; min-height: 44px;
  padding: 8px; border: 0; border-radius: 14px; background: transparent; color: inherit; text-decoration: none;
}
.j-icon-button:hover { background: var(--j-green-soft); }
.j-home { font-size: 28px; line-height: 1; }
.j-page { width: min(1080px, 100%); margin-inline: auto; padding: 0 18px calc(108px + env(safe-area-inset-bottom)); }
.j-topbar {
  display: flex; align-items: center; gap: 7px; padding-block: 15px 18px;
  position: relative; z-index: 10;
}
.j-brand { min-width: 0; margin-right: auto; }
.j-brand > span { display: block; color: var(--j-muted); font-size: 10px; letter-spacing: .14em; }
.j-car-picker {
  border: 0; background: transparent; padding: 2px 2px 2px 0; font-weight: 600 !important;
  font-size: 19px !important; min-width: 0; max-width: 100%; cursor: pointer;
}
.j-topbar .j-primary { padding-inline: 13px; white-space: nowrap; }
.j-topbar .j-primary svg { width: 1.1em; height: 1.1em; }
.theme-switcher { position: relative; }
.j-theme-symbol { font-size: 24px; color: var(--j-green); line-height: 1; }
.theme-panel {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); width: max-content;
  padding: 9px; border: 1px solid var(--j-line); border-radius: 18px;
  background: var(--j-paper); box-shadow: 0 12px 40px #514c3f20; z-index: 30;
}
.theme-panel.open { display: grid; }
.theme-title { padding: 5px 9px 8px; font-size: 12px; color: var(--j-muted); }
.theme-option { display: flex; align-items: center; gap: 9px; border: 0; border-radius: 9px; background: transparent; padding: 12px 10px; text-align: left; }
.theme-option[aria-pressed="true"] { background: var(--j-green-soft); }
.theme-option::before { content: ""; width: 1em; aspect-ratio: 1; border-radius: 50%; background: #a2b386; }
.theme-option[data-theme="warm"]::before { background: #d9d7a5; }
.theme-option[data-theme="simple"]::before { background: #dbe2d2; }
.j-reset-option { padding: 12px 10px; margin-top: 5px; border: 0; border-top: 1px solid var(--j-line); text-align: left; background: transparent; color: var(--j-muted) !important; font-size: 12px !important; }
.j-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 3px 14px; }
.j-page-heading h1 { font-size: 24px; letter-spacing: .06em; font-weight: 400; }
.j-page-heading p { font-size: 12px; color: var(--j-muted); margin-top: 3px; }
.j-page-heading img { width: 3.35em; aspect-ratio: 1; object-fit: contain; }
.j-paper { border: 1px solid var(--j-line); border-radius: 20px; background: var(--j-paper); box-shadow: var(--j-shadow); }
.j-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.j-section-heading h2 { font-size: 17px; font-weight: 400; letter-spacing: .02em; }
.j-section-heading > span { color: var(--j-muted); font-size: 12px; white-space: nowrap; }
.j-section-heading b { color: var(--j-green); font-weight: 600; }
.j-record-layout { display: grid; gap: 16px; align-items: start; }
.j-setup, .j-achievements { padding: 17px; }
.j-setup { position: relative; }
.j-setup .j-section-heading, .j-achievements > .j-section-heading { margin-bottom: 11px; }
.j-setup .j-section-heading h2, .j-achievements > .j-section-heading h2 { font-size: 16px; }
.j-setup .j-section-heading > span { font-size: 11px; }
.j-setting-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.j-setting-field > span { font-size: 12px; color: var(--j-muted); text-align: center; }
.j-setting-field .j-input { text-align: center; padding-inline: 5px; font-weight: 600; }
.j-config-grid, .j-match-fields { display: grid; grid-template-columns: repeat(var(--field-count,4),minmax(0,1fr)); gap: 10px; }
.j-weights { margin-top: 11px; }
.j-field-wrap { position: relative; min-width: 0; }
.j-field-wrap .j-input { padding-right: 22px; }
.j-field-wrap i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--j-muted); font-size: 12px; font-style: normal; pointer-events: none; }
.j-match-block { border-top: 1px solid var(--j-line); margin-top: 16px; padding-top: 13px; }
.j-calculated > div { display: grid; align-items: center; min-height: 44px; padding: 10px 3px; border-radius: 12px; color: var(--j-green-dark); background: var(--j-green-soft); text-align: center; font-size: 16px; line-height: 1.35; font-weight: 600; }
.j-switch { display: flex; padding: 4px; gap: 4px; border: 1px solid var(--j-line); border-radius: 15px; background: var(--j-green-soft); margin-bottom: 15px; }
.j-switch button {
  flex: 1 1 0; min-width: 0; min-height: 44px; border: 0; background: transparent;
  border-radius: 11px; padding: 9px 6px; color: var(--j-muted); font-size: 14px; font-weight: 400;
}
.j-switch button[aria-pressed="true"] { background: var(--j-paper); color: var(--j-green-dark); box-shadow: 0 2px 5px #5a6b3810; }
.j-player-switch { margin-bottom: 13px; }
.j-player-switch button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 3px; font-size: 13px; }
.j-choice-stars { color: #8b987b; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.j-choice-stars small { margin-left: 3px; font-size: 10px; font-weight: 400; }
.j-player-switch [aria-pressed="true"] .j-choice-stars { color: var(--j-green-dark); }
.j-player-sheet { position: relative; min-width: 0; }
.j-player-top { display: none; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 12px; }
.j-person-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.j-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 2.35em; aspect-ratio: 1; background: #eaf0dc; border-radius: 50% 50% 50% 18%; color: #6e8456; font-size: 15px; font-weight: 600; }
.j-avatar[data-tone="1"] { background: #f1eedc; color: #8b8558; }
.j-avatar[data-tone="2"] { background: #e5eee1; color: #728668; }
.j-avatar[data-tone="3"] { background: #e8ede6; color: #758372; }
.j-avatar[data-tone="4"] { background: #f2eddf; color: #9b8967; }
.j-person-name h2, .j-person-name h3 { font-size: 16px; }
.j-stars { display: flex; align-items: baseline; gap: 4px; color: var(--j-green); }
.j-stars strong { font-size: 24px; font-weight: 700; }
.j-stars small { font-size: 11px; color: var(--j-muted); }
.j-medals { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.j-medal-label { display: flex; align-items: center; justify-content: center; gap: 4px; }
.j-medal-mark { display: inline-grid; place-items: center; width: 1.4em; aspect-ratio: 1; font-size: 12px; font-style: normal; color: #a3824a; background: #f5ead2; border-radius: 50%; }
.j-medal-mark[data-medal="top"] { color: #ab8871; background: #f2e0ce; }
.j-medal-mark[data-medal="silver"] { color: #879097; background: #e9edf0; }
.j-medal-mark[data-medal="bronze"] { color: #a6836c; background: #f2e5db; }
.j-input, .j-select {
  display: block; width: 100%; min-width: 0; min-height: 44px; max-width: 100%;
  padding: 10px 12px; border: 1px solid #e8ecdf; border-radius: 11px;
  background: var(--j-field); color: var(--j-ink); font-size: 16px !important; line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.j-input { appearance: textfield; }
.journal-theme input[type="number"]::-webkit-inner-spin-button,
.journal-theme input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.j-input:focus, .j-select:focus { outline: 2px solid var(--j-green); outline-offset: 1px; background: var(--j-paper); }
.j-input[aria-invalid="true"] { border-color: #b56a59; background: #fceee7; }
.j-medals .j-input { text-align: center; padding-inline: 3px; font-weight: 600; }
.j-work-card { position: relative; padding: 22px; }
.j-work-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.j-work-head h2 { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 400; }
.j-serial { color: #a3b28b; font-size: 15px; font-family: "Melody Rounded",sans-serif; }
.j-select { width: auto; padding: 8px 9px; background: var(--j-green-soft); color: var(--j-green-dark); }
.j-quotes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 14px; }
.j-quote { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.j-quote > span { display: flex; align-items: center; justify-content: space-between; gap: 5px; font-size: 13px; }
.j-quote > span::before { content: ''; width: 5px; aspect-ratio: 1; background: #b6c59e; border-radius: 50%; margin-right: 1px; }
.j-quote > span > b { margin-right: auto; font-weight: 500; }
.j-quote > span small { font-size: 10px; color: var(--j-muted); }
.j-money-input { position: relative; }
.j-money-input::before { content: '¥'; position: absolute; top: 11px; left: 12px; color: #99a388; font-size: 14px; pointer-events: none; }
.j-money-input input { padding-left: 28px; text-align: right; font-weight: 600; }
.j-work-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-top: 1px solid var(--j-line); margin-top: 22px; padding-top: 16px; }
.j-work-total > span { font-size: 13px; color: var(--j-muted); }
.j-work-total strong { color: var(--j-green-dark); font-size: 31px; line-height: 1.3; letter-spacing: -.02em; }
.j-currency { font-size: .55em; font-weight: 500; margin-right: 3px; }
.j-work-meta { display: flex; flex-wrap: wrap; gap: 4px 15px; justify-content: space-between; font-size: 11px; color: var(--j-muted); margin-top: 12px; }
.j-work-meta b { color: var(--j-green-dark); font-weight: 400; margin-left: 3px; }
.j-work-note { display: flex; align-items: center; justify-content: center; gap: 10px; color: #a6a28e; margin-top: 26px; font-size: 11px; letter-spacing: .09em; }
.j-work-note::before, .j-work-note::after { content: ''; width: 30px; height: 1px; background: #dbd8c8; }
.j-payments { display: grid; gap: 9px; }
.j-payment { display: grid; grid-template-columns: minmax(0,1fr) minmax(4em,.55fr) auto; align-items: center; gap: 8px; padding: 10px 12px; }
.j-payment .j-person-name { gap: 7px; }
.j-payment .j-avatar { font-size: 12px; }
.j-payment h3 { font-size: 14px; white-space: nowrap; }
.j-payment .j-person-name p { color: var(--j-muted); font-size: 10px; margin-top: 3px; white-space: nowrap; }
.j-payment .j-person-name b { color: var(--j-ink); font-weight: 500; }
.j-payment .j-kind { font-size: 9px; margin-left: 3px; }
.j-payment .j-balance { padding-inline: 6px; font-size: 12px; }
.j-payment-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.j-person-name .j-kind { margin-left: 4px; font-size: 10px; color: var(--j-muted); font-weight: 400; }
.j-balance { display: inline-block; border-radius: 9px; padding: 4px 8px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.j-balance.refund { background: #edf3e4; color: #5e7d45; }
.j-balance.payin { background: #f7eee3; color: #a47856; }
.j-balance.even { background: #eff2e8; color: #879179; }
.j-payment-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-left: 44px; margin-top: 4px; color: var(--j-muted); font-size: 12px; }
.j-payment-bottom b { color: var(--j-ink); font-weight: 500; }
.j-deposit { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--j-muted); font-size: 10px; min-width: 0; }
.j-deposit input { width: 100%; min-height: 44px; padding: 7px; text-align: center; }
.j-income { padding: 16px; }
.j-income .j-payment-top > strong { color: var(--j-green-dark); font-size: 25px; font-variant-numeric: tabular-nums; }
.j-breakdown { border-top: 1px solid var(--j-line); margin-top: 10px; padding-top: 3px; }
.j-breakdown summary { cursor: pointer; font-size: 11px; color: var(--j-muted); padding: 9px 0 3px; }
.j-breakdown-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 16px; padding-top: 10px; font-size: 12px; }
.j-breakdown-list span { display: flex; justify-content: space-between; gap: 8px; color: var(--j-muted); }
.j-breakdown-list b { color: var(--j-ink); font-weight: 500; }
.j-reset-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 18px 3px 0; color: var(--j-muted); font-size: 11px; }
.j-reset-row button { padding: 12px 7px; border: 0; background: transparent; color: #9a8b76; font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.j-error { padding: 12px 15px; margin-top: 16px !important; background: #f8e8df; color: #a45d46; border-radius: 12px; }
.j-bottom-nav {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px;
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  width: min(490px,calc(100% - 28px)); padding: 5px;
  background: var(--j-paper); border: 1px solid var(--j-line);
  border-radius: 22px; box-shadow: 0 8px 35px #4b633b12;
}
.j-bottom-nav button { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; border: 0; border-radius: 16px; background: transparent; padding: 5px 8px; color: var(--j-muted); font-size: 11px; }
.j-bottom-nav img { width: 3.1em; aspect-ratio: 1; object-fit: contain; opacity: .82; }
.j-bottom-nav button[aria-selected="true"] { color: var(--j-green-dark); background: var(--j-green-soft); font-weight: 600; }
.j-bottom-nav button[aria-selected="true"] img { opacity: 1; filter: none; }
.j-saved { font-size: 10px; letter-spacing: .13em; color: #a7a38f; }
.j-desktop-label { display: none; }

/* The generated image is a separate document; this dialog only displays it. */
.export-dialog { width: min(610px,calc(100% - 20px)); max-height: calc(100dvh - 20px); margin: auto; padding: 0; border: 1px solid var(--j-line); border-radius: 23px; background: var(--j-bg); color: var(--j-ink); }
.export-dialog::backdrop { background: #373b2e70; backdrop-filter: blur(4px); }
.export-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; position: sticky; top: 0; z-index: 1; background: var(--j-paper); border-bottom: 1px solid var(--j-line); padding: 10px 16px; }
.export-dialog-head strong { font-size: 14px; font-weight: 600; }
.export-dialog button, .export-dialog a { padding: 11px 16px; border: 1px solid var(--j-line); border-radius: 13px; background: var(--j-paper); color: var(--j-green-dark); font: inherit; text-decoration: none; cursor: pointer; }
.export-dialog-head button { border: 0; padding: 10px; background: transparent; }
.export-image-wrap { padding: 10px; }
.export-dialog img { display: block; width: 100%; height: auto; }
.export-dialog-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; padding: 6px 12px 16px; }
.export-dialog-actions p { flex-basis: 100%; text-align: center; font-size: 12px; }
.export-dialog-actions #exportSave { background: var(--j-green); border-color: var(--j-green); color: #fffdf5; }

/* A small botanical cover; the three links stay in one phone screen. */
.j-portal { position: relative; min-height: 100svh; overflow: hidden; padding: 22px 24px 24px; }
.j-portal::before { content: ''; pointer-events: none; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 22%,#edf2de90,transparent 58%); }
.j-portal-inner { position: relative; max-width: 980px; margin-inline: auto; }
.j-portal-brand { display: flex; align-items: center; justify-content: space-between; color: var(--j-green); font-size: 10px; letter-spacing: .16em; margin-bottom: 15px; }
.j-brand-flower { color: #aabb91; font-size: 20px; line-height: 1; }
.j-portal-hero { position: relative; padding: 0 0 19px; text-align: center; }
.j-portal-illustration { position: relative; width: min(66%,230px); margin: 0 auto 1px; }
.j-portal-illustration::before { content: ''; position: absolute; inset: 18% 2% 9%; border: 1px solid #dce6cb; border-radius: 50%; background: #f4f7e8; transform: rotate(-12deg); }
.j-portal-art { position: relative; width: 100%; margin: 0; }
.j-portal-hero h1 { position: relative; color: var(--j-ink); font-size: 32px; line-height: 1.5; font-weight: 400; letter-spacing: .1em; }
.j-portal-hero h1 span { color: var(--j-green-dark); }
.j-portal-hero p { position: relative; color: var(--j-muted); font-size: 12px; letter-spacing: .18em; margin-top: 3px; }
.j-car-tickets { display: grid; gap: 12px; width: 100%; max-width: 460px; margin: 3px auto 0; }
.j-car-ticket { display: flex; align-items: center; gap: 17px; position: relative; padding: 12px 19px; background: var(--j-paper); border: 1px solid var(--j-line); border-radius: 20px; box-shadow: 0 4px 14px #52663305; text-decoration: none; color: var(--j-ink); transition: transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.j-car-ticket:hover { transform: translateY(-2px); border-color: #bfcca8; box-shadow: 0 7px 20px #5266330e; }
.j-car-ticket:nth-child(2) { background: #f0f4e6; border-color: #dce5cc; }
.j-car-ticket:nth-child(3) { background: #fffdf4; }
.j-car-name { min-width: 0; margin-right: auto; }
.j-car-name strong { display: block; font-size: 21px; font-weight: 600; letter-spacing: .03em; }
.j-car-name small { display: block; color: var(--j-muted); font-size: 12px; margin-top: 1px; }
.j-car-ticket > .j-car-art { flex: 0 0 auto; width: 4.2em; aspect-ratio: 1; object-fit: contain; }
.j-car-arrow { display: grid; place-items: center; flex: 0 0 auto; width: 1.8em; aspect-ratio: 1; border: 1px solid #dce5cd; border-radius: 50%; color: var(--j-green); font-family: sans-serif; font-size: 17px; line-height: 1; }
.j-portal-footer { display: flex; align-items: center; justify-content: center; gap: 12px; color: #a0ab91; font-size: 11px; letter-spacing: .08em; margin-top: 25px; }

@media (max-width: 359px) {
  .j-page { padding-inline: 12px; }
  .j-topbar { gap: 3px; }
  .j-brand > span { font-size: 9px; letter-spacing: .05em; }
  .j-car-picker { font-size: 17px !important; }
  .j-topbar .j-primary { padding-inline: 10px; font-size: 13px; }
  .j-topbar .j-primary svg { display: none; }
  .j-medals { gap: 6px; }
  .j-setup, .j-achievements, .j-work-card { padding: 14px; }
  .j-payment { padding-inline: 10px; }
  .j-payment-bottom { padding-left: 0; }
  .j-config-grid, .j-match-fields { gap: 7px; }
  .j-field-wrap i { right: 8px; }
  .j-medal-label { gap: 2px; }
  .j-portal { padding-inline: 20px; }
  .j-portal-hero h1 { font-size: 28px; }
  .j-car-ticket { gap: 12px; padding: 10px 14px; }
  .j-car-ticket > .j-car-art { width: 3.8em; }
}
@media (min-width: 600px) {
  .j-page { padding-inline: 30px; }
  .j-setup, .j-achievements { padding: 22px; }
  .j-payments { grid-template-columns: repeat(auto-fit,minmax(min(100%,20rem),1fr)); gap: 14px; }
  .j-payment-bottom { padding-left: 0; }
  .j-work-card { padding: 25px; }
  .j-portal { display: grid; align-items: center; padding: 30px 42px; }
  .j-portal-inner { width: 100%; }
  .j-portal-brand { margin-bottom: 25px; }
  .j-portal-illustration { width: min(46%,290px); }
  .j-portal-hero h1 { font-size: 38px; }
  .j-car-tickets { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; max-width: 760px; }
  .j-car-ticket { flex-direction: column; text-align: center; padding: 21px 12px 17px; gap: 10px; }
  .j-car-name { margin-right: 0; }
  .j-car-ticket > .j-car-art { width: 5em; }
  .j-car-arrow { position: absolute; right: 10px; top: 10px; font-size: 13px; }
  .j-portal-hero { padding-bottom: 28px; }
}
@media (min-width: 900px) {
  .j-page { padding-top: 18px; padding-bottom: 40px; }
  .j-topbar { padding-bottom: 24px; border-bottom: 1px solid var(--j-line); margin-bottom: 28px; }
  .j-bottom-nav { position: static; transform: none; margin: 0 0 25px auto; width: min(500px,100%); padding: 6px; border: 1px solid var(--j-line); border-radius: 18px; box-shadow: none; }
  .j-bottom-nav button { flex-direction: row; gap: 9px; padding: 8px 12px; font-size: 13px; }
  .j-bottom-nav img { width: 2em; }
  .j-page-heading { margin-bottom: 25px; }
  .j-page-heading h1 { font-size: 27px; }
  .j-page-heading img { width: 3.7em; }
  .j-record-layout { grid-template-columns: minmax(0,.9fr) minmax(0,1.3fr); gap: 22px; }
  .j-achievements .j-switch, .j-number-section > .j-switch, .j-split-section > .j-switch { display: none; }
  .j-deck { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; align-items: start; }
  .j-player-deck { grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); gap: 12px; }
  .j-player-sheet { padding: 14px 11px; border: 1px solid var(--j-line); border-radius: 17px; }
  .j-player-sheet:last-child:nth-child(odd) { grid-column: 1/-1; }
  .j-player-top { display: flex; }
  .j-player-deck .j-medals { gap: 5px; }
  .j-player-deck .j-avatar { font-size: 12px; }
  .j-player-deck .j-stars { gap: 3px; }
  .j-player-deck .j-stars strong { font-size: 23px; }
  .j-player-deck .j-stars small { display: none; }
  .j-number-section .j-work-card:only-child, .j-split-section .j-work-card:only-child { max-width: 620px; width: 100%; margin-inline: auto; grid-column: 1/-1; }
  .j-payments { grid-template-columns: repeat(auto-fit,minmax(min(100%,20rem),1fr)); }
  .j-desktop-label { display: inline; }
  .j-portal-layout { display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 72px; }
  .j-portal-hero { padding: 10px 0 24px; }
  .j-portal-illustration { width: 92%; max-width: 390px; margin-bottom: 7px; }
  .j-portal-hero h1 { font-size: 43px; }
  .j-car-tickets { grid-template-columns: 1fr; gap: 18px; margin-top: 0; }
  .j-car-ticket { flex-direction: row; text-align: left; padding: 19px 23px; gap: 22px; }
  .j-car-ticket > .j-car-art { width: 5em; }
  .j-car-name { margin-right: auto; }
  .j-car-name strong { font-size: 24px; }
  .j-car-name small { font-size: 12px; }
  .j-car-arrow { position: static; font-size: 18px; }
  .j-portal-footer { margin-top: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .journal-theme * { scroll-behavior: auto !important; transition: none !important; }
}
@media (min-width: 1100px) {
  html[data-car="32"] .j-number-section .j-deck { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
