:root {
  color-scheme: light;
  --ink: #18352f;
  --muted: #65756f;
  --forest: #185b4c;
  --forest-dark: #10483d;
  --mint: #dcefe7;
  --cream: #f7f4ec;
  --paper: #fffefa;
  --coral: #f07a5a;
  --line: #dfe5de;
  --danger: #a43d32;
  --shadow: 0 22px 55px rgba(31, 61, 51, .12);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--forest); font-weight: 700; text-underline-offset: .2em; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: .72rem;
  background: var(--forest);
  color: white;
  box-shadow: 0 8px 18px rgba(24, 91, 76, .2);
}

.brand-mark svg { width: 1.25rem; height: 1.25rem; }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(27rem, .96fr);
}

.auth-story {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 5.5rem);
  background: var(--forest);
  color: white;
}

.auth-story::before,
.auth-story::after {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  content: "";
}

.auth-story::before {
  width: 27rem;
  height: 27rem;
  right: -9rem;
  top: -8rem;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 0 0 5rem rgba(255, 255, 255, .035), 0 0 0 10rem rgba(255, 255, 255, .025);
}

.auth-story::after {
  width: 17rem;
  height: 17rem;
  left: -6rem;
  bottom: -7rem;
  background: var(--coral);
  opacity: .16;
  filter: blur(1px);
}

.auth-story .brand { color: white; }
.auth-story .brand-mark { background: white; color: var(--forest); box-shadow: none; }

.story-copy { max-width: 41rem; margin: 4rem 0; }
.eyebrow { margin: 0 0 1.1rem; color: #aee0ce; font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.story-copy h1 { max-width: 12ch; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 6vw, 5.9rem); font-weight: 400; letter-spacing: -.055em; line-height: .98; }
.story-copy > p:last-of-type { max-width: 34rem; margin: 1.65rem 0 0; color: #d7ebe3; font-size: clamp(1rem, 1.4vw, 1.2rem); }

.quote-card {
  max-width: 36rem;
  padding: 1.2rem 1.35rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 1rem;
  background: rgba(255, 255, 255, .09);
  backdrop-filter: blur(8px);
}

.quote-card p { margin: 0 0 .7rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; }
.quote-card span { color: #b9d8cd; font-size: .86rem; font-weight: 700; }

.auth-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem clamp(1.5rem, 6vw, 6rem);
  background: var(--paper);
}

.auth-card { width: min(100%, 28rem); }
.auth-card h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 2.25rem; font-weight: 500; letter-spacing: -.035em; }
.intro { margin: .7rem 0 2rem; color: var(--muted); }
.auth-switch { margin: 1.45rem 0 0; color: var(--muted); text-align: center; }

.form-stack { display: grid; gap: 1.12rem; }
.field { display: grid; gap: .42rem; }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
label, .field-label { color: var(--ink); font-size: .86rem; font-weight: 800; }
.hint { color: var(--muted); font-size: .78rem; font-weight: 500; }

input, select, textarea {
  width: 100%;
  border: 1px solid #cfd8d2;
  border-radius: .7rem;
  outline: none;
  background: white;
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}

input, select { min-height: 3rem; padding: .68rem .82rem; }
textarea { min-height: 7.8rem; resize: vertical; padding: .8rem .9rem; }
input::placeholder, textarea::placeholder { color: #95a09b; }
input:focus, select:focus, textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(24, 91, 76, .12); }

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 0;
  border-radius: .7rem;
  padding: .7rem 1.1rem;
  background: var(--forest);
  color: white;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: background .16s ease, transform .16s ease;
}

.button:hover { background: var(--forest-dark); transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .62; transform: none; }
.button-secondary { border: 1px solid var(--line); background: white; color: var(--ink); }
.button-secondary:hover { background: #f3f5f1; }
.button-small { min-height: 2.5rem; padding: .5rem .86rem; font-size: .88rem; }
.button-wide { width: 100%; margin-top: .25rem; }

.message { min-height: 1.5rem; margin: .25rem 0 0; color: var(--danger); font-size: .87rem; font-weight: 650; }
.message:empty { display: none; }

.sample-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
  padding: .9rem 1rem;
  border-radius: .75rem;
  background: var(--mint);
  color: #315c50;
  font-size: .8rem;
}

.sample-login strong { display: block; color: var(--forest-dark); font-size: .82rem; }
.sample-login code { color: inherit; font-family: inherit; }

