:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --panel: #ffffff;
  --ink: #171a1f;
  --muted: #646b76;
  --line: #d9ddd6;
  --accent: #216869;
  --accent-strong: #164b4c;
  --warn: #a7552b;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  src: url("/fonts/roboto-regular.ttf") format("truetype");
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  src: url("/fonts/roboto-medium.ttf") format("truetype");
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  src: url("/fonts/roboto-bold.ttf") format("truetype");
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 900;
  src: url("/fonts/roboto-black.ttf") format("truetype");
}

* {
  box-sizing: border-box;
}

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

button,
select,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.shell-narrow {
  width: min(920px, calc(100% - 32px));
}

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

.intro-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 0;
  line-height: 1;
}

h2 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.lede {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
}

.install,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.install {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  margin-bottom: 18px;
}

.install p {
  margin-bottom: 0;
  color: var(--muted);
}

pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  border-radius: 6px;
  background: #111820;
  color: #ecf7f7;
  white-space: pre-wrap;
  word-break: break-word;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr);
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
}

.count {
  min-width: 32px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e6efec;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.list {
  display: grid;
}

.list-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfbf8;
}

.list-controls .label {
  margin-bottom: 4px;
}

.item {
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.item:last-child {
  border-bottom: 0;
}

.item:hover,
.item.active {
  background: #eef4f0;
}

.item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.status {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #edf1f4;
  color: #38404a;
  font-size: 0.78rem;
  font-weight: 700;
}

.snippet {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.url,
.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.detail {
  padding: 18px;
}

.empty {
  margin: 0;
  color: var(--muted);
}

.empty-state {
  padding: 18px 16px;
  font-weight: 700;
}

.field {
  margin-bottom: 16px;
}

.label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.value {
  overflow-wrap: anywhere;
}

.selected-text {
  padding: 12px;
  border-left: 4px solid var(--accent);
  background: #f3f6f3;
}

.definition-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 18px 18px 18px 42px;
}

.definition-list li {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfbf8;
}

.definition-list h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.3;
}

.definition-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.definition-list .empty {
  border: 0;
  background: transparent;
}

.pagination {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: #fbfbf8;
}

.page-summary,
.page-current {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.6fr);
  gap: 18px;
  margin-bottom: 18px;
}

.trend-summary {
  padding: 18px;
}

.trend-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trend-pill {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfbf8;
  color: var(--muted);
  font-size: 0.9rem;
}

.trend-pill strong {
  color: var(--accent-strong);
  font-size: 1rem;
}

.trend-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trend-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.trend-list li:last-child {
  border-bottom: 0;
}

.trend-list span {
  overflow-wrap: anywhere;
}

.practice-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.practice-item {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfbf8;
}

.practice-item h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.practice-item p {
  margin: 0;
  color: var(--muted);
}

.practice-item ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}

.practice-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.practice-categories span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #e6efec;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

select {
  min-height: 40px;
  padding: 0 10px;
}

input {
  min-height: 40px;
  padding: 8px 10px;
}

textarea {
  min-height: 120px;
  padding: 10px;
  resize: vertical;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}

button:hover {
  background: var(--accent-strong);
}

.secondary {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary:hover {
  background: #f0f2ee;
}

.button-link.secondary {
  padding: 0 14px;
}

.save-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.save-row button[type="submit"] {
  min-width: 140px;
}

.danger {
  width: 42px;
  min-width: 42px;
  padding: 0;
  background: var(--warn);
  font-size: 1.2rem;
  line-height: 1;
}

.danger:hover {
  background: #7f351b;
}

.feedback {
  color: var(--accent-strong);
  font-size: 0.9rem;
}

.error {
  color: var(--warn);
}

.graphic-shell {
  width: min(1320px, calc(100% - 32px));
  --bg: #2A2354;
  --panel: #352d66;
  --ink: #ffffff;
  --muted: #d8d3f2;
  --line: rgba(255, 255, 255, 0.18);
  --accent: #59D6C7;
  --accent-strong: #59D6C7;
  color: var(--ink);
  font-family: Roboto, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body:has(.graphic-shell) {
  background: #2A2354;
}

.graphic-shell .intro {
  color: var(--ink);
}

.graphic-shell .lede,
.graphic-shell .template-tile span:last-child,
.graphic-shell .label {
  color: var(--muted);
}

.graphic-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.template-tile {
  display: grid;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}

.template-tile:hover {
  border-color: var(--accent);
  background: #403776;
}

.template-tile.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(89, 214, 199, 0.2);
}

.template-tile strong {
  font-size: 1.15rem;
}

.template-tile span:last-child {
  color: var(--muted);
}

.template-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.graphic-builder-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(420px, 1fr);
  gap: 18px;
  align-items: start;
}

.graphic-builder-layout[hidden] {
  display: none;
}

.graphic-controls,
.graphic-preview-panel {
  min-width: 0;
}

.graphic-brand-logo {
  display: block;
  width: min(230px, 100%);
  height: auto;
  margin-bottom: 12px;
}

.graphic-form {
  padding: 18px;
}

.graphic-form input,
.graphic-form textarea {
  border-color: rgba(89, 214, 199, 0.34);
  background: #ffffff;
  color: #1f2937;
}

.graphic-form input::placeholder,
.graphic-form textarea::placeholder {
  color: #6b7280;
}

.graphic-form textarea {
  min-height: 84px;
}

.graphic-preview-wrap {
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: auto;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.06) 75%);
  background-color: #211b45;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

#graphic-preview {
  display: block;
  width: min(100%, 540px);
  height: auto;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(17, 24, 32, 0.16);
}

#flowchart-preview {
  display: block;
  width: min(100%, 540px);
  height: auto;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(17, 24, 32, 0.16);
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 20px, 680px);
    padding: 18px 0;
  }

  .intro,
  .install,
  .layout,
  .practice-grid,
  .graphic-builder-layout,
  .list-controls,
  .form-row {
    grid-template-columns: 1fr;
  }

  .intro {
    display: grid;
    align-items: start;
  }

  .intro-actions {
    align-items: stretch;
  }

  .pagination,
  .page-buttons {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 2.35rem;
  }
}
