/* Ramco Fabricators tools: shared stylesheet.
   Tokens, type and chrome follow the Ramco Fabricators design system as it is
   built on ramcofabricators.com (ramco-site/src/style.css): Archivo, the two
   blues, square corners, 1px steel borders, the deep-blue footer band. The
   components below (panels, fields, buttons, tables) are the same idioms the
   Chord Rise Table and the quote viewer already use. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/archivo-latin.woff2") format("woff2");
}

:root {
  --blue: #004a95;
  --blue-deep: #0b2d57;
  --blue-tint: #e8f0f9;
  --cta: hsl(7, 75%, 50%);
  --cta-hover: #ef4a4a;
  --ink: #16202b;
  --steel: #5b6773;
  --steel-light: #d9dee4;
  --steel-tint: #f2f4f6;
  --white: #fff;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --text: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 80rem;
  --gutter: 1.25rem;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--text);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--blue);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--cta);
  color: var(--white);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip:focus {
  left: 0;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Type */
h1,
h2 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  color: var(--blue);
  margin-bottom: 0.6rem;
}
h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 1.25rem 0 0.25rem;
}
p {
  margin: 0 0 1rem;
  max-width: 62ch;
}
.lead {
  font-size: 1.2rem;
  line-height: 1.55;
  max-width: 62ch;
  margin-top: 1rem;
}
code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}
.muted {
  color: var(--steel);
}
.small {
  font-size: 0.9rem;
}
.num {
  font-variant-numeric: tabular-nums;
}

/* Header: logo, a "Tools" mark, and who is signed in. */
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem 1.5rem;
  max-width: var(--wrap);
  width: 100%;
  margin: 0 auto;
  padding: 1rem var(--gutter);
}
.site-header .logo img {
  width: 238px;
  height: 66px;
}
.site-header .wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--blue-deep);
  text-decoration: none;
  padding-left: 1.5rem;
  border-left: 1px solid var(--steel-light);
  line-height: 1;
  white-space: nowrap;
}
.site-header .whoami {
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--steel);
  text-align: right;
}
.site-header .whoami b {
  color: var(--ink);
  font-weight: 600;
}

/* Nav: the sticky link bar from the main site. */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--white);
  border-top: 1px solid var(--steel-light);
  border-bottom: 1px solid var(--steel-light);
}
.site-nav ul {
  list-style: none;
  margin: 0 auto;
  padding: 0.6rem var(--gutter);
  max-width: var(--wrap);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.site-nav a:hover {
  border-color: var(--steel-light);
}
.site-nav a[aria-current] {
  color: var(--blue);
  border-color: var(--blue);
}
.site-nav .lock {
  display: inline-block;
  width: 0.65em;
  height: 0.65em;
  margin-left: 0.3em;
  vertical-align: -0.02em;
  fill: var(--steel);
}

/* Main */
main {
  flex: 1;
  border-top: 4px solid var(--blue);
}
main > :where(.page-head, .wrap, .two-col, .tools) {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  width: 100%;
}
.page-head {
  padding-top: 2.5rem;
  padding-bottom: 1.75rem;
}
.page-head .lead {
  margin-bottom: 0;
}
.wrap {
  padding-bottom: 3rem;
}
.two-col {
  display: grid;
  grid-template-columns: minmax(18rem, 2fr) 3fr;
  gap: 1.5rem 3rem;
  align-items: start;
  padding-bottom: 3rem;
}
.two-col.even {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 52rem) {
  .two-col,
  .two-col.even {
    grid-template-columns: 1fr;
  }
}

/* Tool cards on the home page, in the .service idiom. */
.tools {
  list-style: none;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2rem 2.5rem;
  padding-block: 0 3.5rem;
}
.tool {
  border-top: 4px solid var(--blue);
  padding-top: 1.1rem;
}
.tool h2 {
  font-size: 1.5rem;
}
.tool h2 a {
  color: inherit;
  text-decoration: none;
}
.tool h2 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}
.tool p {
  color: var(--steel);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.tool .path {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--steel);
}

