:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top right, rgba(57, 116, 255, 0.12), transparent 32rem),
    #f5f7fb;
}

button {
  font: inherit;
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 80px;
}

.hero {
  max-width: 780px;
  padding: 40px;
  border: 1px solid #dce3f0;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.08);
}

.eyebrow,
.card-kicker {
  margin: 0 0 12px;
  color: #3569d4;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

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

h1 {
  max-width: 680px;
  margin-bottom: 18px;
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.intro,
.card p,
.card li {
  color: #5f6d85;
  line-height: 1.7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 18px;
}

.button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.button-primary {
  background: #2456ca;
  color: white;
  box-shadow: 0 10px 24px rgba(36, 86, 202, 0.25);
}

.button-secondary {
  border: 1px solid #cbd6e8;
  background: white;
  color: #234a9e;
}

.profile-form {
  margin-top: 22px;
}

.photo-panel {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid #e2e8f2;
}

.photo-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 20px;
}

.photo-preview {
  display: grid;
  place-items: center;
  width: min(100%, 240px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px dashed #b8c7df;
  border-radius: 18px;
  background: #f7f9fd;
}

.photo-preview-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-empty {
  margin: 0;
  padding: 18px;
  color: #71809a;
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: center;
}

.photo-controls {
  min-width: 0;
}

.photo-controls input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd6e8;
  border-radius: 10px;
  background: white;
  color: #34425a;
  font: inherit;
  font-weight: 450;
}

.photo-controls input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 7px 10px;
  border: 1px solid #cbd6e8;
  border-radius: 7px;
  background: #f7f9fd;
  color: #234a9e;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.photo-status {
  min-height: 24px;
  margin: 14px 0 0;
  color: #66748b;
  font-size: 0.88rem;
  line-height: 1.5;
}

.photo-status[data-tone="success"] {
  color: #167448;
}

.photo-status[data-tone="error"] {
  color: #b42318;
}

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

.form-field {
  display: grid;
  gap: 7px;
  color: #34425a;
  font-size: 0.9rem;
  font-weight: 750;
}

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

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid #cbd6e8;
  border-radius: 10px;
  background: white;
  color: #172033;
  font: inherit;
  font-weight: 450;
  line-height: 1.45;
  padding: 11px 12px;
}

.form-field textarea {
  min-height: 108px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: #3569d4;
  outline: 3px solid rgba(53, 105, 212, 0.16);
}

.field-hint {
  margin: 14px 0 0;
  color: #66748b;
  font-size: 0.82rem;
  line-height: 1.5;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.status {
  min-height: 24px;
  margin: 0;
  color: #66748b;
  font-size: 0.94rem;
}

.status[data-tone="success"] {
  color: #167448;
}

.status[data-tone="error"] {
  color: #b42318;
}

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

.card {
  min-width: 0;
  padding: 28px;
  border: 1px solid #dce3f0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.badge {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8efff;
  color: #315bbb;
  font-size: 0.75rem;
  font-weight: 800;
}

.badge-private {
  background: #e8f7ef;
  color: #167448;
}

.output {
  min-height: 100px;
  max-height: 280px;
  overflow: auto;
  margin: 18px 0 0;
  padding: 16px;
  border-radius: 14px;
  background: #172033;
  color: #dce7ff;
  font: 0.82rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #edf1f8;
  color: #254990;
}

.boundary-card {
  grid-column: 1 / -1;
}

.boundary-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 620px);
    padding-top: 20px;
  }

  .hero,
  .card {
    padding: 22px;
    border-radius: 20px;
  }

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

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field-wide {
    grid-column: auto;
  }

  .photo-layout {
    grid-template-columns: 1fr;
  }

  .photo-preview {
    width: min(100%, 260px);
  }

  .boundary-card {
    grid-column: auto;
  }
}

.credential-panel {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid #e2e8f2;
}

.credential-controls {
  margin-top: 20px;
}

.credential-state {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #dce3f0;
  border-radius: 14px;
  background: #f7f9fd;
}

.credential-state p {
  margin: 0;
  color: #34425a;
  font-size: 0.88rem;
  line-height: 1.5;
}

.admin-card {
  grid-column: 1 / -1;
}

.admin-zip-panel {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid #e2e8f2;
}

.admin-zip-state {
  gap: 8px;
}

.admin-zip-state p {
  overflow-wrap: anywhere;
}

.credential-review-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.credential-review-item {
  padding: 18px;
  border: 1px solid #dce3f0;
  border-radius: 16px;
  background: #f9fbff;
}

.credential-review-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.credential-review-heading h3 {
  min-width: 0;
  margin: 0;
  color: #172033;
  font-size: 0.98rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.credential-review-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 16px 0 0;
}

.credential-review-details div {
  min-width: 0;
}

.credential-review-details dt {
  color: #71809a;
  font-size: 0.76rem;
  font-weight: 750;
}

.credential-review-details dd {
  margin: 4px 0 0;
  color: #34425a;
  font-size: 0.86rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-load-more {
  margin-top: 16px;
}

@media (max-width: 720px) {
  .credential-review-details {
    grid-template-columns: 1fr;
  }

  .admin-card {
    grid-column: auto;
  }
}

.chat-card {
  grid-column: 1 / -1;
}

.chat-room-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.chat-room-form .profile-actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  margin-top: 26px;
}

.chat-room-panel,
.chat-conversation-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dce3f0;
  border-radius: 16px;
  background: #f9fbff;
}

.chat-subheading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chat-subheading h3 {
  margin: 0;
  color: #172033;
  font-size: 1rem;
}

.chat-subheading .field-hint {
  margin-top: 5px;
}

.chat-room-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.chat-room-button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #cbd6e8;
  border-radius: 12px;
  background: white;
  color: #234a9e;
  cursor: pointer;
  text-align: left;
}

.chat-room-button:hover,
.chat-room-button:focus-visible {
  border-color: #3569d4;
  outline: 3px solid rgba(53, 105, 212, 0.14);
}

.chat-room-button-active {
  border-color: #3569d4;
  background: #edf3ff;
  box-shadow: inset 4px 0 #3569d4;
}

.chat-room-button-title {
  color: #172033;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.chat-room-button-meta {
  color: #71809a;
  font-size: 0.76rem;
}

.chat-empty {
  margin: 0;
  color: #71809a;
  font-size: 0.86rem;
  line-height: 1.5;
}

.chat-message-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  min-height: 120px;
  overflow: auto;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #dce3f0;
  border-radius: 14px;
  background: white;
}

.chat-message {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 14px;
  background: #edf1f8;
}

.chat-message-mine {
  justify-self: end;
  background: #e2edff;
}

.chat-message-meta {
  margin: 0 0 5px;
  color: #71809a;
  font-size: 0.73rem;
  line-height: 1.35;
}

.chat-message-body {
  margin: 0;
  color: #172033;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-message-form {
  margin-top: 16px;
}

.chat-message-form .profile-actions {
  margin-top: 10px;
}

.chat-card .field-hint[data-tone="success"] {
  color: #167448;
}

.chat-card .field-hint[data-tone="error"] {
  color: #b42318;
}

@media (max-width: 720px) {
  .chat-card {
    grid-column: auto;
  }

  .chat-room-form,
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-room-form .profile-actions {
    grid-column: auto;
  }

  .chat-message {
    max-width: 94%;
  }
}
