:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6f8;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 48rem);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1rem;
  display: block;
}

.hero,
.panel {
  width: 100%;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: #52606d;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.05;
}

p {
  color: #3e4c59;
  font-size: 1.125rem;
  line-height: 1.5;
}

.primary-action {
  min-height: 3rem;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: #17202a;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-action {
  min-height: 3rem;
  padding: 0 1.25rem;
  border: 1px solid #9aa5b1;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #17202a;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-panel {
  width: 100%;
}

.stack {
  display: grid;
  gap: 0.875rem;
}

.secondary-form {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #d9e2ec;
}

h2 {
  margin: 0;
  font-size: 1.25rem;
}

label {
  display: grid;
  gap: 0.375rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 3rem;
  padding: 0 0.75rem;
  border: 1px solid #bcccdc;
  border-radius: 0.5rem;
  font: inherit;
}

select {
  min-height: 3rem;
  padding: 0 0.75rem;
  border: 1px solid #bcccdc;
  border-radius: 0.5rem;
  background: #ffffff;
  font: inherit;
}

textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #bcccdc;
  border-radius: 0.5rem;
  font: inherit;
  resize: vertical;
}

.form-error {
  min-height: 1.5rem;
  margin: 0;
  color: #b42318;
  font-size: 0.95rem;
}

.home-root {
  display: grid;
  gap: 1.25rem;
}

.home-top,
.capture-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
}

.search-label {
  flex: 1;
}

.count-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.count-strip div,
.count-strip a {
  padding: 0.875rem;
  border: 1px solid #d9e2ec;
  border-radius: 0.5rem;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
}

.count-strip strong {
  display: block;
  font-size: 1.75rem;
}

.count-strip span {
  color: #52606d;
  font-size: 0.9rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.quick-tile {
  min-height: 5rem;
  padding: 0.75rem;
  border: 1px solid #bcccdc;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #17202a;
  font: inherit;
  text-align: left;
}

.quick-tile-link {
  text-decoration: none;
}

.quick-tile span,
.quick-tile small {
  display: block;
}

.quick-tile span {
  font-weight: 700;
}

.quick-tile small {
  margin-top: 0.25rem;
  color: #52606d;
}

.recent-placeholder {
  padding-bottom: 2rem;
}

.recent-list {
  display: grid;
  gap: 0.625rem;
}

.recent-item {
  padding: 0.875rem;
  border: 1px solid #d9e2ec;
  border-radius: 0.5rem;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
}

.recent-item strong,
.recent-item span {
  display: block;
}

.recent-item span {
  margin-top: 0.25rem;
  color: #52606d;
}

.context-strip {
  min-height: 2.5rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid #d9e2ec;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #52606d;
  font-weight: 700;
}

.capture-context-fields {
  display: grid;
  gap: 0.75rem;
}

.capture-preview {
  min-height: 1rem;
}

.capture-preview img {
  display: block;
  width: 100%;
  max-height: 22rem;
  object-fit: contain;
  border-radius: 0.5rem;
  background: #ffffff;
}

.success-panel {
  display: grid;
  gap: 1rem;
}

.success-actions {
  display: grid;
  gap: 0.75rem;
}

.reminder-create-panel {
  display: grid;
  gap: 0.875rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #d9e2ec;
  border-radius: 0.5rem;
  background: #ffffff;
}

.review-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.review-card {
  display: grid;
  gap: 0.875rem;
  padding: 1rem;
  border: 1px solid #d9e2ec;
  border-radius: 0.5rem;
  background: #ffffff;
}

.review-media,
.preview-box {
  min-height: 6rem;
}

.preview-box {
  display: grid;
  place-items: center;
  border: 1px dashed #bcccdc;
  border-radius: 0.5rem;
  color: #52606d;
}

.review-field {
  grid-template-columns: 1fr;
}

.review-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

pre {
  max-height: 12rem;
  overflow: auto;
  white-space: pre-wrap;
  background: #f4f6f8;
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #d9e2ec;
  background: #ffffff;
}

.dashboard-brand {
  color: #17202a;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.dashboard-nav {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
}

.dashboard-nav a {
  padding: 0.625rem 0.75rem;
  border-radius: 0.375rem;
  color: #3e4c59;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.dashboard-nav a[aria-current='page'] {
  background: #17202a;
  color: #ffffff;
}

.dashboard-main {
  width: min(100%, 76rem);
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  gap: 1.25rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card {
  display: grid;
  gap: 0.375rem;
  min-height: 7rem;
  padding: 1rem;
  border: 1px solid #d9e2ec;
  border-radius: 0.5rem;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
}

.metric-card strong {
  font-size: 2rem;
}

.metric-card span {
  color: #52606d;
}

.dashboard-section {
  display: grid;
  gap: 0.875rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-title a {
  color: #17202a;
  font-weight: 700;
}

.dashboard-list {
  display: grid;
  gap: 0.625rem;
}

.dashboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.875rem;
  border: 1px solid #d9e2ec;
  border-radius: 0.5rem;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
}

.dashboard-row span {
  color: #52606d;
}

.dashboard-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(10rem, 1fr));
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  border: 1px solid #d9e2ec;
  border-radius: 0.5rem;
  background: #ffffff;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #d9e2ec;
  border-radius: 0.5rem;
  background: #ffffff;
}

.records-table {
  width: 100%;
  min-width: 54rem;
  border-collapse: collapse;
}

.records-table th,
.records-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #d9e2ec;
  text-align: left;
  vertical-align: top;
}

.records-table th {
  color: #52606d;
  font-size: 0.875rem;
}

.records-table a {
  color: #17202a;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #eef2f6;
  color: #3e4c59;
  font-size: 0.875rem;
  font-weight: 700;
}

.record-detail-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(24rem, 1.1fr);
  gap: 1.25rem;
  align-items: start;
}

.record-preview,
.record-editor {
  display: grid;
  gap: 1rem;
}

.record-preview {
  position: sticky;
  top: 5rem;
}

.record-preview img,
.record-preview iframe {
  width: 100%;
  min-height: 28rem;
  border: 1px solid #d9e2ec;
  border-radius: 0.5rem;
  background: #ffffff;
  object-fit: contain;
}

.record-preview p {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.record-editor > section,
.record-editor > details,
.record-editor > form {
  padding: 1rem;
  border: 1px solid #d9e2ec;
  border-radius: 0.5rem;
  background: #ffffff;
}

.inline-save {
  grid-template-columns: minmax(8rem, 0.5fr) minmax(12rem, 1fr) auto;
  align-items: end;
}

@media (max-width: 32rem) {
  .capture-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 58rem) {
  .dashboard-header {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-main {
    padding: 1rem;
  }

  .metric-grid,
  .dashboard-filters,
  .record-detail-grid,
  .inline-save {
    grid-template-columns: 1fr;
  }

  .record-preview {
    position: static;
  }

  .record-preview img,
  .record-preview iframe {
    min-height: 18rem;
  }
}
