* {
  box-sizing: border-box;
}
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f3f4f6;
  color: #111;
}
.app {
  max-width: 1000px;
  margin: 20px auto;
  padding: 0 14px;
}
.panel {
  background: #fff;
  border: 1px solid #111;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
h1 {
  font-size: 22px;
  margin: 0 0 13px;
}
.search {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.search input {
  font-size: 17px;
  font-weight: 500;
  padding: 13px 15px;
  border: 2px solid #111;
  border-radius: 7px;
  width: 100%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.search input::placeholder {
  color: #777;
}
.filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr 1.35fr;
  gap: 7px;
  margin-top: 8px;
}
.filter {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.filter label {
  font-size: 10px;
  font-weight: 700;
  color: #555;
}
.filter select,
.filter input {
  font-size: 13px;
  padding: 8px;
  border: 1px solid #aaa;
  border-radius: 5px;
  width: 100%;
  background: #fff;
}
.completed-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #444;
  cursor: pointer;
  width: max-content;
}
.completed-filter input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #4b8f52;
  cursor: pointer;
}
button {
  padding: 9px 12px;
  border: 1px solid rgba(0, 0, 0, 0.32);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: linear-gradient(to bottom, #333 0%, #111 58%, #090909 100%);
  color: #fff;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 2px 3px rgba(0, 0, 0, 0.22);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    filter 0.12s ease;
}
button:hover {
  filter: brightness(1.06);
}
button:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.18),
    0 1px 1px rgba(0, 0, 0, 0.15);
}
.secondary {
  background: linear-gradient(to bottom, #f7f7f7 0%, #e8e8e8 55%, #d2d2d2 100%);
  color: #111;
  border-color: #aaa;
  border-bottom-color: #888;
  text-shadow: 0 1px 0 #fff;
}
.result {
  display: grid;
  grid-template-columns: 1.35fr 0.7fr 1.5fr 170px;
  gap: 10px;
  align-items: center;
  border-top: 1px solid #ddd;
  padding: 8px 0;
}
.result:first-child {
  border-top: 0;
}
.result.completed {
  background: #e9f6ea;
  border: 1px solid #b7d9ba;
  border-radius: 7px;
  padding: 8px 7px;
  margin: 3px 0;
}
.result.completed .name {
  color: #245b2a;
}
.completed-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #555;
  margin-top: 4px;
}
.completed-status input {
  margin: 0;
  width: 14px;
  height: 14px;
  accent-color: #4b8f52;
}
.completed-status span {
  font-weight: 700;
}
.name {
  font-weight: 700;
  font-size: 13px;
}
.date-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}
.date {
  color: #333;
  white-space: nowrap;
  font-size: 12px;
}
.edit-appointment-under-date {
  display: inline-block;
  padding: 5px 7px;
  border: 1px solid #3aa8d5;
  border-bottom: 3px solid #2385ad;
  border-radius: 6px;
  background: linear-gradient(to bottom, #9be1fb 0%, #6dcff6 55%, #4db9e4 100%);
  color: #12324a;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 2px 3px rgba(0, 0, 0, 0.18);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    filter 0.12s ease;
}
.edit-appointment-under-date:hover {
  filter: brightness(1.05);
}
.edit-appointment-under-date:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.14),
    0 1px 1px rgba(0, 0, 0, 0.12);
}
.edit-appointment-under-date.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.boat {
  color: #333;
  font-size: 12px;
  line-height: 1.25;
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.actions button,
.actions .action-link {
  width: 100%;
  white-space: nowrap;
  padding: 7px 8px;
  font-size: 12px;
}
.action-link {
  display: block;
  border: 0;
  border-radius: 5px;
  background: #e8e8e8;
  color: #111;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
}
.action-link:hover {
  background: #dcdcdc;
}
.action-link.disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.checklist {
  min-width: 88px;
  grid-column: 1 / -1;
  background: linear-gradient(to bottom, #ffa54f 0%, #f58220 55%, #d9690d 100%);
  color: #fff;
  font-weight: 700;
  border-color: #d66a10;
  border-bottom-color: #a94d05;
}
.checklist:hover {
  filter: brightness(1.06);
}
.html-action {
  grid-column: 1 / -1;
}
.html-action button,
.html-action {
  width: 100%;
}
.print-btn {
  display: block;
  width: 100%;
  padding: 7px 8px;
  font-size: 12px;
  border: 1px solid #27682a;
  border-bottom: 3px solid #1c4f20;
  border-radius: 6px;
  background: linear-gradient(to bottom, #54a858 0%, #2f7d32 55%, #246628 100%);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 2px 3px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    filter 0.12s ease;
}
.print-btn:hover {
  filter: brightness(1.06);
}
.print-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.18),
    0 1px 1px rgba(0, 0, 0, 0.12);
}
.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.status {
  color: #666;
  margin-top: 8px;
  font-size: 12px;
}
#printArea {
  display: none;
}
.sheet {
  font-family: Arial, sans-serif;
  max-width: 7.65in;
  margin: auto;
  color: #111;
}
.mast {
  border-bottom: 3px solid #111;
  padding: 0 0 9px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
}
.brand {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}
.brand img {
  display: block;
}
.brand img {
  width: 0.5in;
  height: auto;
  max-width: 0.5in;
  object-fit: contain;
  object-position: left center;
}
.masttitle {
  text-align: center;
}
.title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.subtitle {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  margin-top: 3px;
}
.roprint {
  text-align: right;
  font-size: 12px;
  font-weight: 700;
}
.ronum {
  display: inline-block;
  min-width: 1.15in;
  padding-bottom: 2px;
  text-align: left;
}
.roline {
  display: inline-block;
  min-width: 1.15in;
  border-bottom: 1px solid #111;
  padding-bottom: 2px;
  text-align: left;
}
.section {
  margin-top: 8px;
  border: 1px solid #111;
  border-radius: 4px;
  overflow: hidden;
}
.sectitle {
  background: #000 !important;
  color: #fff !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 5px 7px;
}
.info {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.info td {
  padding: 5px 7px;
  border-bottom: 1px solid #111;
}
.info tr:last-child td {
  border-bottom: 0;
}
.label {
  font-size: 10.5px;
  text-transform: uppercase;
  color: #666;
  font-weight: 800;
  width: 16%;
  white-space: nowrap;
}
.value {
  font-weight: 600;
  width: 34%;
  vertical-align: middle;
}
.address-value {
  vertical-align: top;
  white-space: normal;
  line-height: 1.3;
  min-height: 32px;
}
.address-content {
  display: block;
  white-space: normal;
  overflow: visible;
  height: auto;
  max-height: none;
}
.instruction {
  background: #000;
  color: #fff;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  text-align: center;
  font-size: 10.5px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.5px;
  padding: 6px;
  margin: 8px 0;
}
.checkstack {
  display: block;
}
.checksection {
  border: 1px solid #111;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}
.checksection:first-child {
  margin-top: 0;
}
.checkgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}
.additionalgrid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0;
}
.additionalgrid .checkitem {
  border-right: 1px solid #111;
  border-bottom: 0;
}
.additionalgrid .checkitem:last-child {
  border-right: 0;
}
.otherline {
  display: inline-block;
  min-width: 2.35in;
  border-bottom: 1px solid #111;
  margin-left: 6px;
  vertical-align: 2px;
}
.box {
  border: 1px solid #111;
  border-radius: 4px;
  overflow: hidden;
}
.boxtitle {
  background: #000 !important;
  color: #fff !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  padding: 5px 7px;
}
.boxtip {
  font-size: 7.5px;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.3px;
  margin-left: 8px;
  white-space: nowrap;
}
.checkitem {
  padding: 3px 6px;
  font-size: 10.5px;
  border-bottom: 1px solid #111;
  min-height: 18px;
  box-sizing: border-box;
}
.checkgrid .checkitem {
  border-right: 1px solid #111;
}
.checkgrid .checkitem:nth-child(4n) {
  border-right: 0;
}
.checkgrid .checkitem:nth-last-child(-n + 4) {
  border-bottom: 0;
}
.checkitem:last-child {
  border-bottom: 0;
}
.sq {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.3px solid #111;
  vertical-align: -1px;
  margin-right: 6px;
  background: #fff;
}
.sq.checked {
  font-size: 10px;
  font-weight: 900;
  line-height: 9px;
  text-align: center;
  color: #111;
}
.battery-notes {
  padding: 4px 7px 6px;
}
.battery-note-line {
  height: 20px;
  border-bottom: 1px solid #111;
}
.parts {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}
.parts td,
.parts th {
  border-top: 1px solid #111;
  border-right: 1px solid #111;
  padding: 4px 6px;
  height: 23px;
}
.parts tr:first-child th {
  border-top: 0;
}
.parts tr:last-child td {
  border-bottom: 0;
}
.parts td:first-child,
.parts th:first-child {
  border-left: 0;
}
.parts td:last-child,
.parts th:last-child {
  border-right: 0;
}
.parts th {
  background: #000;
  color: #fff;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  text-align: left;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.parts th:nth-child(2) {
  width: 18%;
}
.parts th:nth-child(3) {
  width: 25%;
}
.write {
  color: #555;
}
.notes {
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 7px;
  font-size: 11px;
  line-height: 1.3;
  box-sizing: border-box;
}
.note-entry {
  min-height: 18px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.tech-notes {
  padding: 5px 7px 7px;
}
.tech-note-line {
  height: 20px;
  border-bottom: 1px solid #111;
}
.tech-note-line:last-child {
  margin-bottom: 0;
}
.tower {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}
.tower td {
  border-right: 1px solid #111;
  padding: 6px;
}
.tower td:first-child {
  border-left: 0;
}
.tower td:last-child {
  border-right: 0;
}
.sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 16px;
  padding-top: 5px;
  font-size: 11px;
  font-weight: 700;
}
.sigline {
  display: block;
  border-bottom: 1px solid #111;
  height: 17px;
  margin-top: 3px;
}
.foot {
  font-size: 10px;
  color: #666;
  text-align: right;
  margin-top: 8px;
}
@media (max-width: 700px) {
  .filters {
    grid-template-columns: 1fr;
  }
  .result {
    grid-template-columns: 1fr;
  }
  .actions {
    grid-template-columns: 1fr 1fr;
  }
  .date {
    white-space: normal;
  }
}
@media print {
  body {
    background: #fff;
  }
  .app {
    display: none !important;
  }
  #printArea {
    display: block;
  }
  @page {
    size: letter;
    margin: 0.18in 0.35in 0.25in;
  }
  .sheet {
    max-width: none;
  }
  .section,
  .checksection {
    break-inside: avoid;
  }
  .checkstack,
  .parts,
  .tower,
  .sign {
    break-inside: avoid;
  }
}

