/* Baseline theme. Structure-only styling meant to be replaced by a site-specific design.
   All colors/typography are tokens on :root. Uses logical properties so RTL works. */
:root {
  --c-primary: #1f3a5f;
  --c-secondary: #3c7a89;
  --c-accent: #e0a458;
  --c-soft: #c9d6df;
  --c-bg: #f7f9fb;
  --c-surface: #ffffff;
  --c-text: #1b2733;
  --c-muted: #5b6b7a;
  --font-body: system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans JP", "Noto Sans TC", "Noto Sans Arabic", sans-serif;
  --font-head: var(--font-body);
  --radius: 10px;
  --wrap: 1160px;
  --gap: clamp(16px, 3vw, 28px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--c-bg); color: var(--c-text); font: 17px/1.7 var(--font-body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.25; color: var(--c-text); }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin: .2em 0 .4em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 2em 0 .6em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 .4em; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.skip-link { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--c-surface); padding: 8px 12px; z-index: 10; }
.skip-link:focus { inset-inline-start: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.site-header { background: var(--c-surface); border-bottom: 1px solid var(--c-soft); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--c-text); font-weight: 700; font-size: 1.1rem; }
.nav-toggle { margin-inline-start: auto; display: none; background: none; border: 1px solid var(--c-soft); border-radius: var(--radius); padding: 6px 12px; font: inherit; cursor: pointer; }
.site-nav { margin-inline-start: auto; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; color: var(--c-text); font-size: .95rem; padding: 6px 0; display: inline-block; }
.site-nav a[aria-current="page"] { color: var(--c-primary); box-shadow: inset 0 -2px 0 var(--c-accent); }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; margin: 0; }
  .nav-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; padding-bottom: 12px; }
}

/* layout pieces */
main { padding-block: 24px 64px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 12px; font-size: .88rem; color: var(--c-muted); }
.breadcrumb li + li::before { content: "/"; margin-inline-end: 6px; color: var(--c-soft); }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; color: var(--c-secondary); margin: 0; font-weight: 600; }
.lead { font-size: 1.15rem; color: var(--c-muted); max-width: 70ch; }
.meta { font-size: .88rem; color: var(--c-muted); }
.page-head { margin-bottom: 24px; }
.btn, .btn-secondary, button[type="submit"] { display: inline-block; padding: 10px 18px; border-radius: var(--radius); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 2px solid var(--c-primary); }
.btn, button[type="submit"] { background: var(--c-primary); color: #fff; }
.btn-secondary { background: transparent; color: var(--c-primary); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--gap); align-items: center; padding-block: 16px 24px; }
.hero-points { padding-inline-start: 1.2em; }
.hero-media img { border-radius: var(--radius); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--c-surface); border: 1px solid var(--c-soft); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-body { padding: 16px 18px 18px; }
.card h3 { margin: .3em 0; }
.card h3 a { text-decoration: none; color: var(--c-text); }
.card p { margin: .4em 0; }

.intro-split { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--gap); align-items: start; }
@media (max-width: 860px) { .intro-split { grid-template-columns: 1fr; } }

/* article */
.prose { max-width: 75ch; }
.prose table { font-size: .95rem; }
.cover img { border-radius: var(--radius); margin-bottom: 24px; }
.article-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc { position: sticky; top: 84px; font-size: .9rem; border-inline-start: 3px solid var(--c-soft); padding-inline-start: 14px; }
.toc h2 { font-size: .95rem; margin: 0 0 8px; }
.toc ol { padding-inline-start: 1.1em; margin: 0; }
@media (max-width: 960px) { .article-layout { grid-template-columns: 1fr; } .toc { position: static; } }
.callout { background: var(--c-surface); border-inline-start: 4px solid var(--c-accent); padding: 4px 18px; margin: 1.4em 0; border-radius: 0 var(--radius) var(--radius) 0; }
.related-tool { background: var(--c-surface); border: 1px solid var(--c-soft); border-radius: var(--radius); padding: 8px 22px 22px; margin-top: 40px; }

