/* KnowUnlimited.com — UI & Editorial Stylesheet */

:root {
  --bg-page: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-card: #ffffff;
  --text-heading: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --brand-primary: #0f766e;
  --brand-primary-hover: #115e59;
  --brand-soft: #f0fdfa;
  --brand-border: #99f6e4;
  --grid-header-bg: #f1f5f9;
  --grid-border: #cbd5e1;
  --cell-output-bg: #ecfdf5;
  --cell-output-border: #10b981;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
  color: var(--text-body);
  line-height: 1.65;
}

.guide-section,
.guide-article {
  max-width: 72ch;
}

.guide-section h2,
.guide-article h2 {
  color: var(--text-heading);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.guide-section p,
.guide-article p {
  margin-bottom: 1rem;
}

/* Spreadsheet-Style Worked Tables (.sheet-table) */
.sheet-wrap {
  overflow-x: auto;
  margin: 1.25rem 0 1.75rem;
  border: 1px solid var(--grid-border);
  border-radius: 10px;
  background: var(--bg-card);
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.sheet-table th,
.sheet-table td {
  border: 1px solid var(--grid-border);
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: middle;
}

.sheet-table thead th {
  background: var(--grid-header-bg);
  color: var(--text-heading);
  font-weight: 700;
}

.sheet-table .sheet-col-hdr {
  background: #e2e8f0;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  text-align: center;
  padding: 0.3rem 0.5rem;
}

.sheet-table .sheet-row-num {
  background: #f8fafc;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  text-align: center;
  width: 36px;
  user-select: none;
}

.sheet-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sheet-table .cell-output {
  background: var(--cell-output-bg);
  outline: 1.5px solid var(--cell-output-border);
  outline-offset: -1.5px;
  font-weight: 600;
  color: #065f46;
}

/* Standalone fx Formula Bar (.fx-bar) */
.fx-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 1rem 0 1.35rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--grid-border);
  border-radius: 8px;
}

.fx-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: #e2e8f0;
  color: var(--text-heading);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 0.92rem;
  flex-shrink: 0;
}

.fx-code {
  flex: 1 1 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  color: var(--text-heading);
  background: transparent;
  padding: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.fx-copy-btn {
  border: 1px solid var(--grid-border);
  background: #ffffff;
  color: var(--text-heading);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.fx-copy-btn:hover {
  border-color: var(--brand-primary);
  background: var(--brand-soft);
  color: var(--brand-primary-hover);
}

.fx-copy-btn.copied {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

/* Semantic Callout Cards */
.callout-tip,
.callout-warn {
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
  font-size: 0.94rem;
}

.callout-tip {
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-left: 4px solid var(--brand-primary);
}

.callout-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
}
