@charset "UTF-8";
:root {
  color-scheme: light;
  --paper: #faf7f0;
  --cream: #f0ece2;
  --white: #fffdf9;
  --ink: #302d26;
  --muted: #625d53;
  --line: #ddd7ca;
  --accent: #a94c34;
  --accent-dark: #873b29;
  --accent-pale: #f3e3d8;
  --sage: #727e62;
  --sage-pale: #e7eadf;
  --danger: #a6322f;
  --radius: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: var(--accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.2; }
p { margin-bottom: 16px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
::selection { background: #ead4bc; color: var(--ink); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.app-header, .site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.header-inner { max-width: 1248px; margin: auto; padding: 18px 32px; display: flex; align-items: center; gap: 40px; min-height: 88px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; background: none; border: 0; padding: 0; }
.brand-name, .brand > span:not(.brand-mark) { font-family: Georgia, "Times New Roman", serif; font-size: 35px; letter-spacing: -2px; line-height: 1; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; color: var(--accent); }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.app-nav, .desktop-nav { display: flex; align-items: center; gap: 5px; flex: 1; }
.nav-item, .nav-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: transparent; border: 0; padding: 11px 16px; min-height: 44px; border-radius: 30px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 550; transition: background .15s, color .15s; }
.nav-item:hover, .nav-link:hover { color: var(--ink); background: var(--cream); }
.nav-item.active, .nav-link.active, .nav-item[aria-current="page"] { background: var(--ink); color: var(--paper); }
.header-actions { display: flex; gap: 8px; margin-left: auto; }
.header-note, .local-badge { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.local-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sage); }
.mobile-nav, .bottom-nav { display: none; }
.app-main, main { min-height: calc(100dvh - 89px); }
.page { max-width: 1248px; padding: 42px 32px 70px; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-heading > div { max-width: 700px; }
.eyebrow { text-transform: uppercase; letter-spacing: 2.1px; color: var(--accent); font-size: 12px; line-height: 1.4; font-weight: 700; margin: 0 0 9px; }
.page-title { font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 4.5vw, 52px); font-weight: 400; letter-spacing: -1.6px; margin: 0 0 10px; line-height: 1.06; }
.page-description { color: var(--muted); max-width: 530px; margin: 0; font-size: 14px; line-height: 1.7; }
.toolbar { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.search-field { position: relative; display: flex; align-items: center; gap: 9px; min-width: 220px; color: var(--muted); background: var(--cream); padding: 0 15px; border-radius: 9px; border: 1px solid transparent; height: 46px; flex: 1; max-width: 360px; }
.search-field:focus-within { border-color: var(--accent); }
.search-field input { border: 0; outline: 0; background: transparent; min-width: 0; width: 100%; height: 44px; color: var(--ink); font-size: 13px; }
.search-field .input { border: 0; background: transparent; padding: 0; box-shadow: none; }
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); border-radius: 30px; padding: 10px 16px; background: transparent; font-size: 12px; white-space: nowrap; min-height: 44px; transition: background .15s; }
.chip:hover { border-color: #aba28f; background: var(--cream); }
.chip.active, .chip[aria-pressed="true"] { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.chip-count, .count { color: var(--muted); font-size: 12px; margin-left: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 12px 20px; border: 1px solid transparent; border-radius: 9px; font-weight: 600; font-size: 13px; text-decoration: none; line-height: 1.3; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--white); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-secondary { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { background: var(--cream); border-color: #b5ad9c; }
.btn-quiet { color: var(--muted); background: transparent; padding: 10px 12px; }
.btn-quiet:hover { background: var(--cream); color: var(--ink); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-small { min-height: 40px; font-size: 12px; padding: 9px 14px; }
.icon-btn { width: 44px; height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); padding: 0; }
.icon-btn:hover { background: var(--cream); color: var(--ink); }
.icon-btn.active, .icon-btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-pale); }
.masonry { columns: 4; column-gap: 22px; }
.pattern-card { break-inside: avoid; margin: 0 0 28px; position: relative; border-radius: var(--radius); }
.pattern-card > button, .pattern-open { display: block; text-align: left; padding: 0; border: 0; background: transparent; width: 100%; }
.pattern-image, .pattern-card img { width: 100%; height: auto; aspect-ratio: auto; object-fit: cover; border-radius: var(--radius); background: var(--cream); }
.pattern-image-wrap, .pattern-art { position: relative; overflow: hidden; border-radius: var(--radius); }
.pattern-card .pattern-image { transition: filter .2s, transform .3s; }
.pattern-card:hover .pattern-image { filter: brightness(.97); transform: scale(1.015); }
.pattern-save, .save-button, .card-save { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; min-width: 38px; background: var(--white); border: 0; border-radius: 50%; color: var(--ink); display: grid; place-items: center; box-shadow: 0 2px 8px #302d2610; }
.pattern-save.active, .save-button.active, .card-save.active, .pattern-save[aria-pressed="true"] { background: var(--accent); color: white; }
.pattern-info { padding: 13px 2px 0; }
.pattern-info h2, .pattern-info h3, .pattern-title { font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 400; letter-spacing: -.35px; margin: 0 0 4px; color: var(--ink); }
.pattern-info p { color: var(--muted); font-size: 12px; margin: 0; line-height: 1.7; }
.pattern-meta { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12px; }
.pattern-card .tag { font-size: 12px; padding: 2px 7px; margin-top: 7px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 32px 0 17px; }
.section-heading h2, .section-title { font-family: Georgia, "Times New Roman", serif; font-size: 26px; letter-spacing: -.5px; font-weight: 400; margin: 0; }
.section-heading h3 { margin: 0; font-size: 18px; }
.section-heading p { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tag { display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; color: var(--muted); background: var(--cream); padding: 3px 8px; font-size: 12px; line-height: 1.6; }
.tag.accent, .tag.active { color: var(--accent); background: var(--accent-pale); }
.tag.success { color: #4f6344; background: var(--sage-pale); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.surface { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.surface h2, .surface h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.4px; }
.surface h2 { font-size: 25px; }
.surface h3 { font-size: 21px; }
.empty-state { text-align: center; padding: 70px 24px; max-width: 460px; margin: 0 auto; }
.empty-state > svg { color: var(--sage); width: 42px; height: 42px; margin-bottom: 17px; }
.empty-state h2, .empty-state h3 { font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 400; margin-bottom: 10px; }
.empty-state p { color: var(--muted); font-size: 14px; line-height: 1.7; margin-bottom: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-label, .field > label { font-size: 12px; font-weight: 650; letter-spacing: .15px; }
.field-full, .full-width, .form-wide { grid-column: 1 / -1; }
.input, .textarea, .select { width: 100%; min-height: 46px; border: 1px solid var(--line); padding: 11px 12px; border-radius: 7px; background: var(--white); color: var(--ink); outline: 0; font-size: 14px; transition: border-color .15s; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-pale); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.65; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
input[type="file"] { font-size: 12px; max-width: 100%; }
input[type="file"]::file-selector-button { border: 1px solid var(--line); background: var(--cream); padding: 9px 11px; margin-right: 10px; border-radius: 6px; font: inherit; cursor: pointer; }
.field-help, .form-hint { color: var(--muted); font-size: 12px; margin: 0; line-height: 1.6; }
.form-error, .error { color: var(--danger); font-size: 13px; }
.form-actions, .modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 19px; margin-top: 3px; }
.form-actions .btn-danger { margin-right: auto; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); padding: 19px 0; }
.list-row:last-child { border-bottom: 0; }
.list-row h3, .list-row h4 { margin: 0 0 5px; font-size: 15px; font-weight: 600; }
.list-row p { margin: 0; font-size: 12px; color: var(--muted); }
.list-row > div:first-child:not(.swatch):not(.yarn-swatch) { flex: 1; min-width: 0; }
.list-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-shrink: 0; }
.inventory-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.inventory-card { border-bottom: 1px solid var(--line); padding: 18px 0; position: relative; }
.inventory-card h3 { font-family: Georgia, "Times New Roman", serif; font-size: 21px; font-weight: 400; margin: 10px 0 6px; }
.inventory-card p { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.swatch, .yarn-swatch { width: 48px; height: 48px; border-radius: 50%; background: var(--cream); display: grid; place-items: center; color: var(--accent); flex-shrink: 0; border: 1px solid #302d2612; }
.yarn-card .swatch, .inventory-card .swatch { width: 64px; height: 64px; }
.yarn-swatch::after { content: ""; display: block; width: 32px; height: 32px; border: 2px solid #ffffff70; border-radius: 50%; transform: rotate(-35deg); }
.hook-size { min-width: 64px; font-size: 27px; color: var(--accent); font-family: Georgia, "Times New Roman", serif; }
.hook-size small { font-size: 12px; font-family: -apple-system, sans-serif; color: var(--muted); }
.tabs { display: flex; border-bottom: 1px solid var(--line); gap: 26px; margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; min-height: 48px; padding: 11px 1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; white-space: nowrap; }
.tab.active, .tab[aria-selected="true"] { color: var(--accent); border-color: var(--accent); font-weight: 650; }
.tabs::-webkit-scrollbar { display: none; }
.detail-back, .back-link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; background: transparent; border: 0; color: var(--muted); padding: 0; margin: -8px 0 20px; font-size: 12px; text-decoration: none; }
.detail-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 55px; align-items: start; }
.detail-hero { position: sticky; top: 118px; border-radius: var(--radius); overflow: hidden; }
.detail-hero img { width: 100%; max-height: 740px; object-fit: cover; border-radius: var(--radius); }
.detail-content { min-width: 0; padding-top: 8px; }
.detail-content .page-title { font-size: 43px; line-height: 1.12; margin-bottom: 17px; }
.detail-description { color: var(--muted); line-height: 1.8; font-size: 14px; }
.detail-actions { display: flex; gap: 10px; margin: 24px 0 26px; flex-wrap: wrap; }
.detail-tabs { margin-top: 29px; }
.materials-list { list-style: none; margin: 0; padding: 0; }
.materials-list li { padding: 12px 0 12px 25px; border-bottom: 1px solid var(--line); position: relative; font-size: 13px; }
.materials-list li::before { content: ""; position: absolute; left: 3px; top: 20px; width: 6px; height: 6px; border: 1px solid var(--accent); border-radius: 50%; }
.pattern-steps { margin: 0; padding-left: 23px; }
.pattern-steps li { padding-left: 9px; padding-bottom: 18px; font-size: 14px; line-height: 1.85; }
.pattern-steps li::marker { color: var(--accent); font-size: 12px; font-weight: 650; }
.source-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); word-break: break-word; font-size: 13px; }
.attachment-list { display: flex; flex-direction: column; gap: 8px; }
.attachment { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--cream); border-radius: 7px; font-size: 12px; }
.project-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.project-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.project-card > img, .project-card-image { aspect-ratio: 1.5; width: 100%; object-fit: cover; }
.project-card-body, .project-info { padding: 21px; }
.project-card h2, .project-card h3 { font-family: Georgia, "Times New Roman", serif; font-size: 23px; font-weight: 400; margin: 0 0 9px; }
.project-card p { color: var(--muted); font-size: 12px; }
.project-card .btn { width: 100%; margin-top: 16px; }
.project-card .inline { justify-content: space-between; }
.progress-bar { height: 5px; width: 100%; background: var(--cream); border-radius: 8px; overflow: hidden; margin: 14px 0 9px; }
.progress-bar > span, .progress-bar > div { display: block; height: 100%; background: var(--sage); border-radius: inherit; transition: width .2s; }
.workspace-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px, .8fr); gap: 38px; align-items: start; }
.workspace-main { min-width: 0; }
.workspace-side { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 112px; }
.workspace-side .surface { padding: 22px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.workspace-heading h1 { font-size: 39px; }
.counter { background: var(--cream); border-radius: var(--radius); text-align: center; padding: 30px 25px 24px; position: relative; }
.counter-label { font-size: 12px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; font-weight: 650; }
.counter-value { font-family: Georgia, "Times New Roman", serif; font-size: 104px; font-weight: 400; line-height: 1; letter-spacing: -5px; color: var(--ink); padding: 15px 0 12px; font-variant-numeric: tabular-nums; }
.counter-total { color: var(--muted); font-size: 12px; margin-bottom: 22px; }
.counter-controls { display: flex; align-items: center; justify-content: center; gap: 20px; }
.counter-controls > button { width: 64px; height: 64px; border-radius: 50%; min-width: 64px; padding: 0; display: grid; place-items: center; }
.counter-controls .btn-primary { width: 76px; height: 76px; }
.counter-controls .btn-secondary { background: var(--paper); border-color: #d2c9b8; }
.counter-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 17px; font-size: 12px; color: var(--muted); }
.counter-undo { background: transparent; border: 0; min-height: 44px; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.step-list { display: flex; flex-direction: column; gap: 0; }
.step-row { display: flex; align-items: flex-start; gap: 14px; padding: 20px 3px; border-bottom: 1px solid var(--line); line-height: 1.85; font-size: 14px; }
.step-row.completed { color: var(--muted); }
.step-row.active { background: var(--accent-pale); border-radius: 10px; padding: 18px 16px; margin-top: 3px; border-color: transparent; }
.step-row > button, .step-check { width: 30px; height: 30px; min-width: 30px; display: grid; place-items: center; border: 1px solid #c4bba9; background: transparent; border-radius: 50%; margin-top: 2px; padding: 0; }
.step-row.completed > button, .step-check[aria-pressed="true"] { background: var(--sage); border-color: var(--sage); color: white; }
.step-number { color: var(--accent); font-size: 12px; font-weight: 650; line-height: 1.5; margin-bottom: 5px; letter-spacing: .7px; text-transform: uppercase; }
.step-text { white-space: pre-wrap; }
.step-row p { margin: 0; }
.timer { text-align: center; padding: 7px 0; }
.timer-value { font-family: Georgia, "Times New Roman", serif; font-size: 40px; letter-spacing: -1px; font-variant-numeric: tabular-nums; margin: 12px 0 16px; }
.timer-controls { display: flex; gap: 8px; justify-content: center; }
.notes-status, .autosave-status { color: var(--muted); font-size: 12px; padding-top: 6px; text-align: right; min-height: 20px; }
.stat-grid, .stats-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; margin: 28px 0 30px; }
.stat { border-left: 1px solid var(--line); padding: 5px 0 7px 22px; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-value { font-family: Georgia, "Times New Roman", serif; font-size: 42px; letter-spacing: -1.3px; line-height: 1.2; margin: 0 0 5px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat strong { display: block; font-family: Georgia, serif; font-size: 38px; font-weight: 400; }
.journal-grid, .settings-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; }
.goal-panel { padding: 28px; background: var(--sage-pale); border-radius: var(--radius); }
.goal-panel h2 { font-family: Georgia, serif; font-weight: 400; font-size: 29px; letter-spacing: -.7px; }
.goal-panel .progress-bar { background: #d2d8c7; }
.goal-panel .stat-value { font-size: 45px; }
.session-row { display: flex; align-items: center; gap: 15px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.session-date { width: 40px; text-align: center; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.session-date strong { font-size: 24px; font-family: Georgia, serif; display: block; font-weight: 400; color: var(--ink); }
.settings-section { padding: 26px 0; border-bottom: 1px solid var(--line); }
.settings-section:first-child { padding-top: 0; }
.settings-section h2 { font-family: Georgia, serif; font-size: 25px; font-weight: 400; margin: 0 0 11px; }
.settings-section p { max-width: 620px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.storage-status { display: inline-flex; gap: 7px; align-items: center; font-size: 12px; color: var(--sage); }
.install-instructions { padding-left: 22px; font-size: 13px; color: var(--muted); line-height: 1.9; }
.install-instructions li { padding-bottom: 5px; }
.tools-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.calculator-result { font-family: Georgia, serif; font-size: 30px; margin: 20px 0 0; color: var(--accent); }
.stripe-preview { display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; min-height: 100px; }
.stripe-preview > div { min-height: 12px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: #25221972; padding: 24px; backdrop-filter: blur(3px); }
.modal { width: min(650px,100%); max-height: calc(100dvh - 48px); border: 0; border-radius: 16px; background: var(--paper); box-shadow: 0 24px 70px #302d2633; overflow-y: auto; overscroll-behavior: contain; padding: 0; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 26px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; background: var(--paper); }
.modal-header h2 { font-family: Georgia, serif; font-size: 28px; font-weight: 400; letter-spacing: -.6px; margin: 0; }
.modal-body { padding: 24px 26px 27px; }
.modal-body > form { display: flex; flex-direction: column; gap: 18px; }
.modal-body > .stack { gap: 18px; }
.modal-actions { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 22px; }
.toast, .toast-container { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 150; max-width: calc(100% - 40px); background: var(--ink); color: var(--white); padding: 13px 22px; border-radius: 8px; font-size: 13px; box-shadow: 0 5px 25px #302d2620; }
.toast:empty, .toast-container:empty { display: none; }
.offline-banner, .storage-banner { padding: 12px 24px; background: var(--accent-pale); color: #773924; text-align: center; font-size: 12px; border-bottom: 1px solid #e1c3b1; }
.skip-link { position: absolute; z-index: 200; top: -80px; left: 10px; background: var(--ink); color: white; padding: 12px 20px; border-radius: 6px; }
.skip-link:focus { top: 10px; }
.divider { height: 1px; background: var(--line); margin: 24px 0; }
.app-footer { border-top: 1px solid var(--line); max-width: 1184px; margin: 0 auto; padding: 22px 0; display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; letter-spacing: .3px; }
@media (min-width: 1600px) { .page { max-width: 1440px; } .header-inner { max-width: 1440px; } .masonry { column-gap: 28px; } .pattern-card { margin-bottom: 34px; } }
@media (max-width: 1050px) {
  .header-inner { gap: 24px; padding: 17px 26px; }
  .nav-item, .nav-link { padding: 10px 12px; font-size: 12px; }
  .header-note, .local-badge { display: none; }
  .masonry { columns: 3; column-gap: 19px; }
  .page { padding: 34px 26px 65px; }
  .detail-layout { gap: 34px; }
  .detail-content .page-title { font-size: 36px; }
  .project-grid { gap: 17px; }
  .workspace-layout { gap: 25px; }
  .inventory-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .header-inner { padding: 13px 20px; min-height: 70px; gap: 16px; }
  .brand-name, .brand > span:not(.brand-mark) { font-size: 32px; }
  .brand img { width: 29px; height: 29px; border-radius: 8px; }
  .brand-mark { width: 29px; height: 29px; }
  .app-nav, .desktop-nav { display: none; }
  .header-actions .btn { min-height: 40px; padding: 9px 13px; font-size: 12px; }
  .header-actions { margin-left: auto; }
  .mobile-nav, .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--paper); border-top: 1px solid var(--line); z-index: 50; justify-content: space-around; padding: 7px 6px max(7px, env(safe-area-inset-bottom)); min-height: 65px; }
  .mobile-nav .nav-item, .bottom-nav .nav-item, .mobile-nav .nav-link, .bottom-nav .nav-link { flex: 1; flex-direction: column; gap: 3px; padding: 6px 2px; border-radius: 0; color: var(--muted); min-height: 50px; font-size: 12px; background: transparent; }
  .mobile-nav .nav-item.active, .bottom-nav .nav-item.active, .mobile-nav .nav-link.active, .bottom-nav .nav-link.active { color: var(--accent); background: transparent; }
  .mobile-nav .nav-item svg, .bottom-nav .nav-item svg { width: 21px; height: 21px; }
  .nav-label { font-size: 12px; font-weight: 600; }
  .app-main, main { min-height: calc(100dvh - 70px); }
  .page { padding: 28px 20px calc(95px + env(safe-area-inset-bottom)); }
  .page-heading { gap: 14px; margin-bottom: 23px; align-items: center; }
  .page-heading > .btn { padding: 11px 13px; font-size: 12px; }
  .page-heading .btn svg { width: 16px; height: 16px; }
  .page-title { font-size: 37px; letter-spacing: -1.2px; margin-bottom: 8px; }
  .page-description { font-size: 12px; line-height: 1.7; max-width: 330px; }
  .eyebrow { font-size: 12px; letter-spacing: 1.7px; }
  .toolbar { gap: 14px; margin-bottom: 18px; }
  .search-field { max-width: none; min-width: 100%; height: 45px; }
  .chips { gap: 7px; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 3px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { font-size: 12px; padding: 10px 14px; min-height: 42px; }
  .chip-count { display: none; }
  .masonry { columns: 2; column-gap: 13px; }
  .pattern-card { margin-bottom: 22px; }
  .pattern-image, .pattern-card img { border-radius: 10px; }
  .pattern-info { padding: 10px 1px 0; }
  .pattern-info h2, .pattern-info h3, .pattern-title { font-size: 18px; line-height: 1.22; }
  .pattern-info p, .pattern-meta { font-size: 12px; line-height: 1.6; }
  .pattern-save, .save-button, .card-save { top: 9px; right: 9px; width: 33px; height: 33px; min-width: 33px; }
  .pattern-save svg, .save-button svg, .card-save svg { width: 17px; height: 17px; }
  .section-heading { margin-top: 26px; gap: 12px; }
  .section-heading h2, .section-title { font-size: 25px; }
  .section-heading .btn { font-size: 12px; padding: 9px 11px; }
  .surface { padding: 21px; border-radius: 11px; }
  .form-grid { gap: 14px; }
  .field-label, .field > label { font-size: 12px; }
  .input, .textarea, .select { font-size: 16px; }
  .modal-backdrop { padding: 14px; align-items: center; }
  .modal { max-height: calc(100dvh - 28px); border-radius: 13px; }
  .modal-header { padding: 16px 19px; }
  .modal-header h2 { font-size: 26px; }
  .modal-body { padding: 20px; }
  .modal-actions, .form-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; }
  .detail-layout { grid-template-columns: 1fr; gap: 25px; }
  .detail-hero { position: relative; top: auto; max-height: 470px; }
  .detail-hero img { max-height: 470px; object-fit: cover; }
  .detail-content { padding-top: 0; }
  .detail-content .page-title { font-size: 36px; }
  .detail-description { font-size: 13px; line-height: 1.75; }
  .detail-actions { margin: 22px 0; }
  .detail-actions > .btn-primary { flex: 1; }
  .tabs { gap: 25px; margin-bottom: 20px; }
  .tab { font-size: 12px; }
  .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .project-card > img, .project-card-image { aspect-ratio: 1; }
  .project-card-body, .project-info { padding: 15px; }
  .project-card h2, .project-card h3 { font-size: 21px; }
  .project-card p { font-size: 12px; }
  .project-card .btn { padding: 10px; font-size: 12px; }
  .project-card .inline { gap: 7px; }
  .workspace-layout { grid-template-columns: 1fr; gap: 26px; }
  .workspace-side { position: static; gap: 20px; }
  .workspace-heading h1 { font-size: 33px; }
  .counter { padding: 25px 20px 19px; }
  .counter-value { font-size: 100px; }
  .counter-controls { gap: 25px; }
  .step-row { font-size: 14px; gap: 12px; padding: 18px 1px; }
  .step-row > button, .step-check { width: 36px; height: 36px; min-width: 36px; }
  .inventory-grid { gap: 13px; }
  .list-row { gap: 12px; padding: 17px 0; }
  .list-row h3 { font-size: 14px; }
  .list-row p { font-size: 12px; }
  .list-actions { gap: 0; }
  .list-actions .icon-btn { width: 39px; height: 44px; min-width: 39px; }
  .stat-grid, .stats-grid { gap: 13px; margin: 24px 0; }
  .stat { padding-left: 15px; }
  .stat-value, .stat strong { font-size: 34px; }
  .stat-label { font-size: 12px; }
  .journal-grid, .settings-grid { grid-template-columns: 1fr; gap: 23px; }
  .goal-panel { padding: 24px; }
  .goal-panel h2 { font-size: 26px; }
  .tools-grid { grid-template-columns: 1fr; }
  .toast, .toast-container { bottom: calc(86px + env(safe-area-inset-bottom)); font-size: 12px; padding: 12px 17px; width: max-content; text-align: center; }
  .app-footer { display: none; }
}
@media (max-width: 370px) {
  .page { padding-left: 15px; padding-right: 15px; }
  .header-inner { padding-left: 15px; padding-right: 15px; }
  .page-heading { flex-wrap: wrap; align-items: start; }
  .page-heading > .btn { min-height: 42px; }
  .page-title { font-size: 34px; }
  .form-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .stat-value, .stat strong { font-size: 29px; }
  .pattern-info h2, .pattern-info h3, .pattern-title { font-size: 17px; }
  .list-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print { .app-header, .mobile-nav, .bottom-nav, .header-actions, .toast, .icon-btn, .detail-actions, .back-link { display: none !important; } .page { padding: 15px; } .detail-layout { grid-template-columns: 1fr 1fr; } .detail-hero { position: static; } }
/* Application and feature-specific compositions. */
.app-header { display: flex; align-items: center; gap: 42px; padding: 20px max(32px, calc((100vw - 1184px) / 2)); min-height: 88px; }
.app-header .brand { gap: 9px; }
.app-header .brand-caption { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; line-height: 1.4; letter-spacing: .15px; max-width: 76px; margin-left: 5px; color: var(--muted); text-align: left; }
.app-header .brand-mark { color: var(--accent); }
.brand-name { font-size: 35px; }
body.modal-open { overflow: hidden; }
.storage-warning { padding: 13px 25px; background: var(--accent-pale); color: #773924; text-align: center; font-size: 12px; }
.library-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 24px; }
.library-count { font-size: 12px; white-space: nowrap; }
.library-toolbar { margin-bottom: 16px; }
.library-toolbar > .search-field { max-width: 440px; }
.pattern-title-button { background: transparent; padding: 4px 0 0; border: 0; text-align: left; min-height: 36px; width: 100%; }
.pattern-title-button:hover h2 { color: var(--accent); }
.pattern-meta { justify-content: space-between; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.sample-label { text-transform: none; letter-spacing: 0; font-size: 12px; color: #8f887b; }
.pattern-card .pattern-title { margin-bottom: 4px; }
.pattern-caption { font-size: 12px !important; }
.save-pattern { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; background: var(--white); color: var(--ink); box-shadow: 0 2px 9px #302d2610; }
.save-pattern.is-saved { background: var(--accent); color: var(--white); }
.save-pattern.is-saved svg { fill: currentColor; }
.detail-navigation { display: flex; justify-content: space-between; align-items: center; margin: -10px 0 22px; }
.detail-navigation > .btn { padding-left: 0; }
.pattern-detail-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.detail-image-wrap { overflow: hidden; border-radius: var(--radius); background: var(--cream); max-height: 610px; }
.detail-image { width: 100%; height: auto; max-height: 610px; object-fit: cover; }
.pattern-detail-copy { padding-top: 12px; }
.detail-kicker { justify-content: space-between; min-height: 44px; margin: -6px 0 8px; }
.detail-kicker .save-pattern { position: static; background: var(--cream); box-shadow: none; }
.detail-kicker .save-pattern.is-saved { background: var(--accent); }
.detail-kicker .eyebrow { margin: 0; }
.pattern-detail-copy .page-title { font-size: 45px; line-height: 1.12; margin: 0 0 18px; }
.detail-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 21px; }
.pattern-description { font-size: 14px; color: var(--muted); line-height: 1.85; }
.pattern-keywords { font-size: 12px; }
.detail-project-actions { margin: 26px 0; }
.pattern-personal-note { border-top: 1px solid var(--line); padding-top: 15px; }
.pattern-personal-note .section-heading { margin-top: 0; font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.pattern-personal-note p { font-size: 13px; color: var(--muted); }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.pattern-detail-body { max-width: 800px; margin: 37px auto 0; }
.pattern-tab-panel { min-height: 260px; }
.pattern-tab-panel > h2, .pattern-tab-panel .section-heading h2 { font-size: 25px; font-family: Georgia, serif; font-weight: 400; margin: 21px 0 15px; }
.pattern-tab-panel .section-heading { margin: 14px 0; }
.pattern-tab-panel .section-heading h2 { margin: 0; }
.material-list { padding: 0; margin: 0 0 13px; list-style: none; }
.material-list li { display: flex; align-items: baseline; gap: 13px; border-bottom: 1px solid var(--line); padding: 14px 0; font-size: 13px; }
.material-dot { width: 6px; height: 6px; flex-shrink: 0; border: 1px solid var(--accent); border-radius: 50%; }
.pattern-steps { list-style: none; padding: 0; }
.pattern-steps li { display: flex; gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.pattern-steps .step-number { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; height: 28px; width: 28px; min-width: 28px; margin: 4px 0 0; }
.pattern-steps p { white-space: pre-wrap; margin: 0; }
.pattern-tab-panel .btn { margin-top: 18px; }
.source-link > .stack { flex: 1; gap: 3px; }
.source-credit { color: var(--muted); font-size: 12px; margin: 17px 0; }
.attachment-link { color: var(--ink); text-decoration: none; font-size: 13px; }
.attachment-link > span:first-of-type { flex: 1; }
.attachment-link:hover { color: var(--accent); }
.form-section { border-top: 1px solid var(--line); padding-top: 21px; margin-top: 4px; }
.form-section h3 { font-family: Georgia, serif; font-size: 23px; font-weight: 400; margin: 0 0 16px; }
.form-cover-preview { height: 135px; width: 110px; object-fit: cover; border-radius: 8px; }
.cover-upload { display: flex; align-items: center; gap: 18px; }
.cover-upload .field { flex: 1; }
.pattern-picker { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
.pattern-picker img { object-fit: cover; border-radius: 6px; }
.pattern-picker span { flex: 1; font-family: Georgia, serif; font-size: 20px; }
.project-grid { margin-top: 24px; }
.project-cover { display: block; overflow: hidden; height: 230px; }
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.project-card h2 a { text-decoration: none; color: var(--ink); }
.project-card h2 a:hover { color: var(--accent); }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 13px; font-size: 12px; }
.text-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--accent); padding: 0; min-height: 44px; font-size: 12px; text-decoration: none; text-align: left; }
.text-link:hover { text-decoration: underline; }
.workspace-heading { display: block; margin-bottom: 27px; }
.workspace-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 17px; }
.workspace-title-row .page-title { margin-bottom: 0; }
.workspace-heading .back-link { margin-bottom: 17px; }
.counter-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; }
.counter-heading { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.counter-heading h2 { font-family: inherit; font-size: 12px; font-weight: 600; margin: 0; }
.counter-heading > span { font-size: 12px; }
.counter-value { display: block; }
.counter-plus { border: 0; background: var(--accent); color: var(--white); }
.counter-plus:hover { background: var(--accent-dark); }
.counter-minus { border: 1px solid #cfc5b3; background: var(--paper); }
.counter-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 8px 0 20px; }
.counter-footer > span { font-size: 12px; max-width: 190px; text-align: right; }
.counter-footer .btn { padding-left: 1px; font-size: 12px; }
.repeat-counter { background: #e9ecdf; }
.repeat-counter .counter-value { font-size: 72px; padding: 37px 0 25px; }
.repeat-counter .counter-controls > button { width: 54px; height: 54px; min-width: 54px; }
.repeat-counter .counter-controls { gap: 13px; }
.repeat-counter .btn-quiet { padding: 7px; min-height: 38px; margin: 5px 0 -14px; font-size: 12px; }
.timer-panel { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 0; margin-bottom: 26px; }
.timer-panel h2 { font-family: Georgia, serif; font-weight: 400; font-size: 22px; margin: 0 0 4px; }
.timer-panel p { font-size: 12px; margin: 0; }
.timer-panel .timer-controls { align-items: center; gap: 13px; flex-wrap: wrap; }
.timer-panel .timer-value { font-family: Georgia, serif; font-size: 26px; margin: 0; }
.timer-panel .btn { padding: 9px 12px; min-height: 42px; font-size: 12px; }
.focus-line { padding: 23px; border: 1px solid #dfc9b7; border-radius: 11px; margin: 0 0 26px; background: #f4e9dc; }
.focus-line .section-heading { margin: 0 0 14px; }
.focus-line h2 { font-size: 22px; }
.current-instruction { font-family: Georgia, serif; font-size: 23px; line-height: 1.65; margin: 0 0 18px; }
.focus-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.focus-actions .btn { border-color: #cdb9a3; }
.all-instructions > summary { cursor: pointer; font-weight: 600; font-size: 12px; min-height: 44px; padding: 11px 0; }
.step-list { list-style: none; padding: 0; margin: 0 0 25px; }
.step-row.is-current { border-bottom-color: #c2ad93; }
.step-row.is-complete .step-text { color: var(--muted); }
.step-row .step-text { display: block; background: transparent; border: 0; padding: 0; text-align: left; line-height: 1.85; color: var(--ink); font-size: 13px; min-height: 44px; }
.step-row .step-check { min-width: 44px; width: 44px; height: 44px; margin: 0; }
.step-row .step-number { margin: 0; }
.notes-section { border-top: 1px solid var(--line); padding-top: 22px; }
.notes-section > span { display: block; font-size: 12px; margin-top: 7px; }
.workspace-image { width: 100%; max-height: 240px; object-fit: cover; border-radius: 11px; }
.workspace-materials .section-heading { margin-top: 0; }
.workspace-materials .section-heading h2 { font-size: 23px; }
.workspace-materials .field { margin-top: 20px; }
.yarn-checks { display: flex; flex-direction: column; gap: 9px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; padding: 5px 0; font-size: 12px; line-height: 1.75; cursor: pointer; }
.check-row input { flex-shrink: 0; }
.workspace-sources { border-top: 1px solid var(--line); padding-top: 23px; }
.workspace-sources h2 { font-family: Georgia, serif; font-size: 23px; font-weight: 400; margin-bottom: 3px; }
.workspace-sources .source-link { font-size: 12px; }
.workspace-sources p { font-size: 12px; }
.project-actions { display: flex; flex-wrap: wrap; gap: 7px; border-top: 1px solid var(--line); padding-top: 19px; }
.project-actions .btn { min-height: 44px; padding: 10px 12px; font-size: 12px; }
.finished-banner { padding: 12px 17px; background: var(--sage-pale); color: #526744; border-radius: 8px; display: flex; gap: 9px; align-items: center; font-size: 13px; }
.inventory-card { padding: 18px; background: transparent; border: 1px solid var(--line); border-radius: 11px; }
.inventory-card .yarn-swatch { width: 100%; height: 140px; border-radius: 7px; border: 0; color: #ffffffb0; margin-bottom: 7px; }
.inventory-card .yarn-swatch svg { width: 70px; height: 70px; }
.inventory-card .yarn-swatch::after { display: none; }
.hook-swatch { width: 100%; height: 140px; border-radius: 7px; background: var(--cream); display: flex; align-items: baseline; justify-content: center; padding-top: 35px; gap: 5px; color: var(--accent); }
.hook-swatch > span { font-family: Georgia, serif; font-size: 58px; line-height: 1; letter-spacing: -2px; }
.hook-swatch > small { font-size: 12px; color: var(--muted); }
.inventory-card-body { gap: 12px; }
.inventory-card-body h3 { margin: 9px 0 5px; }
.inventory-card-body > .tag { align-self: flex-start; }
.inventory-facts { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; }
.inventory-facts > div { display: flex; flex-direction: column; }
.inventory-facts dt { font-size: 12px; }
.inventory-facts dd { margin: 3px 0 0; font-size: 14px; }
.inventory-actions { justify-content: space-between; padding-top: 7px; }
.inventory-note { font-size: 12px; white-space: pre-wrap; }
.inventory-count { font-size: 12px; margin: 2px 0 15px; }
.journal-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 27px 0 34px; gap: 20px; }
.journal-stats .muted { font-size: 12px; }
.goal-panel { border: 0; margin-bottom: 27px; }
.goal-panel .section-heading { margin: 0; }
.goal-panel p { margin: 0; }
.goal-number { font-family: Georgia, serif; font-size: 40px; letter-spacing: -1px; }
.goal-number span { font-family: -apple-system, sans-serif; font-size: 13px; letter-spacing: 0; }
.goal-panel > p.muted { font-size: 12px; }
.session-row .session-icon { width: 42px; height: 42px; background: var(--cream); display: grid; place-items: center; border-radius: 50%; flex-shrink: 0; color: var(--muted); }
.session-details { flex: 1; }
.session-details .text-link { font-size: 15px; min-height: 26px; font-family: Georgia, serif; color: var(--ink); }
.session-details p { font-size: 12px; }
.tools-panel { margin-top: 30px; }
.tools-panel > summary { cursor: pointer; min-height: 44px; font-family: Georgia, serif; font-size: 24px; }
.tools-content { margin-top: 23px; }
.tools-content h3 { margin-bottom: 0; }
.tools-content .calculator-result { font-size: 25px; margin: 0 0 10px; }
.settings-page { max-width: 930px; }
.settings-section.surface { margin-bottom: 20px; padding: 25px; }
.settings-section.stack > h2 { margin-bottom: 2px; }
.settings-section.stack p { margin: 0; }
.settings-section.stack { gap: 16px; }
.settings-section.reset-section { margin-top: 12px; }
.install-steps { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.9; padding-left: 20px; }
@media (max-width: 1050px) {
  .app-header { padding: 18px 26px; gap: 24px; }
  .app-header .brand-caption { display: none; }
  .pattern-detail-layout { gap: 30px; }
  .pattern-detail-copy .page-title { font-size: 38px; }
  .timer-panel { align-items: start; }
  .timer-panel .timer-controls { justify-content: flex-end; }
  .project-cover { height: 190px; }
}
@media (max-width: 760px) {
  .app-header { min-height: 69px; padding: 12px 20px; gap: 15px; }
  .app-header .brand-caption { display: block; font-size: 12px; max-width: 65px; margin-left: 4px; }
  .app-header .brand > span:not(.brand-mark):not(.brand-caption) { font-size: 32px; }
  .app-header .header-actions { gap: 4px; }
  .library-filter-row { margin-bottom: 20px; }
  .library-count { display: none; }
  .library-toolbar { flex-wrap: nowrap; gap: 10px; }
  .library-toolbar > .search-field { min-width: 0; flex: 1; }
  .library-toolbar > .chip { flex-shrink: 0; }
  .library-toolbar .search-field input { font-size: 12px; }
  .pattern-meta { font-size: 8px; gap: 2px; line-height: 1.6; }
  .sample-label { font-size: 8px; }
  .pattern-title-button { min-height: 40px; padding-top: 5px; }
  .save-pattern { top: 7px; right: 7px; width: 44px; height: 44px; }
  .save-pattern svg { width: 18px; height: 18px; }
  .detail-navigation { margin-top: -9px; margin-bottom: 14px; }
  .pattern-detail-layout { grid-template-columns: 1fr; gap: 22px; }
  .detail-image-wrap { max-height: 430px; }
  .detail-image { max-height: 430px; }
  .pattern-detail-copy { padding-top: 0; }
  .pattern-detail-copy .page-title { font-size: 37px; margin-bottom: 15px; }
  .pattern-description { font-size: 13px; }
  .detail-tags { margin-bottom: 17px; }
  .detail-project-actions { margin: 23px 0 10px; }
  .detail-project-actions .btn:first-child { flex: 1; }
  .pattern-detail-body { margin-top: 26px; }
  .pattern-tab-panel { min-height: 230px; }
  .pattern-tab-panel .section-heading { font-size: 24px; }
  .pattern-tab-panel .section-heading .muted { font-size: 12px; }
  .pattern-steps { font-size: 13px; }
  .project-cover { height: 170px; }
  .project-card-footer { align-items: flex-start; flex-direction: column; gap: 0; }
  .project-card-footer .text-link { font-size: 12px; }
  .workspace-title-row .page-title { font-size: 34px; }
  .workspace-layout { display: flex; flex-direction: column; }
  .workspace-main, .workspace-side { width: 100%; }
  .workspace-heading { margin-bottom: 23px; }
  .workspace-heading .back-link { margin-bottom: 12px; }
  .counter-grid { gap: 12px; grid-template-columns: 1.25fr 1fr; }
  .counter { padding: 19px 14px 17px; }
  .counter-heading { gap: 5px; align-items: flex-start; }
  .counter-heading h2 { font-size: 12px; }
  .counter-heading > span { font-size: 12px; }
  .counter-value { font-size: 84px; padding: 17px 0 16px; }
  .counter-controls { gap: 15px; }
  .counter-controls > button { width: 53px; height: 53px; min-width: 53px; }
  .counter-controls .counter-plus { width: 62px; height: 62px; min-width: 62px; }
  .repeat-counter .counter-value { font-size: 66px; padding: 29px 0 23px; }
  .repeat-counter .counter-controls { gap: 9px; }
  .repeat-counter .counter-controls > button { width: 44px; height: 44px; min-width: 44px; }
  .repeat-counter .counter-controls .counter-plus { width: 49px; height: 49px; min-width: 49px; }
  .repeat-counter .btn-quiet { font-size: 12px; }
  .counter-footer { margin-bottom: 14px; gap: 12px; }
  .counter-footer > span { font-size: 12px; max-width: 170px; }
  .timer-panel { gap: 16px; padding: 16px 0; }
  .timer-panel h2 { font-size: 20px; }
  .timer-panel p { font-size: 12px; max-width: 150px; }
  .timer-panel .timer-controls { gap: 7px; flex-direction: column; align-items: flex-end; }
  .timer-panel .timer-value { font-size: 24px; }
  .timer-panel .btn { font-size: 12px; padding: 9px; }
  .focus-line { padding: 20px; }
  .focus-line .section-heading h2 { font-size: 21px; }
  .current-instruction { font-size: 22px; }
  .focus-actions .btn { padding-left: 12px; padding-right: 12px; font-size: 12px; }
  .workspace-image { max-height: 290px; }
  .workspace-side { border-top: 1px solid var(--line); padding-top: 25px; }
  .workspace-materials .section-heading h2 { font-size: 25px; }
  .inventory-card { padding: 12px; }
  .inventory-card .yarn-swatch, .hook-swatch { height: 110px; }
  .inventory-card .yarn-swatch svg { width: 57px; height: 57px; }
  .hook-swatch { padding-top: 30px; }
  .hook-swatch > span { font-size: 49px; }
  .inventory-card h3 { font-size: 20px; }
  .inventory-facts { gap: 10px; }
  .inventory-facts dt { font-size: 12px; }
  .inventory-facts dd { font-size: 12px; }
  .inventory-actions { flex-wrap: nowrap; gap: 5px; }
  .inventory-actions .btn { font-size: 12px; padding: 9px 10px; }
  .journal-stats { gap: 13px; margin-top: 25px; }
  .journal-stats .muted { font-size: 12px; }
  .goal-panel { padding: 22px; }
  .goal-panel .section-heading h2 { font-size: 23px; }
  .goal-panel .section-heading .btn { font-size: 12px; }
  .goal-number { font-size: 35px; }
  .goal-number span { font-size: 12px; }
  .session-row { gap: 10px; flex-wrap: nowrap; }
  .session-row .session-icon { width: 33px; height: 33px; }
  .session-row .inline { gap: 0; flex-wrap: nowrap; }
  .session-row .icon-btn { width: 35px; min-width: 35px; }
  .session-details .text-link { font-size: 15px; }
  .session-details p { font-size: 12px; line-height: 1.8; }
  .settings-section.surface { padding: 22px; }
  .settings-section h2 { font-size: 24px; }
  .settings-actions .btn { flex: 1; padding-left: 12px; padding-right: 12px; }
}
/* The header shell follows the same page width as the content. */
.app-header { display: block; padding: 0; min-height: 0; }
.app-header .header-inner { max-width: 1248px; width: 100%; min-height: 88px; padding: 18px 32px; gap: 42px; }
@media (min-width: 1600px) { .app-header .header-inner { max-width: 1440px; } }
@media (max-width: 1050px) { .app-header .header-inner { padding: 17px 26px; gap: 24px; } }
@media (max-width: 760px) { .app-header .header-inner { min-height: 69px; padding: 12px 20px; gap: 15px; } }
@media (max-width: 370px) { .app-header .header-inner { padding-left: 15px; padding-right: 15px; } }
/* Row-ordered cards keep visual, keyboard and screen-reader reading order together. */
.masonry { columns: auto; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 28px 22px; align-items: start; }
.masonry > .pattern-card { margin: 0; min-width: 0; }
.sample-label { color: var(--muted); }
@media (min-width: 1600px) { .masonry { gap: 32px 28px; } }
@media (max-width: 1050px) { .masonry { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 25px 19px; } }
@media (max-width: 760px) { .masonry { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 23px 13px; } }
/* Keep every button reachable with a thumb, including compact secondary actions. */
button { min-height: 44px; }
.pattern-title-button, .repeat-counter .btn-quiet, .btn-small { min-height: 44px; }
.list-actions .icon-btn, .session-row .icon-btn { width: 44px; min-width: 44px; height: 44px; }
.session-details .text-link { min-height: 44px; }
@media (max-width: 760px) {
  .chip { min-height: 44px; }
  .pattern-meta, .sample-label { font-size: 12px; }
  .header-actions .btn { min-height: 44px; }
  .repeat-counter .btn-quiet { margin-bottom: -11px; }
}
/* Instruction text uses the full remaining row beside its check control. */
.step-row .step-text { flex: 1; width: auto; min-width: 0; height: auto; overflow-wrap: anywhere; }
/* Saved measurements and colour planning tools. */
.tools-page { max-width: 1248px; }
.tools-section-heading { align-items: flex-start; margin-top: 28px; }
.tools-section-heading p { max-width: 500px; }
.calculators-grid { display: grid; grid-template-columns: minmax(0,1.12fr) minmax(0,1fr); gap: 32px; align-items: start; }
.calculators-grid > .stack { gap: 32px; }
.tool-card { border-top: 1px solid var(--line); padding: 24px 0 0; min-width: 0; }
.tool-card h2 { font-family: Georgia, serif; font-size: 27px; font-weight: 400; letter-spacing: -.5px; margin-bottom: 23px; }
.tool-card > .field { margin-bottom: 18px; }
.tool-result { border-left: 2px solid #bda47d; padding: 3px 0 3px 18px; margin: 23px 0 0; }
.tool-result > strong { font-family: Georgia, serif; font-weight: 400; font-size: 26px; letter-spacing: -.4px; color: var(--accent); display: block; line-height: 1.4; }
.tool-result p { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 10px 0 0; }
.tool-result small { display: block; color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 8px; }
.tool-card > .field-help { margin-top: 17px; }
.spacing-calculator { grid-column: 1 / -1; }
.spacing-calculator .form-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.spacing-instructions { margin: 15px 0 0; padding-left: 21px; color: var(--ink); font-size: 13px; line-height: 1.85; }
.spacing-instructions li { padding: 3px 0 3px 5px; }
.swatch-library-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.swatch-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; align-items: stretch; min-width: 0; }
.swatch-art { width: 130px; flex-shrink: 0; background: #b2bca0; display: grid; grid-template-columns: repeat(8,1fr); align-content: center; padding: 18px 12px; gap: 3px 2px; }
.swatch-art span { display: block; height: 12px; border: 2px solid #e8eddd80; border-top: 0; border-radius: 0 0 8px 8px; }
.swatch-card-info { padding: 14px 19px 15px; flex: 1; min-width: 0; }
.swatch-card-info > .inline { flex-wrap: nowrap; }
.swatch-card-info > .inline .inline { gap: 0; }
.swatch-card-info h3 { font-family: Georgia, serif; font-size: 24px; font-weight: 400; margin: 9px 0 14px; letter-spacing: -.4px; overflow-wrap: anywhere; }
.swatch-gauge { font-family: Georgia, serif; font-size: 20px; margin: 0 0 14px; }
.swatch-gauge small { display: block; font-family: -apple-system, sans-serif; font-size: 12px; color: var(--muted); margin-top: 3px; }
.swatch-card-info > p.muted { font-size: 12px; line-height: 1.8; margin-bottom: 10px; }
.swatch-notes { font-size: 12px; margin: 13px 0 0; }
.swatch-card-info > .btn { padding-left: 0; }
.swatch-live-gauge { font-family: Georgia, serif; font-size: 22px; line-height: 1.5; color: var(--accent); margin: 4px 0; }
.stripe-plans-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.stripe-plan-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-width: 0; }
.stripe-plan-preview { display: flex; flex-direction: column; width: 100%; height: 280px; background: var(--cream); overflow: hidden; }
.stripe-plan-preview > span { flex-basis: 0; display: block; width: 100%; min-height: 0; }
.stripe-plan-card-body { padding: 17px 20px 21px; }
.stripe-plan-card-body h3 { font-family: Georgia, serif; font-size: 24px; font-weight: 400; letter-spacing: -.5px; margin: 0; flex: 1; overflow-wrap: anywhere; }
.stripe-plan-card-body > .inline { gap: 2px; flex-wrap: nowrap; align-items: flex-start; }
.stripe-plan-card-body > .inline > .inline { gap: 0; flex-wrap: nowrap; }
.stripe-plan-card-body > p { font-size: 12px; color: var(--muted); margin: 9px 0 14px; }
.stripe-plan-card-body > .btn { width: 100%; margin-top: 15px; }
.stripe-row-ranges { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 3px; }
.stripe-row-ranges > summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 12px; color: var(--muted); }
.stripe-range-list { max-height: 320px; overflow-y: auto; padding: 0 3px 5px 0; }
.stripe-range-row { display: grid; grid-template-columns: 14px minmax(80px,1fr) minmax(0,1fr) 44px; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding: 10px 0; font-size: 12px; }
.stripe-range-row > span:nth-of-type(3) { overflow-wrap: anywhere; }
.stripe-range-row > small { font-size: 12px; text-align: right; }
.colour-dot { display: block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid #302d2620; }
.stripe-editor-layout { display: grid; grid-template-columns: minmax(0,1fr) 130px; gap: 20px; align-items: start; }
.stripe-editor-preview { padding-top: 5px; position: sticky; top: 90px; }
.stripe-editor-preview .stripe-plan-preview { height: 340px; border-radius: 8px; border: 1px solid #302d2612; }
.stripe-editor-rows { display: flex; flex-direction: column; gap: 15px; }
.stripe-editor-row { display: grid; grid-template-columns: 44px minmax(0,1fr) 62px; gap: 8px; align-items: end; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.stripe-editor-row > .input { padding-left: 10px; padding-right: 10px; font-size: 13px; }
.stripe-editor-row > .field .input { padding-left: 9px; padding-right: 5px; }
.stripe-editor-row > .field .field-label { font-size: 12px; }
.colour-input { display: block; border: 1px solid var(--line); border-radius: 7px; width: 44px; height: 46px; background: transparent; padding: 4px; cursor: pointer; }
.colour-input::-webkit-color-swatch-wrapper { padding: 0; }
.colour-input::-webkit-color-swatch { border: 0; border-radius: 3px; }
.stripe-order-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 0; margin-top: -6px; margin-bottom: -9px; }
.stripe-order-actions .icon-btn { width: 44px; height: 44px; }
.stripe-order-actions .icon-btn > span { font-size: 19px; }
.stripe-plan-summary { font-size: 12px; margin: 0; }
.stripe-plan-form > .field-help { margin-top: -10px; }
.counter-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.counter-grid .counter { padding: 20px 14px 15px; }
.counter-grid .counter-heading { align-items: flex-start; }
.counter-grid .counter-value { font-size: 76px; padding: 22px 0 20px; }
.counter-grid .counter-controls { gap: 9px; }
.counter-grid .counter-controls > button { width: 46px; height: 46px; min-width: 46px; }
.counter-grid .counter-controls .counter-plus { width: 55px; height: 55px; min-width: 55px; }
.counter-grid .repeat-counter .counter-value, .counter-grid .stitch-counter .counter-value { font-size: 62px; padding: 29px 0 24px; }
.counter-grid .counter .btn-quiet { font-size: 12px; min-height: 44px; padding: 5px; margin: 5px 0 -7px; }
.stitch-counter { background: #ede3d5; }
.line-counter { border-top: 1px solid #dfc9b7; margin-top: 20px; padding-top: 17px; }
.line-counter .section-heading { margin-bottom: 8px; }
.line-counter .section-heading h3 { font-family: inherit; font-size: 12px; font-weight: 600; }
.line-count-value { font-family: Georgia, serif; font-size: 30px; }
.line-counter-actions { gap: 8px; }
.line-counter-actions .icon-btn { border: 1px solid #cdb9a3; }
.line-counter > .field { max-width: 200px; margin-top: 10px; }
.line-target { max-width: 120px; }
.step-copy { flex: 1; min-width: 0; }
.step-photo-button { border: 0; background: transparent; padding: 0; border-radius: 8px; display: block; max-width: 100%; margin-top: 12px; }
.step-photo { width: auto; max-width: 100%; max-height: 160px; object-fit: contain; border-radius: 8px; }
.step-photo-figure, .step-photo-viewer { margin: 0; }
.step-photo-full { width: 100%; max-height: 70dvh; object-fit: contain; border-radius: 8px; }
.step-photo-figure figcaption { font-size: 13px; margin-top: 15px; color: var(--muted); line-height: 1.8; }
.step-photo-mapping { gap: 15px; align-items: center; }
.step-photo-mapping > img { max-width: 64px; height: 64px; object-fit: cover; border-radius: 7px; }
.step-photo-mapping > .field { flex: 1; }
.drafts-section { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 4px; }
.draft-row > div:first-child { min-width: 0; }
.draft-row h3, .draft-row strong { overflow-wrap: anywhere; }
.onboarding { text-align: center; }
.onboarding > img { width: 100%; max-height: 190px; object-fit: cover; border-radius: 9px; margin-bottom: 20px; }
.onboarding h2 { font-family: Georgia, serif; font-size: 30px; font-weight: 400; letter-spacing: -.6px; }
.onboarding p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.onboarding form { text-align: left; margin-top: 20px; }
.onboarding .btn { width: 100%; }
.share-preview, .share-card-preview { max-width: 100%; max-height: 65dvh; object-fit: contain; border-radius: 10px; }
@media (max-width: 1050px) {
  .swatch-library-grid { grid-template-columns: 1fr; }
  .stripe-plans-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .counter-grid { gap: 10px; }
  .counter-grid .counter { padding-left: 11px; padding-right: 11px; }
  .counter-grid .counter-controls { gap: 5px; }
}
@media (max-width: 760px) {
  .calculators-grid { grid-template-columns: 1fr; gap: 25px; }
  .calculators-grid > .stack { gap: 25px; }
  .tool-card { padding-top: 22px; }
  .tool-card h2 { font-size: 26px; margin-bottom: 20px; }
  .tool-result > strong { font-size: 25px; }
  .tool-result { padding-left: 15px; }
  .spacing-calculator .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tools-section-heading { gap: 10px; }
  .tools-section-heading .btn { font-size: 12px; padding: 10px 12px; }
  .tools-section-heading h2 { font-size: 25px; }
  .tools-section-heading p { font-size: 12px; max-width: 210px; }
  .swatch-card { display: block; }
  .swatch-art { width: 100%; height: 120px; padding: 17px calc((100% - 145px) / 2); gap: 2px; }
  .swatch-art span { height: 9px; }
  .swatch-card-info { padding: 16px 21px; }
  .swatch-card-info h3 { font-size: 25px; margin-top: 9px; }
  .stripe-plans-grid { grid-template-columns: 1fr; }
  .stripe-plan-preview { height: 250px; }
  .stripe-plan-card-body { padding: 18px 21px 22px; }
  .stripe-editor-layout { grid-template-columns: minmax(0,1fr) 80px; gap: 12px; }
  .stripe-editor-preview .stripe-plan-preview { height: 300px; }
  .stripe-editor-row { grid-template-columns: 44px minmax(0,1fr) 52px; gap: 6px; }
  .stripe-editor-row > .input { font-size: 16px; padding-left: 7px; padding-right: 7px; }
  .stripe-editor-row > .field .input { padding-left: 7px; }
  .stripe-editor-row > .field .field-label { font-size: 12px; }
  .stripe-range-row { gap: 6px; font-size: 12px; grid-template-columns: 12px minmax(76px,1fr) minmax(0,1fr) 38px; }
  .stripe-range-row small { font-size: 12px; }
  .counter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .counter-grid .row-counter { grid-column: 1 / -1; padding: 17px 19px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; column-gap: 18px; }
  .counter-grid .row-counter .counter-heading { grid-column: 1 / -1; }
  .counter-grid .row-counter .counter-value { font-size: 84px; padding: 13px 0 0; text-align: left; }
  .counter-grid .row-counter .counter-controls { justify-content: flex-end; gap: 18px; padding-top: 14px; }
  .counter-grid .row-counter .counter-controls > button { width: 55px; height: 55px; min-width: 55px; }
  .counter-grid .row-counter .counter-controls .counter-plus { width: 66px; height: 66px; min-width: 66px; }
  .counter-grid .repeat-counter, .counter-grid .stitch-counter { padding: 17px 16px 14px; }
  .counter-grid .repeat-counter .counter-value, .counter-grid .stitch-counter .counter-value { font-size: 62px; padding: 18px 0; }
  .counter-grid .counter-controls { gap: 18px; }
  .counter-grid .counter-controls > button { width: 44px; height: 44px; min-width: 44px; }
  .counter-grid .counter-controls .counter-plus { width: 52px; height: 52px; min-width: 52px; }
  .counter-grid .counter .btn-quiet { margin: 4px 0 -6px; }
  .line-counter .section-heading h3 { font-size: 12px; }
  .line-counter-actions .btn { font-size: 12px; padding-left: 9px; padding-right: 9px; }
  .library-page .page-heading { display: block; }
  .library-page .page-heading > .inline { margin-top: 17px; gap: 9px; }
  .library-page .page-heading > .inline .btn { flex: 1; padding: 11px 10px; font-size: 12px; }
  .draft-row { flex-wrap: wrap; gap: 8px; }
  .draft-row > .inline { width: 100%; justify-content: flex-end; }
  .step-photo-mapping { flex-wrap: wrap; }
  .step-photo-mapping > .field { min-width: 180px; }
}
@media (max-width: 370px) {
  .stripe-editor-layout { grid-template-columns: 1fr; }
  .stripe-editor-preview { position: static; }
  .stripe-editor-preview .stripe-plan-preview { height: 160px; }
  .stripe-editor-row { grid-template-columns: 44px minmax(0,1fr) 62px; }
  .spacing-calculator .form-grid { grid-template-columns: 1fr; }
}
/* Making controls remain close to the work on an iPhone. */
.focus-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -8px 0 23px; }
.focus-toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.focus-toolbar .btn { font-size: 12px; }
.focus-mode .workspace-layout { grid-template-columns: minmax(0,1fr); max-width: 820px; margin-left: auto; margin-right: auto; }
.focus-mode .workspace-side, .focus-mode .notes-section, .focus-mode .all-instructions, .focus-mode .focus-secondary { display: none; }
.focus-mode .workspace-main { width: 100%; }
.focus-mode .counter-footer > span { display: none; }
@media (max-width: 760px) {
  .pattern-detail { padding-bottom: calc(185px + env(safe-area-inset-bottom)); }
  .detail-project-actions { position: fixed; bottom: calc(65px + env(safe-area-inset-bottom)); left: 0; right: 0; margin: 0; padding: 12px 20px; gap: 9px; background: var(--paper); border-top: 1px solid var(--line); z-index: 45; box-shadow: 0 -5px 18px #302d2608; }
  .detail-project-actions .btn { flex: 1; min-height: 46px; padding: 11px 9px; font-size: 12px; }
  .focus-toolbar { gap: 10px; margin-top: -6px; margin-bottom: 19px; }
  .focus-toolbar p { font-size: 12px; }
  .focus-toolbar .btn { font-size: 12px; padding: 10px 13px; }
  .focus-mode .workspace-heading { margin-bottom: 18px; }
  .focus-mode .workspace-title-row .page-title { font-size: 31px; }
  .focus-mode .counter-grid .row-counter { padding: 14px 18px; }
  .focus-mode .counter-grid .row-counter .counter-value { font-size: 68px; padding-top: 8px; }
  .focus-mode .counter-grid .row-counter .counter-controls { padding-top: 8px; }
  .focus-mode .counter-grid .repeat-counter, .focus-mode .counter-grid .stitch-counter { padding: 13px 15px 11px; }
  .focus-mode .counter-grid .repeat-counter .counter-value, .focus-mode .counter-grid .stitch-counter .counter-value { font-size: 44px; padding: 10px 0; }
  .focus-mode .counter-footer { margin: 0 0 8px; }
  .focus-mode .focus-line { padding: 19px; margin-bottom: 10px; }
  .focus-mode .current-instruction { font-size: 22px; }
}
/* Reading sizes are shared across dense lists, forms and the making workspace. */
.field-help, .form-hint, .field > small, .notes-status, .autosave-status,
.pattern-meta, .sample-label, .pattern-caption, .stat-label, .inventory-count,
.inventory-facts dt, .session-details p, .counter-heading > span,
.counter-footer > span, .timer-panel p, .storage-status, .stripe-range-row,
.stripe-range-row > small, .swatch-gauge small, .tool-result small,
.source-host, .source-credit { font-size: 12px; }
small { font-size: 12px; }
.project-grid > .project-card:only-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(180px,240px) minmax(0,1fr); }
.project-grid > .project-card:only-child .project-cover { height: 100%; min-height: 240px; }
.project-grid > .project-card:only-child .project-card-body { padding: 28px 32px; }
.project-grid > .project-card:only-child h2 { font-size: 32px; margin-top: 8px; }
.project-grid > .project-card:only-child .project-card-footer { align-items: center; margin-top: 10px; }
.project-grid > .project-card:only-child .project-card-footer .text-link { min-height: 46px; background: var(--accent); color: var(--white); padding: 11px 18px; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 600; }
.project-grid > .project-card:only-child .project-card-footer .text-link:hover { background: var(--accent-dark); }
.project-share-preview, .finish-photo-preview { display: block; width: 100%; max-width: 100%; max-height: 60dvh; object-fit: contain; border-radius: 10px; background: var(--cream); }
.finish-photo-preview { max-height: 240px; }
.project-share > .inline { justify-content: center; }
.project-share > .inline > .btn { flex: 1; }
.onboarding .field { text-align: left; }
.onboarding-intro { margin: 0; }
.focus-mode .focus-secondary { display: block; border-top: 1px solid var(--line); margin-top: 23px; padding-top: 8px; }
.focus-secondary > summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 14px; font-weight: 600; }
.focus-mode .focus-secondary .all-instructions, .focus-mode .focus-secondary .notes-section { display: block; }
.focus-mode .focus-secondary .timer-panel { margin-top: 13px; }
.line-counter > summary { cursor: pointer; min-height: 44px; padding: 10px 0; font-size: 14px; font-weight: 600; }
@media (max-width: 760px) {
  /* Action labels and field labels stay legible at an iPhone's native scale. */
  button, .btn, .text-link { font-size: 14px !important; }
  .field-label, .field > label { font-size: 14px !important; line-height: 1.4; }
  .mobile-nav .nav-label, .bottom-nav .nav-label { font-size: 12px; }
  .page-description, .pattern-description, .settings-section p, .onboarding p { font-size: 14px; }
  .page-heading > .btn { max-width: 100%; }
  .project-grid > .project-card:only-child { grid-template-columns: 105px minmax(0,1fr); }
  .project-grid > .project-card:only-child .project-cover { min-height: 250px; }
  .project-grid > .project-card:only-child .project-card-body { padding: 18px; }
  .project-grid > .project-card:only-child h2 { font-size: 25px; line-height: 1.2; margin-top: 7px; }
  .project-grid > .project-card:only-child p { font-size: 12px; line-height: 1.7; }
  .project-grid > .project-card:only-child .project-card-footer { flex-direction: column; align-items: stretch; gap: 7px; }
  .project-grid > .project-card:only-child .project-card-footer .text-link { justify-content: center; padding-left: 10px; padding-right: 10px; }
  .pattern-meta { letter-spacing: .3px; row-gap: 4px; }
  .pattern-caption { line-height: 1.7; }
  .detail-project-actions { padding: 12px 20px; }
  .detail-project-actions .btn { min-width: 0; white-space: normal; text-align: center; }
  .focus-toolbar { align-items: center; }
  .focus-toolbar p { font-size: 12px; }
  .counter-heading h2 { font-size: 14px; }
  .counter-heading > span { font-size: 12px; }
  .counter-footer { align-items: flex-start; }
  .counter-footer > span { max-width: 180px; line-height: 1.6; }
  .counter-footer .btn { white-space: normal; }
  .focus-mode .focus-line { padding: 20px; }
  .focus-mode .current-instruction { font-size: 23px; line-height: 1.55; }
  .focus-mode .focus-line .section-heading h2 { font-size: 23px; }
  .focus-mode .counter-grid { margin-top: 19px; }
  .focus-mode .counter-grid .counter-value { font-variant-numeric: tabular-nums; }
  .focus-mode .focus-secondary { margin-top: 20px; }
  .tools-section-heading { flex-wrap: wrap; }
  .tools-section-heading p { max-width: 290px; font-size: 14px; }
  .tool-result p, .tool-result small { font-size: 12px; }
  .stripe-editor-layout { grid-template-columns: 1fr; }
  .stripe-editor-preview { position: static; }
  .stripe-editor-preview .stripe-plan-preview { height: 180px; }
  .stripe-editor-row { grid-template-columns: 44px minmax(0,1fr) 72px; align-items: end; }
  .stripe-editor-row > .field .field-label { font-size: 14px; }
  .stripe-range-row { grid-template-columns: 12px minmax(90px,1fr) minmax(0,1fr) 50px; font-size: 12px; }
  .stripe-range-row > small { font-size: 12px; }
  .session-row { flex-wrap: wrap; }
  .session-row > .inline:last-child { margin-left: auto; }
  .swatch-card-info > p.muted, .swatch-gauge small { font-size: 12px; }
  .timer-panel { flex-wrap: wrap; }
  .timer-panel p { font-size: 12px; max-width: 220px; }
  .timer-panel .timer-controls { flex-direction: row; align-items: center; justify-content: flex-end; flex: 1; flex-wrap: wrap; }
  .notes-section > span { font-size: 12px; }
  .check-row { font-size: 14px; }
  .finished-banner { font-size: 14px; }
  .inventory-facts dt { font-size: 12px; }
  .inventory-actions { flex-wrap: wrap; }
  .inventory-actions .btn { flex: 1; }
  .list-row p { font-size: 12px; }
  .list-actions .icon-btn, .session-row .icon-btn { width: 44px; min-width: 44px; }
}
@media (max-width: 370px) {
  .project-grid > .project-card:only-child { grid-template-columns: 85px minmax(0,1fr); }
  .project-grid > .project-card:only-child .project-card-body { padding: 15px; }
  .project-grid > .project-card:only-child h2 { font-size: 23px; }
  .stripe-range-row { grid-template-columns: 12px minmax(85px,1fr) minmax(0,1fr); }
  .stripe-range-row > small { grid-column: 2 / -1; text-align: left; margin-top: -5px; }
}
/* Personal titles and notes may contain long words or pasted links. */
.page-title, .pattern-title, .pattern-caption, .project-card h2,
.inventory-card h3, .inventory-note, .swatch-card-info h3,
.stripe-plan-card h3, .pattern-description, .source-credit,
.step-text, .current-instruction, .draft-row strong { overflow-wrap: anywhere; }
.text-link { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.tag.accent, .tag.active { color: var(--accent-dark); }
@media (max-width: 760px) {
  .search-field input { font-size: 16px !important; }
}
/* Stash photos and colour swatches are entered by the maker. */
.inventory-card .yarn-photo { display: block; width: 100%; height: 140px; object-fit: cover; border-radius: 7px; margin-bottom: 7px; }
.inventory-card .yarn-swatch-empty { background: var(--cream); color: var(--muted); font-size: 14px; text-align: center; padding: 14px; }
.yarn-photo-preview { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.yarn-photo-preview:empty { display: none; }
.yarn-photo-preview-image { width: 100%; max-width: 250px; max-height: 180px; object-fit: contain; border-radius: 8px; background: var(--cream); }
@media (max-width: 760px) { .inventory-card .yarn-photo { height: 110px; } }
.line-counter-details { border-top: 1px solid #dfc9b7; margin-top: 16px; }
.line-counter-details > summary { cursor: pointer; min-height: 44px; padding: 12px 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.line-counter-details .line-counter { border-top: 0; margin-top: 0; padding-top: 3px; }
.focus-project-actions { max-width: 820px; margin: 20px auto 0; padding-top: 8px; }
.focus-photo-details > summary { cursor: pointer; min-height: 44px; padding: 12px 0; font-size: 14px; font-weight: 600; color: var(--muted); }
/* Keep the mobile pattern feed close to its photographs. */
@media (max-width: 760px) {
  .library-page { padding-top: 14px; }
  .library-page > .page-heading { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; margin-bottom: 12px; }
  .library-page > .page-heading > div:first-child { flex: 1; min-width: 0; }
  .library-page > .page-heading .eyebrow,
  .library-page > .page-heading .page-description { display: none; }
  .library-page > .page-heading .page-title { font-size: 28px; line-height: 1.15; letter-spacing: -.8px; margin: 0; }
  .library-page > .page-heading > .inline { flex: 0 0 auto; flex-wrap: nowrap; gap: 8px; margin: 0; }
  .library-page > .page-heading > .inline .btn { flex: none; min-height: 44px; padding: 10px 12px; white-space: nowrap; }
  /* The import control keeps its full accessible name in its DOM text. */
  .library-page > .page-heading > .inline .btn-secondary { width: 44px; min-width: 44px; height: 44px; padding: 0; gap: 0; font-size: 0 !important; }
  .library-page > .page-heading > .inline .btn-secondary svg { width: 19px; height: 19px; }
  .library-page .library-toolbar { gap: 9px; margin-bottom: 8px; }
  .library-page .library-toolbar .search-field { height: 44px; }
  .library-page .library-filter-row { margin-bottom: 10px; gap: 8px; }
  .library-page .library-filter-row .chips { padding-bottom: 0; }
  .library-page .library-filter-row .chip { padding: 10px 13px; }
  .library-page .inspiration-section > .section-heading { margin-top: 0; margin-bottom: 11px; }
  .library-page .inspiration-section > .section-heading h2 { font-size: 23px; line-height: 1.2; margin: 0; }
  .library-page .inspiration-section > .section-heading p { font-size: 12px; line-height: 1.45; margin: 4px 0 0; max-width: 100%; }
  .library-page > .masonry + .inspiration-section { margin-top: 30px; }
}
@media (max-width: 370px) {
  .library-page > .page-heading .add-pattern svg { display: none; }
}
@media (min-width: 371px) and (max-width: 760px) {
  /* Full action labels fit beside the title when decorative icons are omitted. */
  .library-page > .page-heading { gap: 8px; }
  .library-page > .page-heading > .inline { gap: 7px; }
  .library-page > .page-heading > .inline .btn { padding: 10px 8px; }
  .library-page > .page-heading > .inline .btn svg { display: none; }
  .library-page > .page-heading > .inline .btn-secondary { width: auto; min-width: 0; font-size: 14px !important; }
}
