/*
 * Movora documentation: styles for index.html and gallery.html.
 * Plain hand-written CSS, no build step. The "Fresh Mint" look of the
 * item: deep green, lime and coral on a soft mint page.
 * Fonts: Fredoka (headings) and Onest (text), SIL Open Font License 1.1,
 * in assets/fonts with their licence files.
 */

/* ------------------------------------------------------------------ fonts */

@font-face {
    font-family: "Fredoka";
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url("fonts/Fredoka-latin.woff2") format("woff2");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Fredoka";
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url("fonts/Fredoka-latin-ext.woff2") format("woff2");
    unicode-range:
        U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/Onest-latin.woff2") format("woff2");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/Onest-latin-ext.woff2") format("woff2");
    unicode-range:
        U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------------------------------------------ tokens */

:root {
    --green: #0E6B4F;
    --green-dark: #0A4F3A;
    --green-deep: #083D2D;
    --green-light: #17855F;
    --green-soft: #E3F4EC;
    --green-softer: #F0FAF5;
    --lime: #C6F36B;
    --lime-ink: #0A3A2A;
    --lime-soft: #EEFBD3;
    --coral: #FF7A59;
    --coral-ink: #B8401F;
    --coral-soft: #FFE8E0;
    --amber: #F5B83D;
    --amber-ink: #7E5200;
    --amber-soft: #FFF3D6;
    --page: #F4FBF7;
    --card: #FFFFFF;
    --ink: #163A2C;
    --ink-2: #35574A;
    --muted: #5C756B;
    --line: #DCEBE3;
    --line-strong: #C6DDD1;
    --code-bg: #0F2C21;
    --code-ink: #E3F4EC;
    --code-muted: #8FC2AE;
    --radius-lg: 26px;
    --radius: 20px;
    --radius-sm: 14px;
    --radius-xs: 9px;
    --shadow-sm: 0 1px 2px rgba(16, 41, 31, 0.05);
    --shadow: 0 1px 2px rgba(16, 41, 31, 0.04), 0 10px 28px rgba(16, 41, 31, 0.07);
    --shadow-lg: 0 18px 50px rgba(8, 40, 28, 0.28);
    --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-head: "Fredoka", "Onest", ui-rounded, system-ui, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --toc-width: 268px;
}

/* ------------------------------------------------------------------ base */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16.5px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
}

body.is-locked {
    overflow: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-head);
    font-weight: 600;
    line-height: 1.2;
    color: var(--ink);
    letter-spacing: -0.01em;
}

h2 {
    font-size: 30px;
    margin: 0 0 6px;
}

h3 {
    font-size: 21px;
    margin: 38px 0 10px;
}

h4 {
    font-size: 17px;
    margin: 26px 0 8px;
}

p {
    margin: 0 0 14px;
}

a {
    color: var(--green);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--green-dark);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--lime);
    outline-offset: 2px;
    border-radius: 6px;
}

img {
    max-width: 100%;
}

ul,
ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

li {
    margin: 4px 0;
}

li > ul,
li > ol {
    margin: 6px 0;
}

strong {
    font-weight: 650;
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 32px 0;
}

kbd {
    display: inline-block;
    padding: 1px 7px;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 7px;
    background: var(--card);
    font-family: var(--font);
    font-size: 0.86em;
    line-height: 1.5;
}

code {
    font-family: var(--font-mono);
    font-size: 0.87em;
    background: var(--green-soft);
    color: var(--green-deep);
    padding: 1px 6px;
    border-radius: 6px;
    overflow-wrap: anywhere;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--lime);
    color: var(--lime-ink);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

/* ------------------------------------------------------------------ hero */

.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 12%, rgba(198, 243, 107, 0.22), transparent 42%),
        radial-gradient(circle at 8% 110%, rgba(198, 243, 107, 0.14), transparent 40%),
        linear-gradient(160deg, var(--green-light) 0%, var(--green) 45%, var(--green-dark) 100%);
    color: #FFFFFF;
    padding: 56px 24px 64px;
}

.hero::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -160px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    border: 42px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 34px;
}

.hero-mark {
    flex: 0 0 auto;
    width: 112px;
    height: 112px;
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.1);
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.hero-mark img {
    width: 80px;
    height: 80px;
}

.hero-kicker {
    display: inline-block;
    margin: 0 0 10px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--lime);
    color: var(--lime-ink);
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0.02em;
}

