:root {
  color-scheme: light;
  --ink: #06111c;
  --muted: #536575;
  --paper: #f4f8fb;
  --panel: rgba(255, 255, 255, 0.9);
  --line: rgba(21, 90, 144, 0.16);
  --accent: #125ea8;
  --accent-strong: #0b436f;
  --gold: #c28b2c;
  --danger: #eb244a;
  --complete: #00d96f;
  --secondary: #eaf2f8;
  --shadow: 0 16px 38px rgba(20, 50, 79, 0.13);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --ink: #ffffff;
  --muted: #b7cada;
  --paper: #05090e;
  --panel: rgba(13, 18, 24, 0.9);
  --line: rgba(79, 186, 255, 0.17);
  --accent: #155a90;
  --accent-strong: #75d7ff;
  --gold: #d9a742;
  --danger: #eb244a;
  --complete: #39ff88;
  --secondary: rgba(11, 22, 33, 0.86);
  --shadow: 0 22px 58px rgba(0, 0, 0, 0.44);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 35%, rgba(91, 198, 255, 0.16), transparent 25rem),
    radial-gradient(circle at 92% 12%, rgba(21, 90, 144, 0.1), transparent 18rem),
    linear-gradient(135deg, #f8fbfe 0%, #edf4fa 52%, #e2edf6 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  scrollbar-gutter: stable;
}

body[data-theme="dark"] {
  background:
    radial-gradient(circle at 50% 35%, rgba(26, 111, 179, 0.22), transparent 26rem),
    radial-gradient(circle at 92% 12%, rgba(67, 169, 255, 0.12), transparent 19rem),
    linear-gradient(135deg, #04080e 0%, #07101b 52%, #020408 100%);
  background-attachment: fixed;
}

body:has(.lock-screen.visible),
body:has(.auth-screen.visible) {
  overflow: hidden;
}

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

button {
  touch-action: manipulation;
}

.app-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(82px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0 18px;
}

.app-brand {
  display: grid;
  grid-template-columns: minmax(128px, 172px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.app-logo {
  width: 100%;
  height: 58px;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  object-fit: contain;
  object-position: left center;
}

body[data-theme="dark"] .app-logo {
  border: 0;
  background: #ffffff;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.8rem;
  line-height: 1.05;
}

h2 {
  font-size: 1rem;
}

.icon-button,
.remove-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
}

.icon-button {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  background: var(--accent);
  color: white;
  font-size: 1.8rem;
  line-height: 1;
  box-shadow: var(--shadow);
}

.menu-icon {
  gap: 5px;
}

.menu-icon span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: white;
}

.menu-panel {
  display: none;
  gap: 8px;
  margin: -6px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 10px;
  box-shadow: var(--shadow);
}

.popup-panel {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 12;
  width: min(432px, calc(100% - 28px));
  transform: translateX(-50%);
  margin: 0;
}

.menu-panel.open {
  display: grid;
}

.popup-title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.popup-options {
  display: grid;
  gap: 8px;
}

.report-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 8px;
}

.report-open-button {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-report-button {
  display: inline-grid;
  place-items: center;
  text-align: center;
  padding-inline: 8px;
}

.copy-report-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-report-button.copied {
  background: var(--complete);
  color: white;
}

.action-icon.copied {
  background: var(--complete);
  color: white;
}

.popup-empty {
  border-radius: 8px;
  background: var(--secondary);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 12px;
}

.menu-item {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--secondary);
  color: var(--accent-strong);
  font-weight: 800;
  text-align: left;
  padding: 0 12px;
}

.menu-item.active {
  background: var(--accent);
  color: white;
}

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

.bottom-nav {
  position: fixed;
  right: 0;
  left: 0;
  bottom: 0;
  z-index: 11;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  width: min(100%, 460px);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -10px 24px rgba(20, 50, 79, 0.12);
  padding: 5px 5px calc(5px + env(safe-area-inset-bottom));
  backdrop-filter: blur(16px);
  transform: translateY(0);
  transition: transform 180ms ease;
  will-change: transform;
}

.bottom-nav.is-hidden {
  transform: translateY(calc(100% + env(safe-area-inset-bottom) + 8px));
}

