:root {
  --paper: #f3efe6;
  --ink: #17211c;
  --muted: #5c6a63;
  --card: #fffcf7;
  --line: #d9d1c3;
  --accent: #0b6b52;
  --accent-2: #c45c26;
  --danger: #9b2c2c;
  --shadow: 0 18px 40px rgba(23, 33, 28, 0.08);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.gate-card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.gate-card { width: min(560px, 100%); padding: 36px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; color: var(--accent); margin: 0 0 8px; font-family: ui-sans-serif, system-ui, sans-serif; }
h1 { font-size: 2rem; line-height: 1.15; margin: 0 0 12px; font-weight: 600; }
h2 { font-size: 1.1rem; margin: 0 0 16px; }
.lede, .muted { color: var(--muted); }
.connection { display: grid; gap: 10px; margin: 20px 0 24px; padding: 0; }
.connection div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.connection dt { color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.8rem; }
.connection dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86rem; word-break: break-all; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.86rem; }
.field span { color: var(--muted); }
.field input, .field select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks { display: grid; gap: 8px; margin: 8px 0 16px; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.9rem; }
.check { display: flex; gap: 8px; align-items: center; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { border-color: var(--line); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.error { color: var(--danger); font-family: ui-sans-serif, system-ui, sans-serif; }

.app { max-width: 1280px; margin: 0 auto; padding: 28px 18px 64px; }
.top { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 24px; flex-wrap: wrap; }
.top-meta { display: flex; gap: 22px; align-items: center; font-family: ui-sans-serif, system-ui, sans-serif; }
.layout { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.panel { padding: 20px; }
.work { display: grid; gap: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.estimate, .logs, .job-list { font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.9rem; }
.estimate { background: #eef6f2; border-radius: 12px; padding: 12px; margin-top: 14px; }
.logs { max-height: 180px; overflow: auto; padding-left: 18px; color: var(--muted); }
.job-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.job-list button { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.88rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.exports { display: flex; gap: 8px; }
.exports button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 10px; cursor: pointer; }
a { color: var(--accent-2); }

@media (max-width: 960px) {
  .layout, .row { grid-template-columns: 1fr; }
}
