@charset "UTF-8";

/* Shared navigation additions */
.desktop-nav a.is-current {
  color: var(--ink);
  background: color-mix(in srgb, var(--steel) 12%, transparent);
}
html[data-theme="dark"] .desktop-nav a.is-current { color: #fff; }
.mobile-menu { display: none; position: relative; }
.mobile-menu summary {
  width: 46px; height: 46px; display: grid; place-content: center; gap: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; list-style: none;
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary span { width: 21px; height: 2px; background: currentColor; border-radius: 2px; }
.mobile-menu nav {
  position: absolute; top: calc(100% + 10px); right: 0; width: min(82vw, 310px);
  display: grid; padding: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-lg);
}
.mobile-menu nav a { padding: 11px 13px; border-radius: 9px; color: var(--text); text-decoration: none; font-weight: 750; }
.mobile-menu nav a:hover { background: var(--paper-2); }

/* Fix: Japanese glyphs in the animation hero must never be clipped. */
.hero-copy { min-width: 0; overflow: visible; }
.hero h1 { line-height: 1.02; overflow: visible; }
.hero-line { overflow: visible; }
.hero-line-atlas {
  width: 100%;
  padding: .04em .12em .16em .015em;
  line-height: 1.08;
  letter-spacing: -.055em;
  overflow: visible;
}

/* Generic page hero */
.page-hero {
  position: relative;
  overflow: hidden;
  min-height: 470px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  align-items: center;
  gap: clamp(28px, 6vw, 90px);
  padding-block: clamp(64px, 8vw, 112px);
}
.page-hero::before {
  content: ""; position: absolute; inset: 10% auto auto 43%; width: 35rem; aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--steel) 20%, transparent); border-radius: 50%;
  box-shadow: inset 0 0 0 5rem color-mix(in srgb, var(--cyan) 3%, transparent);
  pointer-events: none;
}
.page-hero-copy { position: relative; z-index: 1; min-width: 0; }
.page-hero h1 {
  margin: 0; max-width: 12ch; font-size: clamp(3rem, 7vw, 6.7rem); line-height: 1.03;
  letter-spacing: -.065em;
}
.page-hero h1 span { display: block; color: var(--steel); }
.page-hero-lead { max-width: 760px; margin: 26px 0 0; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.2rem); }
.page-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.page-hero-actions a {
  min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 0 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface);
  font-weight: 850; text-decoration: none;
}
.page-hero-actions a:first-child { color: #fff; background: var(--ink); border-color: var(--ink); }
.page-hero-stats {
  position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.page-hero-stats div {
  min-height: 138px; display: grid; align-content: end; padding: 20px;
  background: var(--surface-alpha); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}
.page-hero-stats strong { font-size: clamp(2rem, 4vw, 3.8rem); line-height: 1; letter-spacing: -.06em; color: var(--ink); }
html[data-theme="dark"] .page-hero-stats strong { color: #fff; }
.page-hero-stats span { margin-top: 7px; color: var(--muted); font-size: .76rem; font-weight: 800; }
.page-hero-stats div:last-child { background: linear-gradient(145deg, var(--ink), var(--steel)); color: #fff; }
.page-hero-stats div:last-child strong, .page-hero-stats div:last-child span { color: #fff; }

/* Lab home */
.lab-home-hero { min-height: 710px; }
.lab-home-hero h1 { max-width: 100%; }
.lab-home-hero h1 em { display: block; color: transparent; font-style: normal; background: linear-gradient(95deg, var(--ink), var(--steel-2), var(--cyan)); background-clip: text; -webkit-background-clip: text; padding-bottom: .08em; }
.lab-hero-art {
  position: relative; min-height: 480px; display: grid; place-items: center;
}
.lab-hero-art img { width: min(100%, 650px); filter: drop-shadow(0 28px 46px rgb(36 33 63 / .22)); }
.lab-tool-section { padding: 10px 0 110px; }
.lab-section-heading { max-width: 780px; margin-bottom: 34px; }
.lab-section-heading h2 { margin: 0; font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: 1.05; letter-spacing: -.055em; }
.lab-section-heading p:not(.eyebrow) { color: var(--muted); }
.lab-tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.lab-tool-card {
  position: relative; overflow: hidden; min-height: 310px; display: grid; align-content: space-between; padding: clamp(24px, 4vw, 42px);
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-md);
  text-decoration: none; transition: transform .25s ease, box-shadow .25s ease;
}
.lab-tool-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.lab-tool-card::after {
  content: ""; position: absolute; right: -70px; bottom: -90px; width: 240px; aspect-ratio: 1; border-radius: 50%;
  background: color-mix(in srgb, var(--card-accent, var(--cyan)) 13%, transparent);
}
.lab-tool-card .tool-number { color: var(--card-accent, var(--steel)); font-family: ui-monospace, monospace; font-size: .76rem; font-weight: 900; letter-spacing: .14em; }
.lab-tool-card h3 { margin: 10px 0 0; font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1; letter-spacing: -.055em; }
.lab-tool-card p { max-width: 46rem; margin: 20px 0 0; color: var(--muted); }
.lab-tool-card footer { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 18px; margin-top: 36px; }
.lab-tool-card ul { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.lab-tool-card li { padding: 5px 9px; color: var(--muted); background: var(--paper); border-radius: 999px; font-size: .69rem; font-weight: 800; }
.lab-tool-card b { width: 44px; height: 44px; display: grid; place-items: center; color: #fff; background: var(--ink); border-radius: 50%; }
.lab-tool-card.animation { --card-accent: #7c3aed; }
.lab-tool-card.html { --card-accent: #e34f26; }
.lab-tool-card.css { --card-accent: #1572b6; }
.lab-tool-card.colors { --card-accent: #e11d48; }
.lab-tool-card.debug { --card-accent: #0f8a72; }
.lab-source-panel {
  display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; margin: 0 auto 110px; padding: clamp(28px, 5vw, 56px);
  color: #fff; background: linear-gradient(135deg, var(--ink), #3b3568 70%, var(--steel)); border-radius: 30px; box-shadow: var(--shadow-lg);
}
.lab-source-panel h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3.2rem); line-height: 1.1; }
.lab-source-panel p { max-width: 760px; color: #d8d6e6; }
.lab-source-panel nav { display: grid; gap: 9px; }
.lab-source-panel a { min-width: 210px; padding: 12px 16px; color: #fff; border: 1px solid rgb(255 255 255 / .2); border-radius: 12px; text-decoration: none; font-weight: 800; }

/* Reference explorer */
.reference-main { padding-bottom: 110px; }
.reference-switcher {
  position: sticky; top: var(--header-height); z-index: 45; background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-block: 1px solid color-mix(in srgb, var(--line) 90%, transparent); backdrop-filter: blur(16px);
}
.reference-switcher-inner { width: var(--shell); min-height: 68px; margin-inline: auto; display: flex; align-items: center; gap: 7px; overflow-x: auto; padding: 11px 0; scrollbar-width: none; }
.reference-switcher-inner::-webkit-scrollbar { display: none; }
.reference-tab {
  min-height: 44px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; padding: 9px 14px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 999px;
  cursor: pointer; font-weight: 850; white-space: nowrap;
}
.reference-tab[aria-selected="true"] { color: #fff; background: var(--ink); }
.reference-explorer { padding-top: 42px; }
.reference-controls {
  display: grid; grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(160px, .28fr)); gap: 12px;
  padding: 18px; background: var(--surface-alpha); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-sm); backdrop-filter: blur(12px);
}
.reference-search { position: relative; display: flex; align-self: end; align-items: center; }
.reference-search span { position: absolute; left: 16px; color: var(--steel); font-size: 1.4rem; }
.reference-search input, .reference-controls select {
  width: 100%; min-height: 50px; padding: 0 14px; color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
}
.reference-controls .reference-search input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { min-height: 50px; padding-left: 48px; }
.reference-controls label { display: grid; gap: 5px; color: var(--muted); font-size: .68rem; font-weight: 850; }
.reference-controls label select { font-size: .88rem; }
.reference-summary-line { display: flex; justify-content: space-between; gap: 20px; margin: 20px 2px; color: var(--muted); }
.reference-summary-line strong { color: var(--ink); font-size: 1.3rem; }
html[data-theme="dark"] .reference-summary-line strong { color: #fff; }
.reference-explorer { --reference-results-min-height: clamp(360px, 70vh, 680px); }
.reference-grid { min-height: var(--reference-results-min-height); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 18px; }
.reference-card {
  min-width: 0; display: grid; grid-template-rows: auto auto 1fr auto; padding: 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow-sm); transition: transform .2s, border-color .2s, box-shadow .2s;
}
.reference-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.reference-card-header { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.reference-card h3 { min-width: 0; margin: 7px 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.28rem; overflow-wrap: anywhere; }
.reference-card .kind { color: var(--steel-2); font-size: .66rem; font-weight: 900; letter-spacing: .1em; }
.reference-status { flex: 0 0 auto; padding: 4px 8px; color: var(--muted); background: var(--paper); border-radius: 999px; font-size: .62rem; font-weight: 850; }
.reference-status.is-obsolete { color: #a2163b; background: #fff0f4; }
html[data-theme="dark"] .reference-status.is-obsolete { color: #ff9bb7; background: #4a1223; }
.reference-card > p { margin: 14px 0; color: var(--muted); font-size: .88rem; }
.reference-reading { display: block; margin-top: 5px; color: var(--muted); font-size: .72rem; font-weight: 750; line-height: 1.55; }
.css-type-notation { display: block; margin-top: 3px; color: var(--muted); font-size: .66rem; line-height: 1.55; }
.css-type-notation code { color: var(--steel); overflow-wrap: anywhere; }
.reference-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-self: end; }
.reference-card-meta span { padding: 4px 8px; color: var(--muted); background: var(--paper); border-radius: 7px; font-size: .62rem; }
.reference-card button {
  margin-top: 18px; min-height: 44px; color: #fff; background: var(--ink); border: 0; border-radius: 11px; cursor: pointer; font-weight: 850;
}
.reference-empty { min-height: var(--reference-results-min-height); margin-top: calc(-1 * var(--reference-results-min-height)); display: grid; place-items: center; padding: 70px 20px; text-align: center; color: var(--muted); }
.reference-load-more { display: block; min-width: 240px; min-height: 50px; margin: 28px auto 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 13px; cursor: pointer; font-weight: 850; }
.reference-load-more[hidden], .reference-empty[hidden] { display: none !important; }
html[data-theme="dark"] .reference-load-more { color: #fff; }
.reference-source-note { margin: 30px 0 0; padding: 18px 20px; color: var(--muted); background: color-mix(in srgb, var(--cyan) 8%, var(--surface)); border-left: 4px solid var(--cyan); border-radius: 12px; font-size: .82rem; }
.reference-source-note a { color: var(--steel); font-weight: 850; }

.reference-dialog { width: min(1180px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 34px 110px rgb(3 12 24 / .45); }
.reference-dialog::backdrop { background: rgb(3 12 24 / .72); backdrop-filter: blur(5px); }
.reference-dialog-shell { max-height: calc(100dvh - 30px); display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.reference-dialog-header { display: flex; justify-content: space-between; gap: 20px; padding: 24px 28px; border-bottom: 1px solid var(--line); }
.reference-dialog-header > div { min-width: 0; }
.reference-dialog-header h2 { margin: 4px 0 0; font-family: ui-monospace, monospace; font-size: clamp(1.7rem, 4vw, 3rem); overflow-wrap: anywhere; }
.reference-dialog-header p { margin: 8px 0 0; color: var(--muted); }
.reference-dialog-close { width: 44px; height: 44px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--text); cursor: pointer; font-size: 1.5rem; }
.reference-dialog-content { overflow-y: auto; padding: 26px 28px 34px; }
.reference-detail-grid { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: 24px; }
.reference-info-stack { display: grid; gap: 14px; align-content: start; }
.reference-info-box { padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 15px; }
.reference-info-box h3 { margin: 0 0 7px; font-size: .8rem; color: var(--steel-2); letter-spacing: .08em; }
.reference-info-box p { margin: 0; }
.reference-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.reference-facts div { padding: 12px; background: var(--paper); border-radius: 11px; }
.reference-facts span { display: block; color: var(--muted); font-size: .64rem; font-weight: 800; }
.reference-facts strong { display: block; margin-top: 3px; overflow-wrap: anywhere; font-size: .83rem; }
.reference-code-box { overflow: hidden; background: var(--code); border-radius: 16px; }
.reference-code-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; color: #a9c4d5; border-bottom: 1px solid rgb(255 255 255 / .1); font-size: .72rem; font-weight: 850; }
.reference-code-toolbar button { padding: 6px 10px; color: #fff; background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .16); border-radius: 8px; cursor: pointer; }
.reference-code-box pre { max-height: 430px; margin: 0; padding: 18px; overflow: auto; color: var(--code-text); background: var(--code); font-size: .82rem; line-height: 1.7; white-space: pre; }
.reference-token-list, .reference-link-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.reference-token-list li, .reference-link-list a { padding: 6px 9px; color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; font-family: ui-monospace, monospace; font-size: .72rem; text-decoration: none; overflow-wrap: anywhere; }
.reference-spec-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.reference-spec-links a { padding: 9px 12px; color: var(--steel); border: 1px solid var(--line); border-radius: 9px; font-weight: 850; text-decoration: none; }

/* HTML dictionary: Japanese beginner learning view. */
.html-guide-callout {
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
  margin-top: 24px; padding: 20px 22px; background: color-mix(in srgb, var(--cyan) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--cyan) 28%, var(--line)); border-radius: 16px;
}
.html-guide-callout h3 { margin: 0 0 5px; color: var(--text); font-size: 1rem; }
.html-guide-callout p { max-width: 780px; margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.75; }
.html-guide-callout button {
  min-height: 46px; flex: 0 0 auto; padding: 0 16px; color: #fff; background: var(--ink);
  border: 0; border-radius: 11px; cursor: pointer; font-weight: 850;
}
body[data-reference="html"] .reference-dialog { width: min(1260px, calc(100% - 28px)); }
html.has-reference-dialog,
body[data-reference].has-reference-dialog { overflow: hidden; }
body[data-reference] .reference-dialog-content { padding-bottom: 46px; }
body[data-reference] .reference-summary-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
body[data-reference] .reference-summary-actions p { margin: 0; }
body[data-reference] #referenceFavoritesOnly {
  min-height: 40px; padding: 0 12px; color: var(--steel); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 850;
}
body[data-reference] #referenceFavoritesOnly[aria-pressed="true"] {
  color: var(--text); background: color-mix(in srgb, var(--cyan) 12%, var(--surface)); border-color: var(--cyan);
}
.reference-card-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.reference-favorite-badge {
  display: inline-grid; place-items: center; min-width: 30px; min-height: 30px; color: #6b4f00;
  background: #fff3bf; border: 1px solid #e7c94f; border-radius: 999px; font-size: .78rem;
}
html[data-theme="dark"] .reference-favorite-badge { color: #ffe69a; background: #493b0d; border-color: #8f7622; }
body[data-reference] #referenceDialog .reference-dialog-header > :first-child { flex: 1 1 420px; }
.reference-dialog-title { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.reference-dialog-title > :first-child { min-width: 0; flex: 1 1 auto; }
.reference-dialog-actions { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: flex-end; gap: 8px; }
.reference-dialog-actions > button:not(.reference-dialog-close) {
  min-height: 44px; padding: 0 12px; color: var(--text); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 850;
}
.reference-dialog-actions > button[aria-pressed="true"] { color: var(--text); background: color-mix(in srgb, var(--cyan) 12%, var(--surface)); border-color: var(--cyan); }
.reference-dialog-actions > button:disabled { opacity: .45; cursor: not-allowed; }
.reference-dialog-actions > button:focus-visible,
body[data-reference] #referenceFavoritesOnly:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.html-learning-detail { display: grid; gap: 18px; }
.html-learning-lead {
  padding: 18px 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--cyan) 10%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--cyan) 24%, var(--line)); border-radius: 17px;
}
.html-learning-lead h3 { margin: 0 0 6px; font-size: 1.02rem; }
.html-learning-lead .html-learning-summary { width: 100%; max-width: none; margin: 0; color: var(--text); line-height: 1.72; }
.html-learning-lead .reference-reading { margin: 8px 0 0; color: var(--muted); font-size: .68rem; font-weight: 600; line-height: 1.5; }
.html-learning-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.html-learning-facts div { min-height: 102px; padding: 15px; border: 1px solid var(--line); }
.html-learning-facts strong { margin-top: 7px; line-height: 1.6; }
.html-rendering-box { border-left: 4px solid var(--cyan); }
.html-nonvisual-notice { margin-top: 14px; padding: 13px 15px; color: var(--text); background: color-mix(in srgb, var(--cyan) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--cyan) 24%, var(--line)); border-radius: 11px; }
.html-nonvisual-notice strong { display: block; color: var(--steel-2); font-size: .82rem; }
.html-nonvisual-notice p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.7; }
.html-rendering-box h3,
.html-learning-detail .reference-info-box h3 { color: var(--text); font-size: .9rem; letter-spacing: 0; }
.html-learning-detail .reference-info-box > p { line-height: 1.75; }
.html-learning-note { margin-top: 12px !important; padding: 12px 14px; color: var(--text); background: color-mix(in srgb, var(--violet) 7%, var(--surface)); border-radius: 10px; }
.html-example-result { border-left: 4px solid var(--violet); }
.reference-box-intro { margin-bottom: 14px !important; color: var(--muted); font-size: .82rem; }
.reference-empty-list { color: var(--muted); font-size: .82rem; }
.reference-rich-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0; padding: 0; list-style: none;
}
.reference-rich-list li { min-width: 0; }
.reference-rich-list a,
.reference-rich-list .is-missing {
  min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px;
  align-content: start; padding: 11px 12px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 11px; text-decoration: none;
}
.reference-rich-list a:hover { border-color: var(--cyan); box-shadow: 0 0 0 2px color-mix(in srgb, var(--cyan) 14%, transparent); }
.reference-rich-list .reference-rich-name-line { min-width: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: baseline; gap: 10px; color: var(--text); }
.reference-rich-list code { color: var(--steel); font-size: .78rem; font-weight: 900; overflow-wrap: anywhere; }
.reference-rich-list .reference-rich-description { min-width: 0; display: block; color: var(--muted); font-size: .7rem; line-height: 1.65; overflow-wrap: anywhere; }
.reference-rich-list .reference-rich-reading { min-width: 0; color: var(--muted); font-size: .72rem; font-weight: 550; line-height: 1.55; }
.html-related-elements { border-left: 4px solid color-mix(in srgb, var(--cyan) 72%, var(--line)); }
.html-global-attributes { padding: 0; overflow: hidden; }
.html-global-attributes > summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 12px;
  padding: 16px 18px; color: var(--text); cursor: pointer; list-style: none;
}
.html-global-attributes > summary::-webkit-details-marker { display: none; }
.html-global-attributes > summary::marker { content: ""; }
.html-global-attributes > summary:hover { background: color-mix(in srgb, var(--cyan) 5%, var(--paper)); }
.html-global-attributes > summary:focus-visible { outline: 3px solid var(--cyan); outline-offset: -4px; }
.html-global-attributes[open] > summary { border-bottom: 1px solid var(--line); }
.html-global-attributes:not([open]) > .html-global-attributes-content { display: none; }
.html-global-attributes-title { min-width: 0; font-size: .88rem; font-weight: 850; line-height: 1.5; }
.html-global-attributes-count,
.html-global-attributes-state { color: var(--muted); font-size: .66rem; font-weight: 650; white-space: nowrap; }
.html-global-attributes-state::after { content: "開く"; }
.html-global-attributes[open] .html-global-attributes-state::after { content: "閉じる"; }
.html-global-attributes-content { padding: 16px 18px 18px; }
.html-global-attributes-content > .reference-box-intro { line-height: 1.72; }
.html-global-attributes .reference-rich-reading { font-size: .7rem; font-weight: 500; }
.html-legacy-list { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.html-legacy-list summary { cursor: pointer; color: var(--muted); font-size: .8rem; font-weight: 850; }
.html-legacy-list[open] summary { margin-bottom: 10px; }
.html-guide-dialog { width: min(1080px, calc(100% - 28px)) !important; }
.html-guide-content { display: grid; gap: 18px; }
.html-guide-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; margin: 0; }
.html-guide-list > div { padding: 13px 0; border-bottom: 1px solid var(--line); }
.html-guide-list dt { color: var(--text); font-weight: 900; }
.html-guide-list dd { margin: 5px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.75; }
.html-guide-list.is-notation dt { font-family: ui-monospace, monospace; }
.html-guide-note { margin-top: 14px !important; padding: 13px 15px; color: var(--text); background: color-mix(in srgb, var(--cyan) 8%, var(--surface)); border-radius: 10px; }
body[data-reference] .reference-spec-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
body[data-reference] .reference-source-link { min-width: 0; display: grid; align-content: start; gap: 6px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
body[data-reference] .reference-source-link a { padding: 0; border: 0; }
body[data-reference] .reference-source-link small { color: var(--muted); font-size: .7rem; line-height: 1.6; }
body[data-reference] .reference-spec-links .reference-link-copy { grid-column: 1 / -1; justify-self: start; }

/* CSS dictionary: beginner learning flow. */
body[data-reference="css"] .reference-dialog { width: min(1260px, calc(100% - 28px)); }
.css-learning-detail { display: grid; gap: 18px; }
.css-learning-lead {
  position: relative; padding: 22px 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--cyan) 10%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--cyan) 24%, var(--line)); border-radius: 17px;
}
.css-learning-lead .reference-reading { margin: 0 0 12px; color: var(--steel); }
.css-learning-lead h3 { margin: 0 0 7px; padding-right: 9rem; font-size: 1.06rem; }
.css-learning-lead > p:last-child { max-width: 80ch; margin: 0; line-height: 1.85; }
.css-learning-level {
  position: absolute; top: 18px; right: 20px; padding: 5px 9px; color: #39327f;
  background: color-mix(in srgb, var(--cyan) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--cyan) 28%, var(--line)); border-radius: 999px; font-size: .68rem; font-weight: 900;
}
html[data-theme="dark"] .css-learning-level { color: var(--steel); }
.css-learning-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.css-learning-facts > div { min-height: 104px; padding: 15px; border: 1px solid var(--line); }
.css-learning-facts strong { margin-top: 7px; line-height: 1.55; }
.css-learning-detail .reference-info-box h3 { color: var(--text); font-size: .9rem; letter-spacing: 0; }
.css-learning-detail .reference-info-box > p { line-height: 1.75; }
.css-example-result { border-left: 4px solid var(--violet); }
.css-no-copy { border-left: 4px solid #c18418; }
.css-formal-syntax {
  max-width: 100%; margin: 12px 0 0; padding: 13px 14px; overflow: auto; color: var(--code-text); background: var(--code); border-radius: 10px; font-size: .78rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere;
}
.css-syntax-details { margin-top: 14px; border-top: 1px solid var(--line); }
.css-syntax-details > summary { padding-top: 13px; color: var(--steel); cursor: pointer; font-size: .82rem; font-weight: 900; }
.css-syntax-details[open] > summary { margin-bottom: 12px; }
.css-syntax-details > .reference-info-box { padding: 0; background: transparent; border: 0; }
.css-usage-target { border-left: 4px solid var(--cyan); }
.css-target-name { margin: 8px 0 0; color: var(--text); font-size: 1rem; font-weight: 900; }
.css-requirement {
  margin-top: 14px; padding: 13px 15px; color: var(--text);
  background: color-mix(in srgb, var(--cyan) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--cyan) 22%, var(--line)); border-radius: 11px;
}
.css-requirement strong { display: block; margin-bottom: 5px; color: var(--steel); font-size: .76rem; }
.css-requirement p { margin: 0; font-size: .82rem; line-height: 1.7; }
.css-pattern-list,
.css-value-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.css-pattern-list li,
.css-value-list li {
  min-width: 0; display: grid; grid-template-columns: minmax(150px, .34fr) minmax(0, 1fr); gap: 12px;
  align-items: start; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
}
.css-pattern-list code,
.css-value-list code { min-width: 0; color: var(--steel); font-weight: 900; overflow-wrap: anywhere; }
.css-pattern-list span,
.css-value-list span { color: var(--muted); font-size: .79rem; line-height: 1.7; }
.css-value-list .css-value-name { display: grid; gap: 2px; align-content: start; color: var(--text); }
.css-value-name strong { color: var(--text); font-size: .84rem; line-height: 1.5; }
.css-value-name small { color: var(--muted); font-size: .66rem; line-height: 1.55; }
.css-value-name small code { font-size: inherit; font-weight: 750; }
.css-value-detail-link {
  min-width: 0; display: grid; gap: 4px; padding: 8px 9px; color: var(--text);
  background: color-mix(in srgb, var(--cyan) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--cyan) 22%, var(--line));
  border-radius: 8px; text-decoration: none;
}
.css-value-detail-link:hover { border-color: var(--cyan); }
.css-value-detail-link:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.css-value-detail-link code,
.css-value-detail-link strong { color: var(--steel); }
.css-value-detail-link small { color: var(--muted); font-weight: 650; }
.css-pattern-example {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px; align-items: center;
  margin: 0 0 12px; padding: 11px 13px; background: color-mix(in srgb, var(--cyan) 7%, var(--paper)); border-radius: 10px;
}
.css-pattern-example span { color: var(--muted); font-size: .72rem; font-weight: 900; }
.css-pattern-example code { min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.css-pattern-notes { display: grid; gap: 7px; margin: 0; padding-left: 1.25rem; color: var(--text); font-size: .82rem; line-height: 1.7; }
.css-wide-values { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.css-wide-values > summary { color: var(--steel); cursor: pointer; font-size: .8rem; font-weight: 900; }
.css-wide-values[open] > summary { margin-bottom: 10px; }
.css-friendly-syntax > .css-syntax-details { margin-top: 16px; }
.css-friendly-syntax .css-notation-guide { margin-top: 14px; }
.css-friendly-syntax .css-notation-guide > h3 { margin-bottom: 7px; }
.css-type-notation-box { border-left: 4px solid var(--cyan); }
.css-type-notation-box details { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.css-type-notation-box summary { color: var(--steel); cursor: pointer; font-size: .8rem; font-weight: 900; }
.css-type-notation-box details p { margin-top: 10px; }
.css-type-notation-box details code { color: var(--steel); font-weight: 900; overflow-wrap: anywhere; }
.copy-toast-global { position: fixed; z-index: 1000; right: 18px; bottom: 18px; max-width: calc(100vw - 36px); padding: 11px 15px; color: #fff; background: var(--ink); border: 1px solid color-mix(in srgb, #fff 32%, transparent); border-radius: 10px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
.copy-toast-global.is-visible { opacity: 1; transform: translateY(0); }
.copy-fallback-dialog { width: min(560px, calc(100% - 32px)); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.copy-fallback-dialog::backdrop { background: rgb(7 24 39 / .62); }
.copy-fallback-dialog form { display: grid; gap: 12px; padding: 20px; }
.copy-fallback-dialog h2, .copy-fallback-dialog p { margin: 0; }
.copy-fallback-dialog p { color: var(--muted); }
.copy-fallback-dialog textarea { width: 100%; min-height: 150px; padding: 10px; color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; font-family: ui-monospace, monospace; }
.copy-fallback-dialog button { justify-self: end; min-height: 44px; padding: 0 16px; color: #fff; background: var(--ink); border: 0; border-radius: 9px; cursor: pointer; }

/* Color tool */
.color-workspace { padding-bottom: 110px; }
.color-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 22px; align-items: start; }
.color-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-md); }
.image-panel { overflow: hidden; }
.drop-zone {
  min-height: 160px; display: grid; place-items: center; padding: 24px; text-align: center; border-bottom: 1px solid var(--line);
  background: linear-gradient(145deg, color-mix(in srgb, var(--cyan) 8%, var(--surface)), var(--surface));
}
.drop-zone.is-dragover { background: color-mix(in srgb, var(--cyan) 18%, var(--surface)); }
.drop-zone label { display: grid; place-items: center; gap: 7px; cursor: pointer; }
.drop-zone input { position: absolute; opacity: 0; pointer-events: none; }
.drop-zone strong { font-size: 1.1rem; }
.drop-zone span, .drop-zone small { color: var(--muted); }
.drop-zone b { display: inline-grid; place-items: center; min-height: 42px; padding: 0 15px; color: #fff; background: var(--ink); border-radius: 10px; }
.canvas-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.canvas-toolbar div { display: flex; align-items: center; gap: 8px; }
.canvas-toolbar button, .canvas-toolbar select { min-height: 38px; padding: 0 11px; color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.canvas-stage { position: relative; min-height: 460px; display: grid; place-items: center; overflow: auto; padding: 20px; background: #cbd5df; background-image: linear-gradient(45deg,#dde4ea 25%,transparent 25%),linear-gradient(-45deg,#dde4ea 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#dde4ea 75%),linear-gradient(-45deg,transparent 75%,#dde4ea 75%); background-size: 24px 24px; background-position: 0 0,0 12px,12px -12px,-12px 0; }
#imageCanvas { display: block; max-width: none; max-height: none; background: #fff; box-shadow: 0 15px 40px rgb(36 33 63 / .24); cursor: crosshair; }
#imageCanvas:focus-visible { outline-color: #0b2545; outline-offset: 5px; }
.canvas-instructions { margin: 0; padding: 10px 16px; color: var(--muted); background: var(--paper-2); border-bottom: 1px solid var(--line); font-size: .78rem; }
.canvas-selection-marker { position: absolute; z-index: 5; width: 18px; height: 18px; pointer-events: none; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px #0b2545, 0 2px 7px rgb(0 0 0 / .45); transform: translate(-50%, -50%); }
.canvas-selection-marker::before, .canvas-selection-marker::after { content: ""; position: absolute; left: 50%; top: 50%; background: #0b2545; transform: translate(-50%, -50%); }
.canvas-selection-marker::before { width: 26px; height: 2px; }
.canvas-selection-marker::after { width: 2px; height: 26px; }
.canvas-placeholder { max-width: 380px; text-align: center; color: #526579; }
.canvas-placeholder strong { display: block; font-size: 1.3rem; color: #34305c; }
.magnifier { position: fixed; z-index: 600; width: 148px; height: 148px; display: none; pointer-events: none; border: 4px solid #fff; border-radius: 50%; box-shadow: 0 10px 36px rgb(0 0 0 / .35); image-rendering: pixelated; }
.magnifier.is-visible { display: block; }
.color-result { position: sticky; top: calc(var(--header-height) + 18px); overflow: hidden; }
.color-preview { min-height: 180px; display: grid; place-items: end start; padding: 20px; background: #6857e5; color: white; }
.color-preview strong { padding: 7px 10px; background: rgb(0 0 0 / .28); border-radius: 8px; font-family: ui-monospace, monospace; }
.color-values { display: grid; gap: 8px; padding: 18px; }
.color-value-row { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 8px; }
.color-value-row label { color: var(--muted); font-size: .7rem; font-weight: 850; }
.color-value-row input { min-width: 0; width: 100%; min-height: 40px; padding: 0 10px; color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; font-family: ui-monospace, monospace; }
.color-value-row button { min-height: 40px; padding: 0 10px; color: #fff; background: var(--ink); border: 0; border-radius: 8px; cursor: pointer; font-size: .72rem; font-weight: 850; }
.color-meta { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; padding: 0 18px 18px; }
.color-meta div { padding: 10px; background: var(--paper); border-radius: 9px; }
.color-meta span { display: block; color: var(--muted); font-size: .65rem; }
.color-meta strong { display: block; margin-top: 3px; font-size: .85rem; }
.palette-section, .named-color-section, .converter-section { margin-top: 22px; padding: 22px; }
.palette-section h2, .named-color-section h2, .converter-section h2 { margin: 0; font-size: 1.35rem; }
.palette-grid, .history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 16px; }
.palette-grid > .color-empty-state,
.history-grid > .color-empty-state {
  grid-column: 1 / -1;
  min-height: 92px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 18px;
  color: var(--muted);
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  text-align: center;
}
.swatch-button { overflow: hidden; min-height: 90px; display: grid; grid-template-rows: 1fr auto; padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.swatch-button i { min-height: 55px; }
.swatch-button span { padding: 6px; font-family: ui-monospace, monospace; font-size: .67rem; }
.color-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.color-tabs button { padding: 8px 12px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 800; }
.color-tabs button[aria-selected="true"] { color: #fff; background: var(--ink); }
.named-color-tools { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 16px; }
.named-color-tools input { min-height: 46px; padding: 0 13px; color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.named-color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px,1fr)); gap: 9px; margin-top: 16px; max-height: 560px; overflow: auto; padding-right: 5px; }
.named-color-card { display: grid; grid-template-columns: 38px 1fr; gap: 9px; align-items: center; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.named-color-card i { width: 38px; height: 38px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .1); }
.named-color-card strong, .named-color-card span { display: block; overflow-wrap: anywhere; }
.named-color-card strong { font-size: .72rem; }
.named-color-card span { color: var(--muted); font-family: ui-monospace, monospace; font-size: .63rem; }
.contrast-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.contrast-card { min-height: 150px; display: grid; place-items: center; padding: 18px; border-radius: 14px; text-align: center; }
.contrast-result { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.contrast-result span { padding: 7px 10px; background: var(--paper); border-radius: 8px; font-size: .72rem; font-weight: 850; }
.local-processing-note { margin-top: 18px; padding: 14px 16px; color: var(--muted); background: color-mix(in srgb, #22c55e 9%, var(--surface)); border-left: 4px solid #22c55e; border-radius: 10px; font-size: .8rem; }

/* Footer variant */
.lab-footer-links { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 24px; }

@media (max-width: 1180px) {
  .site-header { grid-template-columns: auto 1fr auto; }
  .desktop-nav { display: none; }
  .mobile-menu { display: block; justify-self: end; }
  .header-tools { justify-self: end; }
  .reference-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .reference-controls { grid-template-columns: 1fr 1fr 1fr; }
  .reference-search { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .page-hero, .lab-source-panel, .color-layout { grid-template-columns: 1fr; }
  .page-hero { min-height: auto; }
  .page-hero-stats { max-width: 650px; }
  .lab-hero-art { min-height: 360px; }
  .lab-tool-grid { grid-template-columns: 1fr; }
  .lab-source-panel nav { grid-template-columns: repeat(2,1fr); }
  .reference-detail-grid { grid-template-columns: 1fr; }
  .html-learning-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .color-result { position: static; }
}
@media (max-width: 680px) {
  .site-header { grid-template-columns: auto 1fr auto; }
  .header-tools { grid-column: auto; display: flex; justify-self: end; gap: 2px; }
  .header-tools .icon-button { min-width: 44px; min-height: 44px; padding-inline: 4px; }
  .header-tools .tool-label { font-size: .55rem; }
  .mobile-menu { grid-column: auto; }
  .page-hero { padding-block: 54px 76px; }
  .page-hero h1 { max-width: 100%; font-size: clamp(2.7rem, 14vw, 4.5rem); }
  .page-hero-stats { grid-template-columns: 1fr 1fr; }
  .page-hero-stats div { min-height: 110px; }
  .page-hero-stats div:first-child { transform: none; }
  .lab-home-hero h1 { max-width: 100%; }
  .lab-hero-art { min-height: 260px; }
  .lab-tool-card { min-height: 270px; padding: 22px; border-radius: 22px; }
  .lab-source-panel nav { grid-template-columns: 1fr; }
  .lab-source-panel a { min-width: 0; }
  .reference-switcher { top: 66px; }
  .reference-controls { grid-template-columns: 1fr 1fr; padding: 12px; }
  .reference-search { grid-column: 1 / -1; }
  .reference-grid { grid-template-columns: 1fr; }
  .reference-dialog { width: 100%; max-height: 100dvh; border-radius: 0; }
  .reference-dialog-shell { max-height: 100dvh; }
  .reference-dialog-header, .reference-dialog-content { padding: 18px; }
  body[data-reference] #referenceDialog .reference-dialog-header { position: relative; display: block; padding-right: 72px; }
  body[data-reference] #referenceDialog .reference-dialog-title { display: grid; gap: 12px; }
  body[data-reference] #referenceDialog .reference-dialog-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; justify-content: stretch; margin-top: 12px; }
  body[data-reference] #referenceDialog .reference-dialog-actions #referenceDialogBack { grid-column: 1; grid-row: 1; }
  body[data-reference] #referenceDialog .reference-dialog-actions #referenceDialogForward { grid-column: 2; grid-row: 1; }
  body[data-reference] #referenceDialog .reference-dialog-actions #referenceDialogFavorite { grid-column: 1 / -1; grid-row: 2; }
  body[data-reference] #referenceDialog .reference-dialog-close { position: absolute; top: 18px; right: 18px; }
  body[data-reference] .reference-summary-line { align-items: flex-start; flex-wrap: wrap; }
  body[data-reference] .reference-summary-actions { display: grid; justify-items: end; text-align: right; }
  body[data-reference] .reference-spec-links { grid-template-columns: 1fr; }
  body[data-reference] .reference-spec-links .reference-link-copy { grid-column: 1; }
  .html-guide-dialog .reference-dialog-header { position: relative; padding-right: 76px; }
  .html-guide-dialog .reference-dialog-header h2 { font-size: clamp(1.45rem, 7.8vw, 2rem); line-height: 1.25; }
  .html-guide-dialog .reference-dialog-close { position: absolute; top: 18px; right: 18px; }
  .reference-facts { grid-template-columns: 1fr; }
  .html-guide-callout { display: grid; padding: 17px; }
  .html-guide-callout button { width: 100%; min-height: 50px; white-space: normal; }
  .html-learning-lead { padding: 18px; }
  .html-learning-facts { grid-template-columns: 1fr; }
  .html-learning-facts div { min-height: auto; }
  .css-learning-lead { padding: 18px; }
  .css-learning-lead h3 { padding-right: 0; }
  .css-learning-level { position: static; display: inline-block; margin-bottom: 12px; }
  .css-learning-facts { grid-template-columns: 1fr; }
  .css-learning-facts > div { min-height: auto; }
  .reference-rich-list, .html-guide-list { grid-template-columns: 1fr; }
  .reference-rich-list a, .reference-rich-list .is-missing { grid-template-columns: minmax(0, 1fr); }
  .canvas-stage { min-height: 330px; padding: 10px; }
  .color-values { padding: 12px; }
  .color-value-row { grid-template-columns: 54px minmax(0,1fr) auto; }
  .palette-section, .named-color-section, .converter-section { padding: 16px; }
  .contrast-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(3.2rem, 17vw, 4.55rem) !important; line-height: 1.04; }
  .hero-line-motion { white-space: normal; }
  .hero-line-atlas { padding-bottom: .2em; }
}
@media (prefers-reduced-motion: reduce) {
  .lab-tool-card, .reference-card { transition: none; }
  .lab-tool-card:hover, .reference-card:hover { transform: none; }
}

/* 辞典・アニメーション図鑑の折りたたみ式フィルター */
.reference-filter-details,
.catalog-filter-details {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}
.reference-filter-details > summary,
.catalog-filter-details > summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: var(--text);
  cursor: pointer;
  font-size: .84rem;
  font-weight: 850;
}
.reference-filter-details > summary::marker,
.catalog-filter-details > summary::marker { color: var(--cyan); }
.reference-filter-details > summary:focus-visible,
.catalog-filter-details > summary:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 12px; }
.reference-filter-details[open] > summary,
.catalog-filter-details[open] > summary { border-bottom: 1px solid var(--line); }
.reference-filter-details .reference-controls { border: 0; border-radius: 0 0 16px 16px; box-shadow: none; }
.catalog-filter-details .reference-controls { border: 0; border-radius: 0 0 16px 16px; box-shadow: none; }
.animation-reference-controls {
  grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(135px, .55fr));
}
.animation-reference-controls .reference-search { grid-column: auto; }
.animation-reference-controls .animation-filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  grid-column: span 2;
}
.animation-reference-controls .filter-toggle,
.animation-reference-controls .filter-reset {
  min-height: 50px;
  flex: 1 1 150px;
  padding: 0 13px;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 850;
}
.animation-reference-controls .filter-reset { width: 100%; }
.animation-reference-controls .filter-toggle[aria-pressed="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.animation-reference-controls .filter-toggle:focus-visible,
.animation-reference-controls .filter-reset:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.animation-result-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.animation-result-actions p { margin: 0; }
.animation-result-actions .reference-favorites-only {
  min-height: 40px; padding: 0 12px; color: var(--steel); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 850;
}
.animation-result-actions .reference-favorites-only[aria-pressed="true"] {
  color: var(--text); background: color-mix(in srgb, var(--cyan) 12%, var(--surface)); border-color: var(--cyan);
}
.animation-result-actions .reference-favorites-only:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* 詳細ウインドウ内の安全な実表示プレビュー */
.reference-live-example { display: grid; gap: 14px; }
.reference-live-example > h3 { margin-bottom: 0; }
.reference-step-heading {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.reference-step-heading > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--ink);
  border-radius: 50%;
  font-size: .82rem;
  font-weight: 950;
}
.reference-step-heading h3 { margin: 0; }
.reference-step-heading p { margin: 5px 0 0; color: var(--muted); line-height: 1.7; }
.reference-safety-notice {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  color: var(--text);
  background: color-mix(in srgb, #f1b84b 18%, var(--paper));
  border: 2px solid color-mix(in srgb, #c17a00 58%, var(--line));
  border-radius: 11px;
}
.reference-safety-notice strong { font-size: .88rem; }
.reference-safety-notice span { color: var(--muted); font-size: .78rem; line-height: 1.7; }
.reference-learning-path {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 14px 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--cyan) 7%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--cyan) 35%, var(--line));
  border-radius: 13px;
}
.reference-learning-path > strong { font-size: .8rem; }
.reference-learning-path ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.reference-learning-path li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.5;
}
.reference-learning-path li span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--steel-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-weight: 950;
}
.reference-live-editor-label { display: grid; gap: 7px; color: var(--text); font-size: .76rem; font-weight: 850; }
.reference-live-editor {
  width: 100%; min-height: 132px; resize: vertical; padding: 13px 14px;
  color: var(--code-text); background: var(--code); border: 1px solid var(--line-strong); border-radius: 10px;
  font: .82rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 2;
}
.reference-live-editor:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.reference-live-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.reference-live-tabs button {
  min-width: 88px;
  min-height: 40px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 850;
}
.reference-live-tabs button[aria-selected="true"] { color: #fff; background: var(--ink); }
.reference-live-tabs button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.reference-live-editor-label[hidden] { display: none; }
.reference-live-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.reference-live-actions button {
  min-height: 42px; padding: 0 13px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 9px; cursor: pointer; font-weight: 850;
}
.reference-live-actions button:first-child { color: #fff; background: var(--ink); border-color: var(--ink); }
.reference-live-actions button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.reference-live-status { min-height: 1.4em; color: var(--muted); font-size: .78rem; font-weight: 800; }
.reference-live-frame { display: block; width: 100%; min-height: 260px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; }
.reference-live-range,
.reference-live-choice,
.reference-live-control-grid label { display: grid; gap: 7px; color: var(--text); font-size: .78rem; font-weight: 800; }
.reference-live-range > span,
.reference-live-control-grid label > span { display: flex; justify-content: space-between; gap: 12px; }
.reference-live-range output,
.reference-live-control-grid output { color: var(--steel-2); font-family: ui-monospace, monospace; }
.reference-live-range input[type="range"],
.reference-live-control-grid input[type="range"] { width: 100%; accent-color: var(--cyan); }
.reference-live-choice {
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
}
.reference-live-choice select {
  width: 100%;
  min-height: 42px;
  padding: 0 38px 0 12px;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: inherit;
}
.reference-live-choice select:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.reference-live-choice small { color: var(--muted); font-size: .76rem; font-weight: 650; line-height: 1.65; }
.reference-live-observation {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 12px; align-items: start;
  padding: 11px 13px; color: var(--text); background: color-mix(in srgb, var(--cyan) 7%, var(--paper));
  border-left: 4px solid var(--cyan); border-radius: 9px;
}
.reference-live-observation strong { color: var(--steel); font-size: .74rem; }
.reference-live-observation span { color: var(--muted); font-size: .76rem; line-height: 1.7; }
.reference-live-control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.reference-live-control-grid input[type="color"] { width: 100%; min-height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.reference-component-list { display: grid; gap: 9px; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: component; }
.reference-component-list li { display: grid; grid-template-columns: minmax(90px, .25fr) minmax(130px, .32fr) 1fr; gap: 10px; align-items: start; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.reference-component-list li code { color: var(--steel-2); font-weight: 850; }
.reference-component-list li strong { color: var(--text); }
.reference-component-list li span { color: var(--muted); }
.reference-component-list.is-numbered { list-style: none; }
.html-code-anatomy .reference-component-list a {
  width: fit-content;
  max-width: 100%;
  color: var(--steel-2);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--cyan) 55%, transparent);
  text-underline-offset: 3px;
}
.css-code-anatomy .reference-component-list a {
  width: fit-content;
  max-width: 100%;
  color: var(--steel-2);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--cyan) 55%, transparent);
  text-underline-offset: 3px;
}
.css-code-anatomy .reference-component-list a:hover { color: var(--text); }
.css-code-anatomy .reference-component-list a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}
.css-combination-guide { border-left: 4px solid color-mix(in srgb, var(--violet) 72%, var(--line)); }
.css-combination-guide .reference-component-list li { grid-template-columns: minmax(9rem, .28fr) minmax(0, 1fr); }
.css-property-values { border-left: 4px solid color-mix(in srgb, var(--cyan) 70%, var(--line)); }
.css-type-related-properties[open],
.css-type-related-properties:not(details) { border-left: 4px solid color-mix(in srgb, var(--violet) 68%, var(--line)); }
details.css-type-related-properties { padding: 0; overflow: hidden; }
.css-type-related-properties > summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 12px;
  padding: 16px 18px; color: var(--text); cursor: pointer; font-size: .86rem; font-weight: 850; list-style: none;
}
.css-type-related-properties > summary::-webkit-details-marker { display: none; }
.css-type-related-properties > summary::marker { content: ""; }
.css-type-related-properties > summary:hover { background: color-mix(in srgb, var(--cyan) 5%, var(--paper)); }
.css-type-related-properties > summary:focus-visible { outline: 3px solid var(--cyan); outline-offset: -4px; }
.css-type-related-properties[open] > summary { border-bottom: 1px solid var(--line); }
.css-type-related-properties:not([open]) > .css-related-properties-content { display: none; }
.css-related-properties-state::after { content: "開く"; }
.css-type-related-properties[open] .css-related-properties-state::after { content: "閉じる"; }
.css-related-properties-state,
.css-type-related-properties > summary > span:nth-child(2) { color: var(--muted); font-size: .66rem; font-weight: 650; white-space: nowrap; }
.css-related-properties-content { padding: 16px 18px 18px; }
.html-code-anatomy .reference-component-list a:hover { color: var(--text); }
.html-code-anatomy .reference-component-list a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}
.html-value-group {
  margin-top: 10px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
}
.html-value-group summary {
  padding: 13px 0;
  color: var(--text);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 900;
}
.html-value-group[open] { padding-bottom: 14px; }
.html-value-group[open] summary { border-bottom: 1px solid var(--line); }
.html-value-group .reference-component-list { margin-top: 14px; }
.html-check-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.html-check-list li {
  position: relative;
  padding: 11px 12px 11px 36px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  line-height: 1.7;
}
.html-check-list li::before {
  content: "✓";
  position: absolute;
  top: 11px;
  left: 13px;
  color: var(--steel-2);
  font-weight: 950;
}
.html-mistakes { border-left: 4px solid color-mix(in srgb, var(--amber, #f59e0b) 75%, var(--line)); }

@media (max-width: 760px) {
  .reference-live-frame { min-height: 220px; }
  .reference-learning-path ol { grid-template-columns: 1fr 1fr; }
  .reference-live-control-grid { grid-template-columns: 1fr; }
  .reference-component-list li { grid-template-columns: 1fr; gap: 4px; }
  .css-combination-guide .reference-component-list li { grid-template-columns: 1fr; }
  .reference-live-observation { grid-template-columns: 1fr; gap: 4px; }
  .reference-live-actions button { flex: 1 1 150px; }
  .animation-reference-controls { grid-template-columns: 1fr 1fr; }
  .animation-reference-controls .reference-search,
  .animation-reference-controls .animation-filter-actions { grid-column: 1 / -1; }
  .animation-result-actions { margin-top: 8px; justify-content: flex-start; }
}
@media (max-width: 480px) {
  .reference-step-heading { grid-template-columns: 32px minmax(0, 1fr); gap: 9px; }
  .reference-step-heading > span { width: 32px; height: 32px; }
  .reference-learning-path ol { grid-template-columns: 1fr; }
}

/* Color converter additions */
.color-converter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-top: 18px;
}
.color-converter-row label,
.contrast-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
}
.color-converter-row input[type="text"],
.color-converter-row label input:not([type="color"]) {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: ui-monospace, monospace;
}
.color-converter-row input[type="color"],
.contrast-controls input[type="color"] {
  width: 54px;
  min-height: 46px;
  padding: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.color-converter-row button,
.named-color-tools button {
  min-height: 46px;
  padding: 0 15px;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 850;
}
.converter-output {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 9px;
  margin-top: 14px;
}
.converter-output button {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label action" "value value";
  align-items: center;
  gap: 9px;
  padding: 11px;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}
.converter-output button span { grid-area: label; color: var(--muted); font-size: .66rem; font-weight: 900; }
.converter-output button code {
  grid-area: value;
  min-width: 0;
  overflow: visible;
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}
.converter-output button b { grid-area: action; color: var(--steel); font-size: .67rem; }
.color-section-intro { max-width: 900px; margin-bottom: 0; }
.converter-task {
  margin-top: 18px;
  padding: 18px;
  background: color-mix(in srgb, var(--paper) 86%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 14px;
}
.converter-task h3 { margin: 0; font-size: 1.05rem; }
.converter-task > p { margin: 6px 0 0; color: var(--muted); font-size: .82rem; }
.converter-task .color-converter-row,
.converter-task .contrast-controls { margin-top: 14px; }
.converter-help { padding-left: 12px; border-left: 3px solid var(--cyan); }
.color-error { color: #b42318; }
.contrast-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 14px;
  margin-top: 26px;
}
.contrast-controls > button {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 72px;
  padding: 9px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  cursor: pointer;
  text-align: left;
}
.contrast-controls > button:hover { border-color: var(--cyan); }
.contrast-controls > button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.contrast-controls > button > i { width: 54px; height: 52px; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.18); }
.contrast-controls > button > span { min-width: 0; display: grid; gap: 2px; }
.contrast-controls small { color: var(--muted); font-size: .66rem; }
.contrast-controls strong { font: 850 .82rem ui-monospace, monospace; overflow-wrap: anywhere; }
.contrast-controls b { color: var(--steel); font-size: .63rem; }
.contrast-criteria { margin-top: 16px; padding: 15px 16px; color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.contrast-criteria h4 { margin: 0 0 10px; font-size: .88rem; }
.contrast-criteria dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0; }
.contrast-criteria dl > div { min-width: 0; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.contrast-criteria dt { color: var(--text); font-size: .76rem; font-weight: 900; }
.contrast-criteria dd { margin: 4px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.7; }
.contrast-criteria > p { margin: 11px 0 0; color: var(--muted); font-size: .68rem; }
.contrast-result { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.contrast-result > div { min-width: 0; display: grid; gap: 3px; padding: 11px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.contrast-result > div > span { padding: 0; background: transparent; font-size: .7rem; }
.contrast-result > div > strong { color: var(--text); font-size: .8rem; }
.contrast-result > div > small { color: var(--text); font-size: .68rem; line-height: 1.5; }
.contrast-result-item[data-pass="true"] { border-color: color-mix(in srgb, #159467 60%, var(--line)); background: color-mix(in srgb, #159467 8%, var(--surface)); }
.contrast-result-item[data-pass="false"] { border-color: color-mix(in srgb, #c43d5d 58%, var(--line)); background: color-mix(in srgb, #c43d5d 8%, var(--surface)); }
.color-editor-dialog { width: min(880px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.45); }
.color-editor-dialog::backdrop { background: rgba(4,9,18,.72); backdrop-filter: blur(4px); }
.color-editor-shell { max-height: calc(100vh - 26px); overflow: auto; padding: 20px; }
.color-editor-shell > header { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.color-editor-shell h2 { margin: 0; font-size: 1.3rem; }
.color-editor-shell .eyebrow { margin: 0 0 3px; }
.color-editor-shell > header button { width: 42px; height: 42px; color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; font-size: 1.4rem; }
.color-editor-shell > p { margin: 9px 0 0; color: var(--muted); font-size: .76rem; }
.color-editor-preview { min-height: 92px; display: grid; place-items: center; margin-top: 15px; border: 1px solid var(--line-strong); border-radius: 12px; }
.color-editor-preview strong { font: 900 1.2rem ui-monospace, monospace; }
.color-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 13px; }
.color-editor-fields fieldset { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; }
.color-editor-fields fieldset[data-color-group="hex"] { grid-template-columns: 1fr; }
.color-editor-fields fieldset[data-color-group="rgb"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.color-editor-fields legend { padding: 0 5px; color: var(--text); font-size: .78rem; font-weight: 900; }
.color-editor-fields legend small { color: var(--muted); font-weight: 700; }
.color-editor-fields label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: .63rem; font-weight: 800; }
.color-editor-fields input { width: 100%; min-width: 0; min-height: 42px; padding: 0 9px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; font: .76rem ui-monospace, monospace; }
.color-editor-fields input:focus-visible, .color-editor-shell button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.color-editor-status { min-height: 1.4em; }
.color-editor-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }
.color-editor-actions button { min-height: 44px; padding: 0 15px; color: var(--text); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 9px; cursor: pointer; font-weight: 850; }
.color-editor-actions button:first-child { color: #fff; background: #5148c5; border-color: #5148c5; }
.contrast-large strong { font-size: 1.65rem; }
.reference-spec-links button,
.reference-link-copy {
  padding: 9px 12px;
  color: var(--steel);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  font-weight: 850;
}
.reference-info-box code { overflow-wrap: anywhere; }
.reference-info-box h3 + .reference-token-list,
.reference-info-box h3 + .reference-link-list { margin-top: 10px; }
.reference-syntax-intro { margin-bottom: 12px; color: var(--muted); }
.reference-syntax-guide { display: grid; gap: 8px; margin: 0; }
.reference-syntax-guide > div {
  display: grid;
  grid-template-columns: minmax(112px, .34fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  background: var(--paper);
  border-radius: 9px;
}
.reference-syntax-guide dt { font-weight: 900; }
.reference-syntax-guide dd { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.65; }
.reference-syntax-note { margin: 12px 0 0; font-weight: 750; }
kbd {
  padding: .12em .42em;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: ui-monospace, monospace;
}

@media (max-width: 680px) {
  .color-converter-row { grid-template-columns: minmax(0,1fr) auto; }
  .color-converter-row label { grid-column: 1 / -1; }
  .contrast-controls { grid-template-columns: 1fr 1fr; }
  .contrast-criteria dl, .contrast-result, .color-editor-fields { grid-template-columns: 1fr; }
  .contrast-controls > button { grid-template-columns: 42px minmax(0, 1fr); }
  .contrast-controls > button > i { width: 42px; height: 48px; }
  .color-editor-shell { padding: 15px; }
  .converter-task { padding: 14px; }
  .reference-syntax-guide > div { grid-template-columns: 1fr; gap: 4px; }
  .css-pattern-list li,
  .css-value-list li { grid-template-columns: 1fr; gap: 5px; padding: 11px 12px; }
  .css-pattern-example { grid-template-columns: 1fr; gap: 5px; }
}

/* CSS reference hero: the total count spans both columns. */
.page-hero-stats .is-total {
  grid-column: 1 / -1;
  min-height: 112px;
}

/* CSS辞典の総項目カードは全幅にし、5件の統計を読みやすく配置します。 */
.page-hero-stats .is-total {
  grid-column: 1 / -1;
  min-height: 112px;
}

/* Keep the two CSS dictionary title lines readable on narrow screens. */
.css-reference-hero h1 { max-width: 100%; }
.css-reference-hero h1 .css-title-primary,
.css-reference-hero h1 .css-title-secondary {
  display: block;
  white-space: nowrap;
}
.css-reference-hero h1 .css-title-primary { color: var(--ink); }
.css-reference-hero h1 .css-title-secondary { color: var(--steel); }
html[data-theme="dark"] .css-reference-hero h1 .css-title-primary { color: #fff; }
@media (max-width: 680px) {
  .css-reference-hero h1 { font-size: clamp(2.35rem, 10.8vw, 3rem); }
}

@media (max-width: 680px) {
  body[data-reference="css"] .page-hero h1 {
    max-width: 100%;
    font-size: clamp(2.45rem, 11.55vw, 3.65rem);
    line-height: 1.04;
    letter-spacing: -.06em;
    word-break: keep-all;
    overflow-wrap: normal;
  }
}


/* =========================================================
   Distribution assets, site notices, and terms
   ========================================================= */
.site-alert,
.site-legal-note {
  width: var(--shell);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 20px 22px;
  background: color-mix(in srgb, var(--cyan) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--cyan) 22%, var(--line));
  border-left: 5px solid var(--cyan);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.site-alert { margin-bottom: 76px; }
.site-alert strong,
.site-legal-note strong { color: var(--ink); font-size: 1rem; }
html[data-theme="dark"] .site-alert strong,
html[data-theme="dark"] .site-legal-note strong { color: #fff; }
.site-alert p,
.site-legal-note p { margin: 5px 0 0; color: var(--muted); font-size: .86rem; }
.site-alert > a,
.site-legal-note > a {
  flex: 0 0 auto;
  padding: 10px 13px;
  color: var(--steel);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}
.site-legal-note { margin-top: 70px; margin-bottom: 88px; }
.content-license-strip {
  width: var(--shell);
  margin: -30px auto 72px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  font-size: .8rem;
}
.content-license-strip::before {
  content: "i";
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--steel);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 900;
}
.content-license-strip p { margin: 2px 0 0; }
.content-license-strip a { color: var(--steel); font-weight: 850; }

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 16px;
}
.footer-legal-links a {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 750;
  text-decoration: none;
}
.footer-legal-links a:hover { color: var(--steel); }

/* Lab home: fifth asset card */
.lab-tool-card.assets { --card-accent: #159447; grid-column: 1 / -1; min-height: 270px; }
.lab-tool-card.assets .asset-card-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .68fr);
  align-items: center;
  gap: clamp(24px, 5vw, 70px);
}
.asset-card-logos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}
.asset-card-logos img {
  width: 100%;
  max-width: 170px;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 8px;
  background:
    linear-gradient(45deg, color-mix(in srgb, var(--line) 55%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--line) 55%, transparent) 75%),
    linear-gradient(45deg, color-mix(in srgb, var(--line) 55%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--line) 55%, transparent) 75%),
    var(--paper);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
}

/* Logo distribution page */
.logo-page-hero { min-height: 660px; }
.logo-page-hero h1 { max-width: 100%; }
.logo-hero-collage {
  position: relative;
  min-height: 510px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  place-content: center;
}
.logo-hero-collage::before {
  content: "";
  position: absolute;
  inset: 11% 6%;
  z-index: -1;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cyan) 14%, transparent), color-mix(in srgb, #f97316 10%, transparent));
  border-radius: 50%;
  filter: blur(18px);
}
.logo-hero-collage img {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 12px;
  background:
    linear-gradient(45deg, color-mix(in srgb, var(--line) 45%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--line) 45%, transparent) 75%),
    linear-gradient(45deg, color-mix(in srgb, var(--line) 45%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--line) 45%, transparent) 75%),
    var(--surface-alpha);
  background-position: 0 0, 11px 11px;
  background-size: 22px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}
.logo-collection { padding-bottom: 105px; }
.logo-download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.logo-download-card {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-md);
}
.logo-preview {
  min-height: 390px;
  display: grid;
  place-items: center;
  padding: 26px;
  border-bottom: 1px solid var(--line);
}
.checker {
  background:
    linear-gradient(45deg, color-mix(in srgb, var(--line) 55%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--line) 55%, transparent) 75%),
    linear-gradient(45deg, color-mix(in srgb, var(--line) 55%, transparent) 25%, transparent 25% 75%, color-mix(in srgb, var(--line) 55%, transparent) 75%),
    var(--paper);
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
}
.logo-preview img { width: min(100%, 350px); aspect-ratio: 1; object-fit: contain; }
.logo-card-copy { padding: 24px 24px 18px; }
.logo-card-copy > span {
  color: var(--logo-accent);
  font-family: ui-monospace, monospace;
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .12em;
}
.logo-card-copy h3 { margin: 7px 0 0; font-size: 1.55rem; }
.logo-card-copy p { margin: 12px 0 0; color: var(--muted); font-size: .9rem; }
.logo-download-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 24px 24px;
}
.logo-download-actions a {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 8px 10px;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
}
.logo-download-actions a:first-child {
  color: #fff;
  background: var(--logo-accent);
  border-color: var(--logo-accent);
}

.use-case-section { padding-bottom: 100px; }
.use-case-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.use-case-grid article {
  min-height: 220px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.use-case-grid span {
  color: var(--cyan);
  font-family: ui-monospace, monospace;
  font-weight: 950;
}
.use-case-grid h3 { margin: 36px 0 8px; font-size: 1.15rem; }
.use-case-grid p { margin: 0; color: var(--muted); font-size: .86rem; }

.logo-license-panel {
  padding: clamp(28px, 5vw, 58px);
  color: #fff;
  background: linear-gradient(135deg, var(--ink), #163c59 65%, var(--steel));
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
}
.logo-license-heading { max-width: 780px; }
.logo-license-heading h2 { margin: 0; font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 1.04; letter-spacing: -.055em; }
.logo-license-heading p:not(.eyebrow) { color: #c2d6e2; }
.license-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 30px;
}
.license-columns section {
  padding: 23px;
  border: 1px solid rgb(255 255 255 / .16);
  border-radius: 18px;
  background: rgb(255 255 255 / .055);
}
.license-columns h3 { margin: 0 0 14px; font-size: 1.2rem; }
.license-columns ul { display: grid; gap: 9px; margin: 0; padding-left: 1.2rem; color: #d4e2ea; font-size: .88rem; }
.license-allowed h3 { color: #86efac; }
.license-prohibited h3 { color: #fca5a5; }
.credit-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 20px;
  background: rgb(255 255 255 / .08);
  border: 1px solid rgb(255 255 255 / .16);
  border-radius: 18px;
}
.credit-box h3 { margin: 0; }
.credit-box p { margin: 4px 0 10px; color: #c4d7e2; font-size: .85rem; }
.credit-box code {
  display: block;
  overflow-wrap: anywhere;
  color: #a5f3fc;
  font-family: ui-monospace, monospace;
  font-size: .78rem;
}
.credit-box button,
.license-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: #fff;
  background: rgb(255 255 255 / .08);
  border: 1px solid rgb(255 255 255 / .2);
  border-radius: 10px;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 850;
  text-decoration: none;
}
.credit-box button:hover,
.license-actions a:hover { background: rgb(255 255 255 / .14); }
.license-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}
.license-actions a:first-child { background: #fff; color: var(--ink); }

/* Terms page */
.compact-page-hero { min-height: 570px; }
.terms-summary-card {
  position: relative;
  z-index: 1;
  min-height: 310px;
  display: grid;
  align-content: end;
  padding: clamp(26px, 4vw, 46px);
  color: #fff;
  background:
    linear-gradient(145deg, rgb(255 255 255 / .08), transparent),
    linear-gradient(135deg, var(--ink), var(--steel));
  border: 1px solid rgb(255 255 255 / .18);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
}
.terms-summary-card span {
  align-self: start;
  color: #8ee5f2;
  font-family: ui-monospace, monospace;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .14em;
}
.terms-summary-card strong {
  margin-top: 70px;
  font-size: clamp(2.25rem, 5vw, 4.6rem);
  line-height: .96;
  letter-spacing: -.06em;
}
.terms-summary-card p { color: #c6dae5; }
.terms-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding-bottom: 110px;
}
.terms-toc {
  position: sticky;
  top: calc(var(--header-height) + 18px);
  display: grid;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.terms-toc strong {
  padding: 5px 8px 10px;
  color: var(--steel);
  font-size: .76rem;
  letter-spacing: .12em;
}
.terms-toc a {
  padding: 8px;
  color: var(--muted);
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 750;
  text-decoration: none;
}
.terms-toc a:hover { color: var(--ink); background: var(--paper); }
html[data-theme="dark"] .terms-toc a:hover { color: #fff; }
.terms-document {
  min-width: 0;
  padding: clamp(24px, 5vw, 58px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
}
.terms-document > section {
  scroll-margin-top: calc(var(--header-height) + 28px);
}
.terms-document > section + section {
  margin-top: 54px;
  padding-top: 54px;
  border-top: 1px solid var(--line);
}
.terms-number {
  display: inline-block;
  color: var(--cyan);
  font-family: ui-monospace, monospace;
  font-size: .76rem;
  font-weight: 950;
  letter-spacing: .12em;
}
.terms-document h2 {
  margin: 8px 0 20px;
  font-size: clamp(1.65rem, 3vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -.035em;
}
.terms-document h3 { margin: 28px 0 10px; font-size: 1.08rem; }
.terms-document p,
.terms-document li { color: var(--muted); }
.terms-document ul { display: grid; gap: 8px; }
.terms-document a { color: var(--steel); font-weight: 800; }
.terms-note,
.terms-small {
  padding: 14px 16px;
  background: color-mix(in srgb, var(--cyan) 7%, var(--paper));
  border-left: 4px solid var(--cyan);
  border-radius: 9px;
  font-size: .82rem;
}
.terms-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.terms-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.terms-table th,
.terms-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .78rem; }
.terms-table th { color: var(--ink); background: var(--paper); }
html[data-theme="dark"] .terms-table th { color: #fff; }
.terms-table tr:last-child td { border-bottom: 0; }
.terms-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 22px 0; }
.terms-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
}
.terms-actions a:first-child { color: #fff; background: var(--ink); border-color: var(--ink); }

@media (max-width: 980px) {
  .use-case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .terms-layout { grid-template-columns: 1fr; }
  .terms-toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .terms-toc strong { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .lab-tool-card.assets .asset-card-layout { grid-template-columns: 1fr; }
  .logo-download-grid { grid-template-columns: 1fr; }
  .logo-page-hero .logo-hero-collage { min-height: 420px; }
  .license-columns { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .site-alert,
  .site-legal-note { grid-template-columns: 1fr; gap: 13px; padding: 17px; }
  .site-alert > a,
  .site-legal-note > a { white-space: normal; justify-self: start; }
  .content-license-strip { margin-top: -24px; margin-bottom: 54px; }
  .footer-legal-links { justify-content: flex-start; }
  .lab-tool-card.assets { grid-column: auto; }
  .asset-card-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logo-page-hero { padding-bottom: 42px; }
  .logo-page-hero h1 { font-size: clamp(2.75rem, 12.6vw, 3.15rem); letter-spacing: -.07em; }
  .logo-page-hero h1 span { word-break: keep-all; overflow-wrap: normal; }
  .logo-hero-collage { min-height: 330px; gap: 8px; }
  .logo-hero-collage img { padding: 6px; border-radius: 16px; }
  .logo-preview { min-height: 300px; padding: 16px; }
  .logo-card-copy { padding: 20px 18px 15px; }
  .logo-download-actions { grid-template-columns: 1fr; padding: 0 18px 18px; }
  .use-case-grid { grid-template-columns: 1fr; }
  .use-case-grid article { min-height: 180px; }
  .credit-box { grid-template-columns: 1fr; }
  .credit-box button { justify-self: start; }
  .terms-toc { grid-template-columns: 1fr; }
  .terms-document { padding: 20px; border-radius: 20px; }
  .terms-document > section + section { margin-top: 42px; padding-top: 42px; }
}

/* Logo rights, attribution and compliance sections */
.rights-overview,
.safe-use-panel,
.compliance-audit,
.logo-faq { padding-bottom: 100px; }

.rights-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.rights-summary-card {
  position: relative;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  padding: 26px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
}
.rights-summary-card::after {
  content: "";
  position: absolute;
  right: -52px;
  bottom: -74px;
  width: 190px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: color-mix(in srgb, var(--rights-accent) 10%, transparent);
}
.source-card { --rights-accent: #e34c26; }
.changes-card { --rights-accent: #7c3aed; }
.standard-card { --rights-accent: #00a97f; }
.rights-card-number {
  position: relative;
  z-index: 1;
  color: var(--rights-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 2.6rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.08em;
}
.rights-card-kicker {
  position: relative;
  z-index: 1;
  margin: 20px 0 0;
  color: var(--rights-accent) !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .7rem !important;
  font-weight: 950;
  letter-spacing: .14em;
}
.rights-summary-card h3 {
  position: relative;
  z-index: 1;
  margin: 7px 0 0;
  font-size: 1.45rem;
  line-height: 1.25;
}
.rights-summary-card > p:not(.rights-card-kicker) {
  position: relative;
  z-index: 1;
  margin: 13px 0 22px;
  color: var(--muted);
  font-size: .88rem;
}
.rights-summary-card > a {
  position: relative;
  z-index: 1;
  margin-top: auto;
  color: var(--rights-accent);
  font-size: .8rem;
  font-weight: 900;
  text-decoration: none;
}
.rights-summary-card > a:hover { text-decoration: underline; }

.safe-use-panel {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
  gap: clamp(26px, 5vw, 68px);
  align-items: start;
  padding-top: clamp(30px, 5vw, 62px);
  padding-left: clamp(26px, 5vw, 62px);
  padding-right: clamp(26px, 5vw, 62px);
  padding-bottom: clamp(30px, 5vw, 62px);
  margin-bottom: 100px;
  background:
    radial-gradient(circle at 92% 0%, color-mix(in srgb, #7c3aed 16%, transparent), transparent 28rem),
    radial-gradient(circle at 0% 100%, color-mix(in srgb, #00a97f 13%, transparent), transparent 30rem),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow-md);
}
.safe-use-heading h2 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.3rem);
  line-height: 1.02;
  letter-spacing: -.06em;
}
.safe-use-heading > p:not(.eyebrow) { color: var(--muted); }
.safe-use-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.safe-use-columns section {
  padding: 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.safe-use-columns h3 { margin: 0 0 15px; font-size: 1.13rem; }
.safe-use-columns section:first-child h3 { color: #087f5b; }
.safe-use-columns section:last-child h3 { color: #6d28d9; }
html[data-theme="dark"] .safe-use-columns section:first-child h3 { color: #6ee7b7; }
html[data-theme="dark"] .safe-use-columns section:last-child h3 { color: #c4b5fd; }
.safe-use-columns ul { display: grid; gap: 9px; margin: 0; padding-left: 1.2rem; color: var(--muted); font-size: .86rem; }
.safe-use-caution {
  grid-column: 1 / -1;
  margin: 0;
  padding: 17px 19px;
  color: var(--muted);
  background: color-mix(in srgb, #f59e0b 10%, var(--paper));
  border: 1px solid color-mix(in srgb, #f59e0b 25%, var(--line));
  border-left: 5px solid #f59e0b;
  border-radius: 13px;
  font-size: .86rem;
}
.safe-use-caution strong { color: var(--text); }

.license-required h3 { color: #fde68a; }
.attribution-stack { display: grid; gap: 14px; margin-top: 18px; }
.license-inline-note {
  margin: 17px 0 0;
  padding: 13px 15px;
  color: #d7e6ee;
  background: rgb(255 255 255 / .065);
  border: 1px solid rgb(255 255 255 / .14);
  border-radius: 12px;
  font-size: .8rem;
}

.compliance-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.compliance-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
  border-collapse: collapse;
}
.compliance-table th,
.compliance-table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: .82rem;
}
.compliance-table th {
  color: var(--text);
  background: var(--paper);
  font-size: .75rem;
  letter-spacing: .04em;
  white-space: nowrap;
}
.compliance-table th:nth-child(1) { width: 18%; }
.compliance-table th:nth-child(2) { width: 25%; }
.compliance-table th:nth-child(3) { width: 41%; }
.compliance-table th:nth-child(4) { width: 16%; }
.compliance-table td:last-child { white-space: nowrap; }
.compliance-table td { color: var(--muted); }
.compliance-table td:first-child { color: var(--text); font-weight: 850; }
.compliance-table tr:last-child td { border-bottom: 0; }
.audit-pass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 28px;
  padding: 3px 9px;
  color: #087f5b;
  background: color-mix(in srgb, #10b981 11%, var(--paper));
  border: 1px solid color-mix(in srgb, #10b981 30%, var(--line));
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 900;
}
html[data-theme="dark"] .audit-pass { color: #6ee7b7; }
.license-source-list {
  margin-top: 20px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.license-source-list h3 { margin: 0 0 14px; }
.license-source-list ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.license-source-list li {
  display: grid;
  grid-template-columns: minmax(230px, .75fr) minmax(0, 1.25fr);
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.license-source-list li:last-child { border-bottom: 0; }
.license-source-list a { color: var(--steel); font-weight: 850; text-decoration: none; }
.license-source-list a:hover { text-decoration: underline; }
.license-source-list li span,
.license-source-list > p { color: var(--muted); font-size: .83rem; }
.license-source-list > p {
  margin: 18px 0 0;
  padding: 14px 16px;
  background: var(--paper);
  border-radius: 12px;
}

.logo-faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.logo-faq-grid details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: var(--shadow-sm);
}
.logo-faq-grid summary {
  padding: 18px 20px;
  cursor: pointer;
  font-size: .91rem;
  font-weight: 900;
}
.logo-faq-grid p { margin: 0; padding: 0 20px 20px; color: var(--muted); font-size: .86rem; }

@media (max-width: 1040px) {
  .rights-summary-grid { grid-template-columns: 1fr; }
  .rights-summary-card { min-height: 250px; }
  .safe-use-panel { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .rights-overview,
  .safe-use-panel,
  .compliance-audit,
  .logo-faq { padding-bottom: 72px; }
  .safe-use-panel { margin-bottom: 72px; }
  .safe-use-columns,
  .logo-faq-grid { grid-template-columns: 1fr; }
  .license-source-list li { grid-template-columns: 1fr; gap: 4px; }
  .rights-summary-card { padding: 21px; }
  .credit-box code { max-height: 180px; overflow: auto; }
}

/* HTML LS logo purpose, review result, and safe-use checklist */
.logo-purpose-panel,
.license-review-result,
.logo-use-checklist {
  margin-bottom: 100px;
}

.logo-purpose-panel {
  display: grid;
  grid-template-columns: minmax(150px, .34fr) minmax(0, 1.66fr);
  gap: clamp(24px, 5vw, 68px);
  align-items: start;
  padding: clamp(28px, 5vw, 58px);
  background:
    radial-gradient(circle at 0 0, color-mix(in srgb, #f59e0b 12%, transparent), transparent 24rem),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
}
.logo-purpose-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 14px;
  color: #8a4b08;
  background: color-mix(in srgb, #f59e0b 13%, var(--paper));
  border: 1px solid color-mix(in srgb, #f59e0b 32%, var(--line));
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .13em;
  white-space: nowrap;
}
html[data-theme="dark"] .logo-purpose-badge { color: #fcd34d; }
.logo-purpose-panel h2 {
  max-width: 870px;
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.7rem);
  line-height: 1.08;
  letter-spacing: -.055em;
}
.logo-purpose-panel p {
  max-width: 900px;
  margin: 18px 0 0;
  color: var(--muted);
}
.logo-purpose-panel p:last-child {
  padding: 15px 17px;
  background: var(--paper);
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  font-size: .88rem;
}
.logo-purpose-panel p strong { color: var(--text); }

.license-review-result {
  display: grid;
  grid-template-columns: minmax(210px, .46fr) minmax(0, 1.54fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
  padding: clamp(28px, 5vw, 58px);
  color: #e9fff8;
  background:
    radial-gradient(circle at 100% 0, rgb(45 212 191 / .18), transparent 26rem),
    radial-gradient(circle at 0 100%, rgb(124 58 237 / .20), transparent 28rem),
    #11182a;
  border: 1px solid rgb(255 255 255 / .13);
  border-radius: 30px;
  box-shadow: 0 24px 64px rgb(18 24 43 / .24);
}
.license-review-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgb(255 255 255 / .08);
  border: 1px solid rgb(255 255 255 / .13);
  border-radius: 16px;
  font-size: .84rem;
}
.license-review-status span {
  display: grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  color: #062e26;
  background: #5eead4;
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 950;
}
.license-review-result h2 {
  margin: 0;
  color: white;
  font-size: clamp(1.9rem, 4vw, 3.45rem);
  line-height: 1.08;
  letter-spacing: -.055em;
}
.license-review-result p {
  margin: 18px 0 0;
  color: #cbd5e1;
}
.license-review-caution {
  padding: 15px 17px;
  color: #4b3500 !important;
  background: #fff7da;
  border: 1px solid #e5c96a;
  border-left: 4px solid #b77900;
  border-radius: 12px;
  font-size: .86rem;
}
.license-review-result .license-review-caution {
  color: #f1f5f9 !important;
  background: rgb(255 255 255 / .08);
  border-color: rgb(255 255 255 / .18);
  border-left-color: #fbbf24;
}
html[data-theme="dark"] .license-source-list .license-review-caution {
  color: #fff3c4 !important;
  background: #342e1e;
  border-color: #695b30;
  border-left-color: #ffd166;
}

.logo-use-checklist ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.logo-use-checklist li {
  min-height: 245px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.logo-use-checklist li > span {
  color: var(--violet, #7c3aed);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.08em;
}
.logo-use-checklist li strong {
  display: block;
  font-size: 1rem;
  line-height: 1.35;
}
.logo-use-checklist li p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: .82rem;
}

@media (max-width: 1180px) {
  .logo-use-checklist ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .logo-purpose-panel,
  .license-review-result { grid-template-columns: 1fr; }
  .logo-purpose-badge { justify-self: start; }
  .logo-use-checklist ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .logo-purpose-panel,
  .license-review-result,
  .logo-use-checklist { margin-bottom: 72px; }
  .logo-purpose-panel,
  .license-review-result { padding: 22px; border-radius: 22px; }
  .logo-use-checklist ol { grid-template-columns: 1fr; }
  .logo-use-checklist li { min-height: 0; }
}

/* Keep the compliance heading balanced instead of leaving a single Japanese character on a new line. */
.compliance-audit .lab-section-heading h2 {
  max-width: 19ch;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  text-wrap: balance;
}

/* Keep the license-review heading readable at wide widths. */
.compliance-audit .lab-section-heading { max-width: 980px; }
.compliance-audit .lab-section-heading h2 {
  max-width: none;
  font-size: clamp(2.2rem, 3.8vw, 3.55rem);
  text-wrap: wrap;
}
@media (min-width: 900px) {
  .compliance-audit .lab-section-heading h2 { white-space: nowrap; }
}

/* ============================================================
   Portfolio logo & trademark guide
   ============================================================ */
.brand-guide-page {
  --guide-violet: #6d4aff;
  --guide-violet-dark: #4b2ed4;
  --guide-teal: #12b8a6;
  --guide-amber: #f3a712;
  --guide-coral: #f15d6f;
  --guide-navy: #17152e;
}
.brand-guide-hero {
  position: relative;
  min-height: 690px;
  overflow: clip;
  background:
    radial-gradient(circle at 77% 24%, color-mix(in srgb, var(--guide-violet) 18%, transparent), transparent 26rem),
    radial-gradient(circle at 94% 74%, color-mix(in srgb, var(--guide-teal) 18%, transparent), transparent 22rem);
}
.brand-guide-hero .page-hero-copy { position: relative; z-index: 2; }
.brand-guide-hero h1 { max-width: 900px; font-size: clamp(3.25rem, 7.4vw, 7.2rem); }
.brand-guide-hero h1 em {
  color: transparent;
  background: linear-gradient(100deg, var(--guide-violet), var(--guide-teal));
  background-clip: text;
  -webkit-background-clip: text;
  font-style: normal;
}
.brand-guide-hero .page-hero-actions a:first-child {
  color: #fff;
  background: linear-gradient(135deg, var(--guide-violet), var(--guide-violet-dark));
  border-color: transparent;
  box-shadow: 0 16px 34px rgb(109 74 255 / .24);
}
.brand-guide-hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}
.brand-guide-hero-facts li {
  padding: 7px 11px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}
.brand-guide-visual {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
}
.brand-orbit {
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--guide-violet) 28%, transparent);
  border-radius: 50%;
}
.brand-orbit-one { width: 390px; height: 390px; }
.brand-orbit-two {
  width: 265px;
  height: 265px;
  border-color: color-mix(in srgb, var(--guide-teal) 38%, transparent);
  border-style: dashed;
  transform: rotate(18deg);
}
.brand-guide-tile {
  position: absolute;
  width: 142px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: #fff;
  border: 1px solid rgb(255 255 255 / .28);
  border-radius: 30px;
  box-shadow: 0 24px 56px rgb(23 21 46 / .22);
  transform: rotate(var(--tile-rotation, 0deg));
  backdrop-filter: blur(10px);
}
.brand-guide-tile span { font-size: 2rem; font-weight: 950; letter-spacing: -.06em; }
.brand-guide-tile small { font-size: .62rem; font-weight: 900; letter-spacing: .15em; }
.brand-guide-tile-html { top: 42px; left: 38px; --tile-rotation: -8deg; background: linear-gradient(145deg, #ff6a3d, #db3b2d); }
.brand-guide-tile-office { top: 104px; right: 18px; --tile-rotation: 7deg; background: linear-gradient(145deg, #4361ee, #2943bd); }
.brand-guide-tile-creative { bottom: 35px; left: 82px; --tile-rotation: 5deg; background: linear-gradient(145deg, #f24b83, #a92e9a); }
.brand-guide-tile-credit { right: 70px; bottom: 30px; --tile-rotation: -6deg; background: linear-gradient(145deg, #12b8a6, #087c74); }

.brand-guide-alert {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
  margin-top: -30px;
  margin-bottom: 96px;
  padding: 24px 28px;
  color: color-mix(in srgb, var(--text) 90%, var(--guide-coral));
  background: color-mix(in srgb, var(--guide-coral) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--guide-coral) 25%, var(--line));
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.brand-guide-alert-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--guide-coral);
  border-radius: 13px;
  font-size: 1.2rem;
  font-weight: 950;
}
.brand-guide-alert h2 { margin: 0 0 5px; font-size: clamp(1.1rem, 2vw, 1.45rem); }
.brand-guide-alert p { margin: 0; color: var(--muted); }

.brand-guide-section { margin-bottom: 110px; }
.brand-guide-section-heading { max-width: 920px; margin-bottom: 30px; }
.brand-guide-section-heading h2 { margin: 0; font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: 1.08; letter-spacing: -.055em; }
.brand-guide-section-heading > p:last-child { max-width: 760px; margin: 14px 0 0; color: var(--muted); font-size: 1rem; }
.brand-guide-section .eyebrow { color: var(--guide-violet); }
.brand-guide-section .eyebrow span { background: var(--guide-teal); }

.placement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.placement-card {
  min-width: 0;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-sm);
}
.placement-card > header { display: flex; align-items: center; gap: 14px; }
.placement-card > header > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--guide-violet), var(--guide-teal));
  border-radius: 16px;
  font-size: 1.4rem;
  font-weight: 950;
}
.placement-card header small { color: var(--guide-violet); font-size: .63rem; font-weight: 900; letter-spacing: .15em; }
.placement-card h3 { margin: 2px 0 0; font-size: 1.35rem; }
.placement-card ol { display: grid; gap: 13px; margin: 24px 0 0; padding: 0; list-style: none; counter-reset: placement; }
.placement-card li {
  counter-increment: placement;
  position: relative;
  padding: 14px 15px 14px 52px;
  background: color-mix(in srgb, var(--paper) 76%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 14px;
}
.placement-card li::before {
  content: counter(placement, decimal-leading-zero);
  position: absolute;
  top: 14px;
  left: 14px;
  color: var(--guide-violet);
  font-family: ui-monospace, monospace;
  font-size: .72rem;
  font-weight: 950;
}
.placement-card li strong { display: block; }
.placement-card li p { margin: 4px 0 0; color: var(--muted); font-size: .86rem; }
.placement-card code, .output-placement-hint code { padding: .1em .32em; background: color-mix(in srgb, var(--guide-violet) 9%, var(--paper)); border-radius: 5px; }
.placement-code, .credit-copy-block { margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.placement-code > div, .credit-copy-block > div { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 13px; background: color-mix(in srgb, var(--paper) 78%, var(--surface)); }
.placement-code button, .credit-copy-block button {
  min-height: 34px;
  padding: 0 11px;
  color: #fff;
  background: var(--guide-violet);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 900;
}
.placement-code pre, .credit-copy-block pre { max-height: 330px; }

.brand-guide-matrix-section, .brand-group-panel, .brand-guide-sources {
  padding-block: 96px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--guide-violet) 7%, var(--paper)), color-mix(in srgb, var(--guide-teal) 6%, var(--paper)));
  border-block: 1px solid var(--line);
}
.brand-guide-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); }
.brand-guide-table { width: 100%; min-width: 840px; border-collapse: collapse; }
.brand-guide-table th, .brand-guide-table td { padding: 16px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.brand-guide-table thead th { color: var(--muted); background: color-mix(in srgb, var(--paper) 70%, var(--surface)); font-size: .71rem; letter-spacing: .08em; }
.brand-guide-table tbody tr:last-child th, .brand-guide-table tbody tr:last-child td { border-bottom: 0; }
.brand-guide-table tbody th { min-width: 190px; }
.status-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border-radius: 999px; font-size: .67rem; font-weight: 900; white-space: nowrap; }
.status-allowed { color: #087268; background: #dcfaf3; }
.status-limited { color: #8a5200; background: #fff3d5; }
.status-neutral { color: #40526a; background: #e8edf4; }
.status-license { color: #a1223b; background: #ffe3e8; }
html[data-theme="dark"] .status-allowed { color: #87f0df; background: #103f3a; }
html[data-theme="dark"] .status-limited { color: #ffd57d; background: #473715; }
html[data-theme="dark"] .status-neutral { color: #c8d2df; background: #2b394a; }
html[data-theme="dark"] .status-license { color: #ff9daf; background: #4b1f2a; }

.brand-record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.brand-record {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}
.brand-record > header { display: flex; align-items: center; gap: 15px; }
.brand-record header h3 { margin: 5px 0 0; font-size: 1.35rem; }
.brand-record header p { margin: 1px 0 0; color: var(--muted); font-size: .78rem; }
.neutral-brand-mark {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 19px;
  font-family: ui-monospace, monospace;
  font-weight: 950;
  letter-spacing: -.08em;
  box-shadow: 0 12px 26px rgb(23 21 46 / .14);
}
.mark-html { background: linear-gradient(135deg, #f36b3f, #c9392f); }
.mark-html-ls { background: linear-gradient(135deg, #198b62, #0d5944); }
.mark-css { background: linear-gradient(135deg, #4361ee, #2943bd); }
.mark-js { color: #17152e; background: linear-gradient(135deg, #ffd75b, #f3a712); }
.brand-record-summary { margin: 20px 0 0; padding: 16px; background: color-mix(in srgb, var(--paper) 78%, var(--surface)); border-radius: 14px; }
.brand-record-summary p { margin: 0; color: var(--muted); font-size: .88rem; }
.brand-record-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 18px 0 0; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 14px; }
.brand-record-facts div { min-width: 0; padding: 13px; background: var(--surface); }
.brand-record-facts dt { color: var(--muted); font-size: .67rem; font-weight: 900; }
.brand-record-facts dd { margin: 4px 0 0; font-size: .8rem; font-weight: 750; }
.brand-record-facts a { color: var(--guide-violet); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.brand-record .credit-copy-block { margin-top: auto; padding-top: 0; }

.brand-group-panel { margin-bottom: 0; }
.brand-group-microsoft { --group-accent: #4361ee; background: linear-gradient(135deg, color-mix(in srgb, #4361ee 8%, var(--paper)), var(--paper)); }
.brand-group-adobe { --group-accent: #f04e78; background: linear-gradient(135deg, color-mix(in srgb, #f04e78 8%, var(--paper)), var(--paper)); }
.brand-policy-layout { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(310px, .78fr); gap: 24px; }
.brand-policy-main, .brand-policy-side { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-sm); }
.policy-verdict h3 { margin: 12px 0 0; font-size: clamp(1.5rem, 3vw, 2.35rem); line-height: 1.18; letter-spacing: -.04em; }
.policy-verdict p { margin: 14px 0 0; color: var(--muted); }
.safe-skill-example { margin-top: 22px; padding: 18px; background: color-mix(in srgb, #4361ee 7%, var(--paper)); border: 1px solid color-mix(in srgb, #4361ee 18%, var(--line)); border-radius: 16px; }
.adobe-skill-example { background: color-mix(in srgb, #f04e78 7%, var(--paper)); border-color: color-mix(in srgb, #f04e78 18%, var(--line)); }
.safe-skill-example small { color: var(--muted); font-size: .67rem; font-weight: 900; letter-spacing: .08em; }
.safe-skill-example > div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.safe-skill-example span { padding: 8px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: .78rem; font-weight: 850; }
.safe-skill-example p { margin: 10px 0 0; color: var(--muted); font-size: .78rem; }
.brand-policy-side h3 { margin: 0 0 13px; font-size: 1.08rem; }
.brand-policy-side h3:not(:first-child) { margin-top: 24px; }
.brand-policy-side dl { display: grid; gap: 10px; margin: 0; }
.brand-policy-side dl div { padding: 13px; background: color-mix(in srgb, var(--paper) 78%, var(--surface)); border-radius: 12px; }
.brand-policy-side dt { font-size: .75rem; font-weight: 900; }
.brand-policy-side dd { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.official-source-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.official-source-list li { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.official-source-list a { color: var(--group-accent, var(--guide-violet)); font-size: .82rem; font-weight: 850; text-decoration: none; }
.official-source-list small { display: block; margin-top: 4px; color: var(--muted); font-size: .7rem; }
.brand-policy-warning { margin-top: 18px; padding: 14px; background: color-mix(in srgb, var(--guide-amber) 10%, var(--surface)); border-left: 4px solid var(--guide-amber); border-radius: 10px; }
.brand-policy-warning strong { color: #8a5200; }
.brand-policy-warning p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }

.credit-builder {
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(0, 1.18fr);
  gap: 24px;
}
.credit-builder-controls, .credit-builder-output { padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-sm); }
.credit-builder-controls { display: grid; gap: 15px; align-content: start; }
.credit-builder fieldset { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.credit-builder legend { padding: 0 7px; color: var(--guide-violet); font-size: .75rem; font-weight: 900; }
.credit-builder label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .79rem; font-weight: 750; cursor: pointer; }
.credit-builder input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--guide-violet); }
.credit-builder-options { display: grid; gap: 10px; padding: 15px; background: color-mix(in srgb, var(--paper) 78%, var(--surface)); border-radius: 13px; }
.credit-builder-options button { min-height: 42px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-weight: 850; }
.credit-output-header { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 16px; }
.credit-output-header small { color: var(--guide-violet); font-size: .66rem; font-weight: 900; letter-spacing: .14em; }
.credit-output-header h3 { margin: 2px 0 0; font-size: 1.5rem; }
.credit-output-header > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; }
.credit-output-header button {
  min-height: 40px;
  padding: 0 12px;
  color: #fff;
  background: var(--guide-violet);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 900;
}
.credit-builder-output > label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: .72rem; font-weight: 900; }
.credit-builder textarea {
  width: 100%;
  min-height: 230px;
  resize: vertical;
  padding: 15px;
  color: var(--code-text);
  background: var(--code);
  border: 1px solid color-mix(in srgb, var(--guide-violet) 28%, var(--line));
  border-radius: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .76rem;
  line-height: 1.7;
}
.output-placement-hint { margin: 7px 0 0; color: var(--muted); font-size: .72rem; }
.credit-builder-caution { margin-top: 18px; padding: 14px; background: color-mix(in srgb, var(--guide-coral) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--guide-coral) 20%, var(--line)); border-radius: 12px; }
.credit-builder-caution p { margin: 4px 0 0; color: var(--muted); font-size: .76rem; }

.brand-guide-sources { margin-bottom: 100px; }
.official-source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.official-source-grid article { min-width: 0; display: flex; flex-direction: column; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); }
.official-source-grid article > span { color: var(--guide-violet); font-size: .64rem; font-weight: 950; letter-spacing: .13em; }
.official-source-grid h3 { margin: 7px 0 0; font-size: 1.2rem; }
.official-source-grid p { flex: 1; margin: 8px 0 16px; color: var(--muted); font-size: .8rem; }
.official-source-grid a { margin-top: 7px; color: var(--guide-violet); font-size: .78rem; font-weight: 850; text-decoration: none; }

.brand-guide-final-note {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: 34px;
  align-items: center;
  margin-bottom: 100px;
  padding: 36px;
  color: #fff;
  background: linear-gradient(135deg, #17152e, #3d277f 60%, #0c7f74);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
}
.brand-guide-final-note .eyebrow { color: #bfaeff; }
.brand-guide-final-note h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1.08; letter-spacing: -.05em; }
.brand-guide-final-note p { margin: 15px 0 0; color: rgb(255 255 255 / .76); }
.brand-guide-final-note nav { display: grid; gap: 9px; }
.brand-guide-final-note a { padding: 12px 14px; color: #fff; background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .14); border-radius: 11px; text-decoration: none; font-weight: 850; }
.brand-guide-final-note a:hover { background: rgb(255 255 255 / .17); }

@media (max-width: 1080px) {
  .brand-guide-visual { min-height: 390px; }
  .brand-orbit-one { width: 320px; height: 320px; }
  .brand-orbit-two { width: 210px; height: 210px; }
  .brand-guide-tile { width: 112px; border-radius: 24px; }
  .brand-guide-tile-html { left: 4px; }
  .brand-guide-tile-office { right: 4px; }
  .brand-guide-tile-creative { left: 44px; }
  .brand-guide-tile-credit { right: 35px; }
  .brand-policy-layout, .credit-builder { grid-template-columns: 1fr; }
  .official-source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .brand-guide-hero { min-height: auto; }
  .brand-guide-visual { min-height: 330px; }
  .placement-grid, .brand-record-grid, .brand-guide-final-note { grid-template-columns: 1fr; }
  .brand-record-facts { grid-template-columns: 1fr; }
  .credit-output-header { align-items: start; flex-direction: column; }
}
@media (max-width: 560px) {
  .brand-guide-alert { grid-template-columns: 1fr; margin-top: 0; padding: 20px; }
  .brand-guide-hero h1 { font-size: clamp(2.7rem, 13vw, 4rem); }
  .brand-guide-visual { min-height: 280px; }
  .brand-orbit-one { width: 250px; height: 250px; }
  .brand-orbit-two { width: 170px; height: 170px; }
  .brand-guide-tile { width: 92px; border-radius: 20px; }
  .brand-guide-tile span { font-size: 1.45rem; }
  .brand-guide-tile small { font-size: .5rem; }
  .brand-guide-tile-html { top: 15px; left: 0; }
  .brand-guide-tile-office { top: 75px; right: 0; }
  .brand-guide-tile-creative { bottom: 12px; left: 35px; }
  .brand-guide-tile-credit { right: 38px; bottom: 0; }
  .placement-card, .brand-record, .brand-policy-main, .brand-policy-side, .credit-builder-controls, .credit-builder-output { padding: 19px; border-radius: 19px; }
  .credit-builder fieldset { grid-template-columns: 1fr; }
  .official-source-grid { grid-template-columns: 1fr; }
  .brand-guide-final-note { padding: 24px; }
}


/* Brand and trademark guide links */
.lab-tool-card.brand-guide {
  --card-accent: #5b3df5;
  grid-column: 1 / -1;
  min-height: 270px;
  background:
    radial-gradient(circle at 88% 20%, color-mix(in srgb, #30c6ad 18%, transparent), transparent 34%),
    radial-gradient(circle at 75% 90%, color-mix(in srgb, #f1a52b 16%, transparent), transparent 34%),
    var(--surface);
}
.brand-guide-card-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: 32px;
  align-items: center;
  width: 100%;
}
.brand-guide-card-visual {
  position: relative;
  min-height: 220px;
  display: grid;
  grid-template-columns: repeat(3, 72px);
  grid-auto-rows: 72px;
  justify-content: center;
  align-content: center;
  gap: 12px;
}
.brand-guide-card-visual span,
.brand-guide-card-visual b {
  display: grid;
  place-items: center;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 86%, #5b3df5);
  border: 1px solid color-mix(in srgb, #5b3df5 18%, var(--line));
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85rem;
  font-weight: 950;
  letter-spacing: .03em;
  transform: rotate(var(--tile-rotate, 0deg));
}
.brand-guide-card-visual span:nth-child(2) { --tile-rotate: 4deg; }
.brand-guide-card-visual span:nth-child(3) { --tile-rotate: -4deg; }
.brand-guide-card-visual span:nth-child(4) { --tile-rotate: -3deg; }
.brand-guide-card-visual span:nth-child(5) { --tile-rotate: 3deg; }
.brand-guide-card-visual b {
  color: #fff;
  background: linear-gradient(135deg, #5b3df5, #8b5cf6);
  border-color: transparent;
  font-size: 1.6rem;
}
.logo-brand-guide-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  margin-top: 24px;
  margin-bottom: 60px;
  padding: 28px 30px;
  background: linear-gradient(135deg, color-mix(in srgb, #5b3df5 9%, var(--surface)), color-mix(in srgb, #30c6ad 8%, var(--surface)));
  border: 1px solid color-mix(in srgb, #5b3df5 16%, var(--line));
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}
.logo-brand-guide-panel h2 { margin: 0; font-size: clamp(1.55rem, 3.2vw, 2.7rem); line-height: 1.1; letter-spacing: -.04em; }
.logo-brand-guide-panel p:not(.eyebrow) { max-width: 58rem; margin: 12px 0 0; color: var(--muted); }
.logo-brand-guide-panel > a { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; color: #fff; background: #5b3df5; border-radius: 13px; text-decoration: none; font-weight: 900; white-space: nowrap; }
.logo-brand-guide-panel > a:hover { background: #4528d7; }

@media (max-width: 780px) {
  .brand-guide-card-layout { grid-template-columns: 1fr; }
  .brand-guide-card-visual { min-height: 170px; grid-template-columns: repeat(3, 58px); grid-auto-rows: 58px; }
  .logo-brand-guide-panel { grid-template-columns: 1fr; padding: 22px; }
  .logo-brand-guide-panel > a { white-space: normal; text-align: center; }
}
@media (max-width: 560px) {
  .lab-tool-card.brand-guide { grid-column: auto; }
  .brand-guide-card-visual { grid-template-columns: repeat(3, 52px); grid-auto-rows: 52px; gap: 9px; }
  .brand-guide-card-visual span, .brand-guide-card-visual b { border-radius: 15px; font-size: .7rem; }
  .brand-guide-card-visual b { font-size: 1.25rem; }
}

/* Brand guide v4 additions */
.status-open { color: #4f277f; background: #eee3ff; }
.status-community { color: #6e4f00; background: #fff0b8; }
.status-historical { color: #40526a; background: #e8edf4; }
html[data-theme="dark"] .status-open { color: #d5b6ff; background: #3a2459; }
html[data-theme="dark"] .status-community { color: #ffe59a; background: #4f3c0d; }
html[data-theme="dark"] .status-historical { color: #c8d2df; background: #2b394a; }

.placement-principle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 22px;
  padding: 18px 20px;
  background: color-mix(in srgb, var(--guide-teal) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--guide-teal) 22%, var(--line));
  border-radius: 16px;
}
.placement-principle strong { color: var(--guide-teal); white-space: nowrap; }
.placement-principle p { margin: 0; color: var(--muted); }

.brand-record-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.brand-record-span { grid-column: 1 / -1; }
.brand-record-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .72fr); gap: 22px; }
.mark-css-current { color: #fff; background: #663399; }

.license-details,
.special-case-details {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper) 76%, var(--surface));
}
.license-details summary,
.special-case-details summary {
  padding: 14px 16px;
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
}
.license-details[open] summary,
.special-case-details[open] summary { border-bottom: 1px solid var(--line); }
.license-details > p,
.special-case-details > p { margin: 14px 16px 0; color: var(--muted); font-size: .84rem; }
.license-details .credit-copy-block,
.special-case-details .credit-copy-block { margin: 14px 16px 16px; background: var(--surface); }

.builder-download-link {
  min-height: 46px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--guide-violet), color-mix(in srgb, var(--guide-violet) 58%, var(--guide-teal)));
  border-radius: 11px;
  text-decoration: none;
  text-align: center;
  font-size: .8rem;
  font-weight: 900;
}
.builder-download-link:hover { filter: brightness(1.06); transform: translateY(-1px); }

@media (max-width: 900px) {
  .brand-record-split { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .brand-record-grid-wide { grid-template-columns: 1fr; }
  .brand-record-span { grid-column: auto; }
}
@media (max-width: 560px) {
  .placement-principle { grid-template-columns: 1fr; gap: 5px; }
  .placement-principle strong { white-space: normal; }
}

/* Prevent long trademark notices from expanding responsive grids */
.brand-policy-main,
.brand-policy-side,
.credit-builder-controls,
.credit-builder-output,
.credit-copy-block,
.placement-code { min-width: 0; }
.placement-code pre,
.credit-copy-block pre {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: var(--code-text);
  background: var(--code);
  font: .76rem/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
}

.placement-card ol,
.placement-card li,
.placement-card li p,
.placement-card li strong { min-width: 0; }
.placement-card li { overflow-wrap: anywhere; }
.placement-card li code { overflow-wrap: anywhere; word-break: break-word; }

/* Lab home: semantic naming tool card */
.lab-tool-card.naming {
  --card-accent: #6857e5;
  grid-column: 1 / -1;
  min-height: 280px;
  background:
    radial-gradient(circle at 88% 18%, color-mix(in srgb, var(--cyan) 14%, transparent), transparent 30%),
    radial-gradient(circle at 75% 92%, color-mix(in srgb, var(--steel) 14%, transparent), transparent 34%),
    var(--surface);
}
.naming-card-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: 36px;
  align-items: center;
}
.naming-card-visual {
  display: grid;
  gap: 10px;
  padding: 22px;
  background: var(--code);
  border: 1px solid color-mix(in srgb, var(--line) 20%, transparent);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}
.naming-card-visual code {
  display: block;
  overflow: hidden;
  padding: .65rem .8rem;
  color: var(--code-text);
  background: color-mix(in srgb, var(--surface) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 9%, transparent);
  border-radius: 9px;
  font: 800 .78rem ui-monospace, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.naming-card-visual code:nth-child(2) { color: #5eead4; }
.naming-card-visual code:nth-child(3) { color: #fbbf24; }
.naming-card-visual code:nth-child(4) { color: #c4b5fd; }
@media (max-width: 780px) {
  .naming-card-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .lab-tool-card.naming { grid-column: auto; }
  .naming-card-visual { padding: 15px; }
}
