/* SUNCOAST FIREWATCH — Fire Watch Log (mobile-first) */
:root {
  --ink: #111;
  --border: #222;
  --muted: #555;
  --bg: #f7f7f5;
  --paper: #fff;
  --accent: #1a5f9e;
  --warn-bg: #fff3cd;
  --error-bg: #fde8e8;
  --error-border: #c0392b;
  --ok: #1e7a3a;
  --ok-bg: #e8f6ec;
  --ok-strong: #15803d;
  --no: #c0392b;
  --no-bg: #fdecea;
  --no-strong: #b91c1c;
  --btn: #2c3e50;
  --btn-primary: #1a5f9e;
  --btn-danger: #8b2e2e;
  --radius: 8px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --tap: 44px;
  --action-bar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0.65rem;
  padding-bottom: calc(var(--action-bar-h) + var(--safe-bottom) + 1rem);
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.4;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  background: var(--paper);
  padding: 1rem;
  border: 1px solid #ccc;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border-radius: 6px;
}

/* Title */
.title-bar {
  border: 2.5px solid var(--border);
  text-align: center;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.85rem;
}

.title-bar h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.meta-row {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.meta-box {
  border: 2px solid var(--border);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.meta-box-bottom {
  margin: 0.75rem 0 0.85rem;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.25rem 0.75rem;
  width: max-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.brand-top {
  margin-bottom: 0.35rem;
}

.logo {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  shape-rendering: geometricPrecision;
}

.brand-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: 100%;
  font-weight: 800;
  font-size: clamp(1.25rem, 5.5vw, 1.7rem);
  letter-spacing: normal;
  text-align: center;
  line-height: 1.12;
  color: #111;
}

.brand-line {
  display: block;
  white-space: nowrap;
  width: max-content;
  text-align: center;
  letter-spacing: normal;
}

.brand-line:first-child {
  font-size: 1em;
  letter-spacing: normal;
}

/* FIRE WATCH size is set in app.js to match SUNCOAST width */
.brand-line:last-child {
  letter-spacing: normal;
}

.field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
}

.field label {
  font-weight: 600;
  font-size: 0.9rem;
}

/* ≥16px on inputs — prevents iOS zoom-on-focus */
.field input[type="text"],
.field input[type="date"],
.field input[type="time"],
.field input[type="datetime-local"],
.field select {
  width: 100%;
  min-height: var(--tap);
  border: 1.5px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  padding: 0.55rem 0.65rem;
  color: var(--ink);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: #f0f6fc;
  box-shadow: 0 0 0 3px rgba(26, 95, 158, 0.15);
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Desktop toolbar — visible but secondary on mobile (sticky bar is primary) */
.toolbar {
  display: none;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #ddd;
}

.btn {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: var(--tap);
  padding: 0.55rem 0.9rem;
  border: 1.5px solid var(--btn);
  background: #fff;
  color: var(--btn);
  border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation;
}

.btn:hover {
  background: #eef2f5;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary,
.btn-fill-shift {
  background: var(--btn-primary);
  border-color: var(--btn-primary);
  color: #fff;
}

.btn-primary:hover,
.btn-fill-shift:hover {
  background: #154a7a;
}

.btn-danger {
  border-color: var(--btn-danger);
  color: var(--btn-danger);
}

.btn-danger:hover {
  background: #fdf0f0;
}

.save-status {
  font-size: 0.8rem;
  color: var(--muted);
  width: 100%;
}

/* Shift focus mode bar */
.shift-focus-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: #eef6ff;
  border: 1.5px solid #b6d4f0;
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
}

.shift-focus-bar[hidden] {
  display: none !important;
}

.shift-focus-label {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0d3d66;
}

.toggle-all-hours {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-height: var(--tap);
  user-select: none;
}

/* display:flex above beats the native [hidden] rule — force hide */
.toggle-all-hours[hidden] {
  display: none !important;
}

.toggle-all-hours input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--accent);
}

