@import url("https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  --bg: #f3f0ea;
  --fg: #1c2430;
  --panel: #ffffff;
  --line: #d8d2c6;
  --accent: #0b5f4b;
  --accent-soft: #d9efe8;
  --muted: #5c6672;
  --danger: #9b2c2c;
  --display: "Libre Baskerville", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.45;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #d9efe8 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #e8dfd0 0%, transparent 50%),
    var(--bg);
}

a { color: inherit; }

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}

.card { width: min(28rem, 100%); }

.eyebrow {
  margin: 0 0 .35rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand, h1, h2 {
  font-family: var(--display);
  font-weight: 700;
  margin: 0 0 .5rem;
  line-height: 1.2;
}

.brand { font-size: 2.2rem; }
.tagline, .muted { color: var(--muted); }

.field, .stack label {
  display: grid;
  gap: .35rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="number"],
input[type="url"],
input:not([type]),
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: .6rem;
  padding: .65rem .75rem;
  font: inherit;
  line-height: 1.35;
  background: #fff;
}

input[type="file"] {
  width: auto;
  max-width: 100%;
  flex: 1 1 16rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  padding: .45rem .6rem;
  font: inherit;
  background: #fff;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: .2rem 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: .6rem;
  padding: .65rem 1rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
}

.btn.ghost {
  background: #fff;
  color: var(--fg);
  border: 1px solid var(--line);
}

.error {
  background: #fdecec;
  color: var(--danger);
  border-radius: .5rem;
  padding: .6rem .75rem;
  margin-bottom: 1rem;
}

.footer-note { font-size: .85rem; color: var(--muted); margin-top: 1rem; }

.top, .wrap {
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 2.25rem 0 1rem;
}

.top .btn { margin-top: .15rem; }

.wrap { display: grid; gap: 1rem; padding-bottom: 3rem; }

.dash {
  grid-template-columns: minmax(0, 1.55fr) minmax(17rem, .9fr);
  align-items: start;
  gap: 1rem;
}

.dash-main,
.dash-side {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.dash-side {
  position: sticky;
  top: 1rem;
}

.agent-list, .jobs {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: .65rem;
}

.agent-list li, .jobs li {
  border: 1px solid var(--line);
  border-radius: .75rem;
  padding: .75rem .85rem;
  display: grid;
  gap: .2rem;
}

.agent-list span { color: var(--muted); font-size: .95rem; }
.agent-list em {
  font-size: .8rem;
  color: var(--muted);
  font-style: normal;
  line-height: 1.35;
}

@media (max-width: 700px) {
  .dash {
    grid-template-columns: 1fr;
  }
  .dash-side {
    position: static;
  }
}

.jobs li {
  padding: 0;
  overflow: hidden;
}

.job-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: .85rem;
  display: grid;
  gap: .25rem;
  cursor: pointer;
}

.job-row:hover,
.job-row[aria-current="true"] {
  background: var(--accent-soft);
}

.jobs code { font-size: .85rem; color: var(--muted); font-style: normal; }

.reply {
  margin-top: 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f7f4ef;
  border-radius: .75rem;
  padding: 1rem;
  font-family: var(--sans);
  line-height: 1.45;
}

.job-detail {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.job-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.job-detail h3, .job-detail h4 {
  font-family: var(--display);
  margin: 0 0 .35rem;
  line-height: 1.2;
}

.job-detail h4 { margin-top: 1rem; font-size: 1rem; }

.job-detail .reply { margin-top: .35rem; }

.upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-top: .75rem;
}

.upload-row .btn {
  flex: 0 0 auto;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.docs {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: .5rem;
}

.doc-item {
  border: 1px solid var(--line);
  border-radius: .75rem;
  padding: .75rem .85rem;
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) auto;
  align-items: center;
  column-gap: .75rem;
  row-gap: .5rem;
}

.doc-item .doc-check {
  width: 1.1rem !important;
  height: 1.1rem !important;
  max-width: 1.1rem;
  margin: 0;
  padding: 0;
  justify-self: center;
}

.doc-meta {
  display: grid;
  gap: .15rem;
  min-width: 0;
  font-weight: 400;
  cursor: pointer;
}

.doc-meta strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
}

.doc-status {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.doc-status[data-status="ready"] { color: var(--accent); }
.doc-status[data-status="error"] { color: var(--danger); }
.doc-status[data-status="extracting"],
.doc-status[data-status="uploaded"] { color: var(--muted); }

@media (max-width: 560px) {
  .doc-item {
    grid-template-columns: 1.25rem minmax(0, 1fr);
  }
  .doc-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}


#tts-player {
  width: 100%;
  margin-top: .75rem;
}

#tts-panel textarea {
  min-height: 7rem;
}

#tts-download-row {
  margin-top: .75rem;
}
