:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --text: #171717;
  --muted: #525252;
  --accent: #b45309;
  --accent-hover: #9a3412;
  --accent-soft: rgba(180, 83, 9, 0.12);
  --link: #a16207;
  --link-hover: #854d0e;
  --border: rgba(23, 23, 23, 0.08);
  --danger: #b91c1c;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(23, 23, 23, 0.06), 0 8px 24px rgba(23, 23, 23, 0.06);
  --shadow-hover: 0 2px 4px rgba(23, 23, 23, 0.06), 0 12px 32px rgba(23, 23, 23, 0.08);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease, transform 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 100% 70% at 100% 0%, rgba(180, 83, 9, 0.09), transparent 55%),
    radial-gradient(ellipse 80% 50% at 0% 100%, rgba(23, 23, 23, 0.04), transparent 50%);
}

a {
  color: var(--link);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3.5rem;
}

.wrap.wrap--wide {
  max-width: min(960px, 100%);
}

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.025em;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.brand:hover {
  text-decoration: none;
  color: var(--text);
  opacity: 0.88;
}

.brand-accent {
  color: var(--accent);
}

.brand-heart {
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.92;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.user-bar-name {
  font-weight: 500;
  color: var(--text);
}

.logout-form {
  margin: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card+.card {
  margin-top: 1rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.idea-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.idea-list li {
  margin-bottom: 0.65rem;
}

.section-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.65rem;
  letter-spacing: 0.02em;
}

.folder-grid {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.65rem;
}

.folder-grid li {
  margin: 0;
}

a.folder-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  padding: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  min-height: 100%;
  cursor: pointer;
  transition: var(--transition);
}

a.folder-card:hover {
  border-color: rgba(180, 83, 9, 0.35);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}

.folder-card-visual {
  width: 100%;
  aspect-ratio: 1;
  max-height: 7.5rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.folder-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.folder-card-placeholder {
  width: 100%;
  height: 100%;
  min-height: 5rem;
  background: linear-gradient(135deg, var(--border) 0%, var(--bg) 100%);
}

.folder-card-name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
  color: var(--text);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.folder-card:hover .folder-card-name {
  color: var(--accent);
}

.folder-detail-header {
  margin-bottom: 1rem;
}

.folder-detail-top {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.folder-detail-logo-wrap {
  flex-shrink: 0;
}

.folder-detail-logo-btn {
  display: block;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.folder-detail-logo-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.folder-detail-logo {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: cover;
}

.folder-detail-logo-placeholder {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--border) 0%, var(--bg) 100%);
}

.folder-detail-title-block {
  min-width: 0;
  flex: 1;
}

.folder-detail-logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.folder-logo-form {
  flex: 1;
  min-width: min(100%, 18rem);
}

.folder-picker-form {
  margin: 0 0 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.folder-picker-form .field {
  margin-bottom: 0.75rem;
}

.inline-form--links {
  margin-top: 1rem;
}

.photo-upload-form {
  margin-top: 1rem;
}

.photo-upload-form .field {
  margin-bottom: 0.5rem;
}

.photo-preview-unavailable {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
}

.idea-meta-line {
  margin: 1rem 0 0;
}

.delete-idea-form {
  margin: 0;
}

.url-delete-form {
  margin: 0;
}

.card > p.muted + a.btn,
.card > p.muted + button.btn {
  margin-top: 1rem;
}

.idea-card {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.idea-card:hover {
  border-color: rgba(180, 83, 9, 0.3);
  box-shadow: var(--shadow-hover);
}

a.idea-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  justify-content: center;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a.idea-card-body:hover {
  text-decoration: none;
}

a.idea-card-body:hover .idea-card-title {
  color: var(--accent);
}

.idea-card-thumbs {
  flex: 0 1 auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 96px;
  gap: 0.5rem;
  align-items: center;
  align-self: center;
  max-width: min(52vw, 22rem);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  width: max-content;
}

.idea-card-thumb {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}

.idea-card-thumb-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  border-radius: inherit;
  overflow: hidden;
}

.idea-card-thumb-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.idea-card-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.idea-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--border) 0%, var(--bg) 100%);
}

.idea-card-title {
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
  line-height: 1.3;
}

.idea-card-meta {
  margin: 0;
  font-size: 0.82rem;
}

.idea-card-links {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
}

.idea-card-links li {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

.idea-card-link-line {
  color: var(--muted);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idea-card-more {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.08);
}

.btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.25);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn--compact {
  padding: 0.35rem 0.7rem;
  font-size: 0.8125rem;
  border-radius: 8px;
  box-shadow: none;
}

.btn--small {
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  border-radius: 8px;
  box-shadow: none;
}

.btn--tiny {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 6px;
  box-shadow: none;
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.04);
}

.btn.secondary:hover {
  background: var(--bg);
  color: var(--text);
  border-color: rgba(23, 23, 23, 0.14);
  box-shadow: 0 2px 8px rgba(23, 23, 23, 0.06);
}

.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(185, 28, 28, 0.35);
  box-shadow: none;
}

