:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f6f8f7;
  --text: #162018;
  --muted: #68736c;
  --border: #e2e7e3;
  --border-strong: #cbd5ce;
  --green: #087a46;
  --green-soft: #eef7f2;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 34px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  color: var(--green);
  font-size: 24px;
  font-weight: 760;
  line-height: 1;
}

.brand-sub {
  color: var(--text);
  font-size: 14px;
  font-weight: 620;
  line-height: 1.2;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  color: #3f4b43;
  font-size: 14px;
  font-weight: 560;
}

.nav-link svg,
.search svg,
.external svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.nav-link.active {
  background: var(--surface-soft);
  color: var(--text);
}

.shell {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 54px 32px 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 360px);
  gap: 28px;
  align-items: start;
  margin-bottom: 28px;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: 0;
}

.intro {
  max-width: 480px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 8px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 300px;
  min-width: 240px;
  max-width: 360px;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--border);
}

.site-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background-color 150ms ease;
}

.site-card:hover {
  background: var(--surface-soft);
}

.site-card:focus-visible {
  outline: 3px solid rgba(5, 138, 79, 0.22);
  outline-offset: 3px;
}

.initials {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #cfe1d7;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 680;
  letter-spacing: 0;
}

.site-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 630;
  line-height: 1.25;
}

.site-url {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8b5e28;
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
}

.status::before {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.status.offline::before {
  background: #aeb7c2;
}

.external {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
}

.external:hover {
  background: #e9eeee;
  color: var(--green);
}

.empty {
  margin: 42px 0;
  color: var(--muted);
  font-size: 16px;
}

.export-shell {
  width: min(100%, 780px);
}

.export-hero {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 30px;
}

.export-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid #cfe1d7;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
}

.export-icon svg,
.download-button svg,
.export-note svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.export-hero h1 {
  font-size: clamp(30px, 4vw, 42px);
}

.export-hero .intro {
  max-width: 620px;
  margin-top: 10px;
}

.export-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(22, 32, 24, 0.03);
}

.export-card-heading {
  padding: 25px 26px 20px;
  border-bottom: 1px solid var(--border);
}

.export-card h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
}

.export-card-heading p,
.form-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.export-form {
  padding: 24px 26px 26px;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--text);
  font-size: 14px;
  font-weight: 620;
}

.field input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
}

.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 122, 70, 0.12);
}

.export-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
}

.form-hint {
  max-width: 330px;
  margin: 0;
}

.download-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 43px;
  padding: 0 16px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.download-button:hover {
  border-color: #05643a;
  background: #05643a;
}

.download-button:focus-visible,
.back-link:focus-visible {
  outline: 3px solid rgba(8, 122, 70, 0.24);
  outline-offset: 3px;
}

.download-button:active {
  transform: translateY(1px);
}

.export-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #d9e7de;
  border-radius: 8px;
  background: var(--green-soft);
  color: #456352;
}

.export-note svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  color: var(--green);
}

.export-note p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.error-shell {
  width: min(100%, 660px);
}

.error-shell .export-card {
  padding: 30px;
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--green);
  font-size: 14px;
  font-weight: 650;
}

.search:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 122, 70, 0.12);
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px;
  }

  .brand {
    padding: 0;
  }

  .nav {
    min-height: 0;
    padding: 0;
  }

  .shell {
    padding: 32px 20px 52px;
  }

  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 20px;
  }

  .actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .search {
    max-width: none;
  }

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

  .export-form-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .brand-mark {
    font-size: 22px;
  }

  h1 {
    font-size: 34px;
  }

  .site-card {
    grid-template-columns: 40px minmax(0, 1fr) 34px;
    gap: 10px;
    min-height: 70px;
    padding: 13px 0;
  }

  .site-card > div {
    min-width: 0;
  }

  .initials {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .status {
    grid-column: 2 / 3;
    grid-row: 2;
    align-self: start;
  }

  .external {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
  }

  .topbar {
    padding: 14px 16px;
  }

  .nav-link {
    padding: 0 8px;
  }

  .nav-link svg {
    display: none;
  }

  .export-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .date-fields {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .export-card-heading,
  .export-form {
    padding-right: 20px;
    padding-left: 20px;
  }

  .download-button {
    width: 100%;
  }
}