.hero h1 {
    margin: 0;
    color: #FFFFFF;
    font-size: 50px;
    line-height: 1.05;
}

.hero-lead {
    max-width: 680px;
    margin: 14px 0 22px;
    color: #DDF1E7;
    font-size: 18px;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.hero-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

.hero-links a.is-primary {
    background: var(--lime);
    color: var(--lime-ink);
    box-shadow: none;
}

.hero-links a.is-primary:hover {
    background: #D5F88E;
    color: var(--lime-ink);
}

.hero.is-small {
    padding: 34px 24px 40px;
}

.hero.is-small .hero-mark {
    width: 84px;
    height: 84px;
    border-radius: 26px;
}

.hero.is-small .hero-mark img {
    width: 58px;
    height: 58px;
}

.hero.is-small h1 {
    font-size: 40px;
}

/* ------------------------------------------------------------------ phone bar */

.phone-bar {
    display: none;
}

/* ------------------------------------------------------------------ layout */

.layout {
    max-width: 1240px;
    margin: 0 auto;
    padding: 36px 24px 80px;
    display: grid;
    grid-template-columns: var(--toc-width) minmax(0, 1fr);
    gap: 44px;
    align-items: start;
}

.content {
    min-width: 0;
    max-width: 880px;
}

/* ------------------------------------------------------------------ table of contents */

.toc {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 14px 18px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.toc-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 8px 12px;
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 600;
}

.toc-title img {
    width: 26px;
    height: 26px;
}

.toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: toc;
}

.toc li {
    margin: 0;
    counter-increment: toc;
}

.toc a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 11px;
    color: var(--ink-2);
    font-size: 14.5px;
    line-height: 1.35;
    text-decoration: none;
}

.toc a::before {
    content: counter(toc, decimal-leading-zero);
    flex: 0 0 auto;
    min-width: 20px;
    color: var(--muted);
    font-family: var(--font-head);
    font-size: 12px;
    font-weight: 600;
}

.toc a:hover {
    background: var(--green-softer);
    color: var(--green-dark);
}

.toc a.is-active {
    background: var(--lime);
    color: var(--lime-ink);
    font-weight: 600;
}

.toc a.is-active::before {
    color: var(--lime-ink);
}

.toc-foot {
    margin: 14px 8px 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.toc-foot a {
    display: inline;
    padding: 0;
    color: var(--green);
    font-size: 13px;
}

.toc-foot a::before {
    content: none;
}

.toc-foot a:hover {
    background: none;
}

/* ------------------------------------------------------------------ sections */

.doc {
    margin: 0 0 30px;
    padding: 34px 38px 26px;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    scroll-margin-top: 20px;
}

.doc-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.doc-num {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: var(--green-soft);
    color: var(--green);
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
}

.doc-head p {
    margin: 2px 0 0;
    color: var(--muted);
}

.doc h3 {
    scroll-margin-top: 20px;
}

.lead {
    font-size: 18px;
    color: var(--ink-2);
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 14px;
}

.nowrap {
    white-space: nowrap;
}

/* ------------------------------------------------------------------ callouts */

.callout {
    position: relative;
    margin: 18px 0;
    padding: 16px 18px 14px 52px;
    border-radius: var(--radius-sm);
    background: var(--green-softer);
    border: 1px solid var(--green-soft);
}

.callout::before {
    content: "i";
    position: absolute;
    left: 16px;
    top: 16px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--green);
    color: #FFFFFF;
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
}

.callout > :last-child {
    margin-bottom: 0;
}

.callout-title {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-head);
    font-size: 16.5px;
    font-weight: 600;
}

.callout.is-tip {
    background: var(--lime-soft);
    border-color: #DDF5AE;
}

.callout.is-tip::before {
    content: "\2713";
    background: var(--lime);
    color: var(--lime-ink);
}

.callout.is-warn {
    background: var(--amber-soft);
    border-color: #F8E2AE;
}

.callout.is-warn::before {
    content: "!";
    background: var(--amber);
    color: #4A3200;
}

.callout.is-danger {
    background: var(--coral-soft);
    border-color: #FFD3C4;
}

.callout.is-danger::before {
    content: "!";
    background: var(--coral);
}

/* ------------------------------------------------------------------ required box */