body[data-theme="dark"] .bottom-nav {
  border-top-color: rgba(91, 198, 255, 0.28);
  background: rgba(5, 9, 13, 0.96);
  box-shadow:
    0 -16px 36px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.bottom-tab {
  display: grid;
  grid-template-rows: 22px 12px;
  gap: 2px;
  min-height: 48px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  min-width: 0;
  padding: 4px 2px;
}

.bottom-tab svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-tab span {
  display: block;
  width: 100%;
  overflow: hidden;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-tab.active {
  border: 1px solid rgba(21, 90, 144, 0.16);
  background: var(--secondary);
  color: var(--accent-strong);
}

body[data-theme="dark"] .bottom-tab.active {
  border: 1px solid rgba(125, 218, 255, 0.56);
  background: #125ea8;
  color: #ffffff;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.34);
}

body[data-theme="dark"] .bottom-tab:not(.active) {
  border: 1px solid rgba(91, 198, 255, 0.12);
  background: rgba(14, 25, 36, 0.7);
  color: #c9d9e7;
}

.app-page {
  display: none;
}

.app-page.active {
  display: block;
}

.lock-screen,
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(248, 251, 254, 0.92), rgba(237, 244, 250, 0.98)),
    url("https://images.unsplash.com/photo-1503387762-592deb58ef4e?auto=format&fit=crop&w=1200&q=80");
  background-position: center;
  background-size: cover;
}

.lock-screen.visible,
.auth-screen.visible {
  display: grid;
}

.lock-panel {
  width: min(100%, 380px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  padding: 18px;
  box-shadow: var(--shadow);
}

.lock-panel h1 {
  margin-bottom: 8px;
}

.lock-panel input {
  margin-top: 14px;
  letter-spacing: 0;
}

#pinInput {
  font-size: 1.2rem;
  text-align: center;
}

.hidden {
  display: none !important;
}

.pin-error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.panel {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(240, 246, 251, 0.78)),
    var(--panel);
  box-shadow: var(--shadow);
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .menu-panel,
body[data-theme="dark"] .lock-panel,
body[data-theme="dark"] .issue-card,
body[data-theme="dark"] .contact-card,
body[data-theme="dark"] .info-card,
body[data-theme="dark"] .empty-state {
  border-color: rgba(91, 198, 255, 0.28);
  background:
    linear-gradient(145deg, rgba(24, 34, 47, 0.98), rgba(8, 13, 21, 0.98)),
    var(--panel);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
}

.community-panel,
.homesite-panel,
.form-panel,
.email-panel,
.settings-panel {
  padding: 14px;
}

.panel-header,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.button-pair {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.card-action-pair {
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.card-action-button {
  display: grid;
  gap: 3px;
  flex: 0 0 54px;
  width: 54px;
  min-width: 0;
  height: 52px;
  min-height: 52px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--secondary);
  color: var(--accent-strong);
  font-size: 0.64rem;
  font-weight: 800;
  padding: 6px 8px;
  text-align: center;
}

body[data-theme="dark"] .card-action-button,
body[data-theme="dark"] .mini-button,
body[data-theme="dark"] .photo-button,
body[data-theme="dark"] .photo-button.secondary,
body[data-theme="dark"] .pdf-button,
body[data-theme="dark"] .action-icon,
body[data-theme="dark"] .secondary-action,
body[data-theme="dark"] .status-button.secondary,
body[data-theme="dark"] .status-button.undo {
  border: 1px solid rgba(125, 218, 255, 0.5);
  background: #125ea8;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32);
}

body[data-theme="dark"] .mini-button.danger,
body[data-theme="dark"] .remove-button {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.card-action-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-action-button span {
  line-height: 1.05;
}

.community-panel .card-action-button,
.homesite-panel .card-action-button {
  flex-basis: 60px;
  width: 60px;
  height: 56px;
  min-height: 56px;
  padding-inline: 4px;
}

.issue-sort {
  display: grid;
  gap: 2px;
  width: 94px;
  min-width: 94px;
  margin-right: auto;
}

.issue-sort span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.issue-sort select {
  min-height: 34px;
  padding: 0 6px;
  font-size: 0.76rem;
}

.homesite-details {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

label,
.field-grid span,
.notes-field span,
.photo-field span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

select,
textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: none;
}

body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] input {
  background: rgba(5, 9, 14, 0.82);
  color: var(--ink);
}

select,
input {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 86px;
  padding: 11px 12px;
}

select:focus,
textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 90, 144, 0.14);
}