.validation-banner {
  background: var(--error-bg);
  border: 1.5px solid var(--error-border);
  color: #6b1c14;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
}

/* ========== Mobile card rows (default) ========== */
.log-tables {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.table-wrap {
  overflow: visible;
}

.log-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.65rem;
  table-layout: fixed;
  font-size: 1rem;
}

.log-table thead {
  display: none;
}

.log-table tbody tr {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "time"
    "clear"
    "notes"
    "init";
  gap: 0.55rem;
  background: var(--paper);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.log-table tbody tr.row-hidden-shift {
  display: none;
}

.log-table td {
  border: none;
  padding: 0;
  vertical-align: middle;
}

.log-table td.time-cell {
  grid-area: time;
  text-align: left;
  font-weight: 800;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  background: transparent;
  align-self: start;
}

.log-table td.clear-cell {
  grid-area: clear;
  justify-self: stretch;
}

.clear-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.clear-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.log-table td.notes-cell {
  grid-area: notes;
}

.log-table td.init-cell {
  grid-area: init;
}

/* Hide native select on mobile; use Y/N toggles */
.clear-select {
  display: none;
}

.yn-toggles {
  display: flex;
  gap: 0.45rem;
}

.yn-btn {
  min-width: 3.5rem;
  min-height: var(--tap);
  padding: 0 0.85rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  border: 2px solid #999;
  border-radius: 8px;
  background: #f5f5f5;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Yes = green, No = red (always recognizable) */
.yn-btn.yn-y {
  background: var(--ok-bg);
  border-color: var(--ok);
  color: var(--ok-strong);
}

.yn-btn.yn-n {
  background: var(--no-bg);
  border-color: var(--no);
  color: var(--no-strong);
}

.yn-btn[aria-pressed="true"].yn-y {
  background: var(--ok);
  border-color: var(--ok-strong);
  color: #fff;
}

.yn-btn[aria-pressed="true"].yn-n {
  background: var(--no);
  border-color: var(--no-strong);
  color: #fff;
}

.yn-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.notes-input {
  display: block;
  width: 100%;
  min-height: var(--tap);
  border: 1.5px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  padding: 0.55rem 0.65rem;
  color: var(--ink);
  resize: vertical;
  line-height: 1.35;
}

.notes-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #f0f6fc;
  box-shadow: 0 0 0 3px rgba(26, 95, 158, 0.15);
}

/* Expand notes when N is selected */
tr[data-clear="N"] .notes-input {
  min-height: 5.5rem;
  border-color: var(--error-border);
  background: #fff8f8;
}

tr[data-clear="N"] .notes-label {
  color: var(--error-border);
  font-weight: 700;
}

tr[data-clear="N"] .notes-input:invalid {
  border-color: var(--error-border);
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.2);
}

tr[data-clear="Y"] .notes-input {
  min-height: var(--tap);
}

.notes-label,
.init-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.init-input {
  display: block;
  width: 100%;
  min-height: var(--tap);
  border: 1.5px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font-family: "Caveat", "Segoe Script", "Bradley Hand", "Apple Chancery", cursive;
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  padding: 0.45rem 0.55rem;
  color: var(--ink);
}

.init-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #f0f6fc;
  box-shadow: 0 0 0 3px rgba(26, 95, 158, 0.15);
}

/* Invalid card highlight */
tr.row-invalid {
  background: var(--error-bg) !important;
  border-color: var(--error-border) !important;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.25);
}

tr.row-invalid .notes-input {
  background: #fff5f5;
  border-color: var(--error-border);
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.2);
}

tr.row-in-shift:not(.row-invalid) {
  border-color: #7eb0d9;
}

tr.row-in-shift td.time-cell {
  color: #0d3d66;
}

/* Attention footer */
.attention-box {
  border: 2.5px solid var(--border);
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.45;
  border-radius: 6px;
}