.app-shell { min-height: 100vh; }
.topbar { border-bottom: 1px solid var(--line); background: rgba(255, 254, 250, .92); backdrop-filter: blur(12px); }
.topbar-inner { display: flex; max-width: 76rem; min-height: 4.7rem; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 auto; padding: 0 1.5rem; }
.account-actions { display: flex; align-items: center; gap: 1rem; }
.account-label { color: var(--muted); font-size: .87rem; }
.account-label strong { display: block; color: var(--ink); font-size: .92rem; }
.signout-message { max-width: 16rem; margin: 0; color: var(--danger); font-size: .78rem; font-weight: 650; }
.signout-message:empty { display: none; }

.workspace { max-width: 76rem; margin: 0 auto; padding: 2.5rem 1.5rem 4.5rem; }
.welcome { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.welcome h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.2rem, 4vw, 3.65rem); font-weight: 500; letter-spacing: -.05em; line-height: 1.05; }
.welcome-copy { margin: .55rem 0 0; color: var(--muted); }
.kudos-counts { display: flex; min-width: 20rem; align-items: center; gap: 1.1rem; padding: 1rem 1.1rem; border: 1px solid #bcd9cc; border-radius: 1rem; background: var(--mint); }
.kudos-counts-icon { display: grid; width: 2.8rem; height: 2.8rem; flex: 0 0 auto; place-items: center; border-radius: .78rem; background: var(--forest); color: white; }
.kudos-counts-icon svg { width: 1.35rem; height: 1.35rem; }
.kudos-count { min-width: 5.3rem; }
.kudos-count + .kudos-count { padding-left: 1.1rem; border-left: 1px solid #bcd9cc; }
.kudos-count strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.65rem; line-height: 1; }
.kudos-count span { color: #42665c; font-size: .8rem; font-weight: 700; }

.app-grid { display: grid; grid-template-columns: minmax(18rem, .78fr) minmax(25rem, 1.35fr); align-items: start; gap: 1.5rem; }
.panel { border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); box-shadow: 0 10px 28px rgba(35, 61, 52, .055); }
.composer { position: sticky; top: 1.5rem; padding: 1.35rem; }
.panel-heading { margin-bottom: 1.25rem; }
.panel-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; font-weight: 500; letter-spacing: -.025em; }
.panel-heading p { margin: .3rem 0 0; color: var(--muted); font-size: .9rem; }
.composer .button { width: 100%; }
.counter { color: var(--muted); font-size: .78rem; }

.feed-panel { overflow: hidden; }
.feed-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.35rem 1.5rem; border-bottom: 1px solid var(--line); }
.feed-header h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; font-weight: 500; }
.feed-header span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.feed-list { display: grid; margin: 0; padding: 0; list-style: none; }
.note { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .95rem; padding: 1.35rem 1.5rem; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.avatar { display: grid; width: 2.8rem; height: 2.8rem; place-items: center; border-radius: 50%; background: #e7eee9; color: var(--forest); font-size: .83rem; font-weight: 850; letter-spacing: .02em; }
.note-line { margin: .05rem 0 .55rem; font-size: .88rem; }
.note-line strong { color: var(--ink); }
.note-line span { color: var(--muted); }
.note-message { margin: 0; color: #2d403a; font-family: Georgia, "Times New Roman", serif; font-size: 1.04rem; line-height: 1.55; overflow-wrap: anywhere; }
.note time { display: block; margin-top: .65rem; color: #87938e; font-size: .75rem; }
.empty { padding: 3.5rem 1.5rem; color: var(--muted); text-align: center; }
.empty strong { display: block; margin-bottom: .35rem; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.2rem; }
.loading { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }

[hidden] { display: none !important; }

@media (max-width: 850px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-story { min-height: 25rem; padding: 2rem; }
  .story-copy { margin: 4rem 0 1rem; }
  .story-copy h1 { max-width: 14ch; font-size: clamp(2.8rem, 11vw, 4.5rem); }
  .quote-card { display: none; }
  .auth-panel { min-height: auto; padding: 3.5rem 1.5rem; }
  .app-grid { grid-template-columns: 1fr; }
  .composer { position: static; }
}

@media (max-width: 600px) {
  .topbar-inner, .workspace { padding-left: 1rem; padding-right: 1rem; }
  .account-label { display: none; }
  .welcome { align-items: stretch; flex-direction: column; }
  .kudos-counts { min-width: 0; gap: .8rem; }
  .kudos-counts-icon { display: none; }
  .kudos-count { min-width: 0; flex: 1; }
  .note { padding: 1.15rem 1rem; }
  .sample-login { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
