:root {
  --bg: #080b12;
  --surface: #0f1420;
  --surface-2: #151c2b;
  --surface-3: #1b2435;

  --line: #273247;

  --text: #e6edf7;
  --muted: #93a4b8;
  --faint: #65758b;

  --accent: #7dd3fc;
  --accent-2: #a7f3d0;

  --danger: #fb7185;
  --success: #34d399;

  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);

  --radius: 18px;

  --mono:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;

  --sans:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left,
      rgba(125, 211, 252, 0.12),
      transparent 34rem),
    radial-gradient(circle at bottom right,
      rgba(167, 243, 208, 0.08),
      transparent 30rem),
    var(--bg);

  color: var(--text);
  font-family: var(--sans);
}

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

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 40px;

  border: 0;
  border-radius: 999px;

  padding: 0 16px;

  cursor: pointer;

  font-weight: 700;

  color: #04111f;

  background:
    linear-gradient(
      135deg,
      var(--accent),
      var(--accent-2)
    );

  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

button.ghost,
.button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

button.small,
.button.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.icon-button {
  width: 30px;
  height: 30px;
  min-height: 30px;

  padding: 0;

  background: var(--surface-3);
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;

  border: 1px solid var(--line);
  border-radius: 12px;

  padding: 11px 12px;

  outline: none;

  color: var(--text);
  background: rgba(8, 11, 18, 0.72);

  font: inherit;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}

textarea {
  min-height: 520px;

  resize: vertical;

  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
}

label {
  display: block;

  margin: 12px 0 6px;

  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  color: var(--muted);
}

code,
pre {
  font-family: var(--mono);
}

code {
  color: var(--accent);
  overflow-wrap: anywhere;
}

pre {
  overflow: auto;

  padding: 16px;

  border: 1px solid var(--line);
  border-radius: 14px;

  background: #070a11;
  color: var(--text);
}

#appShell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);

  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;

  height: 100vh;

  padding: 20px;

  display: flex;
  flex-direction: column;
  gap: 24px;

  border-right: 1px solid var(--line);

  background: rgba(8, 11, 18, 0.78);

  backdrop-filter: blur(16px);
}

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

.brand-mark {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border-radius: 14px;

  font-weight: 900;

  color: #04111f;

  background:
    linear-gradient(
      135deg,
      var(--accent),
      var(--accent-2)
    );
}

.brand span {
  display: block;

  margin-top: 3px;

  font-size: 12px;

  color: var(--muted);
}

nav {
  display: grid;
  gap: 8px;
}

nav a {
  padding: 10px 12px;

  border-radius: 12px;

  color: var(--muted);

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

nav a:hover,
nav a.active {
  background: var(--surface-2);
  color: var(--text);
}

.main {
  padding:
    28px
    clamp(18px, 4vw, 52px)
    56px;
}

.hero,
.page-head {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(320px, 420px);

  gap: 20px;

  align-items: start;

  margin-bottom: 22px;
}

.page-head {
  grid-template-columns:
    minmax(0, 1fr)
    auto;

  align-items: center;
}

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

h1 {
  margin-bottom: 10px;

  font-size: clamp(32px, 5vw, 58px);

  letter-spacing: -0.065em;
  line-height: 0.95;
}

h2 {
  margin-bottom: 12px;

  font-size: 18px;

  letter-spacing: -0.02em;
}

p {
  color: var(--muted);
  line-height: 1.58;
}

.eyebrow {
  color: var(--accent);

  font-size: 12px;
  font-weight: 800;

  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.045),
      rgba(255, 255, 255, 0.018)
    );

  box-shadow: var(--shadow);
}

.compact-form {
  padding: 18px;
}

.compact-form button {
  width: 100%;
  margin-top: 14px;
}

.grid-list {
  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(260px, 1fr));

  gap: 16px;
}

.card-link {
  position: relative;

  min-height: 170px;

  padding: 18px;

  overflow: hidden;
}

.card-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card-topline,
.card-link h2,
.card-link p,
.card-link code {
  position: relative;
  z-index: 2;
}

.card-topline form,
.icon-button {
  position: relative;
  z-index: 3;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-bottom: 22px;
}

.badge {
  display: inline-flex;
  align-items: center;

  min-height: 28px;

  padding: 0 10px;

  border: 1px solid var(--line);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.025);

  color: var(--muted);

  font-size: 12px;
}

.empty {
  grid-column: 1 / -1;

  display: grid;
  gap: 8px;

  padding: 30px;

  border: 1px dashed var(--line);
  border-radius: var(--radius);

  color: var(--muted);
}

.empty strong {
  color: var(--text);
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 10px;
}

.inline-form label {
  margin: 0 0 6px;
}

.inline-form input {
  min-width: 160px;
}

.table-panel {
  overflow: hidden;
  padding: 0;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  min-height: 62px;

  padding: 16px 18px;

  border-bottom: 1px solid var(--line);
}

.panel-title h2 {
  margin: 0;
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  padding: 14px 18px;

  border-bottom: 1px solid var(--line);

  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);

  font-size: 12px;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td small {
  display: block;

  margin-top: 4px;

  color: var(--muted);
}

.right {
  text-align: right;
}

.notice {
  margin-top: 18px;

  padding: 14px 16px;

  border: 1px solid var(--line);
  border-radius: 14px;
}

.notice.error {
  color: var(--danger);

  border-color: rgba(251, 113, 133, 0.28);

  background: rgba(251, 113, 133, 0.08);
}

.notice.success {
  color: var(--success);

  border-color: rgba(52, 211, 153, 0.28);

  background: rgba(52, 211, 153, 0.08);
}

.editor-grid {
  display: grid;

  grid-template-columns:
    360px
    minmax(0, 1fr);

  gap: 18px;

  align-items: start;

  margin-top: 18px;
}

.editor-form {
  padding-bottom: 18px;
}

.editor-form > label,
.editor-form > input,
.editor-form > textarea,
.editor-form > button {
  width: calc(100% - 36px);

  margin-left: 18px;
  margin-right: 18px;
}

.editor-form > button {
  margin-top: 16px;
}

.editor-form.wide textarea {
  min-height: 620px;
}

.preview-panel {
  overflow: hidden;

  margin-top: 18px;
}

.preview-panel iframe {
  width: 100%;
  min-height: 520px;

  border: 0;

  background: white;
}

@media (max-width: 980px) {
  #appShell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .hero,
  .page-head,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }
}
