/* web/styles.css */
:root {
  --buncss-light: initial;
  --buncss-dark: ;
  color-scheme: light;
  --bg: #f3efe6;
  --ink: #1c1914;
  --muted: #6b6458;
  --surface: #fffdf8;
  --border: #d9d0bf;
  --accent: #0f6b5c;
  --accent-soft: #d7efe9;
  --danger: #9b2c2c;
  --display: "Fraunces", Georgia, serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --mono: "Source Code Pro", ui-monospace, monospace;
  --radius: 10px;
  --shadow: 0 18px 50px #1c191414;
}

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background: radial-gradient(900px 500px at 0% 0%, #0f6b5c14, transparent 60%), radial-gradient(700px 400px at 100% 10%, #9b662c0f, transparent 55%), var(--bg);
  margin: 0;
  line-height: 1.5;
}

#root {
  min-height: 100vh;
}

.app-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.topbar {
  display: flex;
  border-bottom: 1px solid var(--border);
  justify-content: space-between;
  align-items:  flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}

.brand-mark {
  font-family: var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: .75rem;
}

.brand h1 {
  font-family: var(--display);
  margin: .15rem 0 0;
  font-size: 2rem;
  font-weight: 600;
}

.brand p, .muted {
  color: var(--muted);
  margin: .2rem 0 0;
}

.user-chip {
  display: flex;
  align-items:  center;
  gap: .65rem;
}

.user-chip img {
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
}

.tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
}

.tab {
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  background: none;
  border: 1px solid #0000;
  border-radius: 999px;
  padding: .45rem .8rem;
}

.tab[aria-selected="true"] {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  border-radius: 8px;
  padding: .55rem .9rem;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-ghost {
  background: none;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: 1.1fr .9fr;
}

@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

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

.list-item {
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  background: #fffcf7;
  border-radius: 8px;
  width: 100%;
  padding: .85rem 1rem;
}

.list-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.list-item h3 {
  margin: 0;
  font-size: 1rem;
}

.list-item p {
  color: var(--muted);
  margin: .2rem 0 0;
  font-size: .9rem;
}

.badge {
  display: inline-block;
  font-family: var(--mono);
  color: var(--muted);
  background: #efe8db;
  border-radius: 999px;
  padding: .1rem .4rem;
  font-size: .72rem;
}

.form {
  display: grid;
  gap: .75rem;
}

.form label {
  display: grid;
  gap: .3rem;
  font-size: .875rem;
}

.form input, .form textarea, .form select {
  font: inherit;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: .55rem .7rem;
}

.form textarea {
  resize: vertical;
  font-family: var(--mono);
  min-height: 140px;
  font-size: .85rem;
}

.login-page {
  display: grid;
  place-items:  center;
  min-height: calc(100vh - 3rem);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(420px, 100%);
  padding: 2rem;
}

.login-card h2 {
  font-family: var(--display);
  margin: .3rem 0 .5rem;
}

.error-banner {
  color: var(--danger);
  background: #9b2c2c14;
  border: 1px solid #9b2c2c59;
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: .75rem .9rem;
  font-size: .875rem;
}

.status-line {
  text-align: center;
  color: var(--muted);
  padding: 1rem;
}

.detail pre {
  white-space: pre-wrap;
  font-family: var(--mono);
  border: 1px solid var(--border);
  background: #f7f2e8;
  border-radius: 8px;
  padding: .85rem;
  font-size: .82rem;
}

.checkbox-row {
  display: flex;
  align-items:  center;
  gap: .5rem;
}

.permalink-page {
  max-width: 720px;
  margin: 0 auto;
}

.permalink-header {
  margin-bottom: 1.25rem;
}

.permalink-header h1 {
  font-family: var(--display);
  margin: .2rem 0 0;
  font-size: 2rem;
  font-weight: 600;
}

.agreement-markdown {
  white-space: pre-wrap;
  font-family: var(--sans);
  margin: 0;
  font-size: .95rem;
  line-height: 1.65;
}

.permalink-status h2 {
  margin-top: 0;
}

.success-banner {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #0f6b5c59;
  border-radius: 8px;
  margin-top: .85rem;
  padding: .75rem .9rem;
  font-size: .875rem;
}
