:root {
  --ink: #101114;
  --muted: #5b616e;
  --line: #d9dee7;
  --paper: #f6f4ef;
  --panel: #ffffff;
  --soft: #eaf2ee;
  --green: #0f7b57;
  --blue: #215ea8;
  --amber: #c67b28;
  --red: #b94b42;
  --shadow: 0 22px 50px rgba(23, 27, 34, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.tool-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(16, 17, 20, 0.1);
  background: rgba(246, 244, 239, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: white;
  background: var(--ink);
  border-radius: 8px;
  font-size: 0.82rem;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ghost-link,
.primary-link,
.button,
.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.primary-link,
.button.primary {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.danger-button {
  border-color: rgba(185, 75, 66, 0.26);
  color: var(--red);
}

.tool-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(300px, 0.55fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: end;
  padding: clamp(38px, 7vw, 78px) clamp(18px, 4vw, 48px) 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 850px;
  margin-bottom: 14px;
  font-size: clamp(2.35rem, 5vw, 5.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 780px;
  color: var(--muted);
  font-size: 1.08rem;
}

.install-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.install-card h2 {
  margin-bottom: 8px;
  font-size: 1.28rem;
}

.install-card ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.install-card li + li {
  margin-top: 6px;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 clamp(18px, 4vw, 48px) 24px;
}

.stat-card {
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.42fr) minmax(420px, 0.8fr);
  gap: 18px;
  align-items: start;
  padding: 0 clamp(18px, 4vw, 48px) clamp(38px, 7vw, 78px);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.item-form,
.generator {
  display: grid;
  gap: 12px;
  padding: 18px;
}

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

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-weight: 820;
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(33, 94, 168, 0.18);
}

.full {
  grid-column: 1 / -1;
}

.button-row,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.filter-row input,
.filter-row select {
  width: auto;
  min-width: 170px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfcfd;
}

.status-pill,
.priority-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: #1f3e33;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.status-pill.warn {
  background: #fff1dc;
  color: #814d0b;
}

.status-pill.done {
  background: #e7f3ee;
  color: var(--green);
}

.status-pill.lost {
  background: #f8e8e6;
  color: var(--red);
}

.row-actions {
  display: flex;
  gap: 8px;
}

.mini-button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 850;
  cursor: pointer;
}

.output-box {
  min-height: 160px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfcfd;
  white-space: pre-wrap;
}

.empty-state {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.tool-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 4vw, 48px);
  color: white;
  background: var(--ink);
}

.notice {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .tool-hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tool-header,
  .header-actions,
  .tool-footer {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 2.45rem;
  }

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

  .filter-row input,
  .filter-row select {
    width: 100%;
  }
}