.required {
    margin: 0 0 30px;
    padding: 30px 34px 24px;
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
    border: 3px solid var(--coral);
    scroll-margin-top: 20px;
}

.required .doc-num {
    background: var(--coral-soft);
    color: var(--coral-ink);
}

.required-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--coral);
    color: #FFFFFF;
    font-family: var(--font);
    font-size: 12.5px;
    font-weight: 700;
    vertical-align: middle;
    letter-spacing: 0.02em;
}

/* ------------------------------------------------------------------ cards */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 18px 0 22px;
}

.cards.is-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    padding: 18px 18px 14px;
    border-radius: var(--radius);
    background: var(--green-softer);
    border: 1px solid var(--green-soft);
}

.card h4 {
    margin: 0 0 6px;
}

.card p:last-child,
.card ul:last-child {
    margin-bottom: 0;
}

.card-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
    border-radius: 13px;
    background: var(--green);
    color: var(--lime);
    font-family: var(--font-head);
    font-weight: 700;
}

.card.is-lime {
    background: var(--lime-soft);
    border-color: #DDF5AE;
}

.card.is-coral {
    background: var(--coral-soft);
    border-color: #FFD3C4;
}

/* ------------------------------------------------------------------ diagram */

.diagram {
    display: grid;
    grid-template-columns: 1fr 86px 1.3fr 86px 1fr;
    align-items: center;
    gap: 0;
    margin: 22px 0 10px;
}

.diagram-col {
    display: grid;
    gap: 12px;
}

.node {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--card);
    border: 2px solid var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.node strong {
    display: block;
    font-family: var(--font-head);
    font-size: 16.5px;
    font-weight: 600;
}

.node span {
    display: block;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.4;
}

.node.is-server {
    padding: 18px;
    background: var(--green);
    border-color: var(--green-dark);
    color: #FFFFFF;
}

.node.is-server strong {
    font-size: 19px;
}

.node.is-server span {
    color: #CDEBDD;
}

.node.is-server ul {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.node.is-server li {
    margin: 0;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 13.5px;
    line-height: 1.35;
}

.node.is-server li code {
    background: var(--lime);
    color: var(--lime-ink);
}

.node.is-app {
    border-color: var(--lime);
    background: var(--lime-soft);
}

.node.is-web {
    border-color: #B9DDF3;
    background: #EEF7FD;
}

.link {
    position: relative;
    height: 100%;
    min-height: 60px;
    display: grid;
    place-items: center;
}

.link::before {
    content: "";
    position: absolute;
    left: 6px;
    right: 6px;
    top: 50%;
    border-top: 2px dashed var(--green-light);
}

.link span {
    position: relative;
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--card);
    color: var(--green);
    font-size: 11.5px;
    font-weight: 650;
    text-align: center;
    line-height: 1.25;
}

.diagram-services {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 6px 0 4px;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 2px dashed var(--line-strong);
}

.diagram-services b {
    width: 100%;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

/* ------------------------------------------------------------------ chips and badges */

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.chips li,
.chip {
    display: inline-block;
    margin: 0;
    padding: 3px 11px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-deep);
    font-size: 13.5px;
    font-weight: 550;
}

.badge {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-deep);
    font-size: 12.5px;
    font-weight: 650;
    white-space: nowrap;
}

.badge.is-lime {
    background: var(--lime);
    color: var(--lime-ink);
}

.badge.is-coral {
    background: var(--coral-soft);
    color: var(--coral-ink);
}

.badge.is-amber {
    background: var(--amber-soft);
    color: var(--amber-ink);
}

/* ------------------------------------------------------------------ steps */

.steps {
    list-style: none;
    margin: 18px 0 20px;
    padding: 0;
    counter-reset: step;
}

.steps > li {
    position: relative;
    margin: 0 0 14px;
    padding: 0 0 0 50px;
    counter-increment: step;
    min-height: 34px;
}

.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: -2px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: var(--green);
    color: var(--lime);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 16px;
}

.steps > li > strong:first-child {
    display: block;
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 600;
}

/* ------------------------------------------------------------------ code */

.code {
    position: relative;
    margin: 14px 0 18px;
}

pre {
    margin: 0;
    padding: 16px 18px;
    overflow-x: auto;
    border-radius: var(--radius-sm);
    background: var(--code-bg);
    color: var(--code-ink);
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.6;
    tab-size: 4;
}

