:root {
  color: #18221d;
  background: #f4f5ef;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  align-items: center;
  background: #ffffff;
  border: 1px solid #ccd4c7;
  border-radius: 8px;
  color: #18221d;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

button:hover {
  border-color: #7d8a78;
  box-shadow: 0 1px 0 rgba(24, 34, 29, 0.08);
  transform: translateY(-1px);
}

.primary {
  background: #176b4c;
  border-color: #176b4c;
  color: #ffffff;
}

.primary:hover {
  background: #10583d;
  border-color: #10583d;
}

.center-state {
  display: grid;
  gap: 18px;
  min-height: 100vh;
  place-content: center;
  text-align: center;
}

.loading-logo {
  height: 64px;
  margin: 0 auto;
  max-width: 220px;
  object-fit: contain;
}

.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr) minmax(320px, 368px);
  min-height: 100vh;
}

.sidebar,
.detail {
  background: #fbfcf8;
  border-color: #dfe4da;
  padding: 24px;
}

.sidebar {
  border-right: 1px solid #dfe4da;
}

.detail {
  border-left: 1px solid #dfe4da;
  max-height: 100vh;
  overflow: auto;
}

.brand-lockup {
  align-items: center;
  border-bottom: 1px solid #dfe4da;
  display: flex;
  gap: 12px;
  padding-bottom: 24px;
}

.brand-logo {
  display: block;
  height: 52px;
  width: 52px;
  object-fit: contain;
}

.brand-title {
  font-size: 26px;
  line-height: 1;
}

.brand-context {
  color: #667160;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 6px 0 0;
  text-transform: uppercase;
}

.eyebrow {
  color: #667160;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

h2 {
  font-size: 26px;
  line-height: 1.08;
}

h3 {
  font-size: 18px;
  line-height: 1.2;
}

.status-list {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.status-list button {
  justify-content: flex-start;
  min-height: 42px;
  padding: 0 14px;
  text-align: left;
  width: 100%;
}

.status-list button.active {
  background: #e6eee8;
  border-color: #a8b9a8;
  box-shadow: inset 3px 0 0 #176b4c;
  color: #0f3f2d;
  font-weight: 700;
}

.queue {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(244, 245, 239, 0.3) 220px),
    #f4f5ef;
  padding: 32px 28px;
}

.queue-header {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.notice {
  border: 1px solid #dfe4da;
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.notice.error {
  background: #fff2ef;
  border-color: #e6b9b0;
}

.notice.success {
  background: #edf8f0;
  border-color: #a9d6b7;
}

.thread-list {
  display: grid;
  gap: 12px;
}

.thread-card,
.empty-state {
  background: #ffffff;
  border: 1px solid #dfe4da;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(24, 34, 29, 0.05);
}

.thread-card {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 20px;
}

.empty-state {
  padding: 28px;
}

.empty-state p {
  color: #667160;
  margin: 8px 0 0;
}

.requester {
  color: #667160;
  font-weight: 700;
  margin: 0 0 8px;
}

dl {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 16px 0 0;
}

dt {
  color: #667160;
  font-size: 12px;
  line-height: 1.2;
}

dd {
  font-weight: 700;
  margin: 3px 0 0;
}

.thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.draft-link {
  color: #176b4c;
  display: inline-block;
  font-weight: 800;
  margin-top: 14px;
}

form {
  display: grid;
  gap: 18px;
}

.settings-heading {
  border-bottom: 1px solid #dfe4da;
  padding-bottom: 16px;
}

fieldset {
  border: 0;
  border-bottom: 1px solid #dfe4da;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0 0 18px;
}

.policy-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

legend {
  color: #18221d;
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 10px;
  padding: 0;
}

label {
  display: grid;
  gap: 6px;
}

label span,
.connection-row span {
  color: #667160;
  font-size: 12px;
  font-weight: 700;
}

input,
textarea {
  background: #ffffff;
  border: 1px solid #ccd4c7;
  border-radius: 8px;
  color: #18221d;
  min-height: 40px;
  padding: 9px 10px;
  width: 100%;
}

input:focus,
textarea:focus {
  border-color: #176b4c;
  box-shadow: 0 0 0 3px rgba(23, 107, 76, 0.12);
  outline: none;
}

textarea {
  resize: vertical;
}

.connection-row {
  align-items: center;
  background: #f4f5ef;
  border: 1px solid #dfe4da;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
}

.connection-row strong {
  color: #176b4c;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .detail {
    border-left: 0;
    border-top: 1px solid #dfe4da;
    grid-column: 1 / -1;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .detail {
    border: 0;
  }

  .queue {
    padding: 24px 18px;
  }

  .queue-header,
  .thread-card {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar,
  .thread-actions {
    justify-content: flex-start;
  }

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