/* =========================================================
   Paper Figure Studio — journal-like UI
   白底 + 衬线 + 细线，工具面板用无衬线对比
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #0e0e0e;
  --ink-2: #2a2a2a;
  --ink-muted: #6a6a6a;
  --line: #1a1a1a;
  --line-soft: #d9d9d9;
  --paper: #ffffff;
  --paper-soft: #fafafa;
  --panel-bg: #f4f4f1;
  --ruby: #b02029;
  --ruby-soft: rgba(176, 32, 41, 0.08);
  --accent: #0a5cff;

  --serif: "EB Garamond", "Noto Serif SC", "Times New Roman", Times, serif;
  --sans: "Inter", "Noto Serif SC", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --times: "Times New Roman", Times, "Noto Serif SC", serif;
  --sourcesans: "Source Sans 3", "Inter", sans-serif;

  --panel-w: 360px;
  --journal-accent: #b02029;
}

/* ============ Journal theme variables (body[data-journal]) ============ */
body[data-journal="nature"] {
  --serif: "EB Garamond", "Times New Roman", "Noto Serif SC", serif;
  --journal-accent: #006699;
}
body[data-journal="science"] {
  --serif: "Times New Roman", Times, "Noto Serif SC", serif;
  --journal-accent: #b30000;
}
body[data-journal="cell"] {
  --serif: "Source Sans 3", "Inter", "Noto Serif SC", sans-serif;
  --journal-accent: #0b6e4f;
}
body[data-journal="ieee"] {
  --serif: "Times New Roman", Times, "Noto Serif SC", serif;
  --journal-accent: #00629b;
}
body[data-journal="elsevier"] {
  --serif: "EB Garamond", "Times New Roman", serif;
  --journal-accent: #eb6500;
}

html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button, input, select, textarea { font: inherit; color: inherit; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 1px 6px;
  border: 1px solid var(--line-soft);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fff;
}

.tiny-inline { font-size: 11px; color: var(--ink-muted); font-family: var(--sans); }

/* ==================== MASTHEAD ==================== */
.masthead {
  padding: 18px 28px 10px;
  border-bottom: 2px solid var(--line);
}
.masthead__row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.masthead__row--sub {
  align-items: center;
  margin-top: 10px;
}
.masthead__left, .masthead__right { display: flex; gap: 10px; align-items: baseline; }
.journal-mark { color: var(--journal-accent); font-size: 14px; }
.journal-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.masthead__rule { border-top: 1px solid var(--line); margin-top: 6px; }
.masthead__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(22px, 3.2vw, 34px);
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
}
.masthead__title em { font-style: italic; color: var(--ink-muted); font-weight: 400; }
.masthead__nav { display: flex; gap: 14px; }
.linkish {
  background: none; border: none;
  font-family: var(--sans); font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  letter-spacing: 0.05em;
}
.linkish:hover { color: var(--accent); }

/* ==================== LAYOUT ==================== */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr var(--panel-w);
  gap: 0;
  min-height: 0;
}

/* ==================== STAGE ==================== */
.stage {
  padding: 28px;
  background: var(--paper-soft);
  border-right: 1px solid var(--line-soft);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
}
.stage__inner {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.figure-frame {
  position: relative;
  background: #fff;
  border: 1px solid var(--line-soft);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 20px 60px -40px rgba(0,0,0,0.2);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  width: 100%;
  touch-action: none;
  user-select: none;
}
.figure-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.empty-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted);
  cursor: pointer;
  text-align: center;
  font-family: var(--sans);
  font-size: 14px;
  background: rgba(255,255,255,0.0);
  transition: background 0.15s, color 0.15s;
}
.empty-hint:hover, .empty-hint:active {
  background: rgba(10,92,255,0.04);
  color: var(--ink);
}
.empty-hint__big { font-size: 56px; font-weight: 200; margin-bottom: 6px; }
.figure-frame.dragover { outline: 2px dashed var(--accent); outline-offset: -8px; }