pre code {
    padding: 0;
    background: none;
    color: inherit;
    font-size: inherit;
    overflow-wrap: normal;
}

pre .c {
    color: var(--code-muted);
}

.code > pre:first-child {
    padding-top: 38px;
}

.code-label {
    display: block;
    margin: 0 0 -6px;
    padding: 6px 84px 12px 14px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--green-deep);
    color: var(--code-muted);
    font-family: var(--font-mono);
    font-size: 12.5px;
}

.code-label + pre {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 11px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--code-ink);
    font-family: var(--font);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.copy-btn:hover {
    background: var(--lime);
    color: var(--lime-ink);
}

.copy-btn.is-done {
    background: var(--lime);
    color: var(--lime-ink);
}

.code-label ~ .copy-btn {
    top: 4px;
}

.tree {
    white-space: pre;
}

.placeholder-note {
    margin: -8px 0 16px;
    color: var(--muted);
    font-size: 14px;
}

.placeholder-note code {
    font-size: 0.9em;
}

/* ------------------------------------------------------------------ placeholders */
/* An example value to replace (a server path, your domain, a key): highlighted in code and text. */

.ph {
    padding: 0 4px;
    border-radius: 4px;
    background: #FFE9A8;
    color: #5A3B00;
    box-shadow: inset 0 -2px 0 #E0A43A;
}

pre .ph {
    background: rgba(255, 205, 80, 0.22);
    color: #FFDD7A;
    box-shadow: inset 0 -2px 0 #F2B53A;
}

/* "Replace before you run it" note, right before a command with a placeholder. */
.replace-note {
    position: relative;
    margin: 16px 0 -6px;
    padding: 10px 14px 10px 44px;
    border-radius: var(--radius-sm);
    background: var(--amber-soft);
    border: 1px solid #F2C46B;
    color: var(--ink);
    font-size: 14.5px;
}

.replace-note::before {
    content: "\270E";
    position: absolute;
    left: 12px;
    top: 9px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--amber);
    color: #4A3200;
    font-size: 13px;
    font-weight: 700;
}

.replace-note strong {
    color: #7A4B00;
}

.replace-note + .code {
    margin-top: 14px;
}

/* ------------------------------------------------------------------ paid services */
/* Marks an external service that bills the buyer (Google Maps, Twilio, payment gateways). */

.paid {
    display: inline-block;
    margin: 0 2px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--amber);
    color: #4A3200;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.2px;
    vertical-align: 1px;
    white-space: nowrap;
}

.cost-note {
    margin: 10px 0 16px;
    padding: 10px 14px;
    border-left: 4px solid var(--amber);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--amber-soft);
    font-size: 14.5px;
}

/* ------------------------------------------------------------------ tables */

.table-wrap {
    margin: 14px 0 20px;
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    line-height: 1.5;
}

th,
td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

th {
    background: var(--green-softer);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: 0;
}

tbody tr:nth-child(even) td {
    background: #FBFDFC;
}

td code {
    white-space: nowrap;
}

td.wrap code {
    white-space: normal;
}

.method {
    display: inline-block;
    min-width: 54px;
    padding: 1px 7px;
    border-radius: 7px;
    background: var(--green-soft);
    color: var(--green-deep);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.method.is-post {
    background: var(--lime-soft);
    color: #44610A;
}

.method.is-put {
    background: #EEF7FD;
    color: #1F64AE;
}

.method.is-delete {
    background: var(--coral-soft);
    color: var(--coral-ink);
}

.table-required td:first-child {
    min-width: 130px;
    font-weight: 600;
}

/* ------------------------------------------------------------------ definition lists */

.kv {
    display: grid;
    grid-template-columns: minmax(150px, 34%) 1fr;
    gap: 0;
    margin: 12px 0 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.kv dt,
.kv dd {
    margin: 0;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
}

.kv dt {
    background: var(--green-softer);
    font-weight: 600;
    font-size: 14.5px;
}

.kv dd {
    font-size: 15px;
}

.kv dt:last-of-type,
.kv dd:last-of-type {
    border-bottom: 0;
}

/* ------------------------------------------------------------------ screenshots */

.shots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px 16px;
    margin: 18px 0 24px;
}

.shots.is-few {
    grid-template-columns: repeat(auto-fill, minmax(170px, 210px));
}

.shot {
    margin: 0;
}

.shot a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.frame {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(14, 107, 79, 0.06), rgba(198, 243, 107, 0.12)),
        var(--green-softer);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.frame.is-phone {
    aspect-ratio: 360 / 780;
    border-radius: 22px;
    border: 4px solid var(--ink);
}

.frame.is-wide {
    aspect-ratio: 16 / 10;
}

.frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    color: var(--muted);
    font-size: 12px;
}

