/* LDM Ops - plain, readable, no inline styles (CSP style-src 'self'). */
:root {
  --teal: #033746;
  --teal-2: #0b5266;
  --ink: #17242a;
  --muted: #55656c;
  --line: #d9e1e4;
  --bg: #f4f7f8;
  --white: #fff;
  --red: #b42318;
  --red-bg: #fdecea;
  --amber: #a15c00;
  --amber-bg: #fff4e0;
  --green: #1d7a46;
  --green-bg: #e6f4ec;
  --blue-bg: #e8f1f8;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.5;
}
a { color: var(--teal-2); }
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 21px; margin: 0 0 12px; }
h3 { font-size: 18px; margin: 16px 0 8px; }
h4 { font-size: 16px; margin: 12px 0 6px; }
.note { color: var(--muted); font-size: 15px; font-weight: 400; }

.test-banner { background: #f2b705; color: #222; text-align: center; font-weight: 700; padding: 6px 12px; font-size: 15px; }
.topbar { background: var(--teal); color: var(--white); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--white); text-decoration: none; font-weight: 700; font-size: 20px; }
.brand img { background: var(--white); border-radius: 6px; padding: 3px; height: 46px; width: auto; }
.who { margin-left: auto; font-size: 15px; opacity: .9; }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a, .link-button { color: var(--white); font-size: 16px; font-weight: 600; text-decoration: none; }
.topnav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
form.inline { display: inline; margin: 0; }

