:root {
  --page: #dfe0e6;
  --surface: #fbfbf8;
  --surface-2: #f4f5f8;
  --ink: #111111;
  --muted: #65738c;
  --line: #d7d9de;
  --blue: #2457ee;
  --dark: #222222;
  --shadow: 0 14px 34px rgba(17, 24, 39, .08);
  --radius-xl: 34px;
  --radius-lg: 25px;
  --radius-md: 17px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--ink); }
body.dialog-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.site-header { background: var(--page); }
.header-inner { max-width: 1160px; margin: 0 auto; min-height: 86px; padding: 18px 0; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 13px; font-size: 31px; font-weight: 850; letter-spacing: .14em; }
.brand b { display: grid; place-items: center; min-width: 42px; height: 32px; border-radius: 18px; background: var(--surface); font-size: 13px; letter-spacing: 0; }
.language-switch { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.header-inner nav { margin-left: auto; display: flex; gap: 24px; align-items: center; font-size: 15px; }
.header-inner nav a.active { font-weight: 750; }

/* AIPost global header (matchar AppShell topbar/topnav) */
.prompter-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 22px;
}
.prompter-topbar .brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.prompter-topbar .brand-tools {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.prompter-topbar .brand-mark {
  font-family: "Doto", Inter, sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 28px;
}
.prompter-topbar .brand-pill {
  display: inline-flex;
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.prompter-topbar .topnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.prompter-topbar .nav-link {
  position: relative;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 8px 2px;
  text-decoration: none;
  font-size: 14px;
  border-radius: 0;
  box-shadow: none;
}
.prompter-topbar .nav-link:hover { border-bottom-color: rgba(17, 17, 17, 0.35); }
.prompter-topbar .nav-link-active { border-bottom-color: var(--ink); }

.page-shell { max-width: 1160px; margin: 0 auto 72px; }
.beta-banner { display: flex; align-items: center; gap: 16px; min-height: 58px; padding: 12px 18px; border-radius: 18px; background: var(--dark); color: white; box-shadow: var(--shadow); }
.beta-banner span { background: white; color: var(--ink); border-radius: 999px; padding: 7px 13px; font-size: 12px; font-weight: 900; letter-spacing: .13em; }
.beta-banner p { margin: 0; color: #ededed; }

.hero { margin-top: 18px; min-height: 190px; padding: 42px 47px; display: flex; flex-direction: column; justify-content: center; border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); }
.eyebrow { display: block; margin-bottom: 10px; color: #555; font-size: 13px; font-weight: 900; letter-spacing: .14em; }
.eyebrow.blue { color: var(--blue); }
.hero h1 { margin: 0; font-size: clamp(54px, 6vw, 78px); line-height: .98; letter-spacing: -.06em; }
.hero p { margin: 18px 0 0; color: var(--muted); font-size: 19px; }

.browse-panel { margin-top: 18px; padding: 9px; border-radius: 27px; background: var(--surface); box-shadow: var(--shadow); }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-tab { min-height: 54px; border: 1px solid var(--line); border-radius: 19px; background: transparent; font-weight: 800; }
.mode-tab.active { background: var(--dark); color: white; border-color: var(--dark); }
.search-box { margin-top: 16px; min-height: 68px; padding: 0 16px; border: 1px solid var(--line); border-radius: 22px; display: flex; align-items: center; gap: 14px; background: var(--surface); }
.search-box svg { width: 24px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 18px; }
kbd { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; color: var(--muted); background: #f0f1f3; }

.explorer, .catalog { margin-top: 18px; padding: 32px; border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); }
.section-heading, .catalog-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-heading h2, .catalog-header h2 { margin: 0; font-size: clamp(38px, 4vw, 54px); line-height: 1; letter-spacing: -.045em; }
.count-pill { align-self: center; padding: 10px 15px; border: 1px solid var(--line); border-radius: 999px; color: #646464; font-size: 13px; font-weight: 800; background: #f4f4f4; }
.back-button { margin: 22px 0 18px; border: 1px solid var(--line); border-radius: 999px; background: transparent; padding: 10px 16px; font-weight: 800; }

.tree-grid { display: grid; gap: 14px; margin-top: 25px; }
.category-root-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.task-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tree-card { position: relative; min-height: 170px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, #fff, #f8f8f5); text-align: left; overflow: hidden; transition: .18s ease; }
.tree-card:hover, .tree-card.active { transform: translateY(-2px); border-color: var(--ink); box-shadow: 0 10px 24px rgba(0,0,0,.07); }
.tree-number { position: absolute; top: 16px; left: 18px; color: #8d8d8d; font-size: 12px; font-weight: 850; }
.tree-symbol { position: absolute; right: 20px; top: 9px; color: #d1d1cf; font-size: 72px; font-weight: 800; line-height: 1; }
.tree-card strong { position: absolute; left: 20px; right: 50px; bottom: 22px; font-size: 25px; line-height: 1.03; letter-spacing: -.035em; }
.tree-arrow { position: absolute; right: 16px; bottom: 17px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; background: white; }
.tree-card small { position: absolute; left: 20px; bottom: 7px; color: #777; font-size: 11px; opacity: 0; }
.task-card { min-height: 132px; }
.task-card strong { font-size: 24px; }
.task-card small { opacity: 1; bottom: 14px; }
.task-card strong { bottom: 45px; }

.tool-tree { margin-top: 24px; }
.tool-group + .tool-group { margin-top: 28px; }
.tool-group h3 { margin: 0 0 12px; font-size: 22px; }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.tool-card { min-height: 92px; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: white; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; align-items: center; }
.tool-card span { font-weight: 850; font-size: 18px; }
.tool-card small { color: var(--muted); }
.tool-card b { grid-row: 1 / 3; grid-column: 2; font-size: 20px; }
.tool-card:hover, .tool-card.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(36,87,238,.1); }

.catalog { background: #f4f5f8; }
.catalog-header { align-items: center; }
.catalog-header h2 { font-size: 40px; }
.status { margin: 10px 0 0; color: var(--muted); font-size: 17px; }
.catalog-actions { display: flex; gap: 10px; }
.outline-button, .catalog-actions select, .filter-panel select { min-height: 48px; padding: 0 17px; border: 1px solid var(--line); border-radius: 14px; background: white; color: #273249; font-weight: 750; }
.outline-button { display: inline-flex; align-items: center; gap: 10px; }
.outline-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 2; }
.filter-panel { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 14px; background: white; }
.filter-panel label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.text-button { border: 0; background: transparent; color: var(--blue); font-weight: 850; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.active-filters:empty { display: none; }
.active-filters button { border: 0; border-radius: 999px; padding: 10px 14px; background: #e8edff; color: #1644d9; font-weight: 800; }

.prompt-grid { margin-top: 25px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.prompt-card { min-width: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 520px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 5px 13px rgba(17,24,39,.035); }
.prompt-thumb, .prompt-placeholder { height: 220px; margin: 0; background: #e8e9ec; border-bottom: 1px solid var(--line); overflow: hidden; }
.prompt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prompt-placeholder { display: flex; flex-direction: column; gap: 8px; place-items: center; justify-content: center; color: #a7abb5; font-size: 15px; font-weight: 700; background: linear-gradient(160deg, #eef0f3, #e4e6ea); position: relative; }
.prompt-placeholder .placeholder-icon { color: #b8bcc6; }
.prompt-placeholder .placeholder-label { color: #8a8f9a; font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.prompt-placeholder .placeholder-note { color: #b3b7c1; font-size: 12px; font-weight: 600; }
.prompt-card-body { flex: 1; padding: 23px; display: flex; flex-direction: column; }
.card-kicker { display: flex; align-items: center; gap: 8px; }
.card-kicker span, .badge { padding: 8px 11px; border-radius: 999px; background: #e9efff; color: #2450c8; font-size: 12px; font-weight: 850; }
.card-kicker small, .badge.neutral { padding: 8px 11px; border-radius: 999px; background: #f0f1f3; color: #627087; font-size: 12px; font-weight: 800; }
.prompt-card h3 { margin: 20px 0 12px; font-size: 24px; line-height: 1.13; letter-spacing: -.035em; }
.prompt-card p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { margin-top: auto; padding-top: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.card-footer div { display: grid; gap: 3px; }
.card-footer strong { font-size: 13px; }
.card-footer small { color: var(--muted); font-size: 12px; }
.primary-button { border: 0; border-radius: 13px; background: var(--blue); color: white; padding: 14px 18px; font-weight: 850; }
.primary-button.compact { padding: 13px 17px; }
.load-more-wrap { text-align: center; margin-top: 24px; }
.load-more { border: 1px solid var(--line); border-radius: 999px; padding: 13px 24px; background: white; font-weight: 850; }
.empty-state { grid-column: 1 / -1; min-height: 220px; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); }
.empty-state strong { color: var(--ink); font-size: 22px; }

.site-footer { max-width: 1160px; margin: 0 auto; padding: 0 0 42px; display: flex; justify-content: space-between; color: #555; font-size: 13px; }
.site-footer a { text-decoration: underline; }

dialog { width: min(1120px, calc(100vw - 34px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 28px; background: white; box-shadow: 0 40px 100px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(25, 33, 49, .68); backdrop-filter: blur(4px); }
.dialog-shell { position: relative; padding: 38px; overflow: auto; max-height: calc(100vh - 32px); }
.dialog-close { position: absolute; right: 27px; top: 23px; width: 52px; height: 52px; border: 3px solid #1660d8; border-radius: 50%; background: white; color: #46536a; font-size: 34px; line-height: 1; }
.dialog-heading { padding-right: 70px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-heading h2 { margin: 20px 0 12px; font-size: clamp(34px, 4vw, 52px); letter-spacing: -.045em; }
.dialog-heading p { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.5; }
.dialog-image { margin: 25px 0 0; max-height: 420px; overflow: hidden; border-radius: 18px; background: #eee; }
.dialog-image img { width: 100%; max-height: 420px; object-fit: contain; display: block; }
.variable-section, .prompt-preview { margin-top: 28px; }
.variable-section h3, .prompt-preview h3 { margin: 0; font-size: 21px; }
.variable-section > p { color: var(--muted); }
.variable-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.variable-fields label { display: grid; gap: 7px; font-size: 13px; font-weight: 800; }
.variable-fields input { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; }
.prompt-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
#dialogPrompt { width: 100%; min-height: 330px; resize: vertical; padding: 20px; border: 1px solid #cbd4e2; border-radius: 14px; background: #f9fafc; color: #202939; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; line-height: 1.55; }
.dialog-footer { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.dialog-footer div { display: grid; gap: 4px; }
.dialog-footer span { color: var(--muted); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; border-radius: 999px; background: var(--dark); color: white; padding: 12px 18px; font-weight: 800; transition: .2s ease; z-index: 9999; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1180px) {
  .header-inner, .page-shell, .site-footer { width: calc(100% - 36px); }
}
@media (max-width: 920px) {
  .header-inner nav { gap: 12px; }
  .language-switch { display: none; }
  .category-root-grid, .task-grid, .tool-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .prompt-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .filter-panel { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .header-inner { min-height: 70px; }
  .header-inner nav a:not(.active) { display: none; }
  .brand { font-size: 24px; }
  .page-shell { width: calc(100% - 20px); }
  .beta-banner { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .beta-banner p { width: 100%; }
  .hero { padding: 30px 24px; min-height: 160px; }
  .hero h1 { font-size: 48px; }
  .hero p { font-size: 16px; }
  .mode-tabs { grid-template-columns: 1fr; }
  .explorer, .catalog { padding: 22px 16px; border-radius: 25px; }
  .section-heading, .catalog-header { align-items: flex-start; flex-direction: column; }
  .catalog-actions { width: 100%; }
  .catalog-actions > * { flex: 1; }
  .category-root-grid, .task-grid, .tool-grid, .prompt-grid, .variable-fields, .filter-panel { grid-template-columns: 1fr; }
  .tree-card { min-height: 145px; }
  .prompt-card { min-height: 480px; }
  .dialog-shell { padding: 24px 18px; }
  .dialog-close { right: 16px; top: 16px; width: 44px; height: 44px; }
  .dialog-heading { padding-right: 50px; }
  .prompt-preview-header { align-items: flex-start; flex-direction: column; }
  .site-footer { width: calc(100% - 28px); flex-direction: column; gap: 8px; }
}

/* Live v5 – serverrenderade sidor */
:focus-visible { outline: 3px solid rgba(36, 87, 238, .42); outline-offset: 3px; }
.hero.compact { min-height: 160px; }
.hero.compact h1 { font-size: clamp(45px, 5vw, 68px); }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 4px 0; color: #5f6d83; font-size: 14px; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a[aria-current="page"] { color: var(--ink); font-weight: 750; }
.search-box button { min-height: 44px; padding: 0 20px; border: 0; border-radius: 13px; background: var(--blue); color: #fff; font-weight: 850; }
.mode-tab { display: grid; place-items: center; padding: 0 18px; }
.tree-card, .tool-card { color: inherit; text-decoration: none; }
.tool-card:hover { transform: translateY(-2px); }
.prompt-card h2 { margin: 20px 0 12px; font-size: 24px; line-height: 1.13; letter-spacing: -.035em; }
.prompt-card h2 a:hover { color: var(--blue); }
.prompt-placeholder .placeholder-label { text-transform: uppercase; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.pagination { margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.pagination a, .pagination span { min-width: 42px; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; background: #fff; font-weight: 780; }
.pagination a.active, .pagination a[aria-current="page"] { border-color: var(--blue); background: var(--blue); color: #fff; }
.helpful-content, .prompt-detail, .editorial-page { margin-top: 18px; padding: clamp(26px, 5vw, 54px); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); }
.helpful-content h2, .editorial-page h1, .prompt-detail h1 { margin: 0; font-size: clamp(38px, 5vw, 64px); line-height: 1; letter-spacing: -.05em; }
.helpful-content p, .helpful-content li, .editorial-page p, .editorial-page li { color: var(--muted); font-size: 18px; line-height: 1.65; }
.helpful-content ul, .editorial-page ol, .editorial-page ul { padding-left: 24px; }
.editorial-page h2 { margin: 34px 0 8px; font-size: 30px; letter-spacing: -.035em; }
.prompt-detail > header { max-width: 900px; }
.prompt-detail > header p { color: var(--muted); font-size: 20px; line-height: 1.55; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badges span { padding: 8px 12px; border-radius: 999px; background: #e9efff; color: #2450c8; font-size: 12px; font-weight: 850; }
.prompt-detail-image { margin: 28px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #eceef2; }
.prompt-detail-image img { width: 100%; max-height: 620px; object-fit: contain; display: block; }
.variable-section, .prompt-preview, .trust-box { margin-top: 30px; }
.variable-section h2, .prompt-preview h2, .trust-box h2 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.variable-section > p, .trust-box p { color: var(--muted); line-height: 1.6; }
.variable-fields { margin-top: 14px; }
.prompt-preview-header { margin-bottom: 14px; }
#promptText { width: 100%; min-height: 380px; resize: vertical; padding: 22px; border: 1px solid #cbd4e2; border-radius: 16px; background: #f8fafc; color: #202939; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 15px; line-height: 1.62; }
.trust-box { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #f7f7f4; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

@media (min-width: 921px) {
  .prompt-card { content-visibility: auto; contain-intrinsic-size: 520px; }
}

@media (max-width: 640px) {
  .breadcrumbs { padding-left: 2px; font-size: 12px; }
  .search-box { padding: 8px 10px; flex-wrap: wrap; }
  .search-box input { min-height: 44px; flex-basis: calc(100% - 42px); font-size: 16px; }
  .search-box button { width: 100%; }
  .hero.compact h1 { font-size: 42px; }
  .helpful-content, .prompt-detail, .editorial-page { padding: 25px 18px; border-radius: 25px; }
  .prompt-detail > header p { font-size: 17px; }
  #promptText { min-height: 320px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