.shot a:hover .frame {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.shot figcaption {
    margin-top: 8px;
    color: var(--ink-2);
    font-size: 13.5px;
    line-height: 1.4;
}

.shot figcaption b {
    display: block;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
}

.wide-shots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 18px;
    margin: 18px 0 24px;
}

.wide-shots.is-single {
    grid-template-columns: minmax(0, 1fr);
}

.wide-shots .shot.is-tall {
    max-width: 230px;
}

/* ------------------------------------------------------------------ details */

details {
    margin: 10px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
}

summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    list-style-position: inside;
}

details[open] summary {
    border-bottom: 1px solid var(--line);
}

.details-body {
    padding: 14px 16px 4px;
}

/* ------------------------------------------------------------------ gallery page */

.gallery {
    max-width: 1240px;
    margin: 0 auto;
    padding: 30px 24px 80px;
}

.gallery-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 26px;
    padding: 12px 0;
    background: var(--page);
}

.gallery-nav a {
    padding: 7px 15px;
    border-radius: 999px;
    background: var(--card);
    color: var(--ink-2);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
}

.gallery-nav a:hover {
    background: var(--lime);
    color: var(--lime-ink);
    border-color: var(--lime);
}

.gallery-group {
    margin: 0 0 30px;
    padding: 28px 30px 12px;
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
    scroll-margin-top: 70px;
}

.gallery-group h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gallery-group > p {
    color: var(--muted);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 22px 18px;
    margin: 18px 0 18px;
}

.gallery-grid.is-wide {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-flow: dense;
}

.gallery-grid.is-wide .shot.is-tall {
    grid-row: span 2;
    justify-self: center;
    width: 100%;
    max-width: 240px;
}

/* ------------------------------------------------------------------ footer */

.foot {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px 48px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.foot img {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    margin-right: 6px;
}

/* ------------------------------------------------------------------ lightbox */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 72px 24px;
    background: rgba(6, 30, 21, 0.92);
}

.lightbox.is-open {
    display: flex;
}

.lightbox-figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lightbox-img {
    display: block;
    max-width: min(1400px, 100%);
    max-height: calc(100vh - 150px);
    width: auto;
    height: auto;
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: var(--shadow-lg);
}

.lightbox-caption {
    max-width: 760px;
    color: #E3F4EC;
    font-size: 15px;
    text-align: center;
}

.lightbox-caption a {
    color: var(--lime);
}