.attention-box a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  /* larger tap target for phone */
  display: inline-block;
  padding: 0.15rem 0.25rem;
}

.attention-box a:hover {
  color: #0d3d66;
}

/* ========== Sticky mobile action bar ========== */
.mobile-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 0.35rem;
  align-items: stretch;
  padding: 0.45rem 0.5rem calc(0.45rem + var(--safe-bottom));
  background: #fff;
  border-top: 1.5px solid #ccc;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
}

.m-btn {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: var(--tap);
  padding: 0.35rem 0.4rem;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  background: #f7f7f5;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.m-btn-primary {
  background: var(--btn-primary);
  border-color: var(--btn-primary);
  color: #fff;
  font-size: 0.78rem;
}

.m-btn-menu {
  min-width: var(--tap);
  padding: 0.35rem 0.55rem;
}

.m-menu-wrap {
  position: relative;
}

.m-menu-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.4rem);
  min-width: 11rem;
  background: #fff;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 0.35rem;
  z-index: 110;
}

.m-menu-panel[hidden] {
  display: none !important;
}

.m-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: var(--tap);
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.m-menu-danger {
  color: var(--btn-danger);
}

.m-menu-item:hover,
.m-menu-item:active {
  background: #f5f5f5;
}

/* ========== Tablet / desktop (≥900px): two-column table ========== */
@media (min-width: 900px) {
  body {
    padding: 1rem;
    padding-bottom: 1rem;
  }

  .page {
    max-width: 1100px;
    padding: 1.25rem 1.5rem 1.5rem;
    border-radius: 0;
  }

  .title-bar h1 {
    font-size: 1.65rem;
  }

  .meta-row {
    display: block;
    margin-bottom: 0.85rem;
  }

  .meta-box {
    padding: 0.75rem 1rem;
    gap: 0.45rem;
  }

  .brand {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.25rem 0.5rem 0.85rem;
    min-width: 0;
    width: max-content;
    gap: 0.55rem;
    border: none;
    box-shadow: none;
  }

  .logo {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .brand-name {
    font-size: clamp(1.45rem, 2.1vw, 2rem);
    letter-spacing: normal;
    font-weight: 800;
  }

  .field {
    flex-direction: row;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .field label {
    white-space: nowrap;
    min-width: 7.5rem;
    font-size: inherit;
  }

  .field input[type="text"],
  .field input[type="date"],
  .field input[type="time"],
  .field input[type="datetime-local"],
  .field select {
    flex: 1;
    min-width: 8rem;
    width: auto;
    min-height: auto;
    border: none;
    border-bottom: 1.5px solid var(--border);
    border-radius: 0;
    background: transparent;
    padding: 0.2rem 0.25rem;
    font-size: 15px;
    box-shadow: none;
  }

  .field input:focus {
    background: #f0f6fc;
    box-shadow: none;
    border-bottom-color: var(--accent);
  }

  .field-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
  }

  .field-row .field {
    flex: 1;
    min-width: 12rem;
  }

  .toolbar {
    display: flex;
  }

  .btn-fill-shift {
    font-size: 0.95rem;
  }

  .save-status {
    width: auto;
    margin-left: auto;
  }

  .mobile-action-bar {
    display: none;
  }

  .log-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .log-table {
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 0.82rem;
  }

  .log-table thead {
    display: table-header-group;
  }

  .log-table tbody tr,
  .log-table tbody tr.row-in-shift:not(.row-invalid) {
    display: table-row;
    grid-template-columns: unset;
    grid-template-areas: unset;
    gap: unset;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  .log-table tbody tr.row-hidden-shift {
    display: none;
  }

  .log-table th,
  .log-table td {
    border: 1px solid var(--border);
    padding: 0.15rem 0.25rem;
    vertical-align: middle;
  }

  .log-table thead th {
    background: #eee;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    padding: 0.35rem 0.2rem;
  }

  .col-time { width: 18%; }
  .col-clear { width: 18%; }
  .col-notes { width: 46%; }
  .col-init { width: 18%; }

  .log-table td.time-cell {
    text-align: center;
    font-weight: 600;
    font-size: inherit;
    background: #fafafa;
  }

  tr.row-in-shift td.time-cell {
    background: #eef6ff;
    color: inherit;
  }

  .yn-toggles,
  .clear-row {
    display: none;
  }

  .clear-select {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    font: inherit;
    padding: 0.2rem;
    text-align: center;
    cursor: pointer;
    appearance: auto;
    color: var(--ink);
  }

  .clear-select:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    background: #f0f6fc;
  }

  .notes-label,
  .init-label,
  .clear-label {
    display: none;
  }

  .notes-input {
    min-height: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    font-size: inherit;
    padding: 0.2rem;
    resize: none;
    box-shadow: none;
  }

  tr[data-clear="N"] .notes-input,
  tr[data-clear="Y"] .notes-input {
    min-height: auto;
    border: none;
    background: transparent;
  }

  .notes-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    background: #f0f6fc;
    box-shadow: none;
  }

  .init-input {
    min-height: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    font-family: "Caveat", "Segoe Script", "Bradley Hand", "Apple Chancery", cursive;
    font-size: 1.35rem;
    font-weight: 600;
    padding: 0.2rem;
    box-shadow: none;
  }

  .init-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    background: #f0f6fc;
    box-shadow: none;
  }

  tr.row-invalid {
    background: var(--error-bg) !important;
    border: none !important;
    box-shadow: none;
  }

  tr.row-invalid td {
    border-color: var(--error-border);
  }

  .attention-box {
    border-radius: 0;
  }
}