.figure-caption-preview {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.45;
  padding: 6px 8px;
  color: var(--ink);
  border: 1px dashed transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.figure-caption-preview:hover { border-color: var(--line-soft); }
.figure-caption-preview.selected {
  border-color: var(--accent);
  background: rgba(10, 92, 255, 0.04);
}
.figure-caption-preview p { margin: 0 0 4px; }
.figure-caption-preview .citation {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
}

.stage__bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 12px;
}
.stage__bar button {
  background: #fff;
  border: 1px solid var(--line-soft);
  padding: 6px 12px;
  border-radius: 2px;
  cursor: pointer;
  color: var(--ink-2);
  transition: all 0.15s;
}
.stage__bar button:hover:not(:disabled) { border-color: var(--line); }
.stage__bar button:disabled { opacity: 0.4; cursor: not-allowed; }
.ratio-group { display: inline-flex; gap: 4px; }
.ratio-group .ratio.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ==================== PANEL ==================== */
.panel {
  background: var(--panel-bg);
  border-left: 1px solid var(--line-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.panel__handle { display: none; }
.panel__close-fab { display: none; }
.panel__scroll {
  overflow-y: auto;
  padding: 20px 20px 40px;
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  gap: 18px;
  -webkit-overflow-scrolling: touch;
}

.tool {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-margin-top: 20px;
}
.tool legend {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line-soft);
  width: 100%;
  padding-bottom: 6px;
}
.tool.flash { animation: flashTool 1.2s; }
@keyframes flashTool {
  0%, 100% { background: transparent; }
  20% { background: rgba(10,92,255,0.08); }
}

.tool input[type="text"],
.tool textarea,
.tool select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line-soft);
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 13px;
  border-radius: 2px;
  color: var(--ink);
  transition: border-color 0.15s;
}
.tool input:focus, .tool textarea:focus, .tool select:focus {
  outline: none;
  border-color: var(--ink);
}
.tool textarea { resize: vertical; min-height: 60px; font-family: var(--serif); font-size: 14px; }

