:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1a1f29;
  --text-dim: #6b7280;
  --border: #e2e5ea;
  --accent: #102542;
  --accent-2: #c9a869;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --success: #1e7a3d;
  --radius: 12px;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  /* The firm's own drafting font (Word documents, etc). Not on Google
     Fonts — declared by name so it renders correctly on any device that
     already has it installed, with a serif fallback everywhere else. */
  --font-body: 'Bookman Old Style', 'URW Bookman', Georgia, 'Times New Roman', serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --text: #e6e9ef;
    --text-dim: #9aa4b2;
    --border: #2a2f38;
    --accent: #c9a869;
    --accent-2: #c9a869;
    --danger: #ff6b63;
    --danger-bg: #3a1f1d;
    --success: #4ade80;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  button { color: #10131a; }
}
button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}
@media (prefers-color-scheme: dark) {
  button.secondary { color: var(--text); }
}
button.danger { background: var(--danger); color: #fff; }
button:disabled { opacity: 0.5; cursor: default; }

input[type="text"], input[type="date"], input[type="password"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }

/* ---- Top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px calc(14px + env(safe-area-inset-top)) 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: var(--accent);
  color: #fff;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar h1 { font-family: var(--font-serif); font-size: 17px; line-height: 1.2; margin: 0; font-weight: 700; white-space: nowrap; }
.topbar .who { font-size: 12px; opacity: 0.8; }
.topbar button.iconbtn {
  background: transparent; color: #fff; padding: 6px 10px; font-size: 13px;
  border: 1px solid rgba(255,255,255,0.35);
  flex: 0 0 auto;
}
.topbar button.iconbtn#cc-menu-open { font-size: 18px; padding: 4px 10px; line-height: 1; }

/* ---- Content ---- */
main { flex: 1; padding: 16px; padding-bottom: 140px; max-width: 720px; margin: 0 auto; width: 100%; }

/* ---- Segmented control (Search tab: eCourts / Consumer / History) ---- */
.segmented {
  display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px; margin-bottom: 14px;
}
.segmented-btn {
  flex: 1; background: none; color: var(--text-dim); font-weight: 600; font-size: 13px;
  padding: 9px 6px; border-radius: 7px;
}
.segmented-btn.active { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) {
  .segmented-btn.active { color: #10131a; }
}

.section-label {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-dim); margin: 18px 0 8px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.card.tappable:active { opacity: 0.7; }

.case-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.case-row .title { font-weight: 700; font-size: 16px; }
.case-row .meta { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 6px;
  white-space: nowrap; border: 1px solid transparent;
}
.badge.today { background: #f2e4c4; color: #6b4e15; }
.badge.overdue { background: transparent; border-color: var(--danger); color: var(--danger); }
.badge.ok { background: transparent; border-color: var(--border); color: var(--text-dim); }
@media (prefers-color-scheme: dark) {
  .badge.today { background: rgba(201, 168, 105, 0.18); color: var(--accent-2); }
  .badge.overdue { background: transparent; border-color: var(--danger); color: var(--danger); }
  .badge.ok { background: transparent; border-color: var(--border); color: var(--text-dim); }
}

.empty { text-align: center; color: var(--text-dim); padding: 40px 20px; }

/* ---- Menu drawer (hamburger) ---- */
.menu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: stretch; z-index: 15;
}
.menu-drawer {
  background: var(--surface); width: 82%; max-width: 320px; height: 100%;
  overflow-y: auto; padding: calc(14px + env(safe-area-inset-top)) 8px 20px;
  box-shadow: 2px 0 20px rgba(0,0,0,0.2);
}
.menu-drawer .sheet-close { padding: 0 10px; margin-bottom: 4px; }
.menu-drawer-title {
  font-family: var(--font-serif); font-weight: 700; font-size: 17px;
  line-height: 1.3; padding: 4px 14px 10px; color: var(--accent);
}
@media (prefers-color-scheme: dark) {
  .menu-drawer-title { color: var(--accent-2); }
}
.menu-section-label {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; text-align: left;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-dim); font-weight: 700; padding: 16px 14px 6px;
}
.menu-section-label.admin { color: var(--danger); }
.menu-chevron { font-size: 11px; opacity: 0.7; }
.menu-divider { height: 1px; background: var(--border); margin: 10px 10px; }
.menu-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; background: none; color: var(--text);
  font-weight: 500; border-radius: 10px; padding: 11px 14px;
}
.menu-item:active { background: var(--bg); }
.menu-item.menu-logout { color: var(--danger); }
.menu-item.active { background: var(--bg); color: var(--accent); font-weight: 700; }
@media (prefers-color-scheme: dark) {
  .menu-item.active { color: var(--accent-2); }
}
.menu-item-label { font-size: 15px; }
.menu-item-sublabel { font-size: 12px; color: var(--text-dim); font-weight: 400; }