/* Floating theme toggle + listing-page dark theme. Print checklist remains light. */
.theme-toggle {
  position: fixed;
  top: 0;
  right: 24px;
  z-index: 1000;
  border-radius: 0 0 9px 9px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
  background: linear-gradient(to bottom, #555 0%, #333 55%, #222 100%);
  color: #fff;
  border: 1px solid #111;
  border-top: 0;
  border-bottom: 3px solid #111;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 3px 8px rgba(0, 0, 0, 0.28);
}
body.dark-theme {
  background: #15181c;
  color: #eef1f4;
}
body.dark-theme .panel {
  background: #22262b;
  border-color: #454b52;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
body.dark-theme h1 {
  color: #f5f6f7;
}
body.dark-theme .search input,
body.dark-theme .filter select,
body.dark-theme .filter input {
  background: #171a1e;
  color: #f3f4f6;
  border-color: #626971;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
body.dark-theme .search input::placeholder {
  color: #9ca3aa;
}
body.dark-theme .filter label,
body.dark-theme .completed-filter,
body.dark-theme .status,
body.dark-theme .date,
body.dark-theme .boat,
body.dark-theme .completed-status {
  color: #c6cbd1;
}
body.dark-theme .result {
  border-top-color: #3c4249;
}
body.dark-theme .result.completed {
  background: #1f3926;
  border-color: #3e7048;
}
body.dark-theme .result.completed .name {
  color: #a9ddb0;
}
body.dark-theme .name {
  color: #f2f4f6;
}
body.dark-theme .secondary {
  background: linear-gradient(to bottom, #666b70 0%, #50555a 55%, #41464b 100%);
  color: #fff;
  border-color: #777d83;
  border-bottom-color: #2f3337;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}
body.dark-theme .completed-filter input,
body.dark-theme .completed-status input {
  accent-color: #69ad70;
}
body.dark-theme .theme-toggle {
  background: linear-gradient(to bottom, #fafafa 0%, #e8e8e8 55%, #d3d3d3 100%);
  color: #17191c;
  border-color: #aaa;
  border-bottom-color: #777;
  text-shadow: 0 1px 0 #fff;
}
@media (max-width: 700px) {
  .theme-toggle {
    right: 10px;
  }
}
@media print {
  .theme-toggle {
    display: none !important;
  }
}