.field-grid {
  display: grid;
  gap: 12px;
}

.field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
}

.inline-site-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.inline-site-form label,
.site-custom-field-row {
  display: grid;
  gap: 6px;
}

.site-custom-fields {
  display: grid;
  gap: 8px;
}

.site-custom-field-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 76px;
  align-items: center;
}

.site-form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 8px;
}

.custom-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.mini-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--secondary);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 800;
}

.mini-button.danger {
  color: var(--danger);
}

.field-grid label,
.notes-field,
.photo-field {
  display: grid;
  gap: 6px;
}

.notes-field,
.photo-field {
  margin-top: 12px;
}

.photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.photo-button {
  display: grid;
  min-height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
}

.photo-button.secondary {
  background: var(--secondary);
  color: var(--accent-strong);
}

body[data-theme="dark"] .photo-button.secondary,
body[data-theme="dark"] .menu-item,
body[data-theme="dark"] .mini-button,
body[data-theme="dark"] .pdf-button,
body[data-theme="dark"] .info-grid div {
  background: var(--secondary);
}

body[data-theme="dark"] .menu-item,
body[data-theme="dark"] .info-grid div {
  border: 1px solid rgba(91, 198, 255, 0.2);
  background: rgba(14, 25, 36, 0.92);
}

body[data-theme="dark"] .menu-item.active {
  background: #125ea8;
  color: #ffffff;
}

.hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.photo-preview,
.issue-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.preview-photo,
.issue-photos img {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  aspect-ratio: 1;
  background: var(--secondary);
}

.preview-photo {
  position: relative;
}

.preview-photo img,
.issue-photos img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.preview-photo span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(63, 174, 232, 0.92);
  color: white;
  font-size: 0.76rem;
  font-weight: 800;
}

.primary-button,
.email-button,
.pdf-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

body:not([data-theme="dark"]) .primary-button,
body:not([data-theme="dark"]) .email-button,
body:not([data-theme="dark"]) .photo-button,
body:not([data-theme="dark"]) .card-action-button,
body:not([data-theme="dark"]) .mini-button,
body:not([data-theme="dark"]) .secondary-action,
body:not([data-theme="dark"]) .bottom-tab.active,
body:not([data-theme="dark"]) .menu-item.active,
body:not([data-theme="dark"]) .status-button.secondary,
body:not([data-theme="dark"]) .status-button.undo,
body:not([data-theme="dark"]) .status-button:not(.undo):not(.secondary),
body:not([data-theme="dark"]) .home-group-header,
body:not([data-theme="dark"]) .summary-band div {
  border: 1px solid rgba(21, 90, 144, 0.24);
  background: #125ea8;
  color: #ffffff;
}

body[data-theme="dark"] .primary-button,
body[data-theme="dark"] .email-button,
body[data-theme="dark"] .photo-button,
body[data-theme="dark"] .card-action-button,
body[data-theme="dark"] .mini-button,
body[data-theme="dark"] .pdf-button,
body[data-theme="dark"] .secondary-action,
body[data-theme="dark"] .status-button.secondary,
body[data-theme="dark"] .status-button.undo,
body[data-theme="dark"] .status-button:not(.undo):not(.secondary),
body[data-theme="dark"] .home-group-header,
body[data-theme="dark"] .summary-band div {
  border: 1px solid rgba(125, 218, 255, 0.56);
  background: #125ea8;
  color: #ffffff;
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.34);
}