/* Mid-size phones in landscape / small tablets still use cards but wider page */
@media (min-width: 481px) and (max-width: 899px) {
  .page {
    max-width: 640px;
  }

  .field-row {
    flex-direction: row;
  }

  .field-row .field {
    flex: 1;
  }
}


/* Submit Log */
.btn-submit {
  background: #1e7a3a;
  border-color: #1e7a3a;
  color: #fff;
}

.btn-submit:hover {
  background: #176230;
}

.btn-submit-lg {
  width: 100%;
  font-size: 1.1rem;
  min-height: 52px;
  padding: 0.85rem 1rem;
}

.submit-row {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.m-btn-submit {
  background: #1e7a3a !important;
  border-color: #1e7a3a !important;
  color: #fff !important;
  font-size: 0.8rem !important;
}

@media (min-width: 900px) {
  .submit-row {
    margin-top: 1.25rem;
  }
  .btn-submit-lg {
    max-width: 320px;
  }
}

/* ========== Print: single letter page (no JS scale — mobile-safe) ========== */
@media print {
  @page {
    size: letter portrait;
    margin: 0.35in;
  }

  html, body {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 9pt;
    color: #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .page {
    max-width: none !important;
    width: auto !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
  }

  .no-print,
  .mobile-action-bar,
  .shift-focus-bar,
  .toolbar,
  .submit-row,
  .validation-banner,
  .slots-hint,
  .meta-box-bottom,
  #emptyLogHint {
    display: none !important;
  }

  .brand {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    margin: 0 auto 0.2rem;
    padding: 0;
  }

  .logo {
    width: 64px !important;
    max-width: 64px !important;
    height: auto !important;
  }

  .brand-name {
    font-size: 9pt !important;
    line-height: 1.1;
  }

  .title-bar {
    border: 1.5px solid #111 !important;
    margin-bottom: 0.25rem;
    padding: 0.15rem 0.25rem;
  }

  .title-bar h1 {
    font-size: 12pt !important;
    margin: 0;
  }

  .meta-row {
    display: block !important;
    margin-bottom: 0.25rem;
  }

  .meta-box {
    border: 1.25px solid #111 !important;
    padding: 0.25rem 0.4rem;
    gap: 0.15rem;
  }

  .field {
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline;
    gap: 0.3rem;
  }

  .field label {
    min-width: 5.5rem;
    font-size: 8pt;
    font-weight: 700;
  }

  .field input,
  .field select {
    border: none !important;
    border-bottom: 1px solid #333 !important;
    border-radius: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 0.15rem !important;
    font-size: 8pt !important;
    box-shadow: none !important;
    background: transparent !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    color: #000 !important;
  }

  .datetime-split {
    display: flex !important;
    gap: 0.4rem;
    flex: 1;
  }

  .log-tables {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem;
    margin-bottom: 0.2rem;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .table-wrap {
    overflow: visible !important;
    display: block !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .table-wrap[hidden] {
    display: none !important;
  }

  /* Undo mobile card layout — real tables for print */
  .log-table {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    table-layout: fixed !important;
    font-size: 6.25pt !important;
  }

  .log-table thead {
    display: table-header-group !important;
  }

  .log-table tbody {
    display: table-row-group !important;
  }

  .log-table tbody tr,
  .log-table tbody tr.row-hidden-shift,
  .log-table tbody tr.row-in-shift {
    display: table-row !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    gap: unset !important;
    grid-template-columns: unset !important;
    grid-template-areas: unset !important;
  }

  .log-table th,
  .log-table td {
    display: table-cell !important;
    border: 0.6pt solid #111 !important;
    padding: 0.02rem 0.08rem !important;
    vertical-align: middle !important;
    line-height: 1.05;
  }

  .log-table thead th {
    background: #e8e8e8 !important;
    font-size: 6pt !important;
    font-weight: 700;
    text-align: center;
    padding: 0.1rem 0.08rem !important;
  }

  .log-table td.time-cell {
    text-align: center;
    font-weight: 700;
    font-size: 6.25pt !important;
    background: #f7f7f7 !important;
    white-space: nowrap;
    grid-area: unset !important;
  }

  .log-table td.clear-cell,
  .log-table td.notes-cell,
  .log-table td.init-cell {
    grid-area: unset !important;
    justify-self: unset !important;
  }

  .yn-toggles,
  .clear-row,
  .notes-label,
  .init-label,
  .clear-label {
    display: none !important;
  }

  .clear-select {
    display: block !important;
    width: 100%;
    border: none !important;
    background: transparent !important;
    font-size: 6.25pt !important;
    padding: 0 !important;
    text-align: center;
    color: #000 !important;
    -webkit-appearance: none;
    appearance: none;
  }

  .notes-input,
  .init-input {
    display: block !important;
    width: 100% !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 0 !important;
    padding: 0 !important;
    font-size: 6.25pt !important;
    color: #000 !important;
    resize: none;
  }

  .init-input {
    font-family: "Caveat", "Segoe Script", "Bradley Hand", cursive !important;
    font-size: 8.5pt !important;
    font-weight: 600 !important;
    text-align: center;
  }

  .attention-box {
    border: 1.5px solid #111 !important;
    border-radius: 0;
    padding: 0.25rem 0.4rem;
    font-size: 7.5pt;
    margin: 0;
    color: #000;
  }

  .attention-box a {
    color: inherit;
    text-decoration: none;
    padding: 0;
  }

  .hint {
    display: none !important;
  }
}


.slots-hint {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1.5px dashed #999;
  border-radius: 8px;
  background: #fafafa;
  color: var(--muted);
  font-size: 0.9rem;
}
.slots-hint[hidden] { display: none !important; }
.table-wrap[hidden] { display: none !important; }

.slots-hint-open {
  border-style: solid;
  border-color: #7eb0d9;
  background: #eef6fc;
  color: #0d3d66;
}

.field .slots-hint {
  margin: 0.45rem 0 0;
  width: 100%;
}

.datetime-split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0.45rem;
  width: 100%;
}

.field select {
  width: 100%;
  min-height: var(--tap);
  border: 1.5px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  padding: 0.55rem 0.65rem;
  color: var(--ink);
  appearance: auto;
}

.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: #f0f6fc;
  box-shadow: 0 0 0 3px rgba(26, 95, 158, 0.15);
}


