:root {
  --ink: #183229;
  --muted: #64756e;
  --paper: #fbfcf8;
  --panel: #ffffff;
  --pine: #1f6049;
  --pine-dark: #154735;
  --sage: #dfeadf;
  --line: #dce5dc;
  --warm: #e9a857;
  --danger: #a23a34;
  --shadow: 0 18px 50px rgba(25, 57, 45, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 5% 8%, rgba(233, 168, 87, .15), transparent 28rem),
    radial-gradient(circle at 90% 30%, rgba(82, 137, 105, .13), transparent 32rem),
    var(--paper);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
[hidden] { display: none !important; }

.site-header {
  min-height: 72px;
  padding: 14px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(31, 96, 73, .12);
  background: rgba(251, 252, 248, .86);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px 12px 12px 3px;
  color: white;
  background: var(--pine);
  font-family: Georgia, serif;
  font-size: 22px;
}

.header-actions { display: flex; align-items: center; gap: 12px; }
.release { color: var(--muted); font-size: .78rem; }

main { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.login-shell {
  min-height: calc(100vh - 73px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  align-items: center;
  gap: clamp(48px, 9vw, 130px);
  padding: 72px 0;
}

.login-copy h1, .board-heading h1 {
  margin: 8px 0 18px;
  max-width: 720px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(2.7rem, 6vw, 5.7rem);
  line-height: .98;
  letter-spacing: -.055em;
}

.login-copy > p:last-child { max-width: 550px; color: var(--muted); font-size: 1.12rem; line-height: 1.7; }
.eyebrow { margin: 0; color: var(--pine); font-weight: 750; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; }

.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
}

.login-panel { padding: clamp(26px, 5vw, 42px); }
.login-panel h2, .editor h2, .state h2 { margin: 0 0 8px; font-family: Georgia, serif; font-size: 1.7rem; font-weight: 500; }
.muted, .fine-print { color: var(--muted); line-height: 1.5; }
.fine-print { margin: 18px 0 0; font-size: .78rem; text-align: center; }

label { display: block; margin: 19px 0 7px; font-weight: 700; font-size: .86rem; }
input, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #bdcbc1;
  border-radius: 10px;
  color: var(--ink);
  background: white;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(233, 168, 87, .42);
  outline-offset: 2px;
  border-color: var(--pine);
}

.button {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 750;
}
.login-panel .button-primary { width: 100%; margin-top: 24px; }
.button-primary { color: white; background: var(--pine); box-shadow: 0 7px 18px rgba(31, 96, 73, .18); }
.button-primary:hover { background: var(--pine-dark); }
.button-quiet { color: var(--pine); border-color: var(--line); background: rgba(255, 255, 255, .7); }
.button-quiet:hover { background: var(--sage); }
.button-small { min-height: 34px; padding: 5px 11px; font-size: .8rem; }

.board { padding: clamp(48px, 8vw, 88px) 0; }
.board-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 36px; }
.board-heading h1 { margin-bottom: 0; font-size: clamp(2.7rem, 6vw, 4.8rem); }

.editor { max-width: 760px; margin: 0 0 34px; padding: clamp(22px, 4vw, 34px); }
.editor-heading, .idea-heading, .label-row, .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 1.7rem; line-height: 1; }
.icon-button:hover { color: var(--ink); background: var(--sage); }
.label-row label { margin-bottom: 7px; }
.character-count { align-self: end; margin-bottom: 7px; color: var(--muted); font-size: .75rem; }
.form-actions { justify-content: flex-start; margin-top: 20px; }

.idea-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.idea-card { min-height: 190px; padding: 26px; box-shadow: 0 10px 34px rgba(25, 57, 45, .06); }
.idea-heading { align-items: start; }
.idea-card h2 { margin: 0; font-family: Georgia, serif; font-size: 1.4rem; font-weight: 500; overflow-wrap: anywhere; }
.idea-notes { margin: 18px 0; color: #485c54; line-height: 1.62; white-space: pre-wrap; overflow-wrap: anywhere; }
.idea-meta { margin: 24px 0 0; color: var(--muted); font-size: .76rem; }

.state { min-height: 230px; padding: 38px; display: grid; place-items: center; align-content: center; text-align: center; }
.state p { margin: 5px auto 20px; max-width: 450px; color: var(--muted); line-height: 1.5; }
.empty-mark { margin-bottom: 12px; color: var(--warm); font-size: 2.3rem; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--sage); border-top-color: var(--pine); border-radius: 50%; animation: spin .8s linear infinite; }

.notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 5;
  max-width: min(420px, calc(100% - 48px));
  padding: 14px 18px;
  border-radius: 12px;
  color: white;
  background: var(--pine);
  box-shadow: var(--shadow);
}
.notice[data-kind="error"] { background: var(--danger); }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; } }

@media (max-width: 760px) {
  .site-header { padding-inline: 20px; }
  .login-shell { grid-template-columns: 1fr; gap: 38px; padding: 50px 0; }
  .login-copy h1 { font-size: clamp(2.8rem, 14vw, 4.8rem); }
  .idea-grid { grid-template-columns: 1fr; }
  .board-heading { align-items: start; flex-direction: column; }
}

@media (max-width: 440px) {
  main { width: min(100% - 28px, 1120px); }
  .brand > span:last-child { display: none; }
  .login-panel, .editor, .idea-card { border-radius: 15px; }
  .form-actions { align-items: stretch; flex-direction: column; }
}