/* Tags */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--steel);
  border: 1px solid var(--steel-light);
  padding: 0.1rem 0.45rem;
  vertical-align: middle;
}
.tag.blue {
  color: var(--blue);
  border-color: var(--blue);
}

/* Panels: white, 1px steel-light border, square corners. */
.panel {
  border: 1px solid var(--steel-light);
  background: var(--white);
}
.panel-body {
  padding: 1.25rem;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.panel-head h2 {
  margin: 0;
  font-size: 1.35rem;
}
.panel h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}
.panel-note {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--steel-light);
  background: var(--steel-tint);
  font-size: 0.9rem;
  color: var(--steel);
}
.panel-note p {
  margin: 0;
  max-width: none;
}
.panel-note code {
  color: var(--ink);
}
hr.rule {
  border: 0;
  border-top: 1px solid var(--steel-light);
  margin: 1.25rem 0;
}

/* Fields */
.field {
  display: block;
  margin-bottom: 1.1rem;
}
.field > label,
.field > .label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.field .optional,
.field .unit {
  font-weight: 400;
  color: var(--steel);
}
.field .hint {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--steel);
  max-width: none;
}
.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--steel);
  border-radius: 0;
  padding: 0.55rem 0.7rem;
}
/* Option labels are long; a smaller size and room for the arrow stop them from being cut off. */
.field select {
  font-size: 0.85rem;
  padding-right: 1.6rem;
  text-overflow: ellipsis;
}
.field input.num,
.field input.mono,
.field textarea.mono {
  font-variant-numeric: tabular-nums;
}
.field textarea {
  resize: vertical;
  min-height: 5.5rem;
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 0;
  border-color: var(--blue);
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--cta);
}
.field input:disabled,
.field select:disabled {
  background: var(--steel-tint);
  color: var(--steel);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
@media (max-width: 34rem) {
  .field-row {
    grid-template-columns: 1fr;
  }
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  font-weight: 500;
}
.check input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.25rem 0 0;
  accent-color: var(--blue);
  flex: none;
}
.check .hint {
  display: block;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--steel);
}
.err {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--cta);
  min-height: 1.4em;
  margin: 0 0 0.5rem;
  max-width: none;
}
.err:empty {
  margin: 0;
  min-height: 0;
}

/* Buttons. The red CTA stays on the main site; tools use the blue header-button look. */
.btn,
.btn-outline,
.btn-quiet,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  padding: 0.6rem 1.1rem;
  border-radius: 0.25rem;
  border: 2px solid transparent;
}
.btn {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.btn:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}
.btn-outline {
  background: var(--white);
  color: var(--blue);
  border-color: var(--blue);
}
.btn-outline:hover {
  background: var(--blue-tint);
}
.btn-quiet {
  background: none;
  color: var(--blue);
  padding-inline: 0.5rem;
  font-weight: 600;
}
.btn-quiet:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.btn-danger {
  background: none;
  color: var(--cta);
  padding-inline: 0.5rem;
  font-weight: 600;
}
.btn-danger:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.btn:disabled,
.btn-outline:disabled,
.btn-quiet:disabled,
.btn-danger:disabled {
  opacity: 0.5;
  cursor: default;
  text-decoration: none;
}
.btn-sm {
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.75rem;
  margin-top: 0.5rem;
}
.actions .spacer {
  flex: 1;
}

/* Segmented switch (the .menu-button outline, filled when pressed). */
.seg {
  display: inline-flex;
}
.seg button {
  font: 600 0.95rem var(--text);
  color: var(--blue);
  background: var(--white);
  border: 2px solid var(--blue);
  padding: 0.3rem 0.8rem;
  margin-left: -2px;
  cursor: pointer;
}
.seg button:first-child {
  margin-left: 0;
}
.seg button:hover {
  background: var(--blue-tint);
}
.seg button[aria-pressed="true"] {
  background: var(--blue);
  color: var(--white);
}
.seg button:focus-visible {
  position: relative;
  z-index: 1;
}