/* Auto-calculated hours — visibly locked */
.total-hours-auto,
.field input.total-hours-auto[readonly] {
  background: #e9ecef !important;
  color: #495057 !important;
  border-color: #ced4da !important;
  cursor: default;
  pointer-events: none;
  opacity: 1;
}
.total-hours-auto:focus {
  outline: none !important;
  box-shadow: none !important;
  border-color: #ced4da !important;
}


/* Departure times beyond Arrival+24h */
.field select option:disabled,
.field select option.time-out-of-range {
  color: #9aa0a6;
  background: #f0f0f0;
}


/* Custom Departure calendar — gray out days outside Arrival→+24h */
.dep-date-picker {
  position: relative;
  min-width: 0;
}
.dep-date-input {
  width: 100%;
  cursor: pointer;
  background: #fff;
}
.dep-cal {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  width: min(288px, 92vw);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  padding: 0.65rem;
}
.dep-cal[hidden] {
  display: none !important;
}
.dep-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
.dep-cal-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.dep-cal-nav {
  border: 1px solid #ccc;
  background: #f7f7f7;
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.dep-cal-nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.dep-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}
.dep-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dep-cal-day {
  border: none;
  background: transparent;
  border-radius: 8px;
  min-height: 2.15rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ink);
}
.dep-cal-day:hover:not(:disabled):not(.is-empty) {
  background: #eef6ff;
}
.dep-cal-day.is-empty {
  visibility: hidden;
  pointer-events: none;
}
.dep-cal-day.is-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.dep-cal-day.is-disabled,
.dep-cal-day:disabled {
  color: #b0b4ba;
  background: #f1f2f4;
  cursor: not-allowed;
  text-decoration: line-through;
  opacity: 0.85;
}
.dep-cal-hint {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}