/* ---- Floating "New Case" button ---- */
.fab {
  position: fixed; right: 20px; bottom: calc(80px + env(safe-area-inset-bottom));
  width: 58px; height: 58px; border-radius: 50%;
  font-size: 28px; line-height: 1; padding: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  z-index: 8;
}

/* ---- Bottom nav (Home / Search) ---- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav-item {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: none; color: var(--text-dim); font-weight: 600; padding: 10px 0 12px; border-radius: 0;
  position: relative;
}
.bottom-nav-label { font-size: 14px; }
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item.active::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px; border-radius: 2px; background: var(--accent);
}
@media (prefers-color-scheme: dark) {
  .bottom-nav-item.active { color: var(--accent-2); }
  .bottom-nav-item.active::after { background: var(--accent-2); }
}

/* ---- Modal / sheet ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; z-index: 10;
}
.sheet {
  background: var(--surface); width: 100%; max-height: 88vh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
}
.sheet h2 { margin-top: 0; font-size: 18px; }
.sheet-close { display: flex; justify-content: flex-end; }
.sheet-close button { background: none; color: var(--text-dim); padding: 4px 8px; }

.row-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.row-buttons button { flex: 1 1 auto; }
button.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button.btn-icon svg { flex: none; }

.toast {
  position: fixed; bottom: 150px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; z-index: 20; box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.toast.error { background: var(--danger); }

.login-screen {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; gap: 14px;
  background: var(--accent); color: #fff; min-height: 100vh;
}
.login-screen .icon { width: 104px; height: 104px; border-radius: 22px; }
.login-screen .lettermark { font-size: 48px; }
.login-screen h1 { font-family: var(--font-serif); font-size: 22px; margin: 0; }
.login-screen p { color: rgba(255,255,255,0.75); max-width: 320px; line-height: 1.5; }
.login-screen code {
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.3); color: #fff;
  padding: 3px 8px; border-radius: 6px;
}

/* ---- Initial boot state, before app.js finishes loading ---- */
.boot-loading {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--accent); color: #fff; text-align: center; padding: 24px;
}
.boot-loading img, .boot-loading .lettermark { width: 96px; height: 96px; border-radius: 20px; animation: cc-pulse 1.6s ease-in-out infinite; }
.boot-loading .lettermark { font-size: 44px; }
#boot-name { font-family: var(--font-serif); font-size: 20px; font-weight: 700; }
@keyframes cc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.spinner { text-align: center; padding: 40px; color: var(--text-dim); }

/* ---- Firms other than the home firm (M&M) use a formal Baskerville heading face.
   M&M keeps its original Playfair Display headings and Bookman body text. ---- */
html[data-heading="baskerville"] {
  --font-serif: 'Libre Baskerville', Baskerville, Georgia, 'Times New Roman', serif;
}
html[data-heading="baskerville"] .topbar h1 { font-size: 15px; }
html[data-heading="baskerville"] .menu-drawer-title { font-size: 15px; line-height: 1.35; }
html[data-heading="baskerville"] .login-screen h1 { font-size: 20px; line-height: 1.35; }
html[data-heading="baskerville"] #boot-name { font-size: 18px; line-height: 1.35; }

