/* forte.css — pieces shared by every Forte page: the home link (the credits
   page), the instrument menu that is each instrument's title, and the notes.
   Instrument pages keep their own palettes and layouts and load this first; it
   only uses their CSS variables with fallbacks. */

/* iOS Safari enlarges text when the phone turns to landscape unless told not to */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* iOS 26 and later fade the top of a home-screen app (and of Safari's page) into a haze under
   the status bar, unless a solid bar is pinned to the top: then WebKit extends that bar's colour
   instead. It takes the computed background-color of a fixed element at least 90% as wide as the
   page and over 10px tall, hit 4px below the top. This is that bar (every page's first element),
   the colour of the page's top but painting nothing. */
.forte-edge {
  position: fixed; z-index: 2147483647; top: 0; left: 0; right: 0; height: 12px;
  pointer-events: none;
  background-color: var(--bg, #0b0b0e);
  -webkit-background-clip: text; background-clip: text;
}
body[data-instrument] .forte-edge { background-color: var(--panel, #151518); }

/* Forte's mark: a forte, the f of a score's dynamics, as a bold italic serif f. Not the character
   MUSICAL SYMBOL FORTE (U+1D191): Safari has no font with it and draws its stand-in, a staff of
   horizontal lines. */
.forte-mark, .forte-home::before, .forte-menu-home b::before {
  display: inline-block; color: var(--accent, #f0b35a);
  font: italic 700 1.2em/1 "Times New Roman", Times, "Liberation Serif", Georgia, serif;
  padding-right: 0.08em; /* the f's tail leans out past its box */
}
.forte-home::before, .forte-menu-home b::before { margin-right: 0.3em; }

[data-forte-nav] { display: flex; align-items: center; gap: 10px; }

.forte-home {
  font: 700 15px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.4px;
  color: var(--text, #ece8e1);
  text-decoration: none;
  padding: 4px 10px 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--line, #2b2833);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
}
.forte-home::before { content: "f"; }
.forte-home:hover { border-color: var(--accent, #f0b35a); }

.forte-switch { position: relative; min-width: 0; }
/* the instrument's name is the menu's button: Forte's mark, the <h1>, a caret */
.forte-switch summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 3px 10px 3px 8px; border-radius: 8px; border: 1px solid var(--line, #2b2833);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
  color: var(--text, #ece8e1);
}
.forte-switch summary::-webkit-details-marker { display: none; }
.forte-switch summary h1 { margin: 0; min-width: 0; }
.forte-mark { font-size: 17px; }
.forte-caret { color: var(--muted, #9a9284); font-size: 11px; }
.forte-switch[open] summary, .forte-switch summary:hover { border-color: var(--accent, #f0b35a); }
.forte-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  width: min(380px, 86vw);
  max-height: 70vh;
  overflow: auto;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--line, #2b2833);
  background: var(--panel, #151518);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.forte-menu-home {
  display: grid; gap: 1px; padding: 7px 8px 9px; margin-bottom: 4px; border-radius: 7px;
  color: var(--text, #ece8e1); text-decoration: none; border-bottom: 1px solid var(--line, #2b2833);
}
.forte-menu-home b { font-weight: 700; font-size: 14px; }
.forte-menu-home b::before { content: "f"; }
.forte-menu-home span { color: var(--muted, #9a9284); font-size: 11.5px; }
.forte-menu-home:hover { background: rgba(255, 255, 255, 0.06); }
.forte-menu-sec { color: var(--muted, #9a9284); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.7px; margin: 8px 6px 4px; }
.forte-menu-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  column-gap: 8px;
  align-items: baseline;
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--text, #ece8e1);
  text-decoration: none;
}
.forte-menu-item i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); align-self: center; grid-row: span 2; }
.forte-menu-item b { font-weight: 600; font-size: 13px; }
.forte-menu-item span { grid-column: 2; color: var(--muted, #9a9284); font-size: 11.5px; }
a.forte-menu-item:hover { background: rgba(255, 255, 255, 0.06); }
.forte-menu-item.current { background: rgba(255, 255, 255, 0.08); }
.forte-menu-item.soon { opacity: 0.5; }
.forte-menu-foot { margin: 10px 6px 2px; padding-top: 8px; border-top: 1px solid var(--line, #2b2833); color: var(--muted, #9a9284); font-size: 11px; }
.forte-menu-foot a { color: inherit; }
.forte-version {
  color: var(--muted, #9a9284);
  font: 11px ui-monospace, Menlo, monospace;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--line, #2b2833);
}
.forte-version:hover { color: var(--text, #ece8e1); }
.forte-warning {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: max(8px, env(safe-area-inset-top)) 14px 8px;
  background: #3a2a10;
  color: #ffe2b0;
  border-bottom: 1px solid #7a5520;
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.forte-warning a { color: #fff; }

/* How it works (shared/notes.js): a button by the title, and the README in a dialog */
.forte-about {
  display: inline-flex; align-items: center; gap: 6px; align-self: center; flex: none;
  font: 600 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--accent, #f0b35a);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent, #f0b35a) 45%, transparent);
  border-radius: 999px;
  padding: 4px 10px 4px 5px;
  cursor: pointer;
}
.forte-about:hover { border-color: var(--accent, #f0b35a); background: color-mix(in srgb, var(--accent, #f0b35a) 12%, transparent); }
.forte-about-i {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid currentColor; font: italic 700 11px/1 Georgia, "Iowan Old Style", serif;
}
.forte-get .forte-about-i { font: 700 11px/1 system-ui, sans-serif; } /* ↓, the plugin's downloads */

.forte-notes {
  width: min(880px, calc(100vw - 32px));
  height: min(88vh, 1100px); height: min(88dvh, 1100px);
  max-width: none; max-height: none;
  padding: 0;
  border: 1px solid var(--line, #2b2833);
  border-radius: 14px;
  background: var(--panel, #151518);
  color: var(--text, #ece8e1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}
.forte-notes[open] { display: flex; flex-direction: column; }
.forte-notes::backdrop { background: rgba(4, 4, 8, 0.66); }
.forte-notes-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px 12px 28px; border-bottom: 1px solid var(--line, #2b2833);
}
.forte-notes-kicker { color: var(--accent, #f0b35a); font-size: 11px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; }
.forte-notes-ver .forte-version { margin-left: 10px; vertical-align: 1px; }
.forte-notes-bar h2 { margin: 0; font: 400 24px/1.2 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }
.forte-notes-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 4px 28px 28px; outline: none; }
.forte-notes-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.forte-notes-toc a {
  color: var(--muted, #9a9284); font-size: 12.5px; line-height: 1.4; text-decoration: none;
  border: 1px solid var(--line, #2b2833); border-radius: 999px; padding: 3px 10px;
}
.forte-notes-toc a:hover { color: var(--text, #ece8e1); border-color: var(--accent, #f0b35a); }
.forte-notes-text { max-width: 74ch; color: color-mix(in srgb, var(--text, #ece8e1) 88%, var(--muted, #9a9284)); }
.forte-notes-text h2 {
  margin: 30px 0 10px; padding-top: 14px; border-top: 1px solid var(--line, #2b2833);
  color: var(--text, #ece8e1); font: 400 23px/1.25 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
.forte-notes-text h3 { margin: 24px 0 6px; color: var(--text, #ece8e1); font-size: 16px; }
.forte-notes-text h4 { margin: 18px 0 4px; color: var(--text, #ece8e1); font-size: 15px; }
.forte-notes-text p { margin: 12px 0; }
.forte-notes-text ul, .forte-notes-text ol { margin: 12px 0; padding-left: 24px; }
.forte-notes-text li { margin: 5px 0; }
.forte-notes-text li > p { margin: 6px 0; }
.forte-notes-text strong { color: var(--text, #ece8e1); }
.forte-notes-text a { color: var(--accent, #f0b35a); }
.forte-notes-text code { padding: 1px 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); font: 0.86em ui-monospace, Menlo, monospace; }
.forte-notes-text pre {
  margin: 14px 0; padding: 10px 12px; overflow-x: auto;
  border: 1px solid var(--line, #2b2833); border-radius: 8px; background: rgba(255, 255, 255, 0.03);
  font: 12.5px/1.5 ui-monospace, Menlo, monospace;
}
.forte-notes-text pre code { padding: 0; background: none; font: inherit; }
/* a display equation, kept as written */
.forte-notes-text pre.eq {
  padding: 4px 0 4px 16px; border: 0; border-left: 2px solid color-mix(in srgb, var(--accent, #f0b35a) 55%, transparent); border-radius: 0;
  background: none; color: var(--text, #ece8e1);
  font: 16px/1.65 "STIX Two Math", "Cambria Math", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
.forte-notes-text .table { margin: 14px 0; overflow-x: auto; }
.forte-notes-text table { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.forte-notes-text th, .forte-notes-text td { padding: 5px 12px 5px 0; border-bottom: 1px solid var(--line, #2b2833); text-align: left; vertical-align: top; }
.forte-notes-text th { color: var(--muted, #9a9284); font-weight: 600; }
/* an instrument's plugins, in their own dialog (notes.js), as tall as they need */
.forte-notes.forte-sheet { width: min(620px, calc(100vw - 32px)); height: fit-content; max-height: min(88vh, 1100px); max-height: min(88dvh, 1100px); }
.forte-sheet .forte-notes-body { flex: 0 1 auto; }
.forte-plugin { margin: 18px 0 0; font-size: 14.5px; }
.forte-plugin p { margin: 0; }
/* on phones, the notes' way to the plugin (the ↓ Plugin button is hidden there) */
.forte-notes-plugin { display: none; margin: 12px 0 0; font-size: 14px; }
.forte-notes-plugin a { color: var(--accent, #f0b35a); text-decoration: none; }
.forte-plugin-get { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.forte-plugin-get[hidden] { display: none; }
.forte-plugin-get .button { display: inline-flex; flex-direction: column; gap: 1px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line, #2b2833); background: rgba(255, 255, 255, 0.04); color: var(--text, #ece8e1); text-decoration: none; font-weight: 600; }
.forte-plugin-get .button:hover { border-color: var(--accent, #f0b35a); }
.forte-plugin-get .button span { color: var(--muted, #9a9284); font: 500 11.5px ui-monospace, Menlo, monospace; }
/* a system's box: All | AU · VST3 · CLAP · app */
.forte-plugin-get .forte-plugin-sys span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; }
.forte-plugin-sys a { color: var(--accent, #f0b35a); text-decoration: none; }
.forte-plugin-sys a:hover { text-decoration: underline; }
.forte-plugin-sys i { font-style: normal; }
.forte-plugin-get .forte-plugin-sys:hover { border-color: var(--line, #2b2833); }
@media (pointer: coarse) { .forte-plugin-sys a { padding: 6px 2px; margin: -6px 0; } } /* fingers need a bigger target */
.forte-plugin-more { color: var(--muted, #9a9284); font-size: 12.5px; }
.forte-plugin-more a { color: var(--accent, #f0b35a); }
/* your own presets (shared/user-presets.js), in a dialog like the plugin's */
.forte-mypresets { margin: 16px 0 0; font-size: 14.5px; }
.forte-mypresets label { display: block; margin: 0 0 6px; color: var(--muted, #9a9284); font-size: 13px; }
.forte-mypresets h3 { margin: 22px 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted, #9a9284); }
.forte-mypresets-row { display: flex; gap: 8px; }
.forte-mypresets input[type=text] {
  flex: 1; min-width: 0; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line, #2b2833);
  background: rgba(255, 255, 255, 0.05); color: var(--text, #ece8e1); font: 16px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; /* 16px: no zoom on focus in iOS Safari */
}
.forte-mypresets input[type=text]:focus { outline: none; border-color: var(--accent, #f0b35a); }
.forte-mypresets button { padding: 6px 12px; border-radius: 8px; font-size: 13.5px; }
.forte-mypresets-save button[type=submit] { background: var(--accent, #f0b35a); color: var(--accent-ink, #160d02); border-color: transparent; font-weight: 600; }
.forte-mypresets-msg { min-height: 1.4em; margin: 6px 0 0; color: var(--accent, #f0b35a); font-size: 13px; }
.forte-mypresets-msg:empty { min-height: 0; }
.forte-mypresets-link { margin: 12px 0 0; }
.forte-mypresets-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line, #2b2833); }
.forte-mypresets-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--line, #2b2833); }
.forte-mypresets-list .forte-mypresets-none { color: var(--muted, #9a9284); font-size: 13.5px; padding: 10px 0; }
.forte-mypresets button.forte-mypresets-name {
  flex: 1 1 180px; min-width: 0; text-align: left; padding: 6px 0; border: 0; background: none;
  color: var(--text, #ece8e1); font-size: 15px; overflow-wrap: anywhere;
}
.forte-mypresets button.forte-mypresets-name:hover { color: var(--accent, #f0b35a); }
.forte-mypresets-acts { display: flex; gap: 6px; flex: none; }
.forte-mypresets-acts button { padding: 4px 10px; font-size: 12.5px; }
.forte-mypresets-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; }
.forte-notes-src { margin: 30px 0 0; padding-top: 12px; border-top: 1px solid var(--line, #2b2833); color: var(--muted, #9a9284); font-size: 12.5px; }
.forte-notes-src a { color: inherit; }
.forte-notes-status { color: var(--muted, #9a9284); }

/* below 1250px the header is tight (the subtitle is hidden too): just the icon */
@media (max-width: 1249px) {
  .forte-about { width: 28px; height: 28px; padding: 0; justify-content: center; border-radius: 50%; }
  .forte-about-label { display: none; }
}
@media (max-width: 1249px) and (pointer: coarse) {
  .forte-about { width: 36px; height: 36px; }
}
/* phones (no plugins to install there, and the title needs the room): the way to the
   downloads is a line at the top of How it works */
@media (max-width: 600px), (max-width: 1050px) and (max-height: 500px) {
  .forte-get { display: none; }
  .forte-notes-plugin { display: block; }
}
/* phones: the notes fill the screen */
@media (max-width: 600px), (max-width: 1050px) and (max-height: 500px) {
  .forte-notes, .forte-notes.forte-sheet { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
  .forte-notes-bar { padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
  .forte-notes-bar h2 { font-size: 20px; }
  .forte-notes-body { padding: 0 max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
}