body[data-theme="dark"] .mini-button.danger,
body[data-theme="dark"] .remove-button {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

body[data-theme="dark"] .summary-band small,
body[data-theme="dark"] .home-group-header span {
  color: rgba(4, 16, 26, 0.74);
}

.primary-button {
  margin-top: 14px;
}

.primary-button,
.email-button,
.pdf-button,
.photo-button,
.status-button:not(.undo):not(.secondary),
.card-action-button,
.mini-button,
.secondary-action,
.bottom-tab.active,
.menu-item.active,
.home-group-header,
.summary-band div {
  color: #ffffff;
}

.primary-button svg,
.email-button svg,
.pdf-button svg,
.photo-button svg,
.status-button:not(.undo):not(.secondary) svg,
.card-action-button svg,
.mini-button svg,
.secondary-action svg,
.bottom-tab.active svg,
.menu-item.active svg {
  color: #ffffff;
  stroke: currentColor;
}

body:not([data-theme="dark"]) .bottom-tab:not(.active) svg,
body:not([data-theme="dark"]) .menu-item:not(.active) svg,
body:not([data-theme="dark"]) .action-icon:not(.email-button):not(.pdf-button) svg {
  color: #0b436f;
  stroke: currentColor;
  stroke-width: 2.4;
}

.action-icon.email-button,
.action-icon.email-button span,
.action-icon.email-button svg,
.action-icon.pdf-button,
.action-icon.pdf-button span,
.action-icon.pdf-button svg {
  color: #ffffff;
  stroke: currentColor;
}

.secondary-action {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  background: var(--secondary);
  color: var(--accent-strong);
  font-weight: 800;
}

.primary-button:active,
.email-button:active,
.pdf-button:active,
.icon-button:active {
  transform: translateY(1px);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 6px 0;
}

.text-button.danger {
  color: var(--danger);
}

body[data-theme="dark"] .text-button {
  border: 1px solid rgba(125, 218, 255, 0.32);
  border-radius: 8px;
  background: rgba(14, 25, 36, 0.82);
  color: #75d7ff;
  padding: 7px 10px;
}

body[data-theme="dark"] .text-button.danger {
  border-color: rgba(255, 132, 111, 0.45);
  background: rgba(74, 23, 18, 0.72);
  color: #ffb0a1;
}

.issue-actions .text-button {
  min-height: 42px;
  padding: 0 4px;
}

.clear-home-button {
  font-size: 0.78rem;
  white-space: nowrap;
}

.settings-actions,
.settings-list {
  display: grid;
  gap: 8px;
}

.settings-section-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.settings-section-title .mini-button {
  min-height: 38px;
}

.settings-select {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 10px;
}

body[data-theme="dark"] .settings-row {
  background: rgba(5, 9, 14, 0.78);
}

.settings-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 700;
}

.settings-row .text-button {
  text-align: right;
}

.summary-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 6px 0 18px;
}

.summary-band div {
  min-height: 78px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
}

.summary-band span {
  font-size: 1.65rem;
  font-weight: 800;
}

.summary-band small {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.issue-section {
  margin-bottom: 14px;
}

.issue-section > .section-title {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(240, 246, 251, 0.78)),
    var(--panel);
  padding: 10px;
  box-shadow: var(--shadow);
}

body[data-theme="dark"] .issue-section > .section-title {
  background:
    linear-gradient(145deg, rgba(24, 34, 47, 0.98), rgba(8, 13, 21, 0.98)),
    var(--panel);
  border-color: rgba(91, 198, 255, 0.28);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
}

.issue-actions {
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 7px;
  margin-left: 0;
  flex: 1;
}

.issue-list {
  display: grid;
  gap: 10px;
}

.home-issue-group {
  display: grid;
  gap: 9px;
}

.home-issue-group + .home-issue-group {
  margin-top: 24px;
}

.home-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent);
  color: white;
  padding: 10px 12px;
  box-shadow: 0 8px 20px rgba(20, 50, 79, 0.1);
}

.home-group-header strong,
.home-group-header span {
  display: block;
}

.home-group-header strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.home-group-header span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
}

.home-group-header b {
  display: grid;
  flex: 0 0 34px;
  min-width: 34px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.88rem;
}

.issue-card {
  display: grid;
  grid-template-columns: 1fr 36px;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-left: 10px solid var(--danger);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(240, 246, 251, 0.78)),
    var(--panel);
  padding: 12px;
  box-shadow: 0 8px 20px rgba(20, 50, 79, 0.1);
}

.issue-card.trade-complete {
  border-left-color: var(--complete);
}

.issue-meta {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.issue-card h3 {
  margin-top: 4px;
  font-size: 1rem;
  line-height: 1.24;
}

.issue-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.issue-card.completed {
  border-left-color: var(--danger);
  opacity: 0.82;
}

.issue-card.completed.trade-complete {
  border-left-color: var(--complete);
}

body[data-theme="dark"] .issue-card,
body[data-theme="dark"] .issue-card.completed {
  border-left-color: var(--danger);
}

body[data-theme="dark"] .issue-card.trade-complete,
body[data-theme="dark"] .issue-card.completed.trade-complete {
  border-left-color: var(--complete);
}

.status-button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  padding: 0 14px;
}