/* ---- A firm can ask for the Poppins face (its own website's font) ---- */
html[data-heading="poppins"] {
  --font-serif: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
}
html[data-body="poppins"] {
  --font-body: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
}
html[data-heading="poppins"] .topbar h1 { font-size: 15px; font-weight: 600; }
html[data-heading="poppins"] .menu-drawer-title { font-size: 15px; line-height: 1.35; font-weight: 600; }
html[data-heading="poppins"] .login-screen h1 { font-size: 19px; line-height: 1.35; font-weight: 600; }
html[data-heading="poppins"] #boot-name { font-size: 17px; line-height: 1.35; font-weight: 600; }

/* ---- Firm branding: logo badge + the small "Powered by CourtSync" line ---- */
.lettermark {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-2); color: rgba(0, 0, 0, 0.78);
  font-family: var(--font-serif); font-weight: 700;
}
.powered-by { font-size: 11px; letter-spacing: 0.05em; color: var(--text-dim); }
.login-screen .powered-by, .boot-loading .powered-by { color: rgba(255,255,255,0.7); margin-top: 10px; }
.menu-drawer .menu-powered { padding: 0 14px 12px; margin-top: -6px; }

.term-row { display: flex; justify-content: space-between; align-items: center; }
.term-row .cat { font-size: 12px; color: var(--text-dim); }

.progress-line { font-size: 14px; color: var(--text-dim); margin-top: 8px; }

/* ---- Indeterminate progress bar — a search's total length can't be known
   ahead of time, so this just depicts "still actively working," not a
   percentage. ---- */
.progress-bar-track { height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; margin-top: 8px; }
.progress-bar-fill { height: 100%; width: 35%; background: var(--accent); border-radius: 4px; animation: cc-progress-slide 1.2s ease-in-out infinite; }
@keyframes cc-progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(285%); }
}

.coming-soon { text-align: center; color: var(--text-dim); padding: 40px 20px; }

/* Shown under a search when part of it could not be checked, even after retrying. */
.search-problems { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--danger); background: var(--danger-bg); color: var(--text); border-radius: 10px; font-size: 14px; }
.search-problems ul { margin: 8px 0 0; padding-left: 18px; }

.license-banner { background: var(--accent-2); color: #222; text-align: center; padding: 8px 16px; font-size: 14px; }
.license-banner.urgent { background: var(--danger); color: #fff; }

/* Search bar: a rounded field with a magnifier and a clear button, in the firm's colours */
.search-field { position: relative; margin-bottom: 12px; }
.search-field.compact { margin-bottom: 0; }
.search-field.compact::before { left: 13px; width: 16px; height: 16px; }
.search-field.compact input[type="search"] { padding: 9px 38px 9px 38px; font-size: 15px; }
.search-field::before {
  content: ''; position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%);
  background: var(--text-dim); pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E") center / contain no-repeat;
}
.search-field input[type="search"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; padding: 13px 44px 13px 44px; font-size: 16px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-field input[type="search"]::placeholder { color: var(--text-dim); opacity: 1; }
.search-field input[type="search"]:focus {
  outline: none; border-color: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 30%, transparent);
}
.search-field input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; height: 20px; width: 20px; margin-right: 2px; cursor: pointer;
  background: var(--text-dim);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / 70% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / 70% no-repeat;
}