/* Top Departure is display-only — edit at bottom */
.field-departure-top .dep-readonly,
.field-departure-top select.dep-readonly:disabled {
  background: #e9ecef !important;
  color: #495057 !important;
  border-color: #ced4da !important;
  cursor: not-allowed;
  opacity: 1;
  pointer-events: none;
}
.field-departure-top .dep-date-picker-locked {
  pointer-events: none;
}
.field-departure-top .dep-date-input {
  cursor: not-allowed;
}


/* Tip under Notes when All Clear = No */
.notes-no-tip {
  margin: 0.45rem 0 0;
  padding: 0.55rem 0.65rem;
  border: 1.5px solid #c0392b;
  border-radius: 8px;
  background: #fdecea;
  color: #6b1c14;
  font-size: 0.88rem;
  line-height: 1.35;
}
.notes-no-tip[hidden] {
  display: none !important;
}
.notes-no-tip strong {
  font-weight: 800;
}
.notes-no-tip a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}
@media print {
  .notes-no-tip {
    display: none !important;
  }
}


.m-btn-danger {
  color: #8b1e14 !important;
  border-color: #e0a39a !important;
  background: #fdecea !important;
}
.m-btn-danger .m-btn-label {
  font-weight: 700;
}


tr.row-invalid-signoff .init-input,
tr.row-invalid .init-input:invalid {
  border-color: var(--error-border);
  background: #fff8f8;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15);
}
tr[data-clear="Y"] .init-label,
tr[data-clear="N"] .init-label {
  font-weight: 700;
}


tr.row-invalid-clear .yn-toggles {
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.35);
  border-radius: 10px;
}
tr.row-invalid-clear .clear-select {
  border-color: var(--error-border);
  background: #fff8f8;
}
