:root {
  --ink: #172026;
  --muted: #5d6a72;
  --paper: #f7f8f4;
  --white: #fff;
  --teal: #1f7f87;
  --teal-dark: #174f5a;
  --line: #d9e2e5;
  --soft: #eef3ef;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, Arial, sans-serif;
}
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card, .panel, .project-editor {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(20, 39, 44, .09);
}
.login-card { width: min(100%, 420px); padding: 28px; }
.login-card img { width: 110px; margin-bottom: 12px; }
h1, h2, h3, h4 { margin: 0 0 16px; }
h3 { margin-top: 28px; color: var(--teal-dark); }
h4 { margin-top: 20px; }
label { display: grid; gap: 7px; margin-bottom: 14px; font-weight: 750; color: var(--muted); }
input, textarea, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfcfa;
  font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
button, .admin-header a, .admin-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
button { margin-top: 10px; }
.hint { color: var(--muted); font-size: 13px; }
.error { color: #a91f1f; font-weight: 800; }
.notice {
  padding: 14px 16px;
  color: #0f5132;
  background: #dff3e8;
  border-radius: 8px;
  font-weight: 800;
}
.admin-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(18px, 4vw, 44px);
  background: rgba(247, 248, 244, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.admin-header div, .admin-header nav { display: flex; align-items: center; gap: 12px; }
.admin-header img { width: 64px; }
.admin-header nav a:last-child { background: #6c757d; }
.admin-main {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
  padding: clamp(18px, 4vw, 44px);
}
.admin-tabs {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 8px;
}
.admin-tabs a {
  justify-content: flex-start;
  color: var(--teal-dark);
  background: var(--white);
  border: 1px solid var(--line);
}
.admin-tabs a.active {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}
.admin-content { display: grid; gap: 18px; min-width: 0; }
.panel { padding: 22px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.repeat-card {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}
details {
  margin: 14px 0;
  border-radius: 8px;
}
summary {
  cursor: pointer;
  padding: 14px 16px;
  color: var(--teal-dark);
  font-weight: 850;
}
.project-editor > .grid,
.project-editor > details,
.project-editor > div {
  padding: 0 16px 16px;
}
.section-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px 16px;
  margin-bottom: 16px;
}
.section-toggles label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 10px;
  background: var(--soft);
  border-radius: 8px;
}
.section-toggles input { width: auto; min-height: auto; }
.json-editor {
  min-height: 620px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.media-grid figure {
  margin: 0;
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
}
.media-grid img {
  width: 100%;
  height: 110px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
}
.media-grid figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
@media (max-width: 980px) {
  .admin-main { grid-template-columns: 1fr; }
  .admin-tabs { position: static; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .grid.two, .grid.four { grid-template-columns: 1fr; }
}
