:root {
  --bg: #f4f8f8;
  --surface: #ffffff;
  --surface-soft: #e9f2f2;
  --text: #162323;
  --muted: #486060;
  --accent: #1b7f7a;
  --accent-strong: #0f6762;
  --danger: #a52234;
  --border: #d4e1e1;
  --shadow: 0 18px 40px rgba(20, 58, 56, 0.14);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 0% 0%, #fef9ef 0%, #f4f8f8 55%, #e9f0f0 100%);
}

.board-bg-photo {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
}

.background-shape {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 84% 8%, rgba(41, 179, 168, 0.22), transparent 45%),
    radial-gradient(ellipse at 14% 88%, rgba(255, 168, 84, 0.2), transparent 42%);
}

.page {
  position: relative;
  z-index: 1;
  width: calc(100vw - 1.4rem);
  max-width: none;
  margin: 0.7rem auto 1rem;
}

.panel {
  max-width: 520px;
  margin: 3rem auto;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  animation: fade-in 260ms ease;
}

.landing-panel {
  max-width: 560px;
  display: grid;
  gap: 1rem;
}

.brand-lockup {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.brand-logo {
  width: 110px;
  height: 110px;
  border-radius: 24px;
  box-shadow: 0 10px 24px rgba(13, 68, 64, 0.18);
}

.waitlist-form {
  padding: 0.9rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, #fff);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 6%, #fff);
}

h1,
h2,
h3,
.label {
  font-weight: 600;
}

h1 {
  margin: 0 0 0.4rem;
}

.label {
  font-size: 0.82rem;
  margin: 0;
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.auth-choice {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.auth-choice button {
  width: 100%;
}

.auth-actions {
  display: flex;
  gap: 0.7rem;
}

.auth-actions button {
  flex: 1;
}

.forgot-password {
  display: grid;
  gap: 0.55rem;
}

.forgot-password button {
  justify-self: start;
}

.forgot-password-panel {
  display: grid;
  gap: 0.6rem;
  padding: 0.7rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 34%, #fff);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 7%, #fff);
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
}

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

input,
textarea,
select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  background: #fff;
  color: var(--text);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, #fff);
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 10px;
  padding: 0.65rem 0.95rem;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.97);
}

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

.secondary {
  background: rgba(22, 35, 35, 0.07);
  color: var(--text);
  border: 1px solid rgba(212, 225, 225, 0.7);
}

.danger {
  background: color-mix(in srgb, var(--danger) 18%, #fff);
  color: var(--danger);
}

.error {
  margin: 0;
  color: var(--danger);
}

.hidden {
  display: none !important;
}

.topbar {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  border: 1px solid rgba(212, 225, 225, 0.5);
  box-shadow: 0 1px 3px rgba(20, 58, 56, 0.06);
  padding: 0.75rem 1.1rem;
}

.admin-panel {
  margin-top: 1rem;
  display: grid;
  gap: 0.85rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.admin-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, #f7fcfc);
  padding: 0.75rem;
  display: grid;
  gap: 0.55rem;
}

.admin-card h3 {
  margin: 0;
  font-size: 0.9rem;
}

.admin-card-wide {
  grid-column: 1 / -1;
}

.admin-list {
  display: grid;
  gap: 0.45rem;
  max-height: 220px;
  overflow: auto;
  padding-right: 0.2rem;
}

.admin-list-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem;
  background: #fff;
  display: grid;
  gap: 0.35rem;
}

.admin-list-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.admin-list-item-actions {
  display: flex;
  gap: 0.4rem;
}

.admin-list-item-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.topbar h2 {
  margin: 0.25rem 0 0;
}

.board-name-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.board-name-row h2 {
  cursor: pointer;
}

.board-name-btn {
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
}

.board-name-editor {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.2rem 0 0;
  flex-wrap: wrap;
}

.board-name-editor input {
  min-width: 280px;
}

.topbar-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.save-status {
  font-size: 0.85rem;
  color: var(--muted);
}

.topbar-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.topbar-info .info-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(22, 35, 35, 0.05);
  white-space: nowrap;
  cursor: default;
}

.info-chip .chip-tooltip {
  display: none;
  position: fixed;
  padding: 0.45rem 0.65rem;
  background: rgba(22, 35, 35, 0.92);
  color: #fff;
  font-size: 0.76rem;
  border-radius: 8px;
  white-space: pre-line;
  z-index: 50;
  min-width: 120px;
  max-width: 240px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.info-chip:hover .chip-tooltip {
  display: block;
}

/* More menu (desktop dropdown) */
.more-menu-wrapper {
  position: relative;
}

.more-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.4rem;
  min-width: 220px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 225, 225, 0.6);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(20, 58, 56, 0.12);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 10;
}

.more-menu button.secondary {
  width: 100%;
  text-align: left;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.88rem;
}

