/* 2026-09-20: four service-specific visual systems.
   This file loads last so the original application logic and component markup stay intact. */

:root {
  --ui-sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  --ui-serif: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--ui-sans); }
a, button, input, select, summary, [tabindex] { outline-offset: 3px; }
:focus-visible { outline: 3px solid currentColor !important; outline-offset: 3px !important; }
.skip-link {
  position: fixed; z-index: 10000; inset: 8px auto auto 8px; transform: translateY(-150%);
  padding: 10px 14px; background: #fff; color: #111; border: 2px solid currentColor;
}
.skip-link:focus-visible { transform: translateY(0); }

/* Quiet directory header. Selection is a location marker, not a pill. */
.hub-head {
  min-height: 86px; padding: 18px max(24px, calc((100% - 1200px) / 2));
  border-bottom: 1px solid #a9ada5; background: #fbfaf5; color: #202722;
}
.hub-brand { color: #202722; font-family: var(--ui-serif); font-size: 24px; letter-spacing: .05em; }
.hub-brand small { margin-top: 2px; color: #667067; font-family: var(--ui-sans); font-size: 10px; }
.hub-tabs { gap: 28px; }
.hub-tabs a {
  position: relative; min-height: 44px; padding: 11px 0 9px; border: 0; border-radius: 0;
  color: #3f4943; font-size: 13px;
}
.hub-tabs a[aria-current="page"] { background: transparent; border: 0; color: #202722; font-weight: 700; }
.hub-tabs a[aria-current="page"]::after {
  content: ""; position: absolute; right: 0; bottom: 4px; left: 0; height: 3px; background: currentColor;
}
.hub-tabs a:hover { color: #111; }

.hub-main { max-width: 1200px; padding: 54px 24px 72px; }
.hub-main h1, .hub-main h2, .hub-main h3 { text-wrap: balance; }
.hub-footer {
  max-width: 1200px; padding: 30px 24px 42px; border-color: #b9bcb5; color: #5c655f;
}
.hub-footer a { display: inline-block; min-height: 36px; padding-block: 7px; }
.hub-notice { border-left: 4px solid currentColor; border-radius: 0; background: transparent; }
.hub-feedback {
  margin-top: 64px; padding: 24px 0 0; border: 0; border-top: 1px solid currentColor;
  border-radius: 0; background: transparent;
}
.hub-feedback button, .hub-button {
  min-height: 44px; margin: 5px 6px 5px 0; padding: 9px 14px; border-radius: 2px; box-shadow: none;
}

/* Top directory — an index, not a feature-card landing page. */
body[data-page="home"] { background: #f3f0e7; color: #202722; }
body[data-page="home"] .hub-main {
  position: relative; padding-left: 64px; background-image: linear-gradient(90deg, #244d40 0 9px, transparent 9px);
  background-repeat: no-repeat; background-position: 24px 0;
}
.directory-intro { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); gap: 12px 70px; align-items: end; }
.directory-note { grid-column: 1 / -1; margin: 0 0 14px; color: #566159; font-size: 13px; }
.directory-intro h1 {
  margin: 0; font-family: var(--ui-serif); font-size: clamp(42px, 7vw, 82px); font-weight: 600; line-height: 1.2; letter-spacing: .02em;
}
.directory-intro .hub-lead { margin: 0 0 10px; color: #4f5852; font-size: 15px; line-height: 2; }
.service-index { display: block; margin: 54px 0 30px; border-top: 1px solid #8f948d; }
.service-row {
  --service: #244d40; display: grid; grid-template-columns: 255px minmax(0, 1fr) 155px;
  min-height: 120px; align-items: stretch; border-bottom: 1px solid #8f948d; color: #202722; text-decoration: none;
}
.service-row > strong {
  display: flex; align-items: center; padding: 24px 28px; background: var(--service); color: #fff;
  font-family: var(--ui-serif); font-size: 27px; font-weight: 600;
}
.service-row > span { display: grid; align-content: center; gap: 7px; padding: 22px 30px; border-right: 1px solid #b8b9b1; }
.service-row b { font-family: var(--ui-serif); font-size: 19px; }
.service-row small { color: #566159; font-size: 13px; line-height: 1.65; }
.service-row em { display: grid; place-items: center; padding: 16px; color: var(--service); font-style: normal; font-weight: 700; }
.service-row:hover em, .service-row:focus-visible em { text-decoration: underline; text-underline-offset: 5px; }
.service-knowledge { --service: #943f30; }
.service-lifeplan { --service: #17645e; }
.service-tools { --service: #b45118; }
.service-blog { --service: #732c2b; }

/* Knowledge — paper, margin rule, and tree branches. */
body[data-category="knowledge"] {
  --paper: #f2eee3; --sheet: #fffdf7; --ink: #1f2925; --pencil: #9d3d2b; --rule: #c8c0b1;
  background: var(--paper) !important; color: var(--ink) !important;
}
body[data-category="knowledge"] .hub-head { background: var(--paper); border-color: var(--rule); }
body[data-category="knowledge"] .hub-tabs a[aria-current="page"] { color: var(--pencil); }
.notes-app {
  position: relative; max-width: 1380px; padding: 42px 30px 54px 72px !important;
  background: linear-gradient(90deg, transparent 43px, var(--pencil) 43px 45px, transparent 45px) !important;
}
.notes-intro { padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
.notes-running-head { margin: 0; color: #665f55; font-size: 12px !important; letter-spacing: .08em; }
.notes-intro h1 { margin: 10px 0; font-family: var(--ui-serif); font-size: clamp(32px, 4vw, 50px) !important; font-weight: 600; }
.notes-layout { grid-template-columns: 310px minmax(0, 1fr) !important; gap: 0 !important; margin-top: 26px; border: 1px solid var(--rule); }
.notes-tree, .notes-editor {
  border: 0 !important; border-radius: 0 !important; background: var(--sheet) !important; box-shadow: none !important;
}
.notes-tree { border-right: 1px solid var(--rule) !important; }
.notes-tree input, .notes-tree button, .notes-controls button, .notes-controls select {
  min-height: 40px; border-color: #aaa395 !important; border-radius: 2px !important; background: transparent !important; box-shadow: none !important;
}
.notes-outline { border-color: var(--rule) !important; }
.notes-tree-branch::before, .notes-tree-branch > li::before { border-color: #9da99e !important; }
.notes-tree-row { border-radius: 0 !important; }
.notes-tree-row:hover { background: #f2efe6 !important; }
.notes-tree .notes-node.selected {
  border-radius: 0 !important; background: #ebe3d5 !important; box-shadow: inset 3px 0 var(--pencil) !important; color: #49251f !important;
}
.notes-editor .editor-shell, .notes-editor .toolbar, .notes-editor .ProseMirror,
.notes-editor .page-title, .notes-editor .equation-block {
  border-radius: 0 !important; box-shadow: none !important;
}
.notes-editor .toolbar { border-color: var(--rule) !important; background: #f0ede5 !important; }
.notes-editor .ProseMirror { background: var(--sheet) !important; line-height: 1.9; }
body[data-category="knowledge"] .hub-notice { margin: 0 auto; max-width: 1380px; color: #665f55; }

/* Life plan — ruled ledger with an age axis. */
body[data-category="lifeplan"] {
  --bg: #eef0ec; --panel: #fffef9; --text: #18262c; --muted: #58656a; --border: #a7b2b0;
  --accent: #075b6b; --band: #dfe9e7; --input: #fffef9; --hover: #e8eeec; --group: #dfe5e3; --shadow: none;
  color-scheme: light; background: var(--bg); font-variant-numeric: tabular-nums;
}
body[data-category="lifeplan"] .hub-head { background: #e8ebe6; border-bottom: 2px solid #5f7476; }
body[data-category="lifeplan"] .hub-tabs a[aria-current="page"] { color: var(--accent); }
body[data-category="lifeplan"] .toolbar {
  border-bottom: 3px double var(--border); background: var(--panel); box-shadow: none;
}
body[data-category="lifeplan"] .mark { border-width: 0 0 2px; font-family: Georgia, serif; }
body[data-category="lifeplan"] button,
body[data-category="lifeplan"] input,
body[data-category="lifeplan"] select { border-radius: 2px; box-shadow: none; }
body[data-category="lifeplan"] main#main-content { align-items: start; background-color: var(--bg); }
body[data-category="lifeplan"] main#main-content > aside {
  background: #e7eae5; border-right: 3px double var(--border);
}
body[data-category="lifeplan"] .form-group-label {
  padding: 16px 4px 7px; margin: 0; border-bottom: 2px solid #61777a; color: #273b40; font-size: 11px; letter-spacing: .04em;
}
body[data-category="lifeplan"] .category {
  margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none;
}
body[data-category="lifeplan"] .category > summary { min-height: 66px; padding: 13px 8px; }
body[data-category="lifeplan"] .category[open] { border-color: var(--border); box-shadow: none; }
body[data-category="lifeplan"] .category[open] > summary {
  border-bottom: 1px solid var(--border); background: #dfe8e5; color: #173f47;
}
body[data-category="lifeplan"] .category[open] .category-body { animation: ledger-open 140ms ease-out; }
body[data-category="lifeplan"] .more, body[data-category="lifeplan"] .item { border-radius: 0; box-shadow: none; }
body[data-category="lifeplan"] .page-heading { padding-bottom: 14px; border-bottom: 3px double var(--border); }
body[data-category="lifeplan"] .eyebrow { color: var(--accent); font-size: 11px; letter-spacing: .08em; }
body[data-category="lifeplan"] .local-label { padding: 5px 8px; border: 1px solid var(--accent); }
body[data-category="lifeplan"] #kpis {
  border: 3px double var(--border); border-radius: 0; background-image: repeating-linear-gradient(0deg, transparent 0 35px, #eef0eb 35px 36px);
}
body[data-category="lifeplan"] .kpi { min-height: 82px; border-color: var(--border); }
body[data-category="lifeplan"] .chart-panel,
body[data-category="lifeplan"] .table-panel { border-color: var(--border); border-radius: 0; box-shadow: none; }
body[data-category="lifeplan"] .panel-heading { border-bottom: 1px solid var(--border); }
body[data-category="lifeplan"] .segmented { padding: 0; border: 1px solid var(--border); border-radius: 0; background: transparent; }
body[data-category="lifeplan"] .segmented button { border-radius: 0; }
body[data-category="lifeplan"] .segmented button.active { background: var(--accent); color: #fff; box-shadow: none; }
body[data-category="lifeplan"] .chart-tooltip { border-radius: 0; box-shadow: 5px 5px 0 #9aa8a5; }
body[data-category="lifeplan"] .hub-feedback { margin-inline: 24px; color: var(--accent); }

/* Tools — workbench, inventory rows, and measurement ticks. */
body[data-category="tools"] {
  --bg-color: #ebeae4; --surface-color: #fdfcf8; --text-color: #232824; --text-secondary: #5d655f;
  --primary-color: #a94214; --primary-hover: #74300f; --primary-light: #f0e0d5; --primary-glow: transparent;
  --border-color: #9fa49e; --border-hover: #6f756f; --shadow-sm: none; --shadow-md: none; --shadow-lg: none;
  --blur-bg: none; --radius-sm: 2px; --radius-md: 2px; --radius-lg: 2px; --font-sans: var(--ui-sans);
  color-scheme: light; background: var(--bg-color);
}
body[data-category="tools"] .hub-head { background: #deded7; border-bottom: 3px solid #4d534e; }
body[data-category="tools"] .hub-tabs a[aria-current="page"] { color: #a94214; }
body[data-category="tools"] .hub-main { max-width: 1100px; }
.tools-mast { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 50px; align-items: end; }
.tools-mast > p:first-child { grid-column: 1 / -1; margin: 0; color: #59605a; font-size: 12px; }
.tools-mast h1 { margin: 12px 0; font-size: clamp(42px, 7vw, 74px); line-height: 1; letter-spacing: -.05em; }
.tools-mast .hub-lead { margin: 0 0 6px; }
.tools-ruler {
  grid-column: 1 / -1; height: 20px; margin: 18px 0 25px; border-block: 1px solid #6f756f;
  background: repeating-linear-gradient(90deg, transparent 0 19px, #777c76 19px 20px, transparent 20px 39px, #a0a49f 39px 40px);
}
.tool-shelf { margin: 0; padding: 0; border-top: 3px solid #4d534e; list-style: none; }
.tool-shelf li { border-bottom: 1px solid #7f847f; }
.tool-shelf a {
  display: grid; grid-template-columns: 56px 210px minmax(0, 1fr) 75px; min-height: 78px;
  align-items: center; color: var(--text-color); text-decoration: none;
}
.tool-shelf a:hover, .tool-shelf a:focus-visible { background: #f7f0e8; }
.tool-mark { color: #777c76; font: 12px ui-monospace, monospace; }
.tool-shelf strong { font-size: 20px; }
.tool-shelf small { color: var(--text-secondary); font-size: 13px; }
.tool-shelf em { color: var(--primary-color); font-style: normal; font-weight: 700; text-decoration: underline; text-underline-offset: 5px; }
body[data-category="tools"] .main-content { max-width: 1180px; }
body[data-category="tools"] .main-content > header { padding-bottom: 24px; border-bottom: 3px solid #4d534e; }
body[data-category="tools"] .main-content > header h1 { font-size: clamp(34px, 5vw, 58px); letter-spacing: -.04em; }
body[data-category="tools"] :is(.card,.tool-card,.calc-input-panel,.calc-history-panel,.calc-graph-panel,.explain-content,.faq-item,.result-card,.input-panel,.output-panel) {
  border-radius: 0 !important; box-shadow: none !important;
}
body[data-category="tools"] :is(.btn,button,input,select,textarea) { border-radius: 2px !important; }
body[data-category="tools"] :is(.card,.tool-card,.calc-input-panel,.calc-history-panel,.calc-graph-panel) { border-color: var(--border-color) !important; }
body[data-category="tools"] :is(.card,.tool-card,.calc-input-panel,.calc-history-panel,.calc-graph-panel):hover { transform: none !important; box-shadow: none !important; }
body[data-category="tools"] .calc-palette-btn:hover { transform: none; box-shadow: inset 0 -3px var(--primary-color); }
body[data-category="tools"] .hub-feedback { color: var(--primary-color); }

/* Blog — editorial page with running information and rules. */
body[data-category="blog"] {
  background: #f6f2e9; color: #201f1c; font-family: var(--ui-sans);
}
body[data-category="blog"] .hub-head { background: #f6f2e9; border-bottom: 1px solid #8e887d; }
body[data-category="blog"] .hub-tabs a[aria-current="page"] { color: #7a2f2a; }
body[data-category="blog"] a { color: #174f5a; }
body[data-category="blog"] .hub-main { max-width: 1120px; }
.blog-masthead {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 14px 64px;
  padding: 30px 0 42px; border-top: 7px solid #201f1c; border-bottom: 1px solid #8e887d;
}
.blog-running-head { grid-column: 1 / -1; margin: 0; color: #6a655e; font-size: 12px; letter-spacing: .08em; }
.blog-masthead h1 {
  margin: 4px 0; font-family: var(--ui-serif); font-size: clamp(46px, 7vw, 82px); font-weight: 600; line-height: 1.18;
}
.blog-masthead .hub-lead { align-self: end; margin: 0; color: #4f4b45; font-size: 15px; line-height: 1.9; }
.blog-policy { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0 0; border-top: 1px solid #bdb6a8; }
.blog-policy div { display: grid; grid-template-columns: 60px 1fr; gap: 10px; padding: 14px 16px 0 0; }
.blog-policy dt { color: #7a2f2a; font-weight: 700; }
.blog-policy dd { margin: 0; color: #555149; }
.blog-list { display: block; margin-top: 48px; }
.blog-section-head { display: grid; grid-template-columns: 1fr auto; align-items: end; margin-bottom: 0; padding-bottom: 13px; border-bottom: 3px solid #201f1c; }
.blog-section-head h2 { font-family: var(--ui-serif); font-size: 31px; font-weight: 600; }
.blog-card {
  display: grid; grid-template-columns: minmax(210px, .72fr) minmax(0, 1.6fr) 110px; gap: 10px 28px;
  padding: 25px 0; border: 0; border-bottom: 1px solid #a9a296; border-radius: 0; background: transparent; box-shadow: none; overflow: visible;
}
.blog-card::before { display: none; }
.blog-card-top { grid-row: 1 / span 3; display: grid; align-content: start; gap: 6px; border-right: 1px solid #bdb6a8; color: #68645d; }
.blog-topic { padding: 0; border-radius: 0; background: transparent; color: #7a2f2a; font-weight: 700; }
.blog-card h2 { margin: 0; font-family: var(--ui-serif); font-size: clamp(21px, 3vw, 30px); line-height: 1.55; }
.blog-card h2 a { color: #201f1c; }
.blog-card p { margin: 4px 0; color: #555149; }
.blog-card .blog-meta { grid-column: 2; }
.blog-read { grid-column: 3; grid-row: 1 / span 3; align-self: center; justify-self: end; margin: 0; color: #7a2f2a !important; }
.blog-card-featured { padding-block: 34px; border-bottom-width: 3px; }
.blog-card-featured h2 { font-size: clamp(28px, 4vw, 42px); }
.blog-article { max-width: 920px; }
.blog-breadcrumb { padding-bottom: 12px; border-bottom: 1px solid #bdb6a8; }
.blog-article-head { padding-bottom: 38px; border-bottom: 7px solid #201f1c; }
.blog-article-head h1 { font-family: var(--ui-serif); font-size: clamp(36px, 6vw, 66px); font-weight: 600; line-height: 1.35; }
.blog-deck { color: #4f4b45; line-height: 1.9; }
.blog-label { color: #7a2f2a !important; font-size: 12px !important; letter-spacing: .08em; }
.blog-summary {
  padding: 26px 0 26px 30px; border-top: 3px solid currentColor; border-bottom: 1px solid currentColor;
  border-radius: 0; background: transparent !important; color: #201f1c !important; box-shadow: none;
}
.blog-summary .blog-label { color: #7a2f2a !important; }
.blog-callout, .blog-claim, .blog-source-note { border-radius: 0; box-shadow: none; }
.blog-table-wrap { border-color: #a9a296; border-radius: 0; box-shadow: none; }
.blog-two-col { gap: 0; border-block: 1px solid #a9a296; }
.blog-two-col > div { padding: 24px; border: 0; border-radius: 0; background: transparent; }
.blog-two-col > div + div { border-left: 1px solid #a9a296; }
.payment-principles { gap: 0; border-block: 1px solid #b79f81; }
.payment-principles div { padding: 17px 12px; border: 0; border-right: 1px solid #d0c0aa; border-radius: 0; background: transparent; }
.payment-principles div:last-child { border-right: 0; }
.payment-principles b { border-radius: 0; background: transparent; color: #7a2f2a; border-bottom: 2px solid currentColor; }
.payment-picker, .sky-buttons, .sky-result { border-radius: 0; box-shadow: none; }
.payment-picker-result li { padding: 5px 0; border-radius: 0; background: transparent; border-bottom: 1px solid #c8b9a5; }
.atlas-stage { border-radius: 0; background: #102d3f; }
.atlas-core { border-radius: 0; box-shadow: none; }
.atlas-node, .atlas-metrics div, .atlas-flow > div { border-radius: 0; box-shadow: none; }
.sky-stage { border-radius: 0; }
.sky-result dl div, .sky-timeline article, .moon-compare > div:not(.moon-arrow) { border-radius: 0; }
body[data-category="blog"] .hub-feedback { color: #7a2f2a; }

@keyframes ledger-open { from { opacity: .35; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 800px) {
  .hub-head { min-height: 0; padding: 14px 14px 8px; gap: 8px; }
  .hub-brand { font-size: 20px; }
  .hub-tabs { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; gap: 0; border-top: 1px solid #c0c2bc; }
  .hub-tabs a { min-height: 44px; padding: 14px 2px 9px; font-size: 11px; }
  .hub-main { padding: 34px 16px 56px; }
  body[data-page="home"] .hub-main { padding-left: 34px; background-position: 12px 0; background-size: auto; }
  .directory-intro { display: block; }
  .directory-intro h1 { font-size: clamp(39px, 14vw, 58px); }
  .directory-intro .hub-lead { margin-top: 24px; }
  .service-index { margin-top: 38px; }
  .service-row { grid-template-columns: 1fr; min-height: 0; }
  .service-row > strong { min-height: 58px; padding: 15px 18px; font-size: 23px; }
  .service-row > span { padding: 16px 18px; border-right: 0; }
  .service-row > em { min-height: 44px; justify-content: start; padding: 8px 18px 13px; }
  .notes-app { padding: 30px 14px 44px 30px !important; background-position: 0 !important; }
  .notes-layout { grid-template-columns: 1fr !important; }
  .notes-tree { border-right: 0 !important; border-bottom: 3px double var(--rule) !important; }
  body[data-category="knowledge"] :is(button,input,select) { min-height: 44px; }
  .notes-tree-root { max-height: 340px !important; }
  body[data-category="lifeplan"] main#main-content > aside { border-right: 0; border-bottom: 3px double var(--border); }
  body[data-category="lifeplan"] .workspace { padding: 24px 12px; }
  body[data-category="lifeplan"] .toolbar { padding: 12px; }
  body[data-category="lifeplan"] :is(button,input,select,summary) { min-height: 44px; }
  .tools-mast { display: block; }
  .tool-shelf a { grid-template-columns: 38px minmax(0, 1fr) 56px; gap: 7px 10px; padding: 13px 0; }
  .tool-shelf strong { font-size: 18px; }
  .tool-shelf small { grid-column: 2 / 4; }
  .tool-shelf em { grid-column: 3; grid-row: 1; }
  body[data-category="tools"] :is(button,input,select,textarea) { min-height: 44px; }
  .blog-masthead { display: block; padding-top: 18px; }
  .blog-masthead .hub-lead { margin-top: 24px; }
  .blog-policy { grid-template-columns: 1fr; }
  .blog-policy div { border-top: 1px solid #cfc8bb; }
  .blog-section-head { display: block; }
  .blog-card { display: block; padding-block: 24px; }
  .blog-card-top { display: flex; border: 0; margin-bottom: 12px; }
  .blog-card h2 { margin-bottom: 10px; }
  .blog-read { display: inline-block; margin-top: 12px; }
  .blog-article-head h1 { font-size: clamp(34px, 11vw, 50px); }
  .blog-summary { padding-left: 18px; }
  .blog-two-col > div + div { border-left: 0; border-top: 1px solid #a9a296; }
  .payment-principles div { border-right: 0; border-bottom: 1px solid #d0c0aa; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
