:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --ink: #1c2721;
  --muted: #5e6b64;
  --line: #d9ded5;
  --panel: #ffffff;
  --accent: #315c48;
  --accent-strong: #204636;
  --amber: #b66f18;
  --blue: #315f86;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  font: inherit;
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 12px clamp(14px, 2.4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 1.8vw, 2rem);
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.session {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
}

.status {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.primary:hover {
  background: var(--accent-strong);
}

.ghost {
  background: transparent;
  color: var(--ink);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
  gap: 18px;
  min-height: calc(100vh - 76px);
  padding: 16px clamp(14px, 2.4vw, 34px);
}

.workspace,
.side-panel {
  min-width: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 34px;
  margin-bottom: 12px;
}

.section-header p,
.side-panel {
  color: var(--muted);
}

.user-state {
  max-width: 680px;
  text-align: right;
  font-size: 0.92rem;
}

.user-state p {
  margin-bottom: 0;
}

.auth-status {
  margin-top: 4px;
  color: #9f3d22;
  font-size: 0.88rem;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  align-content: start;
}

.menu-item {
  display: grid;
  align-content: space-between;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.menu-item:hover {
  transform: translateY(-2px);
  border-color: #b9c5ba;
  box-shadow: 0 10px 22px rgba(25, 44, 33, 0.08);
}

.menu-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.98rem;
}

.menu-item span {
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.92rem;
}

.menu-item small {
  margin-top: 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.side-panel {
  align-self: start;
  padding: 14px 16px;
  border-left: 3px solid var(--amber);
  background: rgba(255, 255, 255, 0.55);
}

.side-panel ol {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 18px;
  line-height: 1.35;
  font-size: 0.92rem;
}

@media (min-width: 1500px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 360px;
  }

  .menu-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar {
    min-height: 64px;
    padding: 10px 12px;
  }

  .brand h1 {
    font-size: 1.25rem;
  }

  .eyebrow {
    font-size: 0.68rem;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: calc(100vh - 64px);
    padding: 12px;
  }

  .section-header {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
  }

  .session {
    justify-content: flex-end;
  }

  .user-state {
    text-align: left;
  }

  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .menu-item {
    min-height: 98px;
    padding: 12px;
  }

  .side-panel {
    border-left: 0;
    border-top: 3px solid var(--amber);
  }

  .side-panel ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 18px;
  }
}

@media (max-width: 520px) {
  button {
    min-height: 34px;
    padding: 0 11px;
  }

  .topbar {
    align-items: center;
    gap: 8px;
  }

  .status {
    display: none;
  }

  .menu-grid {
    grid-template-columns: 1fr;
  }

  .menu-item {
    min-height: auto;
  }

  .menu-item small {
    margin-top: 8px;
  }

  .side-panel ol {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