.lightbox-btn {
    position: absolute;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.lightbox-btn:hover {
    background: var(--lime);
    color: var(--lime-ink);
}

.lightbox-close {
    top: 14px;
    right: 16px;
}

.lightbox-prev {
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-count {
    position: absolute;
    top: 24px;
    left: 24px;
    color: #A8D3C2;
    font-size: 14px;
    font-weight: 600;
}

/* ------------------------------------------------------------------ smaller screens */

@media (max-width: 1100px) {
    :root {
        --toc-width: 236px;
    }

    .layout {
        gap: 28px;
    }

    .doc {
        padding: 30px 28px 22px;
    }
}

@media (max-width: 960px) {
    html {
        scroll-padding-top: 72px;
    }

    .doc,
    .required,
    .doc h3,
    .doc h4 {
        scroll-margin-top: 72px;
    }

    .layout {
        display: block;
        padding: 18px 16px 60px;
    }

    .content {
        max-width: none;
    }

    .phone-bar {
        position: sticky;
        top: 0;
        z-index: 50;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 16px;
        background: rgba(244, 251, 247, 0.96);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(8px);
    }

    .phone-bar img {
        width: 28px;
        height: 28px;
    }

    .phone-bar-title {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-family: var(--font-head);
        font-weight: 600;
        font-size: 16px;
    }

    .toc-toggle {
        flex: 0 0 auto;
        padding: 8px 15px;
        border: 0;
        border-radius: 999px;
        background: var(--green);
        color: #FFFFFF;
        font-family: var(--font);
        font-size: 14px;
        font-weight: 650;
        cursor: pointer;
    }

    .toc {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 120;
        width: min(330px, 88vw);
        max-height: none;
        border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        visibility: hidden;
    }

    body.toc-open .toc {
        transform: translateX(0);
        visibility: visible;
    }

    .toc-scrim {
        position: fixed;
        inset: 0;
        z-index: 110;
        background: rgba(6, 30, 21, 0.45);
        display: none;
    }

    body.toc-open .toc-scrim {
        display: block;
    }

    .diagram {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .link {
        min-height: 46px;
    }

    .link::before {
        left: 50%;
        right: auto;
        top: 4px;
        bottom: 4px;
        border-top: 0;
        border-left: 2px dashed var(--green-light);
    }

    .diagram-col {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    .hero {
        padding: 34px 16px 40px;
    }

    .hero-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .hero-mark {
        width: 76px;
        height: 76px;
        border-radius: 24px;
    }

    .hero-mark img {
        width: 52px;
        height: 52px;
    }

    .hero h1,
    .hero.is-small h1 {
        font-size: 36px;
    }

    .hero-lead {
        font-size: 16.5px;
    }

    .hero-links a {
        padding: 9px 14px;
        font-size: 14px;
    }

    h2 {
        font-size: 25px;
    }

    h3 {
        font-size: 19px;
    }

    .doc,
    .required {
        padding: 24px 18px 16px;
        border-radius: var(--radius);
    }

    .required {
        border-width: 2px;
    }

    .doc-head {
        gap: 12px;
    }

    .doc-num {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 15px;
    }

    .callout {
        padding: 14px 14px 12px 46px;
    }

    .callout::before {
        left: 12px;
        top: 14px;
    }

    pre {
        padding: 14px 14px;
        font-size: 12.5px;
    }

    .shots,
    .shots.is-few {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 12px;
    }

    .cards.is-two {
        grid-template-columns: minmax(0, 1fr);
    }

    td code {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .table-required thead {
        display: none;
    }

    .table-required,
    .table-required tbody,
    .table-required tr,
    .table-required td {
        display: block;
        width: 100%;
    }

    .table-required tr {
        padding: 12px 14px;
        border-bottom: 1px solid var(--line);
    }

    .table-required tbody tr:nth-child(even) {
        background: #FBFDFC;
    }

    .table-required tr:last-child {
        border-bottom: 0;
    }

    .table-required tbody tr td {
        padding: 2px 0;
        border: 0;
        background: none;
    }

    .table-required td:first-child {
        min-width: 0;
        font-family: var(--font-head);
        font-size: 16.5px;
    }

    .table-required td:nth-child(2)::before {
        content: "Where: ";
        font-weight: 650;
    }

    .table-required td:nth-child(3)::before {
        content: "If you leave it: ";
        font-weight: 650;
        color: var(--coral-ink);
    }

    .wide-shots {
        grid-template-columns: minmax(0, 1fr);
    }

    .kv {
        grid-template-columns: minmax(0, 1fr);
    }

    .kv dt {
        border-bottom: 0;
        padding-bottom: 2px;
    }

    .gallery {
        padding: 18px 16px 60px;
    }

    .gallery-nav {
        position: static;
        padding: 4px 0 8px;
    }

    .gallery-group {
        scroll-margin-top: 12px;
    }

    .gallery-group {
        padding: 22px 16px 8px;
        border-radius: var(--radius);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 12px;
    }

    .gallery-grid.is-wide {
        grid-template-columns: minmax(0, 1fr);
    }

    .lightbox {
        padding: 64px 10px 16px;
    }

    .lightbox-prev,
    .lightbox-next {
        top: auto;
        bottom: 14px;
        transform: none;
    }

    .lightbox-img {
        max-height: calc(100vh - 170px);
    }
}

/* ------------------------------------------------------------------ print */

@media print {
    .toc,
    .phone-bar,
    .copy-btn,
    .hero-links,
    .lightbox {
        display: none !important;
    }

    .layout {
        display: block;
        padding: 0;
    }

    .doc,
    .required {
        box-shadow: none;
        border: 1px solid var(--line);
        break-inside: auto;
    }

    pre {
        white-space: pre-wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .frame,
    .toc {
        transition: none;
    }
}
