:root {
  color-scheme: light;
  --ink: #17201f;
  --muted: #62706c;
  --line: #dce7e2;
  --surface: #ffffff;
  --soft: #f4f8f6;
  --deep: #064c48;
  --green: #0b8f64;
  --gold: #d79b31;
  --danger: #8a2c1b;
  --shadow: 0 24px 70px rgba(15, 47, 43, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

button,
[role="button"] {
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.account-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--deep);
  color: white;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.session-actions span,
p {
  color: var(--muted);
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-action,
.secondary-action,
.danger-action {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 850;
}

.primary-action {
  border: 0;
  background: var(--deep);
  color: white;
  box-shadow: 0 12px 24px rgba(6, 76, 72, 0.2);
}

.primary-action:is(a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.secondary-action {
  color: var(--deep);
  background: white;
  border: 1px solid var(--line);
}

.danger-action {
  color: #8f2c1f;
  background: #fff3ef;
  border: 1px solid #efc6bb;
}

.primary-action:disabled,
.secondary-action:disabled,
.danger-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.account-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(340px, 1.2fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(34px, 6vw, 76px) clamp(18px, 4vw, 54px);
}

.is-signed-in .account-shell {
  grid-template-columns: minmax(0, 1fr);
  max-width: 920px;
  padding-top: clamp(28px, 4vw, 54px);
}

.is-signed-in .intro-panel {
  display: none;
}

.intro-panel h1 {
  max-width: 620px;
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 4.6vw, 5rem);
  line-height: 0.98;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h2,
h3,
p {
  margin-top: 0;
}

.auth-panel,
.dashboard-panel,
.account-form,
.account-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel,
.dashboard-panel {
  padding: clamp(18px, 3vw, 28px);
}

.auth-intro {
  margin-bottom: 16px;
}

.auth-intro h2 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.05;
}

.account-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px;
}

.account-form.compact {
  box-shadow: none;
  margin-bottom: 14px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  color: var(--ink);
  background: #f9fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

textarea {
  min-height: 110px;
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(11, 143, 100, 0.11);
}

.full-span,
.form-actions,
.form-note {
  grid-column: 1 / -1;
}

.form-actions,
.dashboard-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-heading {
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dashboard-panel {
  width: 100%;
}

.profile-summary-form {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 12px;
}

.profile-summary-form .primary-action {
  grid-column: 2 / 4;
  min-width: 160px;
  box-shadow: none;
}

.profile-summary-form label:nth-child(3) {
  grid-column: 1 / 2;
}

.form-note {
  margin: 0;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.55;
}

.success-note {
  color: var(--deep);
  background: #eef8f3;
  border-color: rgba(11, 143, 100, 0.32);
  font-weight: 800;
}

.error-note {
  color: var(--danger);
  background: #fff1ed;
  border-color: rgba(194, 82, 48, 0.32);
  font-weight: 800;
}

.password-panel {
  grid-column: 1 / -1;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.password-panel summary {
  color: var(--deep);
  cursor: pointer;
  font-weight: 850;
}

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

.password-grid button {
  grid-column: 1 / -1;
  width: 100%;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.account-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  box-shadow: none;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title-row h3 {
  margin-bottom: 0;
}

.notification-badge {
  display: inline-grid;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  place-items: center;
  border-radius: 999px;
  background: var(--deep);
  color: white;
  font-size: 0.9rem;
  font-weight: 900;
}

.notification-badge.is-empty {
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
}

.record-list {
  display: grid;
  gap: 8px;
}

.record-list article {
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-item {
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.quote-item:hover,
.quote-item:focus-visible {
  border-color: rgba(11, 143, 100, 0.45);
  box-shadow: 0 12px 24px rgba(6, 76, 72, 0.1);
  outline: none;
  transform: translateY(-1px);
}

.record-list strong,
.record-list span,
.record-list small {
  display: block;
}

.record-list small {
  margin-top: 4px;
  color: var(--muted);
}

.media-list a {
  color: var(--deep);
  font-weight: 850;
}

.profile-tools {
  display: grid;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.profile-tools .primary-action {
  width: 100%;
}

.connected-profile {
  border-color: rgba(11, 143, 100, 0.3) !important;
  background: #eef8f3 !important;
}

.connected-profile strong {
  color: var(--deep);
}

.quote-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.quote-dialog::backdrop {
  background: rgba(12, 31, 29, 0.42);
  backdrop-filter: blur(4px);
}

.quote-dialog-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.quote-dialog-header h2 {
  margin-bottom: 0;
}

.quote-dialog-body {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.quote-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  background: #ecfff7;
  border: 1px solid #94dbc0;
  border-radius: 8px;
}

.quote-actions span {
  display: block;
  margin-bottom: 4px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-actions strong {
  color: var(--deep);
  line-height: 1.45;
}

.quote-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quote-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quote-detail-grid article,
.quote-details-text,
.quote-media-item {
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-detail-grid span,
.quote-details-text span,
.quote-media-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-details-text p {
  margin-bottom: 0;
  color: var(--ink);
  line-height: 1.5;
}

.quote-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quote-media-item {
  display: grid;
  gap: 8px;
}

.quote-media-item img,
.quote-media-item video {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 8px;
  background: #eaf2ef;
}

.quote-media-item a {
  color: var(--deep);
  font-weight: 850;
}

@media (max-width: 920px) {
  .account-shell,
  .account-grid,
  .profile-summary-form {
    grid-template-columns: 1fr;
  }

  .profile-summary-form .primary-action,
  .profile-summary-form label:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .account-topbar,
  .session-actions,
  .account-form,
  .password-grid,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .session-actions button,
  .form-actions button {
    width: 100%;
  }

  .quote-dialog-header,
  .quote-actions,
  .quote-detail-grid,
  .quote-media-grid {
    grid-template-columns: 1fr;
  }

  .quote-dialog-header {
    display: grid;
  }

  .quote-dialog-header button {
    width: 100%;
  }

  .quote-action-buttons {
    justify-content: stretch;
  }

  .quote-action-buttons button {
    width: 100%;
  }
}
