:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --surface: #ffffff;
  --line: #d8ded7;
  --text: #1c2321;
  --muted: #66736d;
  --primary: #126c5a;
  --primary-strong: #0b4c40;
  --accent: #c96f32;
  --danger: #a93636;
  --shadow: 0 18px 42px rgb(28 35 33 / 10%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
}

button:hover {
  background: var(--primary-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

button.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--line);
}

button.danger {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, white);
  color: var(--danger);
}

button.danger:hover {
  background: #fff2f2;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0;
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(360px, 1.1fr);
  gap: 22px;
  align-items: start;
}

.workspace {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.topbar,
.section-head,
.page-actions,
.result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  font-size: 20px;
}

.upload {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.drop-zone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 230px;
  border: 1.5px dashed #98aaa2;
  border-radius: 8px;
  background: #fbfcfa;
  text-align: center;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}

.drop-zone.is-dragging {
  border-color: var(--primary);
  background: #eff9f5;
}

.drop-zone input {
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  position: absolute;
}

.drop-title {
  font-size: 28px;
  font-weight: 800;
}

.drop-meta,
.status,
.page-meta,
.count {
  color: var(--muted);
  font-size: 13px;
}

.upload-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

input[type="text"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--text);
}

input[type="text"]:focus {
  outline: 2px solid color-mix(in srgb, var(--primary) 32%, transparent);
  border-color: var(--primary);
}

.result {
  margin-top: 18px;
  padding: 12px;
  background: #f1f7f4;
  border: 1px solid #cce3da;
  border-radius: 8px;
}

.result a {
  color: var(--primary-strong);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.status {
  min-height: 20px;
  margin-top: 14px;
}

.page-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.page-item {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.page-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.page-title:hover {
  color: var(--primary);
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-actions {
  justify-content: flex-start;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
    width: min(100vw - 20px, 620px);
    padding: 18px 0;
  }

  .workspace {
    padding: 18px;
  }

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

  .page-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .result {
    align-items: stretch;
    flex-direction: column;
  }
}