.more-menu button.secondary:hover {
  background: rgba(22, 35, 35, 0.06);
}

.more-menu button.danger {
  width: 100%;
  text-align: left;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.88rem;
}

.menu-group-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(22, 35, 35, 0.45);
  padding: 0.4rem 0.7rem 0.1rem;
  margin: 0;
}

.more-menu hr {
  border: none;
  border-top: 1px solid rgba(212, 225, 225, 0.6);
  margin: 0.3rem 0;
}

.confirm-delete-panel {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 8px;
  padding: 0.6rem;
  margin-top: 0.2rem;
}

.confirm-delete-panel p {
  font-size: 0.82rem;
  color: var(--danger);
  margin: 0 0 0.5rem;
}

.confirm-delete-actions {
  display: flex;
  gap: 0.4rem;
}

/* Hamburger button — hidden on desktop */
.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  width: 2.5rem;
  height: 2.5rem;
}

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger-icon {
  position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger-icon::before {
  top: -7px;
}

.hamburger-icon::after {
  top: 7px;
}

.hamburger-btn[aria-expanded="true"] .hamburger-icon {
  background: transparent;
}

.hamburger-btn[aria-expanded="true"] .hamburger-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.hamburger-btn[aria-expanded="true"] .hamburger-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Dot indicators — hidden on desktop */
.list-dots {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0 0.2rem;
}

.list-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.list-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.compact-field {
  display: grid;
  gap: 0.25rem;
  min-width: 220px;
}

.compact-field select {
  min-width: 220px;
}

.new-board-creator {
  display: grid;
  gap: 0.5rem;
  min-width: 280px;
  padding: 0.55rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 36%, #fff);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 7%, #fff);
}

.new-board-creator input {
  width: 100%;
}

.new-board-creator-actions {
  display: flex;
  gap: 0.5rem;
}

.new-board-creator-actions button {
  flex: 1;
}

.share-board-panel {
  display: grid;
  gap: 0.5rem;
  min-width: 280px;
  padding: 0.55rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 36%, #fff);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 7%, #fff);
}

.share-board-panel input {
  width: 100%;
}

.share-board-panel-actions {
  display: flex;
  gap: 0.5rem;
}

.share-board-panel-actions button {
  flex: 1;
}

.ai-background-panel {
  display: grid;
  gap: 0.5rem;
  min-width: 280px;
  padding: 0.55rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 36%, #fff);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 7%, #fff);
}

.ai-background-panel input {
  width: 100%;
}

.ai-background-panel-actions {
  display: flex;
  gap: 0.5rem;
}

.ai-background-panel-actions button {
  flex: 1;
}

.lists {
  margin-top: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  cursor: grab;
  scrollbar-width: none;
}

.lists::-webkit-scrollbar {
  display: none;
}

.lists.panning {
  cursor: grabbing;
}

body.board-panning,
body.board-panning * {
  user-select: none !important;
}

.list {
  flex: 0 0 clamp(280px, 23vw, 320px);
  width: clamp(280px, 23vw, 320px);
  min-width: 280px;
  max-width: 320px;
  min-inline-size: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius);
  border: 1px solid rgba(212, 225, 225, 0.4);
  box-shadow: 0 1px 2px rgba(20, 58, 56, 0.04);
  padding: 0.8rem;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
  gap: 0.45rem;
}

.list-header h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.list-edit-btn {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.list-header:hover .list-edit-btn,
.list-edit-btn:focus-visible {
  opacity: 1;
}

.list-title-input {
  font-size: 0.95rem;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  padding: 0.1rem 0.3rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  outline: none;
}

.list-header-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.card-count {
  white-space: nowrap;
}

.list-sort-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-soft) 70%, #fff);
}

