:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #111111;
  --muted: #555555;
  --border: #d9d9d9;
  --border-strong: #bdbdbd;
  --accent: #111111;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

.page-shell {
  width: min(900px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.hero {
  display: block;
  padding: 0 0 1.5rem;
  border-bottom: 1px solid var(--border);
}

.hero-panel,
.math-card {
  display: none;
}

.eyebrow,
.log-label {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.1rem;
}

.hero-text,
.section-heading p,
.card p,
.week-focus,
.meeting-note,
textarea,
.save-status {
  color: var(--muted);
}

.hero-text {
  max-width: 70ch;
  margin: 0 0 1rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-meta span {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.tab-button,
.log-week-button,
.action-button {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius);
}

.tab-button {
  padding: 0.55rem 0.8rem;
}

.tab-button.active,
.log-week-button.active,
.action-button.primary {
  background: #f3f3f3;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.content-grid,
.reference-list,
.week-grid {
  display: grid;
  gap: 1rem;
}

.content-grid,
.week-grid,
.log-layout {
  grid-template-columns: 1fr;
}

.card,
.week-card,
.log-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card,
.log-card,
.week-card {
  padding: 1rem;
}

.goal-list,
.plain-list,
.week-card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading p {
  margin: 0;
}

.week-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.week-tag {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--muted);
}

.week-focus {
  margin-top: 0;
}

.meeting-note {
  margin-bottom: 0;
}

.log-layout {
  display: grid;
  gap: 1rem;
}

.log-sidebar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.log-week-button {
  padding: 0.5rem 0.75rem;
}

.log-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.save-status {
  margin: 0;
  font-size: 0.95rem;
}

.log-field {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.log-help {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.log-help code {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.95em;
}

textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #ffffff;
  font: inherit;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.log-preview-block {
  margin-top: 1rem;
}

.summary-preview {
  min-height: 8rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  overflow-wrap: break-word;
}

.summary-preview p:first-child {
  margin-top: 0;
}

.summary-preview p:last-child {
  margin-bottom: 0;
}

.log-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.action-button {
  padding: 0.55rem 0.85rem;
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 900px);
    padding-top: 1rem;
  }

  .log-card-header {
    flex-direction: column;
  }
}