/* Tabs (the site-nav link style). */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  border-bottom: 1px solid var(--steel-light);
  margin-bottom: 1.25rem;
}
.tabs button {
  font: 500 0.95rem var(--text);
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 0;
  margin-bottom: -1px;
  cursor: pointer;
}
.tabs button:hover {
  border-color: var(--steel-light);
}
.tabs button[aria-selected="true"] {
  color: var(--blue);
  border-color: var(--blue);
  font-weight: 600;
}

/* Tables */
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--steel-light);
  background: var(--white);
}
.table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}
.table th,
.table td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--steel-light);
}
.table thead th {
  background: var(--steel-tint);
  font-weight: 600;
  white-space: nowrap;
  color: var(--blue-deep);
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table tbody tr:hover td {
  background: var(--steel-tint);
}
.table .num {
  text-align: right;
}
.table td .sub {
  display: block;
  font-size: 0.85rem;
  color: var(--steel);
}
.table td.actions-cell {
  white-space: nowrap;
  text-align: right;
}
.table td.actions-cell .btn-quiet,
.table td.actions-cell .btn-danger {
  padding: 0.15rem 0.4rem;
  font-size: 0.85rem;
}
.table a.wrap-url {
  word-break: break-all;
}
.empty {
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--steel);
}

/* Notices */
.notice {
  border-left: 4px solid var(--blue);
  background: var(--steel-tint);
  padding: 0.75rem 1rem;
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}
.notice p {
  margin: 0;
  max-width: none;
}
.notice.error {
  border-left-color: var(--cta);
  background: #fdeeec;
}
.notice.ok {
  border-left-color: var(--blue);
  background: var(--blue-tint);
}

/* A result line: the built link or shortlink, monospace, with a copy button. */
.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: start;
}
.result output,
.result .value {
  display: block;
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--steel-tint);
  border: 1px solid var(--steel-light);
  padding: 0.6rem 0.75rem;
  word-break: break-all;
  min-height: 2.9rem;
}
.result .value.placeholder {
  color: var(--steel);
}

/* Deep-blue band for key figures (the hero and footer colour). */
.band {
  background: var(--blue-deep);
  color: var(--white);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.band .title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e6ebf2;
  margin: 0 0 1rem;
}
.band a {
  color: var(--white);
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1rem 1.5rem;
}
.stat .l {
  font-size: 0.9rem;
  color: #b9c4d3;
  margin-bottom: 0.15rem;
}
.stat .v {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat.lead-stat .v {
  font-size: 2rem;
}
.stat .s {
  font-size: 0.95rem;
  color: #b9c4d3;
  margin-top: 0.15rem;
  font-variant-numeric: tabular-nums;
}

/* Footer */
.site-footer {
  background: var(--blue-deep);
  color: var(--white);
  margin-top: 2rem;
  padding: 2.5rem var(--gutter) 1.75rem;
}
.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem 4rem;
}
.footer-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.site-footer address {
  font-style: normal;
  margin-bottom: 1rem;
}
.site-footer a {
  color: var(--white);
}
.site-footer nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.site-footer nav a {
  text-decoration: none;
}
.site-footer nav a:hover {
  text-decoration: underline;
}
.site-footer :focus-visible {
  outline-color: var(--cta);
}
.footer-note {
  max-width: var(--wrap);
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #b9c4d3;
  font-size: 0.95rem;
}
@media (max-width: 40rem) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

/* Phones */
@media (max-width: 47rem) {
  .site-header {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }
  .site-header .logo img {
    width: 190px;
    height: 53px;
  }
  .site-header .wordmark {
    padding-left: 1rem;
    font-size: 1.15rem;
  }
  .site-header .whoami {
    flex-basis: 100%;
    text-align: left;
    margin-left: 0;
  }
  .page-head {
    padding-top: 1.75rem;
  }
}

/* Dates and short labels stay on one line in tables. */
.table td.small.muted {
  white-space: nowrap;
}