.sort-btn {
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.sort-btn:hover {
  filter: none;
  background: color-mix(in srgb, var(--accent) 18%, #fff);
}

.cards {
  min-height: 50px;
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 0.6rem;
  transition: background-color 0.14s ease;
  border-radius: 10px;
}

.cards.drag-over {
  background: color-mix(in srgb, var(--accent) 9%, #fff);
}

.card {
  position: relative;
  background: #fff;
  border: 1px solid rgba(212, 225, 225, 0.6);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  width: 100%;
  min-width: 0;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background 0.3s ease;
}

.card-cover {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.55rem;
  border: 1px solid var(--border);
}

.card:hover {
  border-color: rgba(27, 127, 122, 0.25);
  box-shadow: 0 2px 8px rgba(20, 58, 56, 0.08);
}

.card.dragging {
  opacity: 0.56;
}

.card-complete-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  display: grid;
  place-items: center;
  z-index: 1;
}

.card:hover .card-complete-btn {
  opacity: 1;
}

.card-complete-btn:hover {
  border-color: var(--accent);
  background: rgba(27, 127, 122, 0.08);
}

.card.completed .card-complete-btn {
  opacity: 1;
  border-color: #2a7f64;
  background: #2a7f64;
}

.card.completed .card-complete-btn::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.card.completed {
  background: linear-gradient(135deg, #f0faf7 0%, #e8f5f0 100%);
  border-color: rgba(42, 127, 100, 0.25);
}

.card.completed .card-title {
  text-decoration: line-through;
  color: var(--muted);
}

.card-title {
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.drop-placeholder {
  height: 68px;
  border: 2px dashed color-mix(in srgb, var(--accent) 48%, #fff);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  pointer-events: none;
}

.list.list-dragging {
  opacity: 0.4;
}

.list-drop-placeholder {
  border: 2px dashed color-mix(in srgb, var(--accent) 48%, #fff);
  background: color-mix(in srgb, var(--accent) 8%, #fff);
  pointer-events: none;
  min-height: 120px;
}

.card-meta {
  margin-top: 0.45rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.badge {
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.76rem;
  background: var(--surface-soft);
  color: var(--muted);
}

.due-badge.due-future {
  background: color-mix(in srgb, #2a7f64 18%, #fff);
  color: #20614e;
}

.due-badge.due-today {
  background: color-mix(in srgb, #d89d29 25%, #fff);
  color: #8a6112;
}

.due-badge.due-overdue {
  background: color-mix(in srgb, var(--danger) 20%, #fff);
  color: #8f1d2c;
}

.priority-badge {
  background: color-mix(in srgb, #d89d29 22%, #fff);
  color: #8a6112;
}

.card.priority {
  border-left: 3px solid #d89d29;
}

.priority-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.priority-toggle input[type="checkbox"] {
  accent-color: #d89d29;
  width: 1rem;
  height: 1rem;
}

.new-card {
  margin-top: 0.7rem;
  width: 100%;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  color: var(--text);
}

.list-creator {
  min-width: 280px;
  max-width: 320px;
  border-style: dashed;
  background: color-mix(in srgb, var(--accent) 5%, #fff);
}

.list-creator-toggle {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--muted);
  border: 1px dashed color-mix(in srgb, var(--accent) 34%, #fff);
}

.list-creator-input {
  width: 100%;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 21, 21, 0.35);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 5;
}

.modal-content {
  width: min(640px, 96vw);
  max-height: 90vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.modal-content * {
  max-width: 100%;
  min-width: 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
}

.modal-header h3 {
  margin: 0;
}

.icon-btn {
  background: transparent;
  font-size: 1.1rem;
  padding: 0.35rem;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.inline-form input {
  flex: 1;
}

.checklist,
.comments {
  display: grid;
  gap: 0.55rem;
}

.card-images {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.55rem;
}

.card-image-item {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem;
  background: #fff;
}

.card-image-item img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 6px;
  background: #f3f7f7;
}

.card-image-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-image-name {
  font-size: 0.82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-editor {
  display: grid;
  gap: 0.55rem;
}

.comment-editor textarea {
  width: 100%;
}

.comment-editor button {
  justify-self: start;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem;
}

.check-item.done span {
  text-decoration: line-through;
  color: var(--muted);
}

.comment {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem;
}

.comment p {
  margin: 0.2rem 0 0;
}

.comment time {
  font-size: 0.78rem;
  color: var(--muted);
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: 1rem;
}

.modal-footer-actions {
  display: flex;
  gap: 0.6rem;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- AI-søk --- */
.ai-search-wrapper {
  flex: 1;
  max-width: 400px;
  min-width: 180px;
  margin: 0 0.6rem;
}

.ai-search-input-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(22, 35, 35, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.1rem 0.3rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ai-search-input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

.ai-search-field {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.45rem 0.5rem;
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
}

.ai-search-submit {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  padding: 0.3rem 0.5rem;
  color: var(--accent);
  cursor: pointer;
  line-height: 1;
}

.ai-search-submit:disabled {
  opacity: 0.4;
  cursor: default;
}

.ai-search-close {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  padding: 0.3rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

/* Results sidebar (desktop: fixed right panel, mobile: overlay) */
.ai-search-results {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(20, 58, 56, 0.10);
  z-index: 6;
  display: flex;
  flex-direction: column;
  animation: slide-in-right 200ms ease;
}

@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.ai-search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ai-search-results-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
  word-break: break-word;
}

.ai-search-results-content .card-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  cursor: pointer;
  font-weight: 500;
}

.ai-search-results-content .card-link:hover {
  text-decoration-style: solid;
}

/* Loading state */
.ai-search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.ai-search-loading-dots {
  display: flex;
  gap: 0.4rem;
}

.ai-search-loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: ai-dot-bounce 1.2s ease-in-out infinite;
}

.ai-search-loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.ai-search-loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes ai-dot-bounce {
  0%, 60%, 100% { opacity: 0.25; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1.1); }
}

.ai-search-footer {
  flex-shrink: 0;
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
}

.ai-search-footer input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
}

.ai-search-footer input:focus {
  border-color: var(--accent);
}

.ai-search-followup-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-size: 0.95rem;
  cursor: pointer;
  line-height: 1;
}

.ai-search-followup-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.ai-chat-user {
  text-align: right;
  margin: 0.8rem 0 0.4rem;
  padding: 0.5rem 0.7rem;
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.ai-chat-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.6rem 0;
}

.ai-search-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 1px;
  animation: blink 0.8s infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@media (max-width: 760px) {
  .page {
    width: calc(100vw - 0.8rem);
    margin-top: 0.4rem;
  }

  .hamburger-btn {
    display: grid;
    place-items: center;
  }

  .topbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }

  .topbar > div:first-child {
    flex: 1;
    min-width: 0;
  }

  .topbar-actions {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
  }

  .topbar-actions.mobile-menu-open {
    display: flex;
  }

  .ai-search-wrapper {
    max-width: 100%;
    min-width: 100%;
    margin: 0;
    display: none;
    order: -1;
  }

  .ai-search-wrapper.mobile-menu-open {
    display: block;
  }

  .ai-search-results {
    width: 100%;
    border-left: none;
    border-radius: 0;
  }

  .more-menu-wrapper {
    position: static;
    width: 100%;
  }

  #moreMenuBtn {
    display: none;
  }

  .more-menu {
    position: static;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: 100%;
    margin-top: 0;
    display: flex !important;
  }

  .auth-choice {
    grid-template-columns: 1fr;
  }

  .auth-actions {
    flex-direction: column;
  }

  .compact-field,
  .compact-field select,
  .new-board-creator,
  .share-board-panel,
  .board-name-editor,
  .board-name-editor input {
    min-width: 100%;
    width: 100%;
  }

  .lists {
    scroll-snap-type: x mandatory;
    gap: 0;
    padding-bottom: 2.5rem;
    cursor: auto;
    -webkit-overflow-scrolling: touch;
    min-height: calc(100vh - 120px);
    min-height: calc(100dvh - 120px);
  }

  .lists.panning {
    cursor: auto;
  }

  .list {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .list-creator {
    flex: 0 0 100%;
    min-width: 100%;
    max-width: 100%;
    scroll-snap-align: start;
  }

  .list-dots {
    display: flex;
    position: fixed;
    bottom: 0.6rem;
    left: 0;
    right: 0;
    z-index: 3;
  }

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

  .modal-content {
    width: 100%;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer-actions {
    justify-content: space-between;
  }
}

/* AI-analyse */
.ai-section {
  margin-bottom: 0.5rem;
}

.ai-analyze-row {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.ai-context-input {
  flex: 1;
  font-size: 0.84rem;
  padding: 0.3rem 0.5rem;
}

.ai-analyze-btn {
  font-size: 0.82rem;
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
}

.ai-loading {
  color: rgba(22, 35, 35, 0.5);
  font-size: 0.85rem;
  padding: 0.3rem 0;
}

/* Sjekkliste med AI */
.check-item-wrapper {
  margin-bottom: 0.2rem;
}

.check-item-actions {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  flex-shrink: 0;
}

.check-ai-btn {
  font-size: 0.72rem !important;
  padding: 0.15rem 0.4rem !important;
  color: var(--accent) !important;
  background: rgba(27, 127, 122, 0.08) !important;
  border-color: rgba(27, 127, 122, 0.18) !important;
}

.check-ai-area {
  margin-left: 1.6rem;
  margin-bottom: 0.4rem;
  padding: 0.4rem 0.5rem;
  background: rgba(27, 127, 122, 0.03);
  border-left: 2px solid rgba(27, 127, 122, 0.15);
  border-radius: 0 8px 8px 0;
}

.ai-solve-panel {
  display: flex;
  gap: 0.3rem;
}

.ai-solve-panel input {
  flex: 1;
  font-size: 0.82rem;
  padding: 0.3rem 0.5rem;
}

.ai-solve-panel button {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  white-space: nowrap;
}

.ai-solve-result {
  margin-top: 0.35rem;
  padding: 0.45rem 0.55rem;
  background: rgba(27, 127, 122, 0.06);
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.ai-suggestion-btn {
  font-size: 0.76rem !important;
  padding: 0.2rem 0.5rem !important;
  border-radius: 20px !important;
  background: rgba(27, 127, 122, 0.08) !important;
  color: var(--accent) !important;
  border-color: rgba(27, 127, 122, 0.2) !important;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ai-suggestion-btn:hover {
  background: rgba(27, 127, 122, 0.16) !important;
}

/* Prioriteringsmodal */
.priorities-modal-content {
  max-width: 520px;
}