.tool button {
  background: #fff;
  border: 1px solid var(--line-soft);
  padding: 8px 12px;
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
  border-radius: 2px;
  color: var(--ink-2);
  transition: all 0.15s;
  text-align: left;
}
.tool button:hover { border-color: var(--ink); background: #fff; color: var(--ink); }
.tool button.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 10px 12px;
}
.tool button.primary:hover { background: #000; }

.tool--hero legend { color: var(--ruby); font-weight: 600; }
.tool button.lucky {
  background: var(--ruby);
  border-color: var(--ruby);
  color: #fff;
  padding: 14px 12px;
  font-size: 14px;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.tool button.lucky:hover { background: #8a1822; border-color: #8a1822; }

.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  background: #fff;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  flex: 1;
  min-width: 0;
  justify-content: center;
}
.check input { margin: 0; }

.stack { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.tiny { font-size: 10px; color: var(--ink-muted); letter-spacing: 0.08em; text-transform: uppercase; }
input[type="range"] { width: 100%; }
input[type="color"] {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
  padding: 2px;
}
.tool.disabled { opacity: 0.7; }
.tool.disabled legend::after {
  content: " · 点画布文字后生效";
  font-size: 9px;
  color: var(--ruby);
  letter-spacing: 0;
  text-transform: none;
}

.upload {
  display: block;
  border: 1.5px dashed var(--ink-muted);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  color: var(--ink-muted);
  font-size: 13px;
  border-radius: 2px;
  transition: all 0.15s;
}
.upload:hover { border-color: var(--ink); color: var(--ink); }

.hint {
  font-size: 11px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.4;
}

.foot {
  font-size: 11px;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.6;
}

/* ==================== JOURNAL PRESET GRID ==================== */
.journal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.j-btn {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start !important;
  gap: 2px;
  padding: 8px 10px !important;
  font-family: var(--sans) !important;
  background: #fff;
  border: 1px solid var(--line-soft) !important;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
  text-align: left !important;
}
.j-btn .j-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.j-btn .j-sub { font-size: 10px; color: var(--ink-muted); letter-spacing: 0.02em; }
.j-btn:hover { border-color: var(--ink) !important; }
.j-btn.on {
  background: var(--ink) !important;
  border-color: var(--ink) !important;
}
.j-btn.on .j-name, .j-btn.on .j-sub { color: #fff !important; }

/* ==================== LAYOUT GRID ==================== */
.layout-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.l-btn {
  aspect-ratio: 1/1;
  font-family: var(--mono) !important;
  font-size: 11px !important;
  padding: 0 !important;
  text-align: center !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  line-height: 1;
}
.l-btn .l-stack { line-height: 1; }
.l-btn.on { background: var(--ink) !important; color: #fff !important; border-color: var(--ink) !important; }

/* ==================== HELP DIALOG ==================== */
.help {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0;
  max-width: 480px;
  width: calc(100% - 32px);
  background: #fff;
  color: var(--ink);
  font-family: var(--serif);
}
.help::backdrop { background: rgba(0,0,0,0.3); }
.help article { padding: 24px 28px; }
.help h2 { font-family: var(--serif); font-weight: 500; margin: 0 0 12px; font-size: 20px; }
.help ol { padding-left: 20px; line-height: 1.7; }
.help li { margin-bottom: 6px; }
.help form { margin-top: 16px; text-align: right; }
.help button {
  background: var(--ink); color: #fff; border: none;
  padding: 8px 20px; font-family: var(--sans); font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
  border-radius: 2px;
}

/* ==================== INTRO OVERLAY ==================== */
.intro-overlay {
  position: fixed; inset: 0;
  background: #fafaf7;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  animation: introFadeIn 0.4s ease;
}
.intro-overlay.closing { animation: introFadeOut 0.3s ease forwards; }
@keyframes introFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes introFadeOut { from { opacity: 1; } to { opacity: 0; pointer-events: none; } }

.intro-card {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 40px 120px -60px rgba(0,0,0,0.25);
  max-width: 1100px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.intro-left {
  padding: 48px 48px 40px;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
}
.intro-kicker {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.intro-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.05;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.intro-sub {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 22px;
}
.intro-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-2);
}
.intro-features li {
  padding-left: 18px;
  position: relative;
}
.intro-features li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--journal-accent);
}
.intro-btn {
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 14px 28px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 2px;
  align-self: flex-start;
  margin-bottom: 24px;
  transition: transform 0.15s, background 0.15s;
}
.intro-btn:hover { background: #000; transform: translateY(-1px); }
.intro-foot {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-muted);
  margin: auto 0 0;
  line-height: 1.7;
}

.intro-right {
  padding: 48px 48px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-soft);
}
.intro-sample {
  margin: 0;
  max-width: 100%;
  font-family: var(--serif);
}
.intro-sample__img {
  position: relative;
  aspect-ratio: 3/4;
  background: #1a1a1a;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 20px 60px -30px rgba(0,0,0,0.35);
}
.intro-sample__img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.intro-sample__label {
  position: absolute; top: 10px; left: 14px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 32px;
  color: #fff;
  text-shadow: 0 0 6px rgba(0,0,0,0.8), 1px 1px 0 rgba(0,0,0,0.6);
}
.intro-sample__arrow {
  position: absolute;
  top: 42%; left: 18%;
  width: 120px; height: 3px;
  background: #fff;
  box-shadow: 0 0 4px rgba(0,0,0,0.6);
  transform: rotate(20deg);
  transform-origin: left center;
}
.intro-sample__arrow::after {
  content: "";
  position: absolute;
  right: -2px; top: -7px;
  border: 9px solid transparent;
  border-left-color: #fff;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.6));
}
.intro-sample__arrow-text {
  position: absolute;
  top: 36%; left: 16%;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: #fff;
  text-shadow: 0 0 4px rgba(0,0,0,0.9);
  transform: translateY(-18px);
}
.intro-sample__scale {
  position: absolute;
  bottom: 14px; right: 14px;
  background: #fff;
  color: #000;
  font-family: var(--serif);
  font-size: 11px;
  padding: 3px 8px 3px 40px;
  background-image: linear-gradient(to right, #fff 30px, transparent 30px);
  border: 1px solid #000;
}
.intro-sample__scale::before {
  content: "";
  position: absolute;
  left: 4px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 4px;
  background: #000;
}
.intro-sample__ph {
  display: none;
  position: absolute; inset: 0;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: #aaa;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.7;
}
.intro-sample__ph code {
  background: #333; color: #ffd;
  padding: 2px 6px; border-radius: 2px;
  font-family: var(--mono);
  font-size: 11px;
}
.intro-sample--missing .intro-sample__ph { display: flex; }
.intro-sample--missing .intro-sample__label,
.intro-sample--missing .intro-sample__arrow,
.intro-sample--missing .intro-sample__arrow-text,
.intro-sample--missing .intro-sample__scale { display: none; }

.intro-sample figcaption {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}
.intro-sample figcaption p { margin: 0 0 6px; }
.intro-sample__cite {
  font-size: 11px;
  font-style: italic;
  color: var(--ink-muted);
}

@media (max-width: 760px) {
  .intro-overlay {
    padding: 0;
    align-items: flex-start;
    -webkit-overflow-scrolling: touch;
  }
  .intro-card {
    grid-template-columns: 1fr;
    max-width: 100%;
    min-height: 100%;
    box-shadow: none;
    border: none;
  }
  .intro-left {
    padding: 22px 20px 18px;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
  }
  .intro-right { padding: 18px 20px 28px; }
  .intro-kicker { font-size: 10px; margin-bottom: 12px; padding-bottom: 8px; }
  .intro-title { font-size: clamp(26px, 8vw, 34px); margin-bottom: 10px; }
  .intro-sub { font-size: 14px; margin-bottom: 16px; }
  .intro-features { font-size: 12px; line-height: 1.75; margin-bottom: 18px; }
  .intro-btn { width: 100%; padding: 13px 20px; font-size: 13px; }
  .intro-foot { font-size: 10px; margin-top: 14px; }
  .intro-sample__img { aspect-ratio: 4/3; }
  .intro-sample__label { font-size: 22px; top: 10px; left: 12px; }
  .intro-sample__scale { font-size: 10px; bottom: 10px; right: 12px; }
  .intro-sample figcaption { font-size: 12px; line-height: 1.5; padding: 12px 2px 0; }
  .intro-sample__cite { font-size: 10.5px; }
}
@media (max-width: 400px) {
  .intro-left { padding: 18px 16px 14px; }
  .intro-right { padding: 14px 16px 24px; }
  .intro-features li { line-height: 1.6; padding-left: 16px; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  :root { --panel-w: 100%; }

  .masthead { padding: 12px 16px 8px; }
  .masthead__row:first-child { display: none; }
  .masthead__row--sub { flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 0; }
  .masthead__title { font-size: 22px; }
  .masthead__title em { display: block; font-size: 14px; margin-top: 2px; }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    position: relative;
  }

  .stage {
    padding: 12px;
    padding-bottom: 64px;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
    min-height: 60vh;
  }
  .stage__inner { max-width: 100%; }

  .panel {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    max-height: 85vh;
    height: 56px;   /* 更小的收起态，给画布留更多空间 */
    border-top: 1px solid var(--line);
    border-left: none;
    transition: height 0.28s cubic-bezier(.2,.7,.2,1);
    z-index: 40;
    box-shadow: 0 -10px 40px -20px rgba(0,0,0,0.25);
    background: var(--panel-bg);
  }
  .panel.open {
    height: 55vh;
    background: rgba(244, 244, 241, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  body.peeking .panel.open {
    opacity: 0.35;
    transition: opacity 0.15s;
  }
  body.peeking .panel__close-fab { opacity: 1; }

  .panel__handle {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: #fff;
    border: none;
    border-bottom: 1px solid var(--line-soft);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-2);
  }
  .panel__handle::before {
    content: "工具面板";
    position: absolute;
    left: 20px; top: 50%;
    transform: translateY(-50%);
  }
  .panel__handle span {
    position: absolute;
    top: 12px; left: 50%;
    transform: translateX(-50%);
    width: 44px; height: 4px;
    background: var(--line-soft);
    border-radius: 2px;
  }
  .panel__handle::after {
    content: "展开 ↑";
    position: absolute;
    right: 20px; top: 50%;
    transform: translateY(-50%);
  }
  .panel.open .panel__handle::after { content: "收起 ↓"; }

  .panel__scroll {
    padding: 66px 14px 40px;
    gap: 14px;
  }

  /* Floating "hide panel to preview" button */
  .panel.open ~ .panel__close-fab,
  .panel__close-fab.show {
    display: block;
    position: fixed;
    right: 14px;
    bottom: calc(55vh + 12px);
    background: var(--ink);
    color: #fff;
    border: none;
    padding: 10px 16px;
    font-family: var(--sans);
    font-size: 12px;
    letter-spacing: 0.08em;
    border-radius: 24px;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  }

  .journal-grid { grid-template-columns: 1fr 1fr; }
  .layout-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .tool-grid { grid-template-columns: 1fr; }
  .masthead { padding: 10px 14px 6px; }
}

/* prevent pinch-zoom on canvas area on mobile */
@media (hover: none) {
  .figure-frame { touch-action: none; }
}
