/* projects/table-charts/src/style.css */
:root {
  --primary: #17251e;
  --canvas: #fffef9;
  --ground: #f7f6f0;
  --forest: #184e3b;
  --surface: #eff1e8;
  --ink-deep: #17251e;
  --charcoal: #263a30;
  --slate: #3e5045;
  --steel: #66786d;
  --hairline: #d6ded5;
  --hairline-soft: #e5ebe2;
  --hairline-strong: #aab9ae;
  --brand-yellow: #d8f36b;
  --brand-blue: #26765a;
  --blue-pressed: #184e3b;
  --yellow-light: #eef8c7;
  --teal-light: #dff2e7;
  --coral-dark: #600000;
  --brand-red: #fbd4d4;
  --on-dark-muted: #c5d6cc;
  --radius-input: 8px;
  --radius-card: 16px;
  --radius-pill: 8px;
  --gutter: clamp(48px, 5vw, 72px);
  --gut: 48px;
  --nav-height: 65px;
  --padb: 72px;
  --ink: var(--primary);
  --bg: var(--ground);
  --accent: var(--forest);
  --action: var(--forest);
  --font-display: system-ui, sans-serif;
  --display-weight: 600;
  --display-tracking: -.035em;
  --t-h2: clamp(24px, 3vw, 38px);
  --mono:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  font: 400 16px/1.5 system-ui, sans-serif;
  color: var(--primary);
  background: var(--ground);
  scroll-padding-top: 16px;
}
* {
  box-sizing: border-box;
}
body[data-tool=table-charts] {
  margin: 0;
  background: var(--ground);
}
a {
  color: var(--blue-pressed);
}
button,
input,
select,
textarea {
  font: inherit;
}
:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 3px;
}
:where(#quick-panel, .editor-modes) button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--forest);
  color: var(--canvas);
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}
:where(#quick-panel, .editor-modes) button:active,
.button:active {
  background: var(--charcoal);
  color: var(--canvas);
}
#quick-panel .secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--hairline-strong);
}
#quick-panel .secondary:is(:hover, :active) {
  background: var(--surface);
}
#quick-panel button:disabled {
  background: var(--hairline);
  color: var(--slate);
  cursor: default;
}
header.nav {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--canvas);
}
.wrap {
  width: min(calc(100% - 2 * var(--gutter)), 1296px);
  margin-inline: auto;
}
nav {
  min-height: 64px;
  padding-block: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 22px;
  font-weight: 500;
  text-decoration: none;
}
.brand-mark {
  display: block;
  flex: none;
  width: 36px;
  height: 36px;
}
.brand-wordmark {
  display: block;
  flex: none;
  width: 105px;
  height: auto;
}
@media (max-width: 560px) {
  .brand {
    gap: 6px;
    font-size: 13px;
  }
  .brand-wordmark {
    width: 78px;
  }
  .brand .brand-mark {
    width: 30px;
    height: 30px;
  }
}
.nav-note {
  color: var(--slate);
  font-size: 13px;
}
.skip-link {
  position: absolute;
  z-index: 10;
  top: 12px;
  left: var(--gutter);
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-input);
  background: var(--canvas);
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}
.hero,
.editor-section {
  display: grid;
  align-items: center;
  min-height: 100svh;
  padding-block: 64px;
}
.hero {
  padding-top: calc(var(--nav-height) + 48px);
}
.hero-text {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  gap: 24px;
}
.hero__text {
  grid-column: span 5;
}
.hero__media {
  grid-column: span 7;
}
.hero .button {
  margin-top: 24px;
}
.hero .button:hover {
  background: var(--charcoal);
  color: var(--canvas);
}
.editor-section {
  background: var(--surface);
}
.editor-section > .wrap > h2 {
  margin-bottom: 20px;
}
.editor-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  gap: 24px;
}
#quick-panel {
  grid-column: span 5;
}
.example-chart {
  grid-column: span 7;
  display: grid;
  align-items: center;
  margin: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--canvas);
}
.example-chart img {
  display: block;
  width: 100%;
  height: auto;
}
#quick-panel[hidden] + .example-chart,
#quick-panel:has(#chart-result:not([hidden])) + .example-chart {
  display: none;
}
#quick-panel:has(#chart-result:not([hidden])) {
  grid-column: 1 / -1;
}
#advanced-panel {
  grid-column: 1 / -1;
}
.chart-hero {
  display: grid;
  align-content: center;
  min-height: clamp(290px, 55vh, 500px);
  padding: clamp(18px, 3vw, 36px);
  border-radius: var(--radius-card);
  background: var(--forest);
  color: var(--canvas);
}
.chart-hero-title {
  margin-bottom: 18px;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 650;
}
.chart-hero-row {
  display: grid;
  grid-template-columns: 4em minmax(0, 1fr) 2ch;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  font-size: 14px;
}
.chart-hero-row span {
  color: #e0ece4;
}
.chart-hero-row b {
  font-variant-numeric: tabular-nums;
}
.chart-hero-row i {
  display: block;
  block-size: 14px;
  inline-size: 100%;
  border-radius: 2px;
  background: var(--brand-yellow);
  transform-origin: left;
}
.chart-hero-row:nth-child(2) i {
  inline-size: 82.8125%;
}
.chart-hero-row:nth-child(4) i {
  inline-size: 65.625%;
}
@media (prefers-reduced-motion: no-preference) {
  .chart-hero-row i {
    animation: chart-bars 650ms 150ms ease-out both;
  }
}
@keyframes chart-bars {
  from {
    transform: scaleX(.3);
  }
  to {
    transform: scaleX(1);
  }
}
h1,
h2,
h3 {
  font-weight: 650;
  overflow-wrap: anywhere;
}
h1 {
  margin: 0 0 12px;
  color: var(--ink-deep);
  font-size: clamp(36px, 4.2vw, 60px);
  line-height: 1.05;
  letter-spacing: -.045em;
}
h2 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.25;
}
h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.4;
}
.lead {
  max-width: 44ch;
  margin: 0;
  color: var(--slate);
  font-size: 18px;
}
.workspace {
  min-width: 0;
  padding: clamp(16px, 3vw, 36px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--canvas);
}
label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
}
#quick-panel :where(input:not([type=checkbox]):not([type=range]):not([type=file]), select, textarea) {
  width: 100%;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-input);
  background: var(--canvas);
  color: var(--primary);
}
#quick-panel :where(input:not([type=checkbox]):not([type=range]):not([type=file]), select, textarea):focus {
  border-color: var(--brand-blue);
  outline: 1px solid var(--brand-blue);
  outline-offset: 0;
}
#quick-panel select {
  border-radius: var(--radius-pill);
}
#quick-panel textarea {
  min-height: 200px;
  padding-block: 12px;
  resize: vertical;
}
textarea.code {
  font: 14px/1.5 var(--mono);
}
#quick-panel .row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 16px;
  margin: 20px 0;
}
#quick-panel .row > .field {
  flex: 1 1 144px;
  padding: 0;
}
.field {
  min-width: 0;
}
.field small,
.hint {
  display: block;
  margin-top: 8px;
  color: var(--slate);
  font-size: 13px;
  line-height: 1.4;
}
input[type=checkbox],
input[type=range] {
  accent-color: var(--primary);
}
input[type=checkbox] {
  width: 18px;
  height: 18px;
  flex: none;
}
input[type=range] {
  width: 100%;
  min-height: 44px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
#quick-panel input[type=file] {
  max-width: 100%;
  min-height: 44px;
  font-size: 13px;
}
#quick-panel input[type=file]:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 3px;
  background: var(--teal-light);
}
#quick-panel ::file-selector-button {
  min-height: 44px;
  margin-inline-end: 8px;
  padding: 8px 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-pill);
  background: var(--canvas);
  color: var(--primary);
  font: inherit;
  cursor: pointer;
}
#status {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--slate);
  font-size: 14px;
  overflow-wrap: anywhere;
}
#status.error {
  padding: 8px 12px;
  border-radius: var(--radius-input);
  color: var(--coral-dark);
  background: var(--brand-red);
}
.closing {
  --bg: #e7eed9;
  display: grid;
  min-height: 100svh;
  padding-block: 64px var(--padb);
  background: var(--bg);
  color: var(--ink);
}
.closing > .wrap {
  display: grid;
  align-content: space-between;
  gap: 48px;
}
.closing__cta {
  max-width: 750px;
}
.closing__cta h2 {
  margin-bottom: 24px;
}
.closing__cta p {
  max-width: 65ch;
  margin: 0 0 24px;
}
.closing__links {
  border-top: 1px solid #66786d;
  padding-top: 20px;
}
.closing__links p {
  margin: 0;
}
.chart-steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}
.chart-steps h3 {
  margin: 0 0 12px;
}
.chart-steps .row {
  margin-bottom: 12px;
}
#quick-panel #table-input {
  min-height: 140px;
}
#table-file {
  max-width: 100%;
}
#chart-preview {
  margin-top: 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-input);
  overflow: auto;
}
#chart-preview svg {
  display: block;
  width: 100%;
  min-width: 540px;
  height: auto;
}
[hidden] {
  display: none !important;
}
@media (max-width: 540px) {
  #quick-panel .chart-steps .row > .field {
    flex-basis: 100%;
  }
}
.editor-modes.t-tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  margin: 0 0 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: var(--canvas);
}
.editor-modes .t-tabs-pill {
  --tabs-pill-bg: var(--brand-yellow);
  top: 4px;
  height: calc(100% - 8px);
}
.editor-modes button {
  height: auto;
  min-height: 44px;
  padding-inline: clamp(10px, 3vw, 24px);
  background: transparent;
  color: var(--primary);
}
.editor-modes:not(.has-sliding-tabs) button[aria-selected=true] {
  background: var(--brand-yellow);
  color: var(--primary);
}
.editor-modes button[aria-selected=false]:hover,
.editor-modes button[aria-selected=false]:active {
  background: var(--hairline-soft);
}
.editor-modes button:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 1px;
}
#advanced-panel {
  min-width: 0;
}
@media (max-width: 767px) {
  :root {
    --gutter: 16px;
    --padb: 48px;
  }
  .hero {
    padding-block: calc(var(--nav-height) + 28px) 48px;
  }
  .hero-text,
  .editor-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero__text,
  .hero__media,
  #quick-panel,
  .example-chart {
    grid-column: auto;
  }
  .chart-hero {
    min-height: 220px;
  }
  .editor-section,
  .closing {
    padding-block: 48px;
  }
}
@media (max-width: 479px) {
  .editor-modes.t-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .editor-modes button {
    padding-inline: 8px;
  }
  .hero .button {
    width: 100%;
  }
}
noscript {
  display: block;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--yellow-light);
}
.page-description {
  padding-block: clamp(24px, 4vw, 56px);
}
.page-description p {
  max-inline-size: 68ch;
  margin-block: 0 12px;
}
.page-description p:last-child {
  margin-block-end: 0;
}
