﻿@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --bg: #f6f2ea;
  --bg-accent: #f1e4d1;
  --ink: #1c1a16;
  --muted: #6f6456;
  --card: #fff9f1;
  --accent: #2b8a7e;
  --accent-2: #d86b4b;
  --accent-3: #2f4b7c;
  --shadow: 0 18px 40px rgba(28, 26, 22, 0.12);
  --radius: 20px;
  --page-gutter: clamp(12px, 1.25vw, 18px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: radial-gradient(circle at top left, #fff7e6, var(--bg)) no-repeat;
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

.app {
  padding: var(--page-gutter) var(--page-gutter) 52px;
}
.site-header {
  position: relative;
  margin-bottom: 18px;
  padding: 14px 12px 12px;
  border: 1px solid #e6d6c2;
  border-radius: 22px;
  background:
    linear-gradient(140deg, rgba(255, 254, 250, 0.92) 0%, rgba(250, 243, 231, 0.94) 58%, rgba(245, 235, 219, 0.9) 100%);
  box-shadow: 0 10px 24px rgba(28, 26, 22, 0.08);
  overflow: hidden;
  isolation: isolate;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 84% 22%, rgba(43, 138, 126, 0.16), transparent 56%),
    radial-gradient(circle at 12% 15%, rgba(216, 107, 75, 0.06), transparent 48%);
  pointer-events: none;
  z-index: 0;
}

.site-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.24) 47%, transparent 73%);
  pointer-events: none;
  z-index: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.topbar > div:first-child {
  flex: 1 1 620px;
  min-width: 0;
  display: grid;
  gap: 10px;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
}
.brand-logo {
  width: clamp(200px, 24vw, 300px);
  height: auto;
  display: block;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 0;
}

.session-name {
  font-family: 'Fraunces', serif;
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 700;
  width: min(760px, 100%);
  max-width: 100%;
  border-bottom: 2px solid var(--accent-2);
  padding: 6px 2px;
  color: var(--ink);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 1 auto;
  min-width: 0;
}
.user-bar-top {
  margin: 0;
}

.btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(28, 26, 22, 0.12);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: #d8c8b2;
  color: var(--ink);
}

.btn-danger {
  background: #d44f3b;
  color: #fff;
  border-color: #b84534;
}

.btn-danger:hover {
  box-shadow: 0 6px 16px rgba(212, 79, 59, 0.26);
}

.layout {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding-right: 4px;
}

.step-pill {
  background: linear-gradient(160deg, #f3e7d5 0%, #f0dfc7 100%);
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #deccb6;
  cursor: pointer;
  transition: 0.2s ease;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  display: block;
  width: 100%;
}

.step-pill-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.step-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid #d8c4ad;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #5a4e42;
  flex: 0 0 auto;
}

.step-pill.active {
  border-color: #bf4f2f;
  background: #fff;
  box-shadow: 0 10px 24px rgba(28, 26, 22, 0.12);
}

.step-pill.locked {
  opacity: 0.72;
}

.step-pill:disabled {
  cursor: not-allowed;
}

.step-pill h4 {
  font-size: 16px;
  margin-bottom: 6px;
}

.step-pill p {
  font-size: 12px;
  color: var(--muted);
}

.stage {
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 14px 30px rgba(28, 26, 22, 0.12);
  min-height: 520px;
  border: 1px solid #eadbc7;
  min-width: 0;
}

.step-view {
  animation: fadeIn 0.4s ease;
}

.about-window .card p {
  font-size: 15px;
  line-height: 1.6;
  color: #4b3f33;
  margin-bottom: 12px;
}
.about-window .card p:last-child {
  margin-bottom: 0;
}
.about-list {
  margin: 8px 0 14px 20px;
  display: grid;
  gap: 6px;
}
.about-list li {
  font-size: 14px;
  line-height: 1.55;
  color: #4b3f33;
}

.admin-inline-shell {
  min-height: 0;
}

