/* General entry page (release 20261028a). One scoped block that owns this page's layout,
   loaded after every other stylesheet so older journal rules in books-ui.css stand aside.
   Selectors start with `html body #app#app .journal-entry-page`. */

/* Header (hero): title + status left, live total, actions right */
html body #app#app .journal-entry-page .ja-hero{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:14px 22px;position:sticky;top:0;z-index:6;margin:0 0 18px!important;padding:16px 20px!important;background:var(--panel)!important;color:var(--ink)!important;border:1px solid var(--line)!important;border-radius:12px;box-shadow:0 2px 10px rgba(12,35,64,.06)}
html body #app#app .journal-entry-page .ja-hero-title{display:grid;gap:2px;min-width:0}
html body #app#app .journal-entry-page .ja-hero-eyebrow{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
html body #app#app .journal-entry-page .ja-hero-title strong{font-size:22px;line-height:1.2;color:var(--ink)}
html body #app#app .journal-entry-page .ja-hero-status{justify-self:start;font-size:12px;font-weight:600;padding:2px 10px;border-radius:999px;background:#e8eef5;color:#33475c}
html body #app#app .journal-entry-page .ja-hero-total{display:grid;justify-items:end;gap:2px;text-align:right}
html body #app#app .journal-entry-page .ja-hero-total span{font-size:12px;font-weight:600;color:var(--muted)}
html body #app#app .journal-entry-page .ja-hero-total b{font-size:22px;font-variant-numeric:tabular-nums;color:var(--ink)}
html body #app#app .journal-entry-page .ja-hero-badge{font-style:normal;font-size:12px;font-weight:700;padding:2px 10px;border-radius:999px;background:#eef2f6;color:#4a5b6b}
html body #app#app .journal-entry-page .ja-hero-badge.is-ok{background:#dff1e3;color:#1c6b2e}
html body #app#app .journal-entry-page .ja-hero-badge.is-off{background:#fde8e6;color:#9b221a}
html body #app#app .journal-entry-page .ja-hero-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}

/* Top fields: one even grid */
html body #app#app .journal-entry-page .ja-top{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(180px,1fr))!important;gap:14px 16px!important;align-items:end!important;margin:0 0 16px!important}
html body #app#app .journal-entry-page .ja-top>.field{margin:0!important;min-width:0!important;max-width:none!important;width:auto!important;flex:none!important}
html body #app#app .journal-entry-page .ja-top>.field>label{display:block;margin:0 0 5px!important;font-size:12px!important;font-weight:600!important;color:var(--muted)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body #app#app .journal-entry-page .ja-top input,html body #app#app .journal-entry-page .ja-top select,html body #app#app .journal-entry-page .ja-cat-fields select,html body #app#app .journal-entry-page .ja-cat-fields .sb-search-select-input{box-sizing:border-box!important;width:100%!important;height:38px!important;min-height:38px!important;padding:0 10px!important;border:1px solid var(--line)!important;border-radius:8px!important;background:var(--panel)!important;color:var(--ink)!important;font:inherit!important;font-size:14px!important;margin:0!important}
html body #app#app .journal-entry-page .ja-top input[readonly]{background:rgba(127,145,165,.08)!important;color:var(--muted)!important}
html body #app#app .journal-entry-page .ja-top .ja-rate{display:grid!important;grid-template-columns:auto minmax(56px,1fr) auto;align-items:center;gap:0 8px}
html body #app#app .journal-entry-page .ja-top .ja-rate>label{grid-column:1/-1}
html body #app#app .journal-entry-page .ja-top .ja-rate>span,html body #app#app .journal-entry-page .ja-top .ja-rate>b{white-space:nowrap;font-size:13px;color:var(--muted);font-weight:600}
html body #app#app .journal-entry-page .ja-top .ja-adj{display:flex!important;align-items:center;gap:8px;height:38px;margin:0!important;white-space:nowrap;color:var(--ink)}
html body #app#app .journal-entry-page .ja-top .ja-adj input{width:auto!important;height:auto!important;min-height:0!important}
html body #app#app .journal-entry-page .ja-cat-fields{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(220px,1fr))!important;gap:14px 16px!important;margin:0 0 16px!important}
html body #app#app .journal-entry-page .ja-cat-fields .field{margin:0!important;max-width:none!important}