.btn.danger:hover {
  background: rgba(185, 28, 28, 0.06);
  box-shadow: none;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

input[type="file"] {
  padding: 0.45rem 0.5rem;
  font-size: 0.9rem;
}

select {
  cursor: pointer;
  appearance: auto;
}

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

.field {
  margin-bottom: 1rem;
}

.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.url-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.url-row:last-child {
  border-bottom: none;
}

.photo-strip {
  margin-top: 0.5rem;
  outline: none;
}

.photo-strip:focus-visible {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  border-radius: 12px;
}

.photo-strip-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(14.5rem, 42vw);
  justify-content: start;
  align-items: stretch;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.35rem 0 0.65rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  width: 100%;
}

.photo-strip-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  scroll-snap-align: start;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.photo-strip-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 12.5rem;
  padding: 0.4rem;
  background: linear-gradient(160deg, #292524 0%, #1c1917 50%, #0c0a09 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.photo-strip-frame--empty {
  height: 5.5rem;
}

button.photo-strip-link {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  min-height: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  font: inherit;
  text-decoration: none;
}

button.photo-strip-link:hover {
  opacity: 0.96;
}

button.photo-strip-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.photo-strip-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}

.photo-strip-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.photo-strip-name {
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.photo-strip-delete {
  flex-shrink: 0;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .photo-strip-scroll {
    scroll-behavior: auto;
    scroll-snap-type: none;
  }
}

.comment {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.comment:last-child {
  border-bottom: none;
}

.comment-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

.inline-form .field {
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

.page-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.page-title-row h1 {
  margin: 0;
  flex: 1;
  min-width: 8rem;
}

.back-link {
  margin: 0 0 1rem;
}

.back-link a {
  font-weight: 500;
}

.login-card {
  max-width: 22rem;
  margin: 0 auto;
}

.login-card h1 {
  font-size: 1.35rem;
}

.login-lead {
  margin-top: 0;
}

.folder-detail-heading {
  margin-bottom: 0.35rem;
}

.folder-ideas-title {
  margin: 0;
  flex: 1;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.inline-field-grow {
  flex: 2;
}

.folder-logo-field {
  flex: 2;
  min-width: 12rem;
}

.comment-body {
  white-space: pre-wrap;
}

input[type="text"]:focus-visible,
input[type="password"]:focus-visible,
input[type="url"]:focus-visible,
input[type="file"]:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: rgba(180, 83, 9, 0.45);
}

/* Full-screen photo preview */
body.photo-lightbox-open {
  overflow: hidden;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.photo-lightbox[hidden] {
  display: none !important;
}

.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 9, 0.94);
  cursor: zoom-out;
}

.photo-lightbox-panel {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.5rem 0.65rem 0.65rem;
  max-height: 100vh;
  pointer-events: none;
}

.photo-lightbox-toolbar,
.photo-lightbox-stage,
.photo-lightbox-hint {
  pointer-events: auto;
}

.photo-lightbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.4rem;
  color: #e7e5e4;
}

.photo-lightbox-zoom-label {
  min-width: 2.75rem;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: #a8a29e;
}

.photo-lightbox-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.65rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fafaf9;
  cursor: pointer;
  text-decoration: none;
}

.photo-lightbox-tool:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  text-decoration: none;
}

.photo-lightbox-open-tab {
  font-weight: 600;
  color: #fbbf24 !important;
  border-color: rgba(251, 191, 36, 0.4);
}

.photo-lightbox-open-tab:hover {
  color: #fcd34d !important;
}

.photo-lightbox-close {
  margin-left: auto;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.15rem 0.5rem;
  min-width: 2.25rem;
}

.photo-lightbox-stage {
  flex: 1;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
}

.photo-lightbox-stage.is-dragging {
  cursor: grabbing;
}

.photo-lightbox-img {
  max-width: 100%;
  max-height: min(78vh, 100%);
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.photo-lightbox-hint {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  text-align: center;
  color: #78716c !important;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .photo-lightbox-panel {
    padding: 0.65rem 0.85rem 1rem;
  }

  .photo-lightbox-toolbar {
    gap: 0.5rem 0.6rem;
    margin-bottom: 0.55rem;
  }

  .photo-lightbox-zoom-label {
    font-size: 1rem;
    min-width: 3.5rem;
  }

  .photo-lightbox-tool {
    padding: 0.6rem 1rem;
    min-height: 48px;
    font-size: 1rem;
    border-radius: 10px;
  }

  .photo-lightbox-tool[data-zoom-in],
  .photo-lightbox-tool[data-zoom-out] {
    min-width: 48px;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    font-size: 1.25rem;
    line-height: 1;
  }

  .photo-lightbox-close {
    min-width: 48px;
    min-height: 48px;
    font-size: 1.85rem;
    padding: 0.25rem;
    margin-left: auto;
  }

  .photo-lightbox-hint {
    display: none;
  }

  .photo-lightbox-open-tab {
    width: 100%;
    justify-content: center;
    margin-left: 0 !important;
    order: 10;
    min-height: 48px;
    font-size: 1rem;
  }
}

@media (max-width: 380px) {
  .photo-lightbox-close {
    margin-left: 0;
  }
}