.admin-inline-frame {
  width: 100%;
  min-height: 700px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.embedded-admin {
  background: transparent;
}

body.embedded-admin .app {
  padding: 0;
}

body.embedded-admin .topbar {
  display: none;
}

body.embedded-admin .stage {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  min-height: 0;
  padding: 0;
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.step-header h2 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
}

.prompt {
  margin-bottom: 18px;
  color: var(--muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

input[type='text'], textarea, select {
  font-family: 'Space Grotesk', sans-serif;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e0d1bf;
  background: #fff;
  font-size: 14px;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.guideline-groups {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}
.guideline-group {
  display: grid;
  gap: 8px;
}
.guideline-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.guideline-group h3 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  line-height: 1.2;
}
.guideline-group > .prompt {
  margin-bottom: 2px;
}
.guideline-empty {
  margin-top: 4px;
}
.relationship-cluster {
  border: 1px solid #e5d4bf;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf8 0%, #fff7ed 100%);
  padding: 12px;
  margin-top: 8px;
}
.relationship-cluster-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.relationship-cluster-head strong {
  font-size: 16px;
  line-height: 1.3;
}
.relationship-cluster-cards {
  margin-top: 0;
}

.card {
  background: #fff;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #ebdbc8;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 10px rgba(28, 26, 22, 0.05);
}
.guideline-disabled {
  background: #f2f2f2;
  border-color: #d8d3cb;
}
.guideline-disabled .card-top p,
.guideline-disabled .comment-meta,
.guideline-disabled .vote-total {
  color: #70695f;
}
.guideline-disabled .vote-panel {
  background: #ece6dc;
}
.tag-disabled {
  background: #e0dbd2;
  color: #4f4a43;
  font-weight: 700;
}

.card h4 {
  font-size: 16px;
}

.card p {
  font-size: 13px;
  color: var(--muted);
}
.card-section {
  margin-top: 4px;
}
.card-top {
  display: grid;
  gap: 6px;
}
.card-top p {
  margin: 0;
}
.mini-list {
  margin: 8px 0 0;
  padding-left: 0;
  list-style: none;
}
.mini-list li {
  margin: 0;
}
.comment-item {
  border-left: 2px solid #e7d6c2;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #fffcf7;
  border-radius: 0 10px 10px 0;
}
.comment-item-empty {
  color: var(--muted);
}
.comment-body {
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}
.comment-meta {
  font-size: 12px;
  color: var(--muted);
}
.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.inline-form input[type='text'] {
  width: 100%;
  min-width: 0;
  padding: 11px 14px;
}
.inline-form .btn {
  white-space: nowrap;
  padding: 10px 18px;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f4e8db;
  font-size: 11px;
  margin-right: 6px;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.vote {
  background: var(--accent-2);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}

.vote[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.delete {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
}

.matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.export {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 6, 0.35);
  display: grid;
  place-items: center;
}

.export-card {
  background: #fff;
  width: min(860px, 92vw);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.export-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.summary {
  width: 100%;
  min-height: 300px;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #eadbc7;
  font-size: 13px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 14px;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .steps {
    top: 10px;
  }

  .step-pill {
    padding: 12px 10px;
  }

  .step-pill h4 {
    font-size: 14px;
  }

  .step-pill p {
    font-size: 11px;
  }

  .stage {
    padding: 18px;
  }
}

.export[hidden] {
  display: none;
}

.app-disclaimer {
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid #e6d8c6;
  border-radius: 14px;
  background: #fff;
  text-align: center;
}

.app-disclaimer p {
  margin: 0 auto;
  max-width: 980px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.app-disclaimer a {
  color: #1f6e64;
  font-weight: 600;
  text-decoration: none;
}

.app-disclaimer a:hover {
  text-decoration: underline;
}
.intro-shell {
  margin-top: 0;
  position: relative;
  z-index: 1;
}
.institution-picker {
  margin-top: 10px;
  position: relative;
  z-index: 1;
}
.institution-picker-card {
  background: #fffaf4;
  border: 1px solid #e4d4c0;
  border-radius: 18px;
  padding: 16px;
}
.institution-picker-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 24px;
}
.institution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.institution-card {
  border: 1px solid #dcc9b3;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  color: var(--ink);
  text-decoration: none;
  display: grid;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.institution-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(28, 26, 22, 0.1);
  border-color: #bf4f2f;
}
.institution-card.active {
  border-color: #2b8a7e;
  box-shadow: 0 10px 22px rgba(43, 138, 126, 0.15);
}
.institution-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.institution-card-meta {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.institution-card-link {
  font-size: 13px;
  font-weight: 600;
  color: #1f6e64;
}
.map-pill {
  border-color: #8db8d6;
  background: linear-gradient(160deg, #e8f3fb 0%, #dcecf8 100%);
}
.map-pill h4 {
  color: #1e3b55;
}
.map-pill p {
  color: #46627a;
}

.header-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.intro-guide {
  border: 1px solid #e0cfb9;
  background: linear-gradient(160deg, #fffef9 0%, #f7ecde 100%);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 8px 18px rgba(28, 26, 22, 0.08);
  transition: box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}
.intro-guide:hover {
  border-color: #d9c3a6;
  box-shadow: 0 12px 24px rgba(28, 26, 22, 0.1);
}
.intro-guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.intro-guide-header h3 {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  line-height: 1.2;
}
.intro-toggle-btn {
  padding: 8px 12px;
  font-size: 12px;
}
.intro-guide-body {
  max-height: 1200px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  clip-path: inset(0 0 0 0 round 14px);
  transform-origin: top;
  will-change: max-height, opacity, transform, margin-top, clip-path;
  transition:
    max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    margin-top 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    clip-path 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  margin-top: 10px;
}
.intro-guide.collapsed .intro-guide-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  transform: translateY(-10px) scaleY(0.98);
  clip-path: inset(0 0 100% 0 round 14px);
  pointer-events: none;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.guide-card {
  background: #fff;
  border: 1px solid #e7d7c5;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 6px 14px rgba(28, 26, 22, 0.06);
  display: grid;
  gap: 8px;
  align-content: start;
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.28s ease, opacity 0.2s ease;
}
.intro-guide:not(.collapsed) .guide-card {
  animation: guideCardIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--card-index, 0) * 28ms);
}
.intro-guide.collapsed .guide-card {
  transform: translateY(-6px);
  opacity: 0;
}
@keyframes guideCardIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.guide-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.guide-index {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #2b8a7e;
  color: #fff;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.guide-card h4 {
  font-size: 15px;
  line-height: 1.3;
  margin: 0;
}
.guide-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.guide-points {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 3px;
}
.guide-points li {
  font-size: 12px;
  color: #5f5448;
  line-height: 1.4;
}
.strategy-map-viewport {
  --grid-size: 48px;
  --grid-x: 0px;
  --grid-y: 0px;
  position: relative;
  min-height: 620px;
  border: 1px solid #ddccb6;
  border-radius: 18px;
  overflow: hidden;
  background-color: #fffdf8;
  background-image:
    linear-gradient(rgba(180, 162, 141, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 162, 141, 0.18) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  background-position: var(--grid-x) var(--grid-y);
  cursor: grab;
}
.strategy-map-viewport.dragging {
  cursor: grabbing;
}
.strategy-map-viewport.node-dragging {
  cursor: default;
}
.strategy-map-world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}
.strategy-map-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.strategy-map-edge {
  fill: none;
  stroke-width: 2.3;
}
.strategy-map-edge.edge-root {
  stroke: #2b8a7e;
}
.strategy-map-edge.edge-child {
  stroke: #5f7187;
}
.strategy-map-edge.edge-orphan {
  stroke: #bf4f2f;
  stroke-dasharray: 6 6;
}
.strategy-map-node {
  position: absolute;
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 8px 16px rgba(28, 26, 22, 0.08);
}
.strategy-map-node[data-draggable="true"] {
  cursor: move;
}
.institution-node {
  border: 3px solid #1f8a7a;
  background: linear-gradient(165deg, #f4fffb 0%, #e8faf4 100%);
  padding: 16px 18px;
  display: grid;
  gap: 10px;
  align-content: start;
  box-shadow: 0 16px 30px rgba(20, 120, 104, 0.24);
}
.institution-subtitle {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 600;
  color: #266c61;
  margin-top: -1px;
}
.institution-node::before {
  content: 'Institucija';
  justify-self: start;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1e6c61;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #b7ddd5;
  border-radius: 999px;
  padding: 2px 8px;
}
.institution-node.active {
  box-shadow:
    0 0 0 4px rgba(43, 138, 126, 0.24),
    0 20px 36px rgba(20, 120, 104, 0.3);
  animation: institutionPulse 2.1s ease-in-out infinite;
}
.institution-node strong {
  font-family: 'Fraunces', serif;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.015em;
}
@keyframes institutionPulse {
  0% {
    box-shadow:
      0 0 0 2px rgba(43, 138, 126, 0.18),
      0 14px 24px rgba(20, 120, 104, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 7px rgba(43, 138, 126, 0.34),
      0 24px 42px rgba(20, 120, 104, 0.32);
  }
  100% {
    box-shadow:
      0 0 0 2px rgba(43, 138, 126, 0.18),
      0 14px 24px rgba(20, 120, 104, 0.18);
  }
}
.institution-node small {
  font-size: 15px;
  color: var(--muted);
}
.institution-node .tag {
  margin-right: 0;
  align-self: start;
  padding: 5px 14px;
  font-size: 14px;
  font-weight: 700;
}
.institution-cycle-label {
  font-size: 14px;
  font-weight: 600;
  color: #4f645d;
}
.guideline-node {
  border: 1px solid #d8c7b1;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  gap: 7px;
  align-content: start;
}
.guideline-node h4 {
  font-size: 14px;
  line-height: 1.35;
  margin: 0;
}
.guideline-node small {
  font-size: 11px;
  color: var(--muted);
}
.guideline-node.top-score {
  box-shadow: 0 0 0 2px rgba(216, 107, 75, 0.24), 0 10px 20px rgba(28, 26, 22, 0.1);
}
.guideline-node.relation-parent {
  border-left: 5px solid #2b8a7e;
}
.guideline-node.relation-child {
  border-left: 5px solid #2f4b7c;
}
.guideline-node.relation-orphan {
  border-left: 5px solid #d86b4b;
}
.guideline-node.status-disabled {
  background: #f1f1f1;
  border-color: #ccc3b7;
  opacity: 0.85;
}
.map-vote-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.map-vote-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid #dbc8b2;
  padding: 2px 7px;
  font-size: 11px;
  background: #fff8ef;
  color: #55493e;
}
.map-vote-chip.top {
  border-color: #d86b4b;
  background: #fff0e3;
  color: #b6482d;
  font-weight: 700;
}
.map-vote-icon {
  font-size: 10px;
  line-height: 1;
}
.map-vote-squares {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
}
.map-vote-square {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #2b8a7e;
  border: 1px solid #1f766c;
  flex: 0 0 auto;
}
.map-vote-empty {
  font-size: 11px;
  color: #76695b;
}
.checkbox-row {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.card-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: 16px;
  align-items: start;
}
.title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.vote-panel {
  background: #fdf3e7;
  border-radius: 16px;
  padding: 10px 14px;
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: start;
}
.vote-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.vote-panel-body {
  display: grid;
  gap: 6px;
}
.vote-label {
  font-size: 12px;
  color: var(--muted);
}
.vote-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vote-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #1f6e64;
  background: #2b8a7e;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 71, 64, 0.25);
  transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease;
}
.vote-btn[data-action='vote-minus'] {
  border-color: #9a4127;
  background: #c85d3a;
}
.vote-btn:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.vote-btn:disabled {
  opacity: 1;
  border-color: #ddccb8;
  background: #efe5d9;
  color: #a79582;
  box-shadow: none;
  cursor: not-allowed;
}
.vote-score {
  font-size: 18px;
  font-weight: 700;
}
.vote-total {
  font-size: 12px;
  color: var(--muted);
}
.admin-panel {
  border-left: 4px solid var(--accent-2);
}
.admin-tabs-card {
  padding: 12px;
}
.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-tab-btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid #dfccb6;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.admin-tab-btn:hover {
  transform: translateY(-1px);
  border-color: #c8b39a;
}
.admin-tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 16px rgba(43, 138, 126, 0.2);
}
.admin-edit {
  background: #fdf7f1;
  border-radius: 14px;
  padding: 10px 12px;
}
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 6, 0.4);
  display: grid;
  place-items: center;
  z-index: 20;
  pointer-events: auto;
}
.login-overlay[hidden] {
  display: none;
}
.login-card {
  background: #fff;
  padding: 24px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  width: min(420px, 90vw);
  position: relative;
  z-index: 21;
  pointer-events: auto;
}
.login-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.error {
  color: #b33a2b;
  font-size: 13px;
}
.user-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  margin: 8px 0 14px;
  flex-wrap: wrap;
}
.user-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: fit-content;
  min-height: 58px;
  background: linear-gradient(180deg, #f8ecdd 0%, #f2e3cf 100%);
  border: 1px solid #d9c2a8;
  border-radius: 999px;
  padding: 7px 8px;
  flex-wrap: wrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 6px 16px rgba(28, 26, 22, 0.09);
}
.institution-switcher {
  background: #fffefb;
  border: 1px solid #ddc9b0;
  border-radius: 999px;
  min-height: 42px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.institution-switcher > span {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}
.institution-switcher select {
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  width: clamp(160px, 17vw, 230px);
  min-width: 0;
  outline: none;
}
.institution-switcher select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.user-toolbar .btn {
  min-height: 42px;
  padding: 9px 16px;
}
.user-toolbar .btn-ghost {
  background: #fff;
  border-color: #dfccb6;
}
.user-chip {
  min-height: 42px;
  background: #fffefb;
  border: 1px solid #dfccb6;
  border-radius: 999px;
  padding: 7px 12px;
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
}
.step-header-actions {
  justify-content: flex-end;
}
.card.featured {
  border: 3px solid #bf4f2f;
  background: linear-gradient(165deg, #fff4ea 0%, #ffe6d4 100%);
  box-shadow: 0 16px 36px rgba(216, 107, 75, 0.22);
  transform: translateY(-2px);
}
.admin-pill {
  border-color: #bfa78e;
  background: linear-gradient(160deg, #efe3d2 0%, #e7d4bc 100%);
}
.admin-pill h4 {
  color: #4a3b2f;
}
.admin-pill p {
  color: #6f6456;
}
.about-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e3d2be;
  padding: 12px;
  box-shadow: 0 6px 14px rgba(28, 26, 22, 0.06);
}
.about-card h4 {
  margin-bottom: 6px;
  font-size: 15px;
}
.about-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.tag-main {
  background: #bf4f2f;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.muted {
  color: var(--muted);
  font-size: 12px;
  margin-left: 10px;
}
.vote-floating {
  position: fixed;
  left: 20px;
  bottom: 20px;
  top: auto;
  z-index: 25;
  display: block;
}
.vote-floating[hidden] {
  display: none;
}
.vote-floating-toggle {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid #dfccb6;
  background: #fff;
  color: #5c5146;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(28, 26, 22, 0.12);
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}
.vote-floating-inner {
  position: relative;
  width: 190px;
  background: #fff;
  border: 2px solid #e5d7c6;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(28, 26, 22, 0.18);
  overflow: hidden;
  transition: width 0.2s ease, padding 0.2s ease, border-radius 0.2s ease;
}
.vote-floating-content {
  display: grid;
  gap: 10px;
  padding-right: 28px;
  opacity: 1;
  max-width: 100%;
  max-height: 180px;
  transition: opacity 0.16s ease, max-width 0.2s ease, max-height 0.2s ease;
}
.vote-floating.collapsed .vote-floating-inner {
  width: 42px;
  min-height: 42px;
  border-radius: 999px;
  padding: 6px;
}
.vote-floating.collapsed .vote-floating-content {
  opacity: 0;
  max-width: 0;
  max-height: 0;
  pointer-events: none;
}
.vote-floating-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.vote-floating-count {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.vote-burst {
  position: absolute;
  pointer-events: none;
  width: 0;
  height: 0;
  z-index: 40;
}
.vote-burst-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color, #2b8a7e);
  transform: translate(-50%, -50%);
  animation: voteBurst 0.6s ease-out forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes voteBurst {
  from {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.7);
  }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3);
  }
}
@media (max-width: 900px) {
  .card-title {
    grid-template-columns: 1fr;
  }
  .vote-panel {
    width: 100%;
  }
  .inline-form {
    grid-template-columns: 1fr;
  }
  .inline-form .btn {
    width: fit-content;
  }
  .vote-floating {
    left: 10px;
    bottom: 10px;
    top: auto;
  }
  .vote-floating-inner {
    width: min(190px, calc(100vw - 20px));
  }
}

@media (max-width: 1280px) {
  .card-title {
    grid-template-columns: 1fr;
  }

  .vote-panel {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .layout {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
  }

  .step-pill p {
    display: none;
  }

  .step-pill {
    padding: 10px 8px;
  }

  .stage {
    padding: 14px;
  }

  .user-bar {
    justify-content: flex-start;
  }

  .site-header {
    padding: 12px 10px 10px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .user-toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .institution-switcher select {
    width: clamp(120px, 40vw, 210px);
  }

  .card-list {
    grid-template-columns: 1fr;
  }

  .institution-grid {
    grid-template-columns: 1fr;
  }

  .strategy-map-viewport {
    min-height: 520px;
  }
}
