:root {
  --bg: #f3efe4;
  --panel: #fffdf8;
  --ink: #182022;
  --muted: #6f776f;
  --line: #d7d0bf;
  --accent: #1d6a42;
  --danger: #9f3328;
  --shadow: 0 18px 40px rgba(24, 32, 34, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(129, 121, 103, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 121, 103, 0.14) 1px, transparent 1px),
    radial-gradient(circle at top right, rgba(34, 79, 69, 0.08), transparent 28%),
    linear-gradient(180deg, #f6f1e8 0%, #efe9da 100%);
  background-size: 72px 72px, 72px 72px, auto, auto;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.page-shell { max-width: 1180px; margin: 0 auto; padding: 32px 20px 60px; }
.hero-card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card, .panel { padding: 24px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.button-row, .toolbar-row, .inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.button, .ghost-button, .danger-button {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 16px;
  text-decoration: none;
}

.button { background: var(--accent); color: white; }
.ghost-button { background: transparent; border-color: var(--line); }
.danger-button { background: #fff1ef; border-color: #e4b3ac; color: var(--danger); }

.grid-two, .grid-three { display: grid; gap: 18px; }
.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.field { display: grid; gap: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid #c7c0ae;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fffdf8;
}

.field textarea { min-height: 110px; resize: vertical; }
.card-list { display: grid; gap: 14px; }
.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.message-box {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fbf8ef;
}

.message-box.error { border-color: #d7a9a2; background: #fff1ef; color: var(--danger); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e9ece7;
  font-size: 14px;
}

.status-chip.pending { background: #f4ebc7; }
.status-chip.approved, .status-chip.active { background: #dcecdf; }
.status-chip.rejected, .status-chip.disabled { background: #f3d8d3; }

.item-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffcf5;
}

.item-card h3 { margin: 0 0 8px; }
.item-meta { font-size: 14px; color: var(--muted); }

.owner-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; }
.owner-stack { display: grid; gap: 16px; }

.landing-shell { display: grid; gap: 24px; }

.landing-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}

.landing-copy, .landing-board-preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.landing-hero-full {
  grid-template-columns: 1fr;
}

.landing-copy-wide {
  min-height: 340px;
  display: grid;
  align-content: center;
  background:
    linear-gradient(rgba(120, 112, 94, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 112, 94, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 253, 248, 0.9), rgba(248, 242, 228, 0.94));
  background-size: 76px 76px, 76px 76px, auto;
}

.landing-kicker {
  margin: 0 0 8px;
  color: #1d6a42;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.landing-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 0.98;
}

.landing-lead {
  max-width: 58ch;
  margin: 0 0 22px;
  font-size: 1.08rem;
  color: #485049;
}

.landing-note {
  max-width: 54ch;
  margin: 0 0 22px;
  color: #5f655d;
}

.preview-board {
  display: grid;
  gap: 10px;
  height: 100%;
  min-height: 320px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #f8f4ea 0%, #ede5d4 100%);
  border: 1px solid #cdc3ae;
}

.preview-header {
  display: grid;
  grid-template-columns: 80px repeat(3, 1fr);
  gap: 8px;
  font-size: 14px;
  color: #5c6058;
}

.preview-grid {
  display: grid;
  grid-template-columns: 80px repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
  align-items: start;
}

.preview-time {
  align-self: start;
  color: #8f3a30;
}

.preview-card, .preview-note {
  min-height: 68px;
  padding: 10px;
  border-radius: 14px;
  box-shadow: 0 10px 20px rgba(24, 32, 34, 0.1);
}

.preview-card.yellow { background: #f1dd78; }
.preview-card.blue { background: #86acd8; }
.preview-note { background: #f6efc8; white-space: pre-line; }

.feature-grid, .pricing-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.feature-card {
  padding: 18px;
  border-radius: 18px;
  background: #fffaf0;
  border: 1px solid var(--line);
}

.feature-card h2, .price-card h2 { margin: 0 0 8px; }

.price-list {
  margin: 14px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.price-card-pro {
  background: linear-gradient(180deg, #fffdf7 0%, #f7f1e1 100%);
}

.legal-panel {
  padding-top: 18px;
}

.legal-toggle-row {
  gap: 14px;
}

.legal-details {
  width: 100%;
}

.legal-summary {
  list-style: none;
  display: inline-flex;
}

.legal-summary::-webkit-details-marker {
  display: none;
}

.legal-copy {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffaf0;
}

.legal-copy h2 {
  margin-top: 0;
}

.board-page {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(56, 113, 82, 0.16), transparent 28%),
    linear-gradient(180deg, #f1ecdf 0%, #e8e0cf 100%);
}

.board-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.board-login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 56px rgba(24, 32, 34, 0.14);
}

.board-login-card h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.board-login-button { justify-self: start; }

.board-stage-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(56, 113, 82, 0.16), transparent 28%),
    linear-gradient(180deg, #f1ecdf 0%, #e8e0cf 100%);
}

.board-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  background:
    radial-gradient(circle at top left, rgba(56, 113, 82, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(248, 244, 235, 0.98), rgba(235, 228, 212, 1));
}

.board-overlay {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 30;
}

.board-overlay-top {
  top: max(14px, env(safe-area-inset-top));
  justify-content: flex-start;
  flex-wrap: wrap;
}

.board-overlay-bottom {
  right: auto;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  align-items: flex-end;
  gap: 12px;
}

.board-chip {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid rgba(24, 32, 34, 0.14);
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.88);
  box-shadow: 0 8px 18px rgba(24, 32, 34, 0.09);
  backdrop-filter: blur(10px);
}

.board-chip strong { font-size: 15px; }
.board-chip strong[title] { cursor: pointer; }
.board-chip span { font-size: 14px; color: var(--muted); }
.board-chip-button {
  border: 0;
  color: #8d2c23;
  background: rgba(247, 220, 214, 0.92);
}

.board-chip-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.board-select {
  border: 0;
  background: transparent;
  min-width: 110px;
  max-width: 34vw;
  outline: none;
}

.board-fab {
  pointer-events: auto;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #34a659 0%, #1d6a42 100%);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  box-shadow: 0 18px 32px rgba(29, 106, 66, 0.34);
}

.board-fab-delete {
  background: linear-gradient(180deg, #c94c44 0%, #9f3328 100%);
  box-shadow: 0 18px 32px rgba(159, 51, 40, 0.32);
}

.board-fab-undo {
  background: linear-gradient(180deg, #d3c49a 0%, #9f8b53 100%);
  box-shadow: 0 18px 32px rgba(120, 101, 52, 0.28);
  font-size: 30px;
}

.board-fab-camera {
  background: linear-gradient(180deg, #7f93a7 0%, #55687c 100%);
  box-shadow: 0 18px 32px rgba(61, 77, 96, 0.28);
  font-size: 26px;
}

.board-fab.active {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
}

.board-fab-menu {
  pointer-events: auto;
  display: grid;
  gap: 8px;
  margin-left: 12px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(24, 32, 34, 0.12);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 18px 36px rgba(24, 32, 34, 0.16);
}

.fab-action {
  min-width: 118px;
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  text-align: left;
  color: #182022;
  background: #f2ecdd;
}

.fab-action.active {
  outline: 2px solid rgba(29, 106, 66, 0.35);
  background: #e5f0e7;
}

.fab-submenu-shell {
  display: grid;
  gap: 8px;
}

.fab-action-with-arrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fab-arrow {
  font-size: 20px;
  line-height: 1;
  opacity: 0.7;
}

.fab-submenu {
  display: grid;
  gap: 8px;
  padding-left: 12px;
}

.fab-sticky.yellow { background: #f3df79; }
.fab-sticky.blue { background: #7ca9df; }
.fab-sticky.green { background: #8fc18f; }
.fab-sticky.red { background: #d99797; }
.fab-sticky.orange { background: #e6b172; }
.fab-sticky.purple { background: #b39adf; }
.fab-sticky.pink { background: #e7b6c8; }
.fab-paper { background: #fffef9; }
.fab-draw { background: #dae7df; }
.fab-duplicate { background: #ece2b9; }
.fab-logout { background: #f7d7d1; color: #8d2c23; }
.fab-delete-card { background: #f3ddd7; color: #8d2c23; }
.fab-erase { background: #d8e5ef; color: #264c69; }

.card-editor {
  position: absolute;
  z-index: 20;
  min-width: 220px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid rgba(24, 32, 34, 0.14);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.97);
  box-shadow: 0 20px 40px rgba(24, 32, 34, 0.16);
}

.card-editor-input {
  width: 100%;
  min-height: 110px;
  padding: 12px;
  border: 1px solid #c7c0ae;
  border-radius: 12px;
  resize: vertical;
  background: #fffdf8;
}

.card-editor-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

@media (max-width: 980px) {
  .grid-two, .grid-three, .owner-layout { grid-template-columns: 1fr; }
  .landing-hero, .feature-grid, .pricing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .board-overlay-top {
    left: 10px;
    right: 10px;
    top: 10px;
    gap: 6px;
    align-items: stretch;
  }

  .board-overlay-bottom {
    left: 12px;
    right: 12px;
    bottom: 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .board-chip {
    min-height: 36px;
    padding: 8px 10px;
  }

  #board-chip {
    flex: 1 1 44%;
    min-width: 0;
  }

  #board-switcher {
    flex: 1 1 36%;
    min-width: 0;
  }

  #board-mode {
    display: none;
  }

  #logout-chip {
    flex: 0 0 auto;
  }

  #active-board-meta {
    display: none;
  }

  .board-select {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .board-fab {
    width: 54px;
    height: 54px;
  }

  .board-fab-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-left: 0;
    width: min(320px, calc(100vw - 24px));
  }

  .fab-action {
    min-width: 0;
    padding: 10px 12px;
  }
}