.table-wrap { overflow-x: auto; margin: 1.2em 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; background: var(--c-surface); }
th, td { border: 1px solid var(--c-soft); padding: 9px 12px; text-align: start; vertical-align: top; }
th { background: var(--c-bg); font-weight: 600; }
th .sort { all: unset; cursor: pointer; font-weight: 600; }
th[aria-sort="ascending"] .sort::after { content: " ▲"; }
th[aria-sort="descending"] .sort::after { content: " ▼"; }
.table-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.hint { font-size: .85rem; color: var(--c-muted); margin: 0; }

/* tools */
.tool-panel { background: var(--c-surface); border: 1px solid var(--c-soft); border-radius: var(--radius); padding: clamp(16px, 3vw, 28px); margin-bottom: 32px; }
.fields { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.input-unit { display: flex; align-items: center; border: 1px solid var(--c-soft); border-radius: var(--radius); background: #fff; }
.input-unit input { border: 0; flex: 1; min-width: 0; padding: 10px 12px; font: inherit; background: transparent; }
.unit { padding-inline: 10px; color: var(--c-muted); font-size: .9rem; }
select, input[type="search"], .quote-input input { width: 100%; padding: 10px 12px; font: inherit; border: 1px solid var(--c-soft); border-radius: var(--radius); background: #fff; }
.actions { margin-block: 18px; }
.results dl { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 0; }
.result-row { background: var(--c-bg); border-radius: var(--radius); padding: 12px 14px; }
.result-row dt { font-size: .85rem; color: var(--c-muted); }
.result-row dd { margin: 0; font-size: 1.35rem; font-weight: 700; }
.note { font-size: .85rem; color: var(--c-muted); }
.checklist { list-style: none; padding: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--c-soft); }
.checklist input { width: 20px; height: 20px; margin-top: 4px; flex: none; }
.progress { font-weight: 600; }

.faq details { background: var(--c-surface); border: 1px solid var(--c-soft); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.link-list { list-style: none; padding: 0; }
.link-list li { padding: 10px 0; border-bottom: 1px solid var(--c-soft); }
.link-list p { margin: 4px 0 0; color: var(--c-muted); font-size: .95rem; }
.search-results { list-style: none; padding: 0; }
.search-results li { padding: 12px 0; border-bottom: 1px solid var(--c-soft); }
.disclosure { margin-top: 48px; font-size: .95rem; color: var(--c-muted); }

/* footer */
.site-footer { background: var(--c-surface); border-top: 1px solid var(--c-soft); padding-block: 32px; font-size: .92rem; }
.site-footer .wrap { display: grid; gap: 20px; grid-template-columns: 1.2fr 1fr 1fr; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.footer-note, .copyright { grid-column: 1 / -1; color: var(--c-muted); margin: 0; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* Billed Fair: an editorial legal-fees workbook */
:root {
  --c-primary: #173d38;
  --c-secondary: #496e66;
  --c-accent: #d2a247;
  --c-soft: #d8ded7;
  --c-bg: #f3f1e9;
  --c-surface: #fffef9;
  --c-text: #1d2c28;
  --c-muted: #596a63;
  --font-body: "Segoe UI", system-ui, sans-serif;
  --font-head: Georgia, "Times New Roman", serif;
  --radius: 14px;
  --wrap: 1120px;
  --gap: clamp(18px, 3vw, 32px);
}

body {
  background: linear-gradient(180deg, #f8f6ef 0, var(--c-bg) 32rem);
  font-size: 16px;
  line-height: 1.72;
}
h1, h2, h3 { letter-spacing: -.025em; }
h1 { font-weight: 500; }
h2 { font-weight: 500; }
.site-header {
  background: rgba(255, 254, 249, .96);
  border-bottom-color: #d8ded7;
  box-shadow: 0 4px 18px rgba(23, 61, 56, .045);
  backdrop-filter: blur(12px);
}
.header-inner { min-height: 72px; }
.brand { font-family: var(--font-head); font-size: 1.22rem; letter-spacing: -.02em; }
.brand img { width: 34px; height: 34px; }
.site-nav ul { gap: 4px 22px; }
.site-nav a { font-size: .9rem; font-weight: 600; }
.site-nav a:hover { color: var(--c-secondary); }
main { padding-block: clamp(24px, 5vw, 48px) 76px; }
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 26px;
  color: #fffef9;
  background: radial-gradient(circle at 84% 15%, rgba(210, 162, 71, .2), transparent 28%), linear-gradient(125deg, #173d38, #28534a 72%, #3d665a);
  box-shadow: 0 22px 52px rgba(23, 61, 56, .16);
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 250px;
  aspect-ratio: 1;
  inset-inline-end: -110px;
  inset-block-end: -150px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(255, 255, 255, .035), 0 0 0 50px rgba(255, 255, 255, .025);
}
.hero h1, .hero h2, .hero h3 { color: #fffef9; }
.hero h1 { max-width: 15ch; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.08; }
.hero .eyebrow { color: #f0c876; }
.hero .lead, .hero .meta { color: rgba(255, 254, 249, .82); }
.hero-points { padding-inline-start: 1.25em; color: rgba(255, 254, 249, .94); }
.hero-points li { padding-inline-start: .25em; margin-block: .35em; }
.hero-points li::marker { color: #e0b45e; }
.hero-media img { width: 100%; min-height: 250px; object-fit: cover; border: 5px solid rgba(255, 254, 249, .16); border-radius: 18px; }
.hero .btn { color: #173d38; background: #f0c876; border-color: #f0c876; }
.hero .btn:hover { background: #ffe09b; border-color: #ffe09b; }
.hero .btn-secondary { color: #fffef9; border-color: rgba(255, 254, 249, .64); }
.hero .btn-secondary:hover { background: rgba(255, 255, 255, .1); }
.eyebrow { letter-spacing: .12em; }
.page-head { padding-block-end: 18px; border-bottom: 1px solid var(--c-soft); }
.grid { align-items: stretch; }
.card {
  border-color: rgba(23, 61, 56, .13);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(23, 61, 56, .055);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(73, 110, 102, .42); box-shadow: 0 14px 32px rgba(23, 61, 56, .1); }
.card-body { padding: 20px 22px 22px; }
.card h3 { font-size: 1.25rem; }
.card h3 a:hover { color: var(--c-secondary); }
.prose { max-width: 74ch; }
.prose h2 { padding-inline-start: 14px; border-inline-start: 3px solid var(--c-accent); }
.prose h3 { color: var(--c-primary); }
.prose blockquote, .callout {
  background: #f5f3e9;
  border-inline-start-color: var(--c-accent);
  border-radius: 0 12px 12px 0;
}
.article-layout { gap: clamp(24px, 4vw, 46px); }
.toc {
  background: var(--c-surface);
  border: 1px solid var(--c-soft);
  border-inline-start: 3px solid var(--c-secondary);
  border-radius: 0 12px 12px 0;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(23, 61, 56, .045);
}
.toc h2 { font-family: var(--font-body); letter-spacing: 0; color: var(--c-primary); }
.btn, .btn-secondary, button[type="submit"] { border-radius: 999px; }
.btn:hover, button[type="submit"]:hover { filter: brightness(1.08); }
.tool-panel, .related-tool {
  border-color: rgba(23, 61, 56, .16);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(23, 61, 56, .06);
}
.result-row { border: 1px solid var(--c-soft); background: #f5f3e9; }
th { background: #e9eee8; color: var(--c-primary); }
th, td { border-color: #d4ddd5; }
.faq details { border-color: rgba(23, 61, 56, .16); box-shadow: 0 4px 14px rgba(23, 61, 56, .035); }
.faq summary::marker { color: var(--c-secondary); }
.site-footer { color: #edf2eb; background: #173d38; border-top: 0; }
.site-footer a { color: #f0c876; }
.site-footer .footer-note, .site-footer .copyright { color: rgba(237, 242, 235, .76); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
@media (max-width: 860px) {
  .hero { border-radius: 20px; }
  .hero h1 { max-width: 18ch; }
}
@media (max-width: 600px) {
  .header-inner { min-height: 64px; }
  .hero { padding: 26px 22px; }
  .hero h1 { font-size: clamp(2rem, 10vw, 2.65rem); }
  .hero-media img { min-height: 180px; }
  .card-body { padding: 18px; }
}