/* Cause list */
.cause-row { display: flex; gap: 12px; align-items: flex-start; }
.cause-serial { min-width: 46px; text-align: center; font-size: 22px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.cause-serial span { display: block; font-size: 10px; font-weight: 400; color: var(--text-dim); letter-spacing: 0.05em; text-transform: uppercase; }
.bench-head { margin: 14px 2px 6px; }
.bench-head .meta { margin-top: 2px; }

/* Print: only the printable sheet shows */
#print-root { display: none; }
/* ---- Vision Board ---- */
main.wide { max-width: 1240px; }
.vb-bar .segmented { margin-bottom: 10px; }
.vb-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.vb-filters select { flex: 1 1 140px; min-width: 0; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.vb-done { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-dim); white-space: nowrap; }
.vb-columns { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
@media (min-width: 900px) {
  .vb-columns.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .vb-columns.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .vb-col { background: rgba(127, 127, 127, 0.07); border-radius: var(--radius); padding: 10px; min-height: 160px; }
}
.vb-col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 8px; font-size: 14px; }
.vb-count { background: var(--border); color: var(--text-dim); border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 700; }
.vb-col-empty { color: var(--text-dim); font-size: 13px; padding: 8px 4px 14px; }
.task-card { border-left: 6px solid var(--border); margin-bottom: 10px; cursor: pointer; }
.task-card.pri-high, .ct-row.pri-high { border-left-color: #d64545; }
.task-card.pri-medium, .ct-row.pri-medium { border-left-color: #e0a800; }
.task-card.pri-low, .ct-row.pri-low { border-left-color: #3f9b5b; }
.task-card.is-done { opacity: 0.62; }
.task-matter { font-weight: 700; font-size: 15px; line-height: 1.3; }
.task-prelit { font-size: 11px; font-weight: 600; color: var(--text-dim); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }
.task-title { margin-top: 4px; font-size: 15px; line-height: 1.35; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px; }
.task-pri { font-weight: 700; padding: 2px 9px; border-radius: 6px; color: #fff; }
.task-pri.pri-high { background: #d64545; }
.task-pri.pri-medium { background: #e0a800; color: #2a2100; }
.task-pri.pri-low { background: #3f9b5b; }
.task-due { color: var(--text-dim); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.task-due.hot { color: var(--danger); border-color: var(--danger); font-weight: 700; }
.task-who { color: var(--text-dim); margin-left: auto; }
.task-who.me { color: var(--accent); font-weight: 700; }
.task-quick { display: flex; gap: 6px; margin-top: 10px; }
.task-quick button { padding: 6px 12px; font-size: 13px; flex: 0 0 auto; }
.pri-seg .segmented-btn.active.pri-high { background: #d64545; color: #fff; }
.pri-seg .segmented-btn.active.pri-medium { background: #e0a800; color: #2a2100; }
.pri-seg .segmented-btn.active.pri-low { background: #3f9b5b; color: #fff; }
.nt-picked { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 10px; font-weight: 600; }
.nt-picked button { padding: 4px 10px; font-size: 12px; }
.nt-results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--text-dim); }
.nt-result { display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 10px 12px; font-weight: 600; }
.nt-result small { color: var(--text-dim); font-weight: 400; margin-top: 2px; }
.ct-row { border-left: 5px solid var(--border); padding: 8px 10px; margin-top: 8px; border-radius: 6px; cursor: pointer; background: rgba(127, 127, 127, 0.06); }
.ct-row.is-done { opacity: 0.6; }
.ct-title { font-weight: 600; font-size: 14px; }
.task-status { color: var(--text-dim); }

/* The bell */
.topbar button.bell { position: relative; padding: 7px 9px; line-height: 0; display: inline-flex; align-items: center; justify-content: center; }
.bell-count {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
}
.bell-count[hidden] { display: none; }

@media print {
  @page { size: A4; margin: 14mm; }
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing { background: #fff !important; }
  body.printing #print-root { display: block; color: #000; background: #fff; font-family: Georgia, 'Times New Roman', serif; font-size: 11pt; }
  #print-root h1 { font-size: 16pt; margin: 0 0 2pt; }
  #print-root h2 { font-size: 12pt; margin: 0 0 2pt; font-weight: normal; }
  #print-root .printed-on { font-size: 9pt; color: #444; margin-bottom: 10pt; }
  #print-root h3 { font-size: 11pt; margin: 12pt 0 4pt; border-bottom: 1px solid #000; padding-bottom: 2pt; break-after: avoid; }
  #print-root h3 span { font-weight: normal; color: #444; }
  #print-root table { width: 100%; border-collapse: collapse; margin-bottom: 6pt; }
  #print-root th, #print-root td { border: 1px solid #888; padding: 3pt 5pt; text-align: left; vertical-align: top; font-size: 10pt; }
  #print-root th { background: #eee; }
  #print-root tr { break-inside: avoid; }
  #print-root td.sr { width: 8%; font-weight: bold; text-align: center; font-size: 12pt; }
  #print-root td.notes { width: 22%; }
}

.listed-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.listed-row input { margin-top: 4px; width: auto; }

.possible-note { font-size: 13px; color: var(--accent-2); margin: 4px 0; }
.not-found-row { border-left: 3px solid var(--danger); }
#print-root .missing { font-size: 10pt; margin: 4pt 0 10pt; }

.case-subline { color: var(--text-dim); margin: -6px 0 10px; }
.case-ids { margin: 0 0 14px; display: grid; gap: 4px; }
.case-ids b { margin-left: 6px; }

.sync-group summary { cursor: pointer; }
.sync-line { padding: 8px 0; border-top: 1px solid var(--border); }

.case-row > div:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.stale-line { display: inline-block; margin-top: 8px; padding: 3px 9px; font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--text-dim); border: 1px solid var(--border); border-radius: 6px; }

/* Small line icons used inside text */
.ui-icon { vertical-align: -3px; margin-right: 6px; flex: none; }

/* ---- Invoices ---- */
.inv-line-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.inv-line-actions { display: flex; gap: 6px; }
.inv-line-actions button { padding: 6px 10px; font-size: 13px; }
.inv-date { display: flex; gap: 8px; align-items: center; }
.inv-date input[type="text"] { flex: 1; min-width: 0; }
.field label.inv-cal { position: relative; flex: none; width: 42px; height: 42px; margin: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
@media (prefers-color-scheme: dark) { .field label.inv-cal { color: var(--text); } }
.field label.inv-cal input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; padding: 0; border: 0; cursor: pointer; }
.inv-check { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.inv-check input { width: 20px; height: 20px; flex: none; }
.sig-preview { margin: 10px 0; padding: 10px; min-height: 80px; background: #fff; border: 1px solid var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.sig-preview img { max-width: 100%; max-height: 120px; }
.sig-pad { display: block; width: 100%; aspect-ratio: 5 / 2; margin: 8px 0; background: #fff; border: 1px dashed var(--border); border-radius: 10px; touch-action: none; }

/* Home screen shortcuts: a tidy grid of tiles */
.home-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.home-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: var(--surface); color: var(--text); font-weight: 400; margin: 0; padding: 14px; min-height: 118px; }
.home-tile.wide { grid-column: 1 / -1; min-height: 0; }
.home-tile-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); margin-bottom: 4px; }
.home-tile-icon svg { width: 22px; height: 22px; }
.home-tile-name { font-weight: 700; font-size: 15px; color: var(--accent); line-height: 1.2; }
.home-tile-note { font-size: 12.5px; color: var(--text-dim); line-height: 1.35; }

/* High Court orders: the list on a case and the full-screen reader */
.order-row { border-top: 1px solid var(--border, #e3e6e4); padding: 9px 0; cursor: pointer; }
.order-row.no-file { cursor: default; opacity: 0.7; }
.order-viewer { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg, #fff); }
.ov-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border, #e3e6e4); }
.ov-bar button, .ov-nav button { width: auto; margin: 0; padding: 8px 12px; }
.ov-title { flex: 1; min-width: 0; text-align: center; }
.ov-title .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-pages { flex: 1; overflow: auto; padding: 4px; background: #8a8f94; -webkit-overflow-scrolling: touch; }
.ov-page { display: block; margin: 0 auto 6px; background: #fff; max-width: 100%; }
.ov-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border, #e3e6e4); }
body.no-scroll { overflow: hidden; }

/* Windows opened from inside the case sheet (Orders, Hearing log) */
.sub-overlay { z-index: 20; }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sub-head h2 { margin: 0; }
.sub-head button { width: auto; margin: 0; padding: 6px 12px; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; }
.menu-arrow { font-size: 26px; color: var(--text-dim); line-height: 1; }

/* Client reports */
.cr-pick { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--border, #e3e6e4); cursor: pointer; }
.cr-pick input { margin-top: 4px; flex: none; width: auto; }
.cr-tick { display: flex; gap: 8px; align-items: center; margin-top: 8px; cursor: pointer; }
.cr-tick input { width: auto; }
.cr-case summary { cursor: pointer; color: var(--accent); }
