/* Knitting: warm and plain, like a pattern book. The settings down the left, the garment, chart
   or pattern filling the rest; on a narrow screen the settings come first and the page scrolls. */

:root {
  --bg: #f3ebdd;
  --card: #fffaf2;
  --edge: #e2d3bb;
  --edge-2: #cdb89a;
  --text: #3b2a1c;
  --muted: #86705a;
  --accent: #c4553a;
  --accent-dark: #a5432c;
  --sage: #3e6b5a;
  --shadow: 0 1px 2px rgba(70, 45, 20, 0.08), 0 4px 14px rgba(70, 45, 20, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden;
  background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: normal; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, .drop:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
[hidden] { display: none !important; }

/* Buttons */
button {
  border: 1px solid var(--edge-2); border-radius: 8px; background: var(--card);
  padding: 6px 12px; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
button:hover:not(:disabled) { background: #fbefdf; border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: default; }
button.round { width: 32px; height: 32px; padding: 0; border-radius: 50%; line-height: 1; }
button.link { border: none; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
button.link:hover { background: none; color: var(--accent-dark); }

/* The bar along the top */
.top {
  flex: none; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--edge);
}
.back { color: var(--muted); text-decoration: none; font-size: 26px; line-height: 1; padding: 0 2px; }
.back:hover { color: var(--text); }
.top h1 { margin: 0; font-size: 22px; color: var(--accent); letter-spacing: 0.02em; }
.name {
  flex: 0 1 260px; min-width: 120px; padding: 5px 8px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; font-size: 16px; font-family: Georgia, serif;
}
.name:hover, .name:focus { border-color: var(--edge-2); background: #fff; outline: none; }
.top-buttons { display: flex; gap: 6px; }
.saved { color: var(--muted); font-size: 12px; margin-left: auto; }
.account { color: var(--muted); font-size: 13px; }
.account a { color: var(--accent); }
.account b { color: var(--text); }

/* The layout */
.app { flex: 1; min-height: 0; display: flex; }
.side {
  flex: none; width: 320px; overflow-y: auto; padding: 14px 12px 24px 16px;
  scrollbar-width: thin; scrollbar-color: var(--edge-2) transparent;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 14px 16px 16px 4px; }

/* The settings' cards */
.card {
  background: var(--card); border: 1px solid var(--edge); border-radius: 12px; padding: 12px 14px 14px;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.card h2 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; font-size: 17px; }
.card.off { opacity: 0.5; pointer-events: none; }
.note { color: var(--muted); font-size: 12px; margin: 6px 0 0; }

.drop {
  display: flex; align-items: center; gap: 12px; padding: 10px; cursor: pointer;
  border: 2px dashed var(--edge-2); border-radius: 10px; background: #fffdf9; transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: #fdf1e6; }
.drop img { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; background: #f1e8d8; image-rendering: auto; display: none; }
.drop.has img { display: block; }
.drop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.drop-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-text span { color: var(--muted); font-size: 12px; }
.samples { margin-top: 8px; color: var(--muted); font-size: 12px; }
.samples button { padding: 2px 8px; font-size: 12px; border-radius: 12px; }

.stepper { display: inline-flex; align-items: center; gap: 6px; font-family: system-ui, sans-serif; font-size: 14px; }
.stepper button { width: 26px; height: 26px; padding: 0; border-radius: 50%; line-height: 1; }
.stepper b { min-width: 16px; text-align: center; }
.swatches { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.swatches label { display: flex; align-items: center; gap: 10px; padding: 3px 4px; border-radius: 8px; cursor: pointer; position: relative; }
.swatches label:hover { background: #f8eedf; }
.swatches input[type=color] { position: absolute; left: 4px; top: 3px; width: 30px; height: 30px; opacity: 0; cursor: pointer; border: none; padding: 0; }
.swatch {
  flex: none; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--c); border: 1px solid rgba(0, 0, 0, 0.15); box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.12);
  font-weight: 700; font-size: 13px; color: #fff; text-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
}
.cname { flex: 1; min-width: 0; }
.cname small { color: var(--muted); }
.amount { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

.garments { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 10px; }
.garments button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; font-size: 11px; color: var(--muted); }
.garments svg { width: 34px; height: 34px; fill: currentColor; }
.garments button[aria-checked="true"] { border-color: var(--accent); background: #fbe9dc; color: var(--accent-dark); }
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
select, input[type=number] {
  padding: 5px 8px; border: 1px solid var(--edge-2); border-radius: 8px; background: #fff;
}
.field select { flex: 1; max-width: 190px; }
.measures, .gauge { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.gauge { grid-template-columns: 1fr 1fr; }
.measures label, .gauge label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.measures input, .gauge input { width: 100%; min-width: 0; }
.unit { display: flex; align-items: center; gap: 4px; color: var(--muted); }

.seg { display: inline-flex; border: 1px solid var(--edge-2); border-radius: 9px; overflow: hidden; margin: 0 6px 10px 0; background: var(--card); }
.seg button { border: none; border-radius: 0; padding: 5px 12px; background: none; }
.seg button + button { border-left: 1px solid var(--edge); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.seg.small button { padding: 4px 10px; font-size: 13px; }
.slider { display: grid; grid-template-columns: 54px 1fr 54px; align-items: center; gap: 8px; margin: 4px 0; color: var(--muted); font-size: 13px; }
.slider input { accent-color: var(--accent); width: 100%; }
.slider output { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; font-size: 12px; }
#centre { font-size: 12px; margin-top: 4px; }

/* The tabs, and each view */
.tabs { flex: none; display: flex; gap: 4px; margin-bottom: -1px; position: relative; z-index: 1; }
.tabs button {
  border-radius: 10px 10px 0 0; border-color: var(--edge); border-bottom-color: transparent; background: transparent;
  padding: 8px 18px; color: var(--muted); font-family: Georgia, serif; font-size: 15px;
}
.tabs button[aria-selected="true"] { background: var(--card); color: var(--text); border-color: var(--edge); border-bottom-color: var(--card); }
.view {
  flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--edge); border-radius: 0 12px 12px 12px; box-shadow: var(--shadow); overflow: hidden;
}

/* The garment */
.stage {
  flex: 1; min-height: 0; position: relative; overflow: hidden; touch-action: none; cursor: grab;
  background: radial-gradient(ellipse at 50% 40%, #fbf5ea, #efe3cf 85%);
}
.stage:active { cursor: grabbing; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage-tools { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.stage-tools > * { pointer-events: auto; }
.stage-tools .seg { margin: 0; }
.spacer { flex: 1; }
.stage-info {
  position: absolute; left: 12px; bottom: 10px; margin: 0; padding: 6px 10px; max-width: calc(100% - 24px);
  background: rgba(255, 250, 242, 0.88); border: 1px solid var(--edge); border-radius: 8px; color: var(--muted); font-size: 12px;
}
.stage-info b { color: var(--accent); }

/* The chart */
.chart-bar, .row-bar, .pattern-bar {
  flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--edge);
}
.chart-bar .seg { margin: 0; }
.paint-colours { display: inline-flex; gap: 4px; }
.paint-colours .swatch { width: 28px; height: 28px; padding: 0; border-radius: 7px; font-size: 12px; }
.paint-colours .swatch[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 1px; }
.row-bar { background: #fdf6ec; }
.row-now { min-width: 120px; text-align: center; font-variant-numeric: tabular-nums; }
.row-text { flex: 1 1 300px; min-width: 0; font-size: 13px; line-height: 1.7; }
.chart-scroll { flex: 1; min-height: 0; overflow: auto; padding: 8px; background: #fffdf8; }
#chart { display: block; margin: 0 auto; cursor: pointer; touch-action: pan-x pan-y; }
#chart.painting { cursor: crosshair; touch-action: none; }

/* The written pattern */
.pattern-bar { justify-content: flex-end; }
.pattern { flex: 1; min-height: 0; overflow: auto; padding: 8px 32px 40px; max-width: 900px; width: 100%; margin: 0 auto; }
.pattern-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--edge); padding-bottom: 8px; }
.pattern-head h2 { margin: 12px 0 2px; font-size: 30px; color: var(--accent-dark); }
.pattern-head .sub { margin: 0 0 8px; color: var(--muted); font-size: 15px; }
.pattern-preview { width: 260px; height: 220px; max-width: 45%; object-fit: contain; }
.pattern section { margin: 18px 0; }
.pattern h3 { margin: 0 0 8px; font-size: 20px; color: var(--sage); border-bottom: 1px solid var(--edge); padding-bottom: 4px; }
.pattern p, .pattern li { max-width: 72ch; }
.steps { padding-left: 22px; }
.steps li { margin: 6px 0; }
.steps li::marker { color: var(--muted); }
table.yarn { border-collapse: collapse; margin: 4px 0 8px; }
table.yarn td { padding: 4px 14px 4px 0; border-bottom: 1px solid #f0e5d4; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 5px;
  background: var(--c); border: 1px solid rgba(0, 0, 0, 0.2); font-style: normal; font-weight: 700; font-size: 11px;
  color: #fff; text-shadow: 0 0 3px rgba(0, 0, 0, 0.7); vertical-align: -5px;
}
.chart-figure { margin: 14px 0; padding: 10px; border: 1px solid var(--edge); border-radius: 10px; background: #fffdf8; overflow-x: auto; }
.chart-figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.chart-figure figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
details.rows { margin: 10px 0; }
details.rows summary { cursor: pointer; color: var(--accent); }
details.rows ul { list-style: none; padding: 0; margin: 8px 0; font-size: 13px; line-height: 1.8; }
details.rows li { padding: 2px 0; border-bottom: 1px dotted #eadcc6; }
details.rows li.heading { font-weight: 600; color: var(--sage); border: none; padding-top: 10px; }
.row-label { white-space: nowrap; }
.rs { display: inline-block; padding: 0 5px; border-radius: 4px; background: #efe3cf; color: var(--muted); font-size: 11px; line-height: 1.6; }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; background: #fbe0d4; color: var(--accent-dark); font-size: 11px; line-height: 1.6; }
dl.abbr { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
dl.abbr dt { font-weight: 600; }
dl.abbr dd { margin: 0; }

/* Knitting along: the row, big */
#view-knit { display: flex; }
#view-knit[hidden] { display: none !important; }
.knit-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--edge); }
.knit-pieces { margin: 0; flex-wrap: wrap; }
.knit-pieces button { display: inline-flex; align-items: baseline; gap: 6px; }
.knit-pieces small { font-size: 11px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.knit-head { flex: none; padding: 10px 16px 6px; }
.knit-where { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.knit-where h2 { margin: 0; font-size: 30px; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.knit-where h2 small { font-size: 17px; color: var(--muted); }
.knit-meta { color: var(--muted); font-size: 13px; }
.knit-progress { height: 6px; margin: 8px 0 4px; border-radius: 3px; background: #efe3cf; overflow: hidden; }
.knit-progress > div { height: 100%; background: var(--sage); border-radius: 3px; transition: width 0.3s; }
.knit-note { margin: 6px 0 0; font-size: 14px; color: var(--accent-dark); }
.knit-note:empty { display: none; }
.knit-strip { flex: none; overflow-x: auto; overflow-y: hidden; padding: 4px 0 8px; background: #fffdf8; border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge); }
.knit-strip canvas { display: block; }
.knit-steps { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px; }
.knit-dir { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.knit-runs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.knit-runs button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 86px; padding: 8px 12px;
  border-radius: 10px; font-size: 18px; text-align: left;
}
.knit-runs button b { font-variant-numeric: tabular-nums; }
.knit-runs .chip { width: 24px; height: 24px; font-size: 12px; vertical-align: -4px; }
.knit-sts { font-size: 11px; color: var(--muted); }
.knit-runs li.done button { opacity: 0.45; text-decoration: line-through; text-decoration-color: var(--sage); background: #f1efe6; }
.knit-runs li.now button { border: 2px solid var(--text); background: #fff; box-shadow: 0 2px 8px rgba(70, 45, 20, 0.15); }
.knit-finished { font-size: 16px; }
.knit-finished button { font-size: 16px; }
.knit-nav {
  flex: none; display: grid; grid-template-columns: 1fr auto 1.6fr; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--edge); background: var(--card);
}
.knit-nav button { min-height: 48px; font-size: 16px; }
.knit-next { background: var(--sage) !important; border-color: var(--sage) !important; color: #fff; font-weight: 600; font-size: 18px !important; }
.knit-next:hover:not(:disabled) { background: #335a4b !important; }
.project-done { display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: #efe3cf; overflow: hidden; }
.project-done span { display: block; height: 100%; background: var(--sage); }

/* The projects */
dialog.projects {
  width: min(640px, calc(100vw - 24px)); max-height: min(80vh, 720px); padding: 16px 18px 18px; border: 1px solid var(--edge);
  border-radius: 14px; background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(40, 25, 10, 0.3);
}
dialog.projects::backdrop { background: rgba(40, 25, 10, 0.35); }
.projects-head { display: flex; align-items: center; justify-content: space-between; }
.projects-head h2 { margin: 0; font-size: 22px; }
.projects-head .close { border: none; background: none; font-size: 24px; padding: 0 6px; }
.project-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.project-list li { position: relative; }
.project-list .open { width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px; text-align: left; border-radius: 10px; }
.project-list li.current .open { border-color: var(--accent); }
.project-list img, .no-thumb { width: 100%; height: 110px; object-fit: contain; background: #f6efe2; border-radius: 6px; display: block; }
.project-list b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-list small { color: var(--muted); font-size: 12px; }
.project-list .delete { position: absolute; top: 12px; right: 12px; padding: 2px 8px; font-size: 11px; opacity: 0; }
.project-list li:hover .delete, .project-list .delete:focus-visible { opacity: 1; }

/* The dock: only in the compact layout */
.dock { display: none; }
.camera { display: none; margin-top: 8px; width: 100%; }
.new-project { margin-left: auto; margin-right: 8px; }

/* Compact (a phone, or a narrow window): one view at a time, filling the screen between the bar
   and the dock; the settings are a view of their own (Design) */
[data-layout="compact"] body { height: 100vh; height: 100dvh; }
[data-layout="compact"] .top { flex-wrap: nowrap; gap: 8px; padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); }
[data-layout="compact"] .top h1 { display: none; }
[data-layout="compact"] .name { flex: 1 1 auto; min-width: 0; font-size: 15px; }
[data-layout="compact"] #new, [data-layout="compact"] .account { display: none; }
[data-layout="compact"] .saved { margin-left: 0; max-width: 90px; font-size: 11px; line-height: 1.2; text-align: right; }
[data-layout="compact"] .app { display: block; overflow: hidden; }
[data-layout="compact"] .side { display: none; width: auto; height: 100%; overflow-y: auto; padding: 12px 12px 20px; -webkit-overflow-scrolling: touch; }
[data-layout="compact"][data-tab="design"] .side { display: block; }
[data-layout="compact"][data-tab="design"] .main { display: none; }
[data-layout="compact"] .main { height: 100%; padding: 0; }
[data-layout="compact"] .tabs { display: none; }
[data-layout="compact"] .view { border: none; border-radius: 0; box-shadow: none; }
[data-layout="compact"] .stage-info { font-size: 11px; left: 8px; bottom: 8px; max-width: calc(100% - 16px); }
[data-layout="compact"] .chart-bar, [data-layout="compact"] .row-bar { padding: 6px 8px; gap: 6px; }
[data-layout="compact"] .row-bar { display: grid; grid-template-columns: auto 1fr auto; }
[data-layout="compact"] .row-now { min-width: 0; }
[data-layout="compact"] .row-text { grid-column: 1 / -1; max-height: 5.5em; overflow-y: auto; }
[data-layout="compact"] .pattern { padding: 4px 16px 32px; }
[data-layout="compact"] .knit-head { padding: 8px 12px 4px; }
[data-layout="compact"] .knit-where h2 { font-size: 24px; }
[data-layout="compact"] .knit-steps { padding: 8px 12px; }
[data-layout="compact"] .knit-runs button { font-size: 16px; min-width: 74px; padding: 6px 10px; }
[data-layout="compact"] .knit-nav { padding-bottom: 8px; }
[data-layout="compact"] .knit-nav #knit-jump { padding: 0 10px; }
[data-layout="compact"] .pattern-head { flex-direction: column-reverse; align-items: flex-start; }
[data-layout="compact"] .pattern-head h2 { font-size: 24px; }
[data-layout="compact"] .pattern-preview { max-width: 100%; width: 100%; height: 200px; }
[data-layout="compact"] dl.abbr { grid-template-columns: 1fr; gap: 0; }
[data-layout="compact"] dl.abbr dd { margin-bottom: 6px; }
[data-layout="compact"] .dock {
  display: grid; grid-template-columns: repeat(5, 1fr); flex: none;
  background: var(--card); border-top: 1px solid var(--edge); padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(70, 45, 20, 0.06);
}
.dock button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; border: none; border-radius: 0;
  background: none; color: var(--muted); font-size: 11px;
}
.dock button:hover:not(:disabled) { background: none; }
.dock svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dock button[aria-selected="true"] { color: var(--accent); }
.dock button[aria-selected="true"] svg { stroke-width: 2.2; }
/* The projects: a sheet up from the bottom */
[data-layout="compact"] dialog.projects {
  width: 100vw; max-width: none; max-height: 85vh; margin: auto 0 0; border-radius: 16px 16px 0 0;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
[data-layout="compact"] .project-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
[data-layout="compact"] .project-list img, [data-layout="compact"] .no-thumb { height: 90px; }
/* A short screen (a phone on its side): less round the edges */
@media (max-height: 500px) {
  [data-layout="compact"] .dock button { flex-direction: row; justify-content: center; gap: 6px; padding: 4px 0; }
  [data-layout="compact"] .dock svg { width: 20px; height: 20px; }
  [data-layout="compact"] .stage-info { display: none; }
}

/* Touch: things big enough for fingers, and nothing that only shows on hover */
[data-input="touch"] .camera { display: block; }
[data-input="touch"] button { min-height: 40px; }
[data-input="touch"] button.round { width: 40px; height: 40px; min-height: 0; }
[data-input="touch"] .stepper button { width: 36px; height: 36px; min-height: 0; }
[data-input="touch"] .samples button { min-height: 34px; padding: 4px 12px; }
[data-input="touch"] .seg button { min-height: 38px; }
[data-input="touch"] .dock button, [data-input="touch"] .garments button { min-height: 0; }
[data-input="touch"] .slider { grid-template-columns: 54px 1fr 50px; margin: 8px 0; }
[data-input="touch"] .slider input { height: 32px; }
[data-input="touch"] select, [data-input="touch"] input[type=number], [data-input="touch"] .name { font-size: 16px; } /* no zooming in on focus */
[data-input="touch"] select, [data-input="touch"] input[type=number] { padding: 8px; }
[data-input="touch"] .swatches label { padding: 5px 4px; }
[data-input="touch"] .paint-colours .swatch { width: 36px; height: 36px; }
[data-input="touch"] .check input { width: 20px; height: 20px; }
[data-input="touch"] .project-list .delete { opacity: 1; min-height: 30px; }
[data-input="touch"] details.rows summary { padding: 8px 0; }

/* Short labels where room is short */
.short { display: none; }
[data-layout="compact"] .long { display: none; }
[data-layout="compact"] .short { display: inline; }
[data-layout="compact"] table.yarn { font-size: 13px; }
[data-layout="compact"] table.yarn td { padding-right: 8px; }

/* Printing: just the pattern */
@media print {
  body { display: block; height: auto; overflow: visible; background: #fff; }
  .top, .side, .tabs, .dock, .pattern-bar, #view-garment, #view-chart, #view-knit { display: none !important; }
  .app, .main { display: block !important; padding: 0; height: auto !important; overflow: visible !important; }
  #view-pattern { display: block !important; border: none; box-shadow: none; overflow: visible; }
  .pattern { overflow: visible; padding: 0; max-width: none; }
  details.rows { display: block; }
  details.rows > ul { display: block; }
  .chart-figure { break-inside: avoid; }
  .chip, .swatch { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
