:root {
  color-scheme: light;
  --bg: #f6f8f4;
  --panel: #fffdf8;
  --ink: #1f2a23;
  --muted: #68756d;
  --line: #dfe8de;
  --moss: #356143;
  --moss-soft: #e8f1e7;
  --clay: #c48359;
  --shadow: 0 14px 30px rgba(39, 55, 43, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

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

button {
  border: 0;
  cursor: pointer;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #d5dfd5;
  border-radius: 10px;
  color: var(--ink);
  outline: none;
  padding: 0.72rem 0.82rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7fa283;
  box-shadow: 0 0 0 3px rgba(53, 97, 67, 0.16);
}

textarea {
  resize: vertical;
}

label {
  color: #46564c;
  display: grid;
  font-size: 0.84rem;
  font-weight: 750;
  gap: 0.4rem;
}

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

.app-topbar {
  align-items: center;
  background: #fffdf8;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(180px, 240px) minmax(260px, 1fr) auto auto auto;
  min-height: 68px;
  padding: 0.75rem clamp(0.85rem, 2vw, 1.5rem);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  display: flex;
  gap: 0.7rem;
  min-width: 0;
}

.brand-icon {
  align-items: center;
  background: #f2dfce;
  border: 1px solid #d8b18f;
  border-radius: 12px;
  color: #7d4b2e;
  display: grid;
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 900;
  height: 38px;
  justify-items: center;
  width: 38px;
}

.brand h1 {
  font-size: 1rem;
  line-height: 1.1;
  margin-bottom: 0.1rem;
}

.brand p {
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 0;
}

.top-controls {
  align-items: center;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: minmax(220px, 1fr) 132px;
  justify-self: center;
  max-width: 680px;
  width: 100%;
}

.search-box {
  align-items: center;
  background: #fff;
  border: 1px solid #dce5dc;
  border-radius: 999px;
  display: flex;
  gap: 0.6rem;
  height: 40px;
  padding: 0 0.82rem;
}

.search-box span {
  color: var(--moss);
  font-size: 0.72rem;
  font-weight: 850;
}

.search-box input {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-width: 0;
  padding: 0;
  width: 100%;
}

.top-controls select {
  border-radius: 999px;
  height: 40px;
  padding-block: 0;
}

.view-tabs {
  align-items: center;
  background: var(--moss-soft);
  border: 1px solid #d6e2d4;
  border-radius: 999px;
  display: flex;
  gap: 0.2rem;
  padding: 0.2rem;
}

.view-tabs button,
.new-idea {
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 850;
  height: 34px;
  padding: 0 0.85rem;
  white-space: nowrap;
}

.view-tabs button {
  background: transparent;
  color: #516159;
}

.view-tabs button.active {
  background: #fff;
  box-shadow: 0 5px 14px rgba(39, 55, 43, 0.12);
  color: var(--moss);
}

.new-idea {
  background: var(--moss);
  color: #fff;
}

.account-panel {
  align-items: center;
  display: flex;
  justify-content: flex-end;
}

.avatar,
.account-panel button {
  align-items: center;
  background: #fff;
  border: 1px solid #cad8c9;
  border-radius: 999px;
  color: var(--moss);
  display: grid;
  font-size: 0.75rem;
  font-weight: 900;
  height: 36px;
  justify-items: center;
  width: 36px;
}

.account-menu {
  align-items: center;
  display: flex;
  gap: 0.45rem;
}

.app-main {
  display: grid;
  gap: 0.9rem;
  max-width: 100vw;
  min-width: 0;
  overflow-x: hidden;
  padding: 0.9rem clamp(0.85rem, 2vw, 1.5rem) 1.5rem;
}

.filters-bar {
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 0.45rem;
  max-width: 100%;
  min-width: 0;
  padding: 0.75rem;
}

.filters-bar > div,
.board-shell,
.kanban-board,
.column,
.lane {
  min-width: 0;
}

.filter-label {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-width: 100%;
  min-width: 0;
}

.filter-chip,
.tag {
  background: var(--cat-bg, #eef2f6);
  border: 1px solid var(--cat-ring, #cfd8e3);
  border-radius: 999px;
  color: var(--cat-fg, #475467);
  font-size: 0.73rem;
  font-weight: 800;
}

.filter-chip {
  min-height: 30px;
  padding: 0 0.78rem;
}

.filter-chip.active {
  box-shadow: inset 0 0 0 2px var(--cat-fg, var(--moss));
}

.board-shell {
  max-width: 100%;
  min-width: 0;
  position: relative;
}

.kanban-board {
  align-items: start;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) minmax(240px, 1fr) minmax(220px, 0.9fr) minmax(190px, 0.62fr);
  min-height: calc(100vh - 205px);
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 0.55rem;
  width: 100%;
}

.column {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 0.65rem;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 210px);
  padding: 0.7rem;
}

.column-completed {
  background: #f2f7f1;
}

.column-header {
  align-items: center;
  display: flex;
  gap: 0.42rem;
  min-height: 30px;
}

.lane-dot {
  border-radius: 999px;
  height: 9px;
  width: 9px;
}

.column-header h2 {
  align-items: center;
  display: flex;
  gap: 0.32rem;
  font-size: 0.84rem;
  line-height: 1;
  margin: 0;
}

.lane-icon {
  align-items: center;
  background: #fff;
  border: 1px solid #dde6dd;
  border-radius: 5px;
  display: inline-grid;
  font-size: 0.56rem;
  font-weight: 900;
  height: 17px;
  justify-items: center;
  width: 18px;
}

.lane-icon-lightbulb::before {
  content: "N";
}

.lane-icon-eyes::before {
  content: "R";
}

.lane-icon-rocket::before {
  content: "W";
}

.lane-icon-check::before {
  content: "A";
}

.lane-icon-grid::before {
  content: "✓";
}

.count-pill,
.lane-add {
  align-items: center;
  border-radius: 999px;
  display: grid;
  font-size: 0.72rem;
  font-weight: 900;
  height: 25px;
  justify-items: center;
  min-width: 25px;
}

.count-pill {
  background: #e5eee4;
  color: var(--moss);
}

.lane-add {
  background: var(--moss-soft);
  color: var(--moss);
  margin-left: auto;
}

.lane {
  display: grid;
  gap: 0.65rem;
  min-height: 140px;
}

.lane.drag-over {
  outline: 2px dashed var(--clay);
  outline-offset: 3px;
}

.drop-empty,
.empty-board-note {
  align-items: center;
  border: 1px dashed #c8d6c7;
  border-radius: 12px;
  color: #87948b;
  display: grid;
  font-size: 0.8rem;
  justify-items: center;
  min-height: 130px;
  padding: 1rem;
  text-align: center;
}

.add-column {
  display: none;
}

.masonry-board {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.list-board {
  display: grid;
  gap: 0.65rem;
}

.list-row .idea-card {
  width: 100%;
}

.idea-card {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--cat-ring, #d9b18e) 55%, #e8e1d8);
  border-left: 4px solid var(--cat-ring, #d9b18e);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(39, 55, 43, 0.08);
  color: var(--ink);
  cursor: pointer;
  min-height: 104px;
  overflow: visible;
  padding: 0.8rem;
  position: relative;
}

.column-completed .idea-card {
  border-left-color: #22a06b;
  box-shadow: none;
  min-height: 78px;
  padding: 0.65rem;
}

.column-completed .idea-image,
.column-completed .idea-text,
.column-completed details,
.column-completed .tags {
  display: none;
}

.column-completed .idea-card h3::before {
  color: #22a06b;
  content: "✓ ";
}

.idea-card.dragging {
  opacity: 0.45;
}

.card-tools {
  align-items: center;
  display: flex;
  gap: 0.32rem;
  position: absolute;
  right: 0.7rem;
  top: 0.72rem;
  z-index: 2;
}

.priority-dot {
  background: var(--cat-fg, var(--clay));
  border-radius: 999px;
  height: 8px;
  width: 8px;
}

.card-tools button {
  background: transparent;
  color: #66736c;
  font-weight: 900;
  height: 20px;
  line-height: 1;
  padding: 0;
}

.card-menu {
  background: #fff;
  border: 1px solid #d8deeb;
  border-radius: 10px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
  color: #101828;
  display: grid;
  gap: 0.25rem;
  min-width: 170px;
  padding: 0.55rem;
  position: absolute;
  right: 0;
  top: 1.4rem;
  z-index: 4;
}

.card-menu strong {
  color: #667085;
  font-size: 0.68rem;
  padding: 0.2rem 0.35rem;
  text-transform: uppercase;
}

.card-menu button {
  background: transparent;
  border-radius: 7px;
  color: #344054;
  font-size: 0.78rem;
  height: auto;
  padding: 0.42rem 0.45rem;
  text-align: left;
}

.card-menu button:hover:not(:disabled) {
  background: #f3f5fb;
}

.card-menu button:disabled {
  color: #98a2b3;
  cursor: default;
}

.card-menu .danger {
  color: #b42318;
}

.idea-image {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  cursor: zoom-in;
  display: block;
  margin-bottom: 0.65rem;
  object-fit: cover;
  width: 100%;
}

.idea-body {
  display: grid;
  gap: 0.48rem;
}

.idea-card h3 {
  color: #26312a;
  font-size: 0.96rem;
  line-height: 1.24;
  margin: 0;
  max-width: calc(100% - 44px);
}

.idea-text {
  color: #53635a;
  display: -webkit-box;
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.tag {
  padding: 0.22rem 0.55rem;
}

.idea-footer {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  margin-top: 0.1rem;
}

.author-pill {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 0.35rem;
  min-width: 0;
}

.author-pill .initial {
  align-items: center;
  background: #e4eee3;
  border: 1px solid #c6d6c5;
  border-radius: 999px;
  color: var(--moss);
  display: grid;
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 900;
  height: 20px;
  justify-items: center;
  width: 20px;
}

.author-pill span:last-child {
  color: #718078;
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idea-footer button {
  background: #f5f7f2;
  border: 1px solid #e1e8df;
  border-radius: 999px;
  color: #5c6b62;
  font-size: 0.72rem;
  padding: 0.2rem 0.42rem;
}

.idea-footer button.active {
  background: #e6f4ef;
  color: #176b52;
  font-weight: 900;
}

details {
  border-top: 1px solid #ece8df;
  margin-top: 0.18rem;
  padding-top: 0.48rem;
}

summary {
  color: #546259;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 850;
}

.comments {
  display: grid;
  gap: 0.45rem;
  margin: 0.55rem 0;
}

.comment {
  background: #f8f6ef;
  border-radius: 8px;
  padding: 0.55rem;
}

.comment strong,
.comment p {
  font-size: 0.72rem;
  margin: 0;
}

.comment strong {
  display: block;
  margin-bottom: 0.18rem;
}

.comment-form {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: 1fr auto;
}

.comment-form input {
  border-radius: 9px;
  font-size: 0.76rem;
  min-width: 0;
  padding: 0.48rem 0.55rem;
}

.comment-form button {
  background: var(--moss);
  border-radius: 9px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 850;
  padding: 0 0.65rem;
}

.auth-popover {
  background: #fff;
  border: 1px solid #dce6dd;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: none;
  left: clamp(0.85rem, 2vw, 1.5rem);
  max-width: 320px;
  padding: 1rem;
  position: fixed;
  top: 78px;
  z-index: 20;
}

.auth-popover.visible {
  display: block;
}

.auth-tabs {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 0.85rem;
}

.auth-tabs button,
.stack button {
  background: var(--moss-soft);
  border-radius: 10px;
  color: var(--ink);
  font-weight: 850;
  min-height: 42px;
  padding: 0 0.9rem;
}

.auth-tabs button.active,
.stack button[type="submit"] {
  background: var(--moss);
  color: #fff;
}

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

.message,
.composer-message {
  color: #b42318;
  font-size: 0.82rem;
  margin: 0;
}

.composer-message.success {
  color: #176b52;
}

.overlay,
.detail-overlay,
.image-lightbox {
  background: rgba(16, 23, 18, 0.72);
  display: grid;
  inset: 0;
  padding: clamp(0.75rem, 3vw, 2rem);
  position: fixed;
  z-index: 30;
}

.overlay {
  align-items: center;
  justify-items: center;
}

.composer {
  background: #fff;
  border: 1px solid #d8ded6;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  max-height: 92vh;
  max-width: 540px;
  overflow: auto;
  padding: 1rem;
  width: min(540px, 100%);
}

.composer-heading {
  align-items: start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.composer-heading p {
  color: var(--clay);
  font-size: 0.72rem;
  font-weight: 900;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.composer-heading h2 {
  margin-bottom: 0;
}

.icon-button {
  align-items: center;
  background: var(--moss-soft);
  border-radius: 999px;
  color: var(--moss);
  display: grid;
  font-weight: 900;
  height: 34px;
  justify-items: center;
  width: 34px;
}

.image-status {
  color: var(--muted);
  font-size: 0.78rem;
}

.detail-overlay,
.image-lightbox {
  align-items: center;
}

.detail-panel {
  background: #fff;
  border: 1px solid #d8ded6;
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1fr);
  margin: auto;
  max-height: 92vh;
  max-width: min(1040px, 96vw);
  overflow: hidden;
  position: relative;
  width: 100%;
}

.detail-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  z-index: 2;
}

.detail-media-wrap {
  align-items: center;
  background: #edf3ec;
  display: grid;
  min-height: 320px;
  padding: 1rem;
}

#detailImage {
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(42, 50, 45, 0.18);
  display: block;
  max-height: calc(92vh - 2rem);
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.detail-content {
  display: grid;
  gap: 1rem;
  max-height: 92vh;
  overflow: auto;
  padding: 2.3rem clamp(1rem, 3vw, 2rem) 1.4rem;
}

.detail-content h2 {
  color: #26312a;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.08;
  margin: 0;
}

#detailBody {
  color: #44544b;
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
  white-space: pre-wrap;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.detail-meta span {
  background: #f3f6f1;
  border: 1px solid #dce6dd;
  border-radius: 999px;
  color: #5b675f;
  font-size: 0.76rem;
  font-weight: 850;
  padding: 0.32rem 0.62rem;
}

.detail-comments {
  border-top: 1px solid #e4e8e0;
  display: grid;
  gap: 0.55rem;
  padding-top: 0.8rem;
}

.detail-comments h3 {
  font-size: 0.82rem;
  margin: 0;
  text-transform: uppercase;
}

.lightbox-panel {
  background: #111a14;
  border-radius: 18px;
  color: #fff;
  display: grid;
  gap: 1rem;
  margin: auto;
  max-height: 94vh;
  max-width: min(1080px, 96vw);
  overflow: hidden;
  padding: 1rem;
}

.lightbox-topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-width: min(720px, 88vw);
}

.lightbox-topbar p,
.lightbox-topbar h2 {
  margin: 0;
}

#lightboxImage {
  border-radius: 14px;
  max-height: 78vh;
  max-width: min(1000px, 92vw);
  object-fit: contain;
}

@media (max-width: 1080px) {
  .app-topbar {
    grid-template-columns: 1fr auto;
  }

  .brand {
    grid-column: 1;
  }

  .account-panel {
    grid-column: 2;
    grid-row: 1;
  }

  .top-controls,
  .view-tabs,
  .new-idea {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .view-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .new-idea {
    width: 100%;
  }

  .kanban-board {
    grid-template-columns: 1fr;
    min-width: 0;
    overflow: visible;
  }

  .column,
  .column-completed {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .app-topbar {
    gap: 0.58rem;
    padding: 0.7rem 0.85rem;
  }

  .top-controls {
    gap: 0.5rem;
    grid-template-columns: minmax(0, 1fr) 118px;
  }

  .search-box {
    height: 40px;
  }

  .search-box span {
    display: none;
  }

  .top-controls select {
    min-width: 0;
    width: 100%;
  }

  .app-main {
    padding: 0.75rem;
  }

  .filters-bar {
    padding: 0.65rem;
  }

  .chip-row {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .filter-chip {
    flex: 0 0 auto;
  }

  .masonry-board {
    grid-template-columns: 1fr;
  }

  .overlay {
    align-items: end;
    padding: 0.75rem;
  }

  .composer {
    border-radius: 18px 18px 12px 12px;
    max-width: none;
  }

  .detail-panel {
    grid-template-columns: 1fr;
    max-height: 94vh;
  }

  .detail-media-wrap {
    min-height: 210px;
    padding: 0.7rem;
  }

  #detailImage {
    max-height: 42vh;
  }

  .detail-content {
    max-height: 54vh;
    padding: 1rem;
  }

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