.status-button.undo {
  background: var(--secondary);
  color: var(--accent-strong);
}

.status-button.secondary {
  background: var(--secondary);
  color: var(--accent-strong);
}

.issue-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.trade-complete-label {
  color: var(--complete);
  font-size: 0.84rem;
  font-weight: 800;
}

.shared-note-field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.shared-note-field span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.shared-note-field textarea {
  min-height: 66px;
  resize: vertical;
}

.completed-section {
  margin-top: 18px;
}

.completed-section.minimized .issue-list {
  display: none;
}

.completed-section.empty {
  display: none;
}

.remove-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--danger);
  border-radius: 8px;
  background: var(--danger);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  text-align: center;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.helper {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.email-actions {
  display: grid;
  gap: 10px;
}

.email-row {
  display: grid;
  grid-template-columns: 1fr repeat(4, 42px);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.email-button {
  display: grid;
  place-items: center;
  min-height: 42px;
  text-decoration: none;
  color: #ffffff;
}

.pdf-button {
  min-height: 42px;
  border: 1px solid rgba(21, 90, 144, 0.24);
  background: #125ea8;
  color: #ffffff;
  font-size: 0.8rem;
}

.action-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
}

.issue-actions > .action-icon {
  gap: 2px;
  width: 54px;
  height: 50px;
  min-height: 50px;
  align-content: center;
  padding: 3px 4px;
}

.issue-actions > .action-icon svg {
  width: 18px;
  height: 18px;
}

.issue-actions > .action-icon span {
  display: block;
  max-width: 100%;
  color: inherit;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.action-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.email-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.email-field input {
  min-height: 42px;
  font-size: 0.88rem;
}

.email-button.disabled {
  pointer-events: none;
  background: #a8aaa8;
}

body[data-theme="dark"] .email-button.disabled {
  color: #000000;
}

.contacts-panel,
.contact-form-panel,
.info-panel,
.all-reports-panel {
  padding: 14px;
}

.contact-filter {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.contact-form-panel form {
  display: grid;
  gap: 12px;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.contact-form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.contact-form-grid .wide-field {
  grid-column: 1 / -1;
}

.contact-form-panel .primary-button {
  margin-top: 2px;
}

@media (max-width: 380px) {
  .contact-form-grid {
    grid-template-columns: 1fr;
  }

  .field-with-action,
  .site-custom-field-row,
  .site-form-actions {
    grid-template-columns: 1fr;
  }
}

.info-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.info-filters label {
  display: grid;
  gap: 6px;
}

.count-pill {
  display: inline-grid;
  min-width: 34px;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 0.84rem;
  font-weight: 800;
}

.contact-list,
.homesite-info-list {
  display: grid;
  gap: 10px;
}

.all-report-links {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.all-report-links .menu-item,
.all-report-links .action-icon {
  border: 1px solid rgba(21, 90, 144, 0.24);
  background: #125ea8;
  color: #ffffff;
}

.all-report-links .action-icon svg {
  color: #ffffff;
  stroke: currentColor;
}

.all-report-links .popup-empty {
  grid-column: 1 / -1;
}

.contact-card,
.info-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(240, 246, 251, 0.78)),
    var(--panel);
  padding: 12px;
  box-shadow: 0 8px 20px rgba(20, 50, 79, 0.1);
}

.contact-topline {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-card h2 {
  margin-top: 4px;
}

.info-card h2 {
  margin-top: 4px;
  font-size: 1rem;
  line-height: 1.25;
}

.contact-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.contact-detail {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px;
  margin-top: 9px;
  font-size: 0.9rem;
}

.contact-detail strong {
  color: var(--muted);
}

.contact-detail a {
  color: var(--accent-strong);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.info-grid div {
  border-radius: 8px;
  background: var(--secondary);
  padding: 9px;
}

.info-grid strong,
.info-grid span {
  display: block;
}

.info-grid strong {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.info-grid span {
  margin-top: 3px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

@media (min-width: 430px) {
  .app-shell {
    padding-inline: 22px;
  }
}
