:root {
  /* Palette based on your TWE screenshots */
  --bg-cream: #f7f1ec;
  --panel-cream: #fdf7f1;
  --deep-red: #a6192e;
  --deep-red-soft: #c12b3d;
  --ink: #121111;
  --muted: #7b6b5e;
  --line: #e2d6ca;
  --card-border: #e7ddd2;

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.04);
}

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

body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: var(--bg-cream);
  color: var(--ink);
}
/* GLG tile on main page */

.glg-tile {
  border: 1px solid var(--card-border);
  background: #ffffff;
  padding: 0.9rem 1rem;
  margin-bottom: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.glg-tile-text {
  max-width: 70%;
}

.glg-tile-label {
  font-family: "Playfair Display", "Times New Roman", serif;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: var(--deep-red);
}

.glg-tile-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.glg-tile-link {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  text-decoration: none;
  color: var(--deep-red);
  white-space: nowrap;
}

.glg-tile-link:hover {
  text-decoration: underline;
}

.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */

.app-header {
  padding: 1.75rem 3rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-cream);
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: flex-end;
}

@media (max-width: 900px) {
  .app-header {
    grid-template-columns: 1fr;
    padding: 1.25rem 1.5rem;
  }
}

.app-header h1 {
  margin: 0;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 2.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-header p {
  margin: 0.35rem 0 0;
  font-size: 0.98rem;
  color: var(--muted);
}

.user-info {
  text-align: right;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.user-info span {
  display: block;
  font-weight: 500;
  color: var(--ink);
}

/* MAIN LAYOUT */

.app-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr);
  gap: 1.75rem;
  padding: 1.75rem 3rem 2.5rem;
}

@media (max-width: 900px) {
  .app-main {
    grid-template-columns: 1fr;
    padding: 1.25rem 1.5rem 2rem;
  }
}

.idea-form-section,
.ideas-section {
  background: var(--panel-cream);
  border-radius: 0;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  padding: 1.75rem 1.5rem 1.6rem;
}

.idea-form-section h2,
.ideas-section h2 {
  margin: 0 0 0.8rem;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.2rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* FORMS */

.idea-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.4rem;
}

.idea-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.idea-form input,
.idea-form textarea {
  margin-top: 0.45rem;
  padding: 0.6rem 0.75rem;
  border-radius: 2px;
  border: 1px solid var(--card-border);
  font-size: 0.95rem;
  font-family: inherit;
  background: #ffffff;
}

.idea-form textarea {
  resize: vertical;
}

/* BUTTONS */

.primary-button,
.secondary-button,
.icon-button {
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: inherit;
}

.primary-button {
  background: var(--deep-red);
  color: #ffffff;
  border-color: var(--deep-red);
}

.primary-button:hover:not(:disabled) {
  background: var(--deep-red-soft);
  border-color: var(--deep-red-soft);
}

.primary-button:disabled {
  opacity: 0.75;
  cursor: default;
}

.secondary-button {
  background: transparent;
  color: var(--deep-red);
  border-color: var(--deep-red);
}

.secondary-button:hover:not(:disabled) {
  background: rgba(166, 25, 46, 0.06);
}

.icon-button {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  padding-inline: 0.7rem;
}

/* SORT CONTROLS */

.ideas-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.sort-controls span {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.chip {
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}

.chip-active {
  color: var(--deep-red);
  border-color: var(--deep-red);
}

/* IDEAS LIST */

#ideasStatusText {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.ideas-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.idea-card {
  background: #ffffff;
  border-radius: 0;
  border: 1px solid var(--card-border);
  padding: 0.9rem 1rem 0.85rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.idea-card:hover {
  border-color: var(--deep-red-soft);
  background: #fffdf9;
}

.idea-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
}

.idea-card-header h3 {
  margin: 0;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.02rem;
}

.idea-meta {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.idea-summary {
  margin: 0.65rem 0 0.1rem;
  font-size: 0.9rem;
  color: var(--ink);
}

.idea-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.45rem;
}

.idea-stats {
  font-size: 0.8rem;
  color: var(--muted);
}

/* VINE BADGE */

.vine-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.vine-emoji {
  font-size: 1.25rem;
}

.vine-label {
  font-size: 0.78rem;
  color: var(--muted);
}

/* USER GATE */

.user-gate-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.user-gate-card {
  background: var(--panel-cream);
  padding: 2rem 2.1rem 1.8rem;
  border-radius: 4px;
  max-width: 460px;
  width: 100%;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.user-gate-card h2 {
  margin: 0;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.user-gate-card p {
  margin: 0.7rem 0 0.9rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.user-gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.user-gate-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.user-gate-form input {
  margin-top: 0.35rem;
  padding: 0.55rem 0.75rem;
  border-radius: 2px;
  border: 1px solid var(--card-border);
  font-size: 0.95rem;
  font-family: inherit;
}

/* DETAIL DRAWER */

.detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: flex-end;
  z-index: 90;
}

.detail-panel {
  background: var(--panel-cream);
  width: min(480px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
}

.detail-header {
  padding: 1.2rem 1.4rem 0.8rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
}

.detail-header h2 {
  margin: 0;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.1rem;
}

.detail-body {
  padding: 1rem 1.4rem;
  overflow-y: auto;
  flex: 1;
}

.detail-comments {
  padding: 1rem 1.4rem 1.3rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.detail-block {
  margin-bottom: 1rem;
}

.detail-block h3 {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.detail-block p {
  margin: 0;
  font-size: 0.92rem;
}

.detail-vine-row {
  margin-top: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-radius: 2px;
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
}

.vine-emoji-large {
  font-size: 1.5rem;
}

.vine-stage-label {
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.vine-stage-sub {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* COMMENTS */

.comments-list {
  list-style: none;
  margin: 0 0 0.8rem;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
}

.comment-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(226, 214, 202, 0.7);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.comment-form textarea {
  width: 100%;
  margin-bottom: 0.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: 2px;
  border: 1px solid var(--card-border);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
}
.twe-logo {
  height: 65px;      /* adjust if needed */
  margin-bottom: 0.8rem;
}
.back-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--deep-red);
  text-decoration: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.back-link:hover {
  text-decoration: underline;
}