/* Lines table */
html body #app#app .journal-entry-page .ja-table-wrap{border:1px solid var(--line);border-radius:10px;overflow:auto}
html body #app#app .journal-entry-page #ja-lines th{position:relative;user-select:none}
html body #app#app .journal-entry-page #ja-lines th.ja-account{min-width:280px}
html body #app#app .journal-entry-page #ja-lines th.ja-party{min-width:200px}
html body #app#app .journal-entry-page .ja-col-grip{position:absolute;top:0;right:-3px;width:7px;height:100%;cursor:col-resize;z-index:2}
html body #app#app .journal-entry-page .ja-col-grip:after{content:"";position:absolute;top:25%;bottom:25%;left:3px;width:1px;background:var(--line)}
html body #app#app .journal-entry-page .ja-col-grip:hover:after,html body #app#app .journal-entry-page #ja-lines.ja-resizing .ja-col-grip:after{background:#4ba3ff;width:2px}
html body #app#app .journal-entry-page #ja-lines.ja-resizing{cursor:col-resize}
html body #app#app .journal-entry-page #ja-lines td input:focus,html body #app#app .journal-entry-page #ja-lines td .sb-search-select-input:focus{outline:2px solid #4ba3ff!important;outline-offset:-1px;border-color:#4ba3ff!important}
html body #app#app .journal-entry-page #ja-lines td.ja-amt input{text-align:right;font-variant-numeric:tabular-nums}
html body #app#app .journal-entry-page .journal-page-footer{padding:12px 0!important;gap:8px}

/* Dark theme: text 4.5:1 or better, field borders 3:1 or better */
html[data-theme="dark"] body #app#app .journal-entry-page .ja-hero{background:#0e2136!important;border-color:#2f4c69!important;box-shadow:none}
html[data-theme="dark"] body #app#app .journal-entry-page .ja-hero-eyebrow,html[data-theme="dark"] body #app#app .journal-entry-page .ja-hero-total span,html[data-theme="dark"] body #app#app .journal-entry-page .ja-top>.field>label,html[data-theme="dark"] body #app#app .journal-entry-page .ja-top .ja-rate>span,html[data-theme="dark"] body #app#app .journal-entry-page .ja-top .ja-rate>b{color:#b4c6d9!important}
html[data-theme="dark"] body #app#app .journal-entry-page .ja-hero-status,html[data-theme="dark"] body #app#app .journal-entry-page .ja-hero-badge{background:#18324d;color:#d7e4f2}
html[data-theme="dark"] body #app#app .journal-entry-page .ja-hero-badge.is-ok{background:#123d25;color:#9be3b0}
html[data-theme="dark"] body #app#app .journal-entry-page .ja-hero-badge.is-off{background:#4a1c1c;color:#ffb4ab}
html[data-theme="dark"] body #app#app .journal-entry-page .ja-top input,html[data-theme="dark"] body #app#app .journal-entry-page .ja-top select,html[data-theme="dark"] body #app#app .journal-entry-page .ja-cat-fields select,html[data-theme="dark"] body #app#app .journal-entry-page .ja-cat-fields .sb-search-select-input,html[data-theme="dark"] body #app#app .journal-entry-page #ja-lines td input,html[data-theme="dark"] body #app#app .journal-entry-page #ja-lines td .sb-search-select-input,html[data-theme="dark"] body #app#app .journal-entry-page .journal-memo textarea{background:#0a1a2c!important;color:#f1f6fc!important;border-color:#5a7896!important}
html[data-theme="dark"] body #app#app .journal-entry-page input::placeholder,html[data-theme="dark"] body #app#app .journal-entry-page textarea::placeholder{color:#93a8be!important;opacity:1}
html[data-theme="dark"] body #app#app .journal-entry-page .ja-top input[readonly]{background:#102538!important;color:#c3d2e1!important}
html[data-theme="dark"] body #app#app .journal-entry-page input[type=date],html[data-theme="dark"] body #app#app .journal-entry-page select{color-scheme:dark}
html[data-theme="dark"] body #app#app .journal-entry-page .ja-table-wrap{border-color:#2f4c69}
html[data-theme="dark"] body #app#app .journal-entry-page #ja-lines th{background:#102a44!important;color:#d7e4f2!important}
html[data-theme="dark"] body #app#app .journal-entry-page .ja-col-grip:after{background:#46637f}
html[data-theme="dark"] body #app#app .journal-entry-page .sb-search-select:after{border-top-color:#c3d2e1!important}

@media screen and (max-width:768px){
  html body #app#app .journal-entry-page .ja-hero{grid-template-columns:1fr auto;position:static}
  html body #app#app .journal-entry-page .ja-hero-actions{grid-column:1/-1;justify-content:flex-start}
  html body #app#app .journal-entry-page .ja-top{grid-template-columns:1fr 1fr!important}
  html body #app#app .journal-entry-page .ja-col-grip{display:none}
}
