:root {
  --brand-primary: #008c95;
  --brand-secondary: #111827;
  --bg: #f6fafb;
  --card: #ffffff;
  --ink: #17212b;
  --muted: #64717d;
  --line: #dce7ec;
  --soft: #eef7f8;
}

* { box-sizing: border-box; }

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

a { color: var(--brand-primary); overflow-wrap: anywhere; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  min-width: 0;
}

.topbar {
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-secondary);
  text-decoration: none;
  font-size: 20px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hero {
  padding: 68px 0;
  text-align: center;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--brand-primary), transparent 86%), transparent 34%),
    linear-gradient(180deg, #fff, var(--bg));
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  overflow-wrap: balance;
}

.hero p {
  margin: 0 auto;
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--brand-primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 42px rgba(23,33,43,0.06);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

.card * {
  max-width: 100%;
}

.grid {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.guide-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(285px, 100%), 1fr));
}

.guide-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease;
}

.guide-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 52px rgba(23,33,43,.1);
}

.guide-thumb {
  height: 190px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand-primary), white 72%), #fff);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.guide-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guide-card-body {
  padding: 24px;
  flex: 1;
  min-width: 0;
}

.guide-card small,
.category-pill {
  color: var(--brand-primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
}

.guide-card h3 {
  margin: 8px 0 10px;
  font-size: 22px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.guide-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.58;
}

.read-link {
  color: var(--brand-primary);
  font-weight: 800;
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--brand-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  max-width: 100%;
  text-align: center;
}

.btn:hover {
  background: var(--brand-secondary);
  color: #fff;
}

.btn-secondary {
  background: var(--brand-secondary);
}

.form {
  max-width: 760px;
  margin: 40px auto;
  padding: 28px;
}

label {
  display: block;
  font-weight: 700;
  margin: 14px 0 6px;
}

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

textarea {
  resize: vertical;
}

.alert {
  padding: 13px 15px;
  border-radius: 12px;
  margin: 14px 0;
  background: #fff1f0;
  color: #b42318;
  border: 1px solid rgba(180,35,24,0.22);
  overflow-wrap: anywhere;
}

.success {
  padding: 13px 15px;
  border-radius: 12px;
  margin: 14px 0;
  background: #e9f8ef;
  color: #087443;
  border: 1px solid rgba(8,116,67,0.22);
}

.section {
  padding: 42px 0;
}

.section-card {
  padding: 30px;
  margin-bottom: 24px;
  min-width: 0;
}

.section-card h1,
.section-card h2,
.section-card h3 {
  overflow-wrap: anywhere;
}

.section-card h2 {
  margin-top: 0;
  font-size: 28px;
  letter-spacing: -0.025em;
}

.section-card p,
.section-card li {
  color: var(--muted);
  line-height: 1.75;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.item-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 18px;
  margin-top: 18px;
}

.item-card {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  min-width: 0;
}

.item-card img {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 12px;
}

.footer-contact {
  margin-top: 50px;
  padding: 32px;
  background: var(--brand-secondary);
  color: #fff;
  overflow: hidden;
}

.footer-contact a {
  color: #fff;
}

.footer-contact p {
  color: rgba(255,255,255,.82);
}

.footer-contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr);
  gap: 24px;
  align-items: center;
}

.footer-logo {
  max-height: 74px;
  max-width: 250px;
  margin-bottom: 16px;
  background: rgba(255,255,255,.08);
  border-radius: 12px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #111827;
  color: #fff;
  padding: 24px;
  min-width: 0;
}

.sidebar a {
  color: #fff;
  display: block;
  padding: 8px 0;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.admin-main {
  padding: 30px;
  min-width: 0;
  overflow-x: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  table-layout: auto;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
}

.table code,
code {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.preview-banner {
  background: #fff8e1;
  border-bottom: 1px solid #f1d277;
  color: #5a4300;
  font-size: .92rem;
  padding: 9px 0;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .admin-main {
    padding: 20px;
  }

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

  .hero {
    padding: 48px 0;
  }

  .section-card {
    padding: 22px;
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .table td,
  .table th {
    white-space: normal;
    min-width: 140px;
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 24px, 1120px);
  }

  .form,
  .section-card,
  .footer-contact,
  .guide-card-body {
    padding: 20px;
  }

  .btn {
    width: 100%;
  }
}
