:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  --ink: #0b2545;
  --muted: #4c6176;
  --accent: #076b8c;
  --line: #dbe5ed;
  --paper: #f4f8fb;
  --white: #fff;
  --topbar: 72px;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #097d9c; outline-offset: 3px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 5; inset: 8px auto auto 8px; padding: 10px 16px; background: var(--white); }
.topbar {
  min-height: var(--topbar);
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(185px, 226px) minmax(0, 520px) 1fr;
  align-items: center;
  gap: 26px;
  padding: 12px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; width: fit-content; font-weight: 750; font-size: 1.25rem; line-height: 1.08; letter-spacing: -.045em; }
.brand small { display: block; margin-top: 4px; font-size: .8125rem; letter-spacing: 0; color: var(--muted); font-weight: 600; }
.brand-mark { display: block; width: 42px; height: 42px; border-radius: 9px; object-fit: contain; }
.entry-topbar { grid-template-columns: 1fr auto; }
.entry-main { width: min(100% - 28px, 650px); margin: clamp(32px, 9vw, 96px) auto; padding: 0; }
.entry-panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: clamp(22px, 6vw, 42px); }
.entry-panel h1 { font-size: clamp(1.75rem, 4vw, 2.65rem); line-height: 1.1; }
.entry-panel p { color: var(--muted); line-height: 1.5; margin: 12px 0; }
.entry-panel .button { margin-top: 6px; }
.entry-panel [hidden] { display: none; }
.search {
  min-width: 0;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 0 12px 0 16px;
  background: #f6f9fb;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.search:focus-within { outline: 2px solid #097d9c; outline-offset: 1px; }
.search input { min-width: 0; width: 100%; height: 43px; padding: 0; border: 0; background: transparent; outline: none; color: var(--ink); }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search-icon { width: 13px; height: 13px; border: 1.6px solid var(--muted); border-radius: 50%; position: relative; flex: 0 0 auto; }
.search-icon::after { content: ""; position: absolute; top: 9px; left: 9px; width: 6px; height: 1.6px; background: var(--muted); transform: rotate(45deg); transform-origin: left; }
.search kbd { padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.company { justify-self: end; font-size: .875rem; font-weight: 650; white-space: nowrap; }
.company:hover, .rail-footer a:hover { text-decoration: underline; }
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); max-width: 1700px; margin: 0 auto; }
.rail { position: sticky; align-self: start; top: var(--topbar); padding: 29px 16px 22px; max-height: calc(100dvh - var(--topbar)); overflow: auto; }
.rail nav { display: grid; gap: 4px; }
.nav-button { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid transparent; border-radius: 9px; min-height: 44px; white-space: nowrap; color: var(--muted); background: transparent; text-align: left; font-size: .9rem; font-weight: 650; }
.nav-button[aria-current] { background: #e4f1f5; color: #074d65; border-color: #cfE5ed; }
.nav-button:hover { background: #eaf1f6; color: var(--ink); }
.nav-button:nth-last-child(2) { margin-top: 12px; }
.nav-button .symbol { width: 26px; height: 26px; font-size: 1rem; background: transparent; }
.rail-footer { margin: 23px 10px 0; padding: 16px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
main { min-width: 0; padding: 28px clamp(20px, 3vw, 44px) 36px 4px; }
.hero {
  overflow: hidden;
  border-radius: 18px;
  background: #071a33 url("/assets/RCE-assets/etp-plant.webp") center 42% / cover no-repeat;
}
.hero-content {
  padding: clamp(29px, 3.65vw, 54px);
  color: #fff;
  background: linear-gradient(90deg, #071a33 0%, rgba(7, 26, 51, .97) 23%, rgba(7, 26, 51, .74) 58%, rgba(7, 26, 51, .31));
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(2.55rem, 4.55vw, 4.75rem); letter-spacing: -.063em; line-height: .99; font-weight: 760; }
.hero p { font-size: clamp(1rem, 1.45vw, 1.1875rem); max-width: 34rem; color: #e5eef3; margin: 18px 0 24px; line-height: 1.55; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 8px; font-size: .9375rem; font-weight: 750; }
.primary { background: #9ae4ee; color: #09283d; }
.primary:hover { background: #c3f0f6; }
.primary:focus-visible { outline-color: #c3f0f6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-secondary { border: 1px solid #a7c8da; color: #fff; background: #102f48; }
.hero-secondary:hover { background: #174363; }
.briefing { padding-top: 23px; }
.briefing-grid { margin: 12px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.briefing-grid > div { padding: 13px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.briefing-grid dt { font-weight: 750; }
.briefing-grid dd { margin: 6px 0 0; color: var(--muted); font-size: .9375rem; line-height: 1.45; }
.launch, .launch-solid { border: 1px solid #9ac6d4; background: #eef8fa; color: #07526c; }
.launch:hover { background: #d9eff4; border-color: #6ea8b9; }
.launch-solid { background: #086784; border-color: #086784; color: var(--white); }
.launch-solid:hover { background: #07536b; border-color: #07536b; }
#quick-start { padding-top: 27px; }
h2 { font-size: clamp(1.27rem, 2vw, 1.6rem); letter-spacing: -.035em; }
.quick-grid, .tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quick-grid { margin-top: 12px; }
.quick-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 12px; padding: 14px; background: var(--white); border-radius: 11px; border: 1px solid var(--line); }
.quick-card:hover, .tool-card:hover { border-color: #87b9c9; }
.quick-card .launch { grid-column: 2; justify-self: start; }
.quick-title { font-size: .975rem; font-weight: 750; display: inline-block; }
.quick-title:hover, .tool-link:hover, .back-link:hover { color: var(--accent); text-decoration: underline; }
.quick-card small { display: block; font-size: .8125rem; color: var(--muted); margin-top: 4px; }
.symbol { flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: #e8edf1; color: #375465; font-family: system-ui, sans-serif; font-size: 1.26rem; font-weight: 690; }
.tone-labs { background: #eee8f8; color: #614681; }
.tone-design { background: #e4f3f5; color: #09657a; }
.tone-calculations { background: #e8effa; color: #285691; }
.tone-references { background: #eef1f3; color: #415b71; }
#directory { padding-top: 28px; scroll-margin-top: calc(var(--topbar) + 4px); }
.directory-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
#tool-status { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.tool-group + .tool-group { margin-top: 23px; }
.tool-group h3 { font-size: 1.03rem; margin-bottom: 10px; }
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  padding: 14px;
}
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.star {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #4f6477;
  font-size: 1.325rem;
  line-height: 1;
}
.star:hover, .star[aria-pressed="true"] { color: #74500e; background: #fff6df; }
.tool-name { font-size: 1rem; line-height: 1.3; }
.tool-link { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #acc4d1; }
.description { color: var(--muted); font-size: .9375rem; line-height: 1.5; margin: 6px 0 14px; }
.card-actions { display: grid; gap: 12px; margin-top: auto; }
.card-actions .launch { justify-self: start; }
.card-meta { display: flex; gap: 8px; align-items: center; justify-content: space-between; color: var(--muted); font-size: .8125rem; }
.access { border-radius: 6px; background: #edf3f6; padding: 3px 7px; white-space: nowrap; }
.empty { border: 1px dashed #a2b7c8; border-radius: 11px; padding: 27px; background: var(--white); color: var(--muted); }
.empty .launch { margin-top: 12px; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 700; }
.detail-panel { margin-top: 10px; padding: clamp(22px, 5vw, 52px); border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.detail-panel .symbol { width: 48px; height: 48px; }
.detail-meta { color: var(--muted); font-weight: 650; margin: 18px 0 8px; }
.detail-title { max-width: 20ch; font-size: clamp(2rem, 4.5vw, 3.8rem); letter-spacing: -.045em; line-height: 1.05; }
.detail-summary { max-width: 60ch; color: var(--muted); font-size: 1.0625rem; line-height: 1.6; margin: 16px 0 22px; }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.detail-actions p { color: var(--muted); font-size: .875rem; }
.related-tools { margin-top: 25px; }
.related-tools h2 { margin-bottom: 12px; }
.related-tools .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1280px) {
  .tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1030px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .topbar { grid-template-columns: 174px minmax(0, 520px) 1fr; gap: 13px; padding-inline: 20px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --topbar: 111px; }
  .topbar { grid-template-columns: 1fr auto; gap: 8px; padding: 8px 14px; }
  .search { grid-row: 2; grid-column: 1 / -1; }
  .search kbd { display: none; }
  .shell { display: block; }
  .rail { position: sticky; top: var(--topbar); z-index: 1; padding: 2px 14px; background: var(--paper); border-bottom: 1px solid var(--line); }
  .rail nav { display: flex; overflow: auto; padding: 3px; }
  .nav-button:nth-last-child(2) { margin-top: 0; }
  .rail-footer { display: none; }
  main { padding: 10px 14px 28px; }
  #directory { scroll-margin-top: calc(var(--topbar) + 52px); }
  .related-tools .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-content { background: linear-gradient(90deg, #071a33 2%, rgba(7, 26, 51, .86) 55%, rgba(7, 26, 51, .54)); }
}
@media (max-width: 540px) {
  .hero-content { padding: 25px 20px; }
  .hero p { max-width: 33ch; margin: 13px 0 18px; }
  .quick-grid { grid-template-columns: 1fr; gap: 8px; }
  .briefing-grid { grid-template-columns: 1fr; gap: 8px; }
  .quick-card { padding: 9px 12px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .quick-card .launch { grid-column: auto; padding-inline: 10px; }
  .tool-grid, .related-tools .tool-grid { grid-template-columns: 1fr; gap: 9px; }
}

.app-nav { display: flex; justify-self: end; align-items: center; gap: 4px; }
.app-nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; white-space: nowrap; padding: 0 10px; border-radius: 7px; color: var(--muted); font-size: .9rem; font-weight: 700; }
.app-nav a:hover, .app-nav a[aria-current="page"] { background: #e4f1f5; color: #074d65; }
.library-heading h1 { font-size: clamp(2rem, 4.5vw, 3.7rem); }
.library-heading p { margin-top: 10px; color: var(--muted); line-height: 1.5; }
@media (max-width: 700px) {
  .topbar .app-nav { grid-column: 2; grid-row: 1; }
  .app-nav a { font-size: .8rem; padding-inline: 7px; }
}