.page { max-width: 1240px; margin: 0 auto; padding: 24px 20px 40px; }
.footer { text-align: center; color: var(--muted); font-size: 15px; padding: 20px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.panel.narrow { max-width: 520px; margin: 40px auto; }
.block { margin-top: 28px; }
.stack { display: grid; gap: 10px; }
.radio { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }

.button { display: inline-block; background: var(--teal); color: var(--white); border: 0; border-radius: 8px; padding: 11px 18px; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; font-family: inherit; }
.button:hover { background: var(--teal-2); }
.button.small { padding: 8px 14px; font-size: 15px; }

.alert { border-radius: 8px; padding: 12px 14px; margin: 16px 0; }
.alert-good { background: var(--green-bg); color: #10462a; border: 1px solid #a8d5b9; }
.alert-bad { background: var(--red-bg); color: #7a1610; border: 1px solid #f1b4ad; }
.alert-info { background: var(--blue-bg); border: 1px solid #b9d3e8; }

/* Summary block */
.summary { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; }
.lead { font-size: 20px; margin: 0 0 14px; }
.counts { list-style: none; padding: 0; margin: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.counts li { background: var(--bg); border-radius: 8px; padding: 10px 16px; font-size: 16px; }
.counts strong { font-size: 24px; margin-right: 6px; }
.counts span { color: var(--muted); font-size: 15px; }
.counts .count-warn { background: var(--amber-bg); }

/* To-do list */
.todo { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.todo-item { background: var(--white); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 8px; }
.todo-item.level-urgent { border-left-color: var(--red); background: var(--red-bg); }
.todo-item.level-overdue { border-left-color: #e08a00; background: var(--amber-bg); }
.todo-item.level-due { border-left-color: var(--teal-2); }
.todo-link { display: grid; grid-template-columns: 1fr 2fr auto; gap: 6px 18px; align-items: center; padding: 12px 16px; color: var(--ink); text-decoration: none; }
.todo-link:hover .todo-main strong { text-decoration: underline; }
.todo-main strong { font-size: 17px; }
.todo-event { display: block; color: var(--muted); font-size: 15px; }
.todo-what { font-size: 16px; }
.todo-due { text-align: right; white-space: nowrap; }
.due-date { display: block; font-weight: 700; }
.due-rel { display: block; font-size: 15px; color: var(--muted); }
.level-urgent .due-rel { color: var(--red); font-weight: 600; }
.level-overdue .due-rel { color: var(--amber); font-weight: 600; }
.empty { background: var(--white); border: 1px dashed var(--line); border-radius: 8px; padding: 16px; }

/* Properties */
.props { display: grid; gap: 6px; }
.prop { background: var(--white); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 8px; }
.prop.level-urgent { border-left: 6px solid var(--red); }
.prop.level-overdue { border-left: 6px solid #e08a00; }
.prop > summary { cursor: pointer; padding: 12px 16px; display: grid; grid-template-columns: 120px 1fr minmax(180px, 320px); gap: 4px 16px; align-items: center; list-style: none; }
.prop > summary::-webkit-details-marker { display: none; }
.prop[open] > summary { border-bottom: 1px solid var(--line); background: var(--bg); }
.prop-apt { font-weight: 700; font-size: 17px; }
.prop-apt .note { display: block; font-weight: 400; }
.prop-addr { color: var(--ink); }
.prop-state { color: var(--muted); font-size: 15px; text-align: right; }
.prop-body { padding: 8px 16px 18px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 8px 0 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.item-title { border-top: 2px solid var(--line); padding-top: 12px; margin-top: 16px; font-size: 17px; }

/* Checklist */
.checklist { border-top: 1px solid var(--line); margin-top: 8px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.step { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--white); }
.step-head { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; }
.step-n { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.step-label .note { display: block; }
.step-status { font-weight: 600; text-align: right; }
.step-date { display: block; font-weight: 400; color: var(--muted); font-size: 15px; }
.st-done .step-n { background: var(--green); color: var(--white); }
.st-done .step-status { color: var(--green); }
.st-booked .step-n { background: var(--blue-bg); }
.st-bad { background: var(--red-bg); border-color: #f1b4ad; }
.st-bad .step-n { background: var(--red); color: var(--white); }
.st-warn { background: var(--amber-bg); border-color: #f3d19c; }
.st-warn .step-n { background: #e08a00; color: var(--white); }
.step-msg { margin: 6px 0 0 40px; font-weight: 600; }
.step > .note { margin: 4px 0 0 40px; }
.edit { margin: 6px 0 0 40px; }
.edit > summary { cursor: pointer; color: var(--teal-2); font-weight: 600; }
.step-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-top: 8px; }
.step-form label { display: grid; gap: 2px; font-size: 15px; color: var(--muted); }
.step-form label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); padding-bottom: 8px; }
select, input[type="date"], input[type="number"], input[type="month"] { font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid #b7c4c9; border-radius: 6px; background: var(--white); color: var(--ink); }
input[type="number"] { width: 90px; }
input[type="checkbox"] { width: 20px; height: 20px; }
.compare { background: var(--blue-bg); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.compare h4 { margin: 0 0 4px; }
.compare dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 0; }
.compare dt { color: var(--muted); }
.compare dd { margin: 0; }

/* Director tables */
.table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 16px; }
.table thead th { background: var(--bg); font-size: 15px; }
.table td { font-variant-numeric: tabular-nums; }
.cell-warn { background: var(--amber-bg); font-weight: 700; }
.month-form { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.month-form label { display: grid; gap: 2px; font-size: 15px; color: var(--muted); }

/* Checklist one-tap actions */
.progress { display: inline-block; background: var(--teal); color: var(--white); border-radius: 12px; padding: 0 10px; font-size: 15px; margin-left: 6px; }
.step-next { border: 2px solid var(--teal-2); box-shadow: 0 0 0 3px var(--blue-bg); }
.next-badge { display: block; color: var(--teal-2); font-weight: 700; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; margin: 8px 0 0 40px; }
.act { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: flex-end; margin: 0; }
.act label { display: grid; gap: 2px; font-size: 15px; color: var(--muted); }
.act label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); padding-bottom: 8px; }
.btn-done { background: var(--green); }
.btn-done:hover { background: #156338; }
.btn-quiet { background: var(--white); color: var(--ink); border: 1px solid #b7c4c9; }
.btn-quiet:hover { background: var(--bg); }
.link-button-dark { background: none; border: 0; padding: 8px 0; color: var(--teal-2); text-decoration: underline; font: inherit; font-size: 15px; cursor: pointer; }
.done-steps { margin-top: 8px; }
.done-steps > summary { cursor: pointer; color: var(--teal-2); font-weight: 600; padding: 6px 0; }

/* Calendar */
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.block-head h1, .block-head h2 { margin: 0; }
.cal-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.cal-filter { margin: 10px 0 0; }
.legend { margin: 12px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.legend .chip { display: inline-block; margin: 0; }
.chip { display: block; margin-top: 4px; padding: 2px 7px; border-radius: 5px; font-size: 15px; line-height: 1.35; text-decoration: none; color: var(--ink); background: var(--blue-bg); border-left: 4px solid var(--teal-2); overflow-wrap: anywhere; }
.chip:hover { text-decoration: underline; }
.chip.ev-in { background: var(--green-bg); border-left-color: var(--green); color: #10462a; font-weight: 600; }
.chip.ev-out { background: var(--red-bg); border-left-color: var(--red); color: #7a1610; font-weight: 600; }
.chip.ev-done { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--green); }
.chip.ev-done::before { content: "\2713  "; color: var(--green); font-weight: 700; }
.cal { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); }
.cal th { background: var(--bg); font-size: 15px; padding: 6px; border: 1px solid var(--line); }
.cal td { vertical-align: top; height: 112px; padding: 4px 6px 8px; border: 1px solid var(--line); }
.cal .weekend { background: #f8fafb; }
.cal th.weekend { background: #eef2f4; color: var(--muted); }
.cal-blank { background: var(--bg); }
.cal-num { display: block; font-weight: 700; font-size: 15px; color: var(--muted); }
.cal-day.today { background: #fff9e0; box-shadow: inset 0 0 0 3px #f2b705; }
.cal-day.today .cal-num { color: var(--ink); }
.cal-today { font-size: 15px; font-weight: 600; color: var(--amber); }
.cal-list { display: none; list-style: none; padding: 0; margin: 0; }
.cal-list-day { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
.cal-list-day.weekend { background: #f8fafb; }
.cal-list-day.today { border: 2px solid #f2b705; background: #fff9e0; }
.cal-list-date { display: block; font-weight: 700; }
.cal-list-events { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-list-events .chip { display: inline-block; margin: 4px 0 0; }

@media (max-width: 700px) {
  .cal { display: none; }
  .cal-list { display: block; }
}

@media (max-width: 760px) {
  h1 { font-size: 24px; }
  .page { padding: 16px 12px 32px; }
  .topbar-in { padding: 8px 12px; gap: 10px; }
  .brand img { height: 38px; }
  .who { display: none; }
  .topnav { margin-left: auto; gap: 14px; }
  .summary { padding: 16px; }
  .lead { font-size: 18px; }
  .counts li { flex: 1 1 30%; padding: 8px 10px; text-align: center; }
  .counts strong { display: block; margin: 0; }
  .todo-link { grid-template-columns: 1fr auto; }
  .todo-what { grid-column: 1 / -1; grid-row: 2; }
  .prop > summary { grid-template-columns: 1fr; }
  .prop-state { text-align: left; }
  .step-msg, .edit, .step > .note, .actions { margin-left: 0; }
  .actions { flex-direction: column; align-items: stretch; }
  .act { justify-content: space-between; }
  .act label { flex: 1 1 auto; }
  .step-form { flex-direction: column; align-items: stretch; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table th, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 2px solid var(--line); padding: 6px 0; }
  .table th[scope="row"] { border: 0; font-size: 17px; }
  .table td { border: 0; padding: 2px 14px; display: flex; justify-content: space-between; }
  .table td::before { content: attr(data-label); color: var(--muted); }
}
