:root {
  --bg: #f7f5ef;
  --card: #ffffff;
  --ink: #151922;
  --muted: #667085;
  --line: #e7e1d6;
  --button: #151922;
  --button-text: #ffffff;
  --soft: #f1ece3;
  --success: #0f7a44;
  --danger: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #fffaf0 0, var(--bg) 42%, #f4f2ec 100%);
  color: var(--ink);
}

a { color: inherit; }

.site-shell, .admin-shell {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0;
}

.admin-shell.narrow {
  width: min(460px, calc(100% - 40px));
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.hero {
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .76rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 5.6rem);
  letter-spacing: -0.065em;
  line-height: .92;
}

.hero-copy {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.16rem;
  line-height: 1.6;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tool-card, .panel, .empty-state {
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(32, 27, 18, .07);
}

.tool-card {
  min-height: 250px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tool-icon-wrap {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--soft);
}

.tool-logo {
  max-width: 42px;
  max-height: 42px;
  object-fit: contain;
}

.tool-placeholder {
  font-size: 1.5rem;
  font-weight: 800;
}

.tool-content { flex: 1; }
.tool-content h2 {
  margin: 0 0 8px;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}

.tool-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.tag {
  display: inline-flex;
  margin-top: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: #52483c;
  font-size: .78rem;
  font-weight: 700;
}

.button {
  border: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 11px 15px;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  text-decoration: none;
  font-weight: 750;
  cursor: pointer;
  font-size: .95rem;
}

.button.full { width: 100%; }
.button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.empty-state {
  padding: 32px;
}

.empty-state h2 { margin: 0 0 8px; }
.empty-state p { margin: 0; color: var(--muted); }

.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-header h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.panel {
  padding: 24px;
  margin-bottom: 18px;
}

.panel h1, .panel h2 {
  margin: 0 0 18px;
  letter-spacing: -0.035em;
}

.panel h1 { font-size: 2rem; line-height: 1; }
.panel h2 { font-size: 1.35rem; }

.form-stack, .tool-form {
  display: grid;
  gap: 15px;
}

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

label {
  display: grid;
  gap: 7px;
  font-weight: 750;
  color: #303642;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

textarea { resize: vertical; }

.alert {
  border: 1px solid #fecaca;
  color: var(--danger);
  background: #fff1f2;
  border-radius: 14px;
  padding: 10px 12px;
}

.success {
  border: 1px solid #bbf7d0;
  color: var(--success);
  background: #f0fdf4;
  border-radius: 14px;
  padding: 10px 12px;
}

.table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th, .admin-table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.admin-table th {
  color: var(--muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.muted { color: var(--muted); font-size: .92rem; }
.mini-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--soft);
  padding: 4px;
}

.pill {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  text-transform: capitalize;
}
.pill.published { color: var(--success); background: #ecfdf3; }
.pill.draft { color: #92400e; background: #fffbeb; }

.action-links {
  display: flex;
  align-items: center;
  gap: 10px;
}
.action-links form { margin: 0; }
.link-button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.link-button.danger { color: var(--danger); }
.current-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .site-shell, .admin-shell { width: min(100% - 28px, 1080px); padding: 34px 0; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
}
