/* Gold invoice calculator
   Eleven light themes on one set of tokens. The theme is data-theme on <html>:
   temple (default, also what :root looks like with no attribute), terracotta, kolam, lotus, mayil, deepam, mandapam, malli,
   muthu, utsav, kalyanam.
   Everything below the token blocks is written once and only reads the tokens. */

/* ---- Tokens: temple. Granite and sandstone, kumkum, turmeric. ---------------- */
:root {
  color-scheme: light;

  --bg: #ece7dd;            /* page ground */
  --photo: url("assets/temple.jpg"); --photo-pos: center 40%; --photo-opacity: .42; --photo-tint: #c9a877; --photo-filter: contrast(1.1) brightness(1.25);
  --surface: #faf7f1;       /* tiles */
  --surface-2: #f3eee4;     /* inset blocks: totals, table head, cards */
  --field: #fffdf9;         /* form fields */
  --ink: #26211c;
  --ink-2: #564d42;         /* secondary text */
  --muted: #6b6153;         /* captions, still AA on every surface */
  --line: #e4dccd;
  --line-strong: #d2c7b3;
  --field-line: #948a78;    /* 3:1 against the tile, so a field reads as a field */
  --accent: #a8301c;        /* fills: main button, chosen option, current-row bar */
  --accent-hover: #8f2715;
  --on-accent: #fff;
  --accent-ink: #7a4d00;    /* text: the "over gold value" figures */
  --tint: #f5e7c0;          /* current row in the wastage table */
  --good: #2c6a3c;
  --good-tint: #e3eedd;
  --bad: #b3261e;
  --focus: #a8301c;

  --radius: 3px;            /* tiles */
  --radius-s: 2px;          /* fields, inset blocks */
  --radius-btn: 2px;
  --head-rule: var(--line); /* hairline between a tile's header and its body */

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: Marcellus, "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --title-ink: var(--ink);
  --title-size: 29px;
  --title-weight: 400;
  --title-track: .01em;
  --tile-size: 13.5px;      /* tile headings: small inscriptional capitals */
  --tile-weight: 400;
  --tile-track: .11em;
  --tile-case: uppercase;

  /* Motifs. Ground texture, the band under the header, the mark by the title. */
  --ground: none;
  --ground-size: auto;
  /* Temple border: a row of stepped gopuram tiers on a rule */
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='7' shape-rendering='crispEdges'%3E%3Cpath d='M0 6h3V4h2V2h2V0h4v2h2v2h2v2h3v1H0z' fill='%23a8301c'/%3E%3C/svg%3E");
  --band-h: 7px;
  --band-size: 18px 7px;
  --band-opacity: .5;
  /* Oil lamp */
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.2c2.1 2.5 3.1 4.2 3.1 5.9a3.1 3.1 0 0 1-6.2 0c0-1.7 1-3.4 3.1-5.9z' fill='%23a8301c'/%3E%3Cpath d='M3.5 13.2h17c0 3.7-3.6 6.2-8.5 6.2s-8.5-2.5-8.5-6.2z' fill='%23b5852a'/%3E%3Cpath d='M8.5 21.6h7' stroke='%23b5852a' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ---- Tokens: terracotta. Fired clay and warm cream, matte, rounded. ---------- */
:root[data-theme=terracotta] {
  --bg: #eee0d0;
  --photo: url("assets/terracotta.jpg"); --photo-pos: center 55%; --photo-opacity: .38; --photo-tint: #cf8a5c; --photo-filter: contrast(1.05);
  --surface: #fbf4ea;
  --surface-2: #f4e8d8;
  --field: #fffaf3;
  --ink: #3a2118;
  --ink-2: #654536;
  --muted: #775848;
  --line: #ecdcc8;
  --line-strong: #dcc6ac;
  --field-line: #a8846a;
  --accent: #b0512a;
  --accent-hover: #97421f;
  --on-accent: #fff;
  --accent-ink: #8f3f17;
  --tint: #f1d6c0;
  --good: #44662a;
  --good-tint: #e6ead2;
  --bad: #a61b33;
  --focus: #b0512a;

  --radius: 14px;
  --radius-s: 9px;
  --radius-btn: 99px;
  --head-rule: transparent;

  --title-ink: var(--accent-ink);
  --title-size: 30px;
  --title-track: 0;
  --tile-size: 18px;
  --tile-track: .005em;
  --tile-case: none;

  /* Incised zigzag between two rules, as on the shoulder of a pot */
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='11'%3E%3Cpath d='M0 .5h14M0 10.500h14' stroke='%23b0512a' stroke-width='1' opacity='.5'/%3E%3Cpath d='M0 7.800l3.500-4.600 3.500 4.600 3.500-4.600 3.500 4.600' fill='none' stroke='%23b0512a' stroke-width='1.1' stroke-linejoin='round'/%3E%3C/svg%3E");
  --band-h: 11px;
  --band-size: 14px 11px;
  --band-opacity: .6;
  /* Pot */
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b0512a' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3.2h8M9.6 3.2v2.4C6 7.2 4 9.9 4 13.3c0 4.3 3.4 7.3 8 7.3s8-3 8-7.3c0-3.4-2-6.1-5.6-7.7V3.2' stroke-width='1.5'/%3E%3Cpath d='M4.5 11.4h15' stroke-width='1'/%3E%3C/svg%3E");
}

/* ---- Tokens: kolam. Rice-flour white on a swept floor, cool and airy. -------- */
:root[data-theme=kolam] {
  --bg: #eae8e3;
  --photo: url("assets/kolam.jpg"); --photo-pos: center; --photo-opacity: .3; --photo-tint: #b9b6ae; --photo-filter: contrast(1.1) brightness(1.1);
  --surface: #ffffff;
  --surface-2: #f6f5f2;
  --field: #ffffff;
  --ink: #20242a;
  --ink-2: #4c535c;
  --muted: #626973;
  --line: #e8e6e1;
  --line-strong: #d6d3cc;
  --field-line: #8d9299;
  --accent: #2f4a6b;
  --accent-hover: #233a56;
  --on-accent: #fff;
  --accent-ink: #2f4a6b;
  --tint: #e6edf5;
  --good: #1c744a;
  --good-tint: #e2f0e8;
  --bad: #b3261e;
  --focus: #2f4a6b;

  --radius: 10px;
  --radius-s: 7px;
  --radius-btn: 7px;
  --head-rule: transparent;

  --display: Jost, "Avenir Next", Avenir, "Century Gothic", "Segoe UI", system-ui, sans-serif;
  --title-size: 30px;
  --title-weight: 300;
  --title-track: -.005em;
  --tile-size: 17px;
  --tile-weight: 400;
  --tile-track: .005em;
  --tile-case: none;

  /* Pulli: the dot grid a kolam is drawn on, white on the floor */
  --ground: radial-gradient(circle, #fff 1.2px, transparent 1.7px);
  --ground-size: 28px 28px;
  /* One line looping round a row of dots */
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 7C7-1.6 21-1.6 28 7M0 7c7 8.6 21 8.6 28 0' fill='none' stroke='%23fff' stroke-width='1.4'/%3E%3Ccircle cx='14' cy='7' r='1.5' fill='%23fff'/%3E%3C/svg%3E");
  --band-h: 14px;
  --band-size: 28px 14px;
  --band-opacity: 1;
  /* Four loops round four dots */
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12C5.5 5.5 9 2 12 2s6.500 3.500 0 10c6.500-6.500 10-3 10 0s-3.500 6.500-10 0c6.500 6.500 3 10 0 10s-6.500-3.500 0-10c-6.500 6.500-10 3-10 0s3.500-6.500 10 0z' fill='none' stroke='%232f4a6b' stroke-width='1.15' stroke-linejoin='round'/%3E%3Cg fill='%232f4a6b'%3E%3Ccircle cx='12' cy='6' r='1.05'/%3E%3Ccircle cx='18' cy='12' r='1.05'/%3E%3Ccircle cx='12' cy='18' r='1.05'/%3E%3Ccircle cx='6' cy='12' r='1.05'/%3E%3C/g%3E%3C/svg%3E");
}


/* ---- Tokens: lotus. Temple-tank lotus: pale rose, soft and rounded. */
:root[data-theme=lotus] {
  --bg: #f1e5e6;
  --photo: url("assets/lotus.jpg"); --photo-pos: center 45%; --photo-opacity: .24; --photo-tint: #d9a3b5; --photo-filter: brightness(2.1);
  --surface: #fdf8f7;
  --surface-2: #f6ebec;
  --field: #fffdfc;
  --ink: #2e1f26;
  --ink-2: #5a4650;
  --muted: #725b66;
  --line: #eedddf;
  --line-strong: #dfc8cc;
  --field-line: #a18690;
  --accent: #a83a62;
  --accent-hover: #8f2f52;
  --on-accent: #fff;
  --accent-ink: #8a2c50;
  --tint: #f5d9e2;
  --good: #2f6a45;
  --good-tint: #e2eedf;
  --bad: #b3261e;
  --focus: #a83a62;

  --radius: 14px;
  --radius-s: 9px;
  --radius-btn: 99px;
  --head-rule: transparent;

  --title-ink: var(--accent-ink);
  --title-size: 30px;
  --title-track: 0;
  --tile-size: 18px;
  --tile-track: .005em;
  --tile-case: none;

  --ground: none;
  --ground-size: auto;
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8'%3E%3Cpath d='M0 7.5q8-11 16 0' fill='none' stroke='%23a83a62' stroke-width='1'/%3E%3C/svg%3E");
  --band-h: 8px;
  --band-size: 16px 8px;
  --band-opacity: .55;
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a83a62' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4c2.6 3 2.6 9 0 13-2.6-4-2.6-10 0-13zM4 9.5c4 .5 7 3.5 8 7.500-4.500-.3-7.800-3.200-8-7.500zM20 9.5c-4 .5-7 3.500-8 7.500 4.500-.3 7.800-3.200 8-7.500zM5 20.500h14'/%3E%3C/svg%3E");
}

/* ---- Tokens: mayil. Peacock: cool teal on a pale green-grey ground. */
:root[data-theme=mayil] {
  --bg: #e2ebe9;
  --photo: url("assets/mayil.jpg"); --photo-pos: center; --photo-opacity: .3; --photo-tint: #7fb5ae; --photo-filter: contrast(1.05) brightness(1.2);
  --surface: #f8fbfa;
  --surface-2: #ecf3f1;
  --field: #fdfffe;
  --ink: #14282b;
  --ink-2: #3c5558;
  --muted: #536b6d;
  --line: #d9e5e2;
  --line-strong: #c0d3cf;
  --field-line: #7a9794;
  --accent: #0f6b70;
  --accent-hover: #0b565a;
  --on-accent: #fff;
  --accent-ink: #0b5f6b;
  --tint: #cfe8e4;
  --good: #2c6a3c;
  --good-tint: #dfeede;
  --bad: #b3261e;
  --focus: #0f6b70;

  --radius: 8px;
  --radius-s: 6px;
  --radius-btn: 6px;
  --head-rule: var(--line);

  --title-ink: var(--ink);
  --title-size: 30px;
  --title-track: 0;
  --tile-size: 13.5px;
  --tile-track: .11em;
  --tile-case: uppercase;

  --ground: none;
  --ground-size: auto;
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='9'%3E%3Cellipse cx='10' cy='4.5' rx='5' ry='3.5' fill='none' stroke='%230f6b70'/%3E%3Ccircle cx='10' cy='4.5' r='1.3' fill='%230f6b70'/%3E%3C/svg%3E");
  --band-h: 9px;
  --band-size: 20px 9px;
  --band-opacity: .45;
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f6b70' stroke-width='1.2' stroke-linecap='round'%3E%3Cellipse cx='12' cy='10.5' rx='6.5' ry='8'/%3E%3Cellipse cx='12' cy='12' rx='3.6' ry='4.6'/%3E%3Ccircle cx='12' cy='13' r='1.6' fill='%230f6b70' stroke='none'/%3E%3Cpath d='M12 18.5v3.500'/%3E%3C/svg%3E");
}

/* ---- Tokens: deepam. Oil lamps at dusk: warm ivory and brass. */
:root[data-theme=deepam] {
  --bg: #f0e6d2;
  --photo: url("assets/deepam.jpg"); --photo-pos: center 60%; --photo-opacity: .3; --photo-tint: #d8b26c; --photo-filter: brightness(2);
  --surface: #fdf9ef;
  --surface-2: #f6eeda;
  --field: #fffdf6;
  --ink: #2b2113;
  --ink-2: #5a4a31;
  --muted: #6f5d42;
  --line: #ebe0c7;
  --line-strong: #dacba7;
  --field-line: #9a8762;
  --accent: #9a5b00;
  --accent-hover: #824c00;
  --on-accent: #fff;
  --accent-ink: #7a4a00;
  --tint: #f6e3b0;
  --good: #2c6a3c;
  --good-tint: #e3eedd;
  --bad: #b3261e;
  --focus: #9a5b00;

  --radius: 6px;
  --radius-s: 4px;
  --radius-btn: 4px;
  --head-rule: var(--line);

  --title-ink: var(--ink);
  --title-size: 30px;
  --title-track: 0;
  --tile-size: 13.5px;
  --tile-track: .11em;
  --tile-case: uppercase;

  --ground: none;
  --ground-size: auto;
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='9'%3E%3Cpath d='M8 1c1.600 2 2.400 3.200 2.400 4.400a2.400 2.400 0 0 1-4.800 0C5.600 4.200 6.400 3 8 1z' fill='%239a5b00'/%3E%3C/svg%3E");
  --band-h: 9px;
  --band-size: 16px 9px;
  --band-opacity: .45;
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a5b00' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M12 3c2 2.400 3 4 3 5.600a3 3 0 0 1-6 0c0-1.600 1-3.200 3-5.600z' fill='%239a5b00' stroke='none'/%3E%3Cpath d='M4 14h16c-.6 3.600-3.800 5.500-8 5.500s-7.400-1.900-8-5.500z'/%3E%3C/svg%3E");
}

/* ---- Tokens: mandapam. Pillared temple corridor: cut stone, square corners, the blue of painted ceilings. */
:root[data-theme=mandapam] {
  --bg: #e8e3da;
  --photo: url("assets/mandapam.jpg"); --photo-pos: center 35%; --photo-opacity: .36; --photo-tint: #b9ad98; --photo-filter: contrast(1.05) brightness(1.15);
  --surface: #f9f7f3;
  --surface-2: #f0ece4;
  --field: #fffefb;
  --ink: #24211d;
  --ink-2: #4f4a43;
  --muted: #666055;
  --line: #e3ddd1;
  --line-strong: #cfc7b7;
  --field-line: #8f8778;
  --accent: #1f5f86;
  --accent-hover: #184d6d;
  --on-accent: #fff;
  --accent-ink: #1b5578;
  --tint: #d6e5ee;
  --good: #2c6a3c;
  --good-tint: #e0eedd;
  --bad: #b3261e;
  --focus: #1f5f86;

  --radius: 0px;
  --radius-s: 0px;
  --radius-btn: 0px;
  --head-rule: var(--line);

  --title-ink: var(--ink);
  --title-size: 30px;
  --title-track: 0;
  --tile-size: 13.5px;
  --tile-track: .11em;
  --tile-case: uppercase;

  --ground: none;
  --ground-size: auto;
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 0h8v1.5H1zM3 1.5h4v6H3zM1 7.5h8V9H1z' fill='%231f5f86'/%3E%3C/svg%3E");
  --band-h: 9px;
  --band-size: 14px 9px;
  --band-opacity: .4;
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f5f86' stroke-width='1.3' stroke-linecap='round'%3E%3Cpath d='M2.5 5h19M2.5 19.500h19M5.5 5v14.500M10 5v14.500M14 5v14.500M18.500 5v14.500M4 2.500h16'/%3E%3C/svg%3E");
}

/* ---- Tokens: malli. Jasmine: fresh white and leaf green, soft and rounded. */
:root[data-theme=malli] {
  --bg: #e8eee5;
  --photo: url("assets/malli.jpg"); --photo-pos: center; --photo-opacity: .3; --photo-tint: #a9bfa6; --photo-filter: contrast(1.05) brightness(1.5);
  --surface: #fbfdf9;
  --surface-2: #eff5eb;
  --field: #ffffff;
  --ink: #1c2a1f;
  --ink-2: #43544a;
  --muted: #586a5e;
  --line: #dde6d8;
  --line-strong: #c6d3c0;
  --field-line: #7f9383;
  --accent: #2f6b3f;
  --accent-hover: #25562f;
  --on-accent: #fff;
  --accent-ink: #2a6138;
  --tint: #d9ead6;
  --good: #2c6a3c;
  --good-tint: #dfeeda;
  --bad: #b3261e;
  --focus: #2f6b3f;

  --radius: 16px;
  --radius-s: 10px;
  --radius-btn: 99px;
  --head-rule: transparent;

  --title-ink: var(--accent-ink);
  --title-size: 30px;
  --title-track: 0;
  --tile-size: 18px;
  --tile-track: .005em;
  --tile-case: none;

  --ground: none;
  --ground-size: auto;
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Ccircle cx='7' cy='4.5' r='2.4' fill='none' stroke='%232f6b3f'/%3E%3Ccircle cx='7' cy='4.5' r='.9' fill='%232f6b3f'/%3E%3C/svg%3E");
  --band-h: 9px;
  --band-size: 14px 9px;
  --band-opacity: .45;
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f6b3f' stroke-width='1.1'%3E%3Cellipse cx='12' cy='6.3' rx='2.5' ry='4'/%3E%3Cellipse cx='12' cy='6.3' rx='2.5' ry='4' transform='rotate(72 12 12)'/%3E%3Cellipse cx='12' cy='6.3' rx='2.5' ry='4' transform='rotate(144 12 12)'/%3E%3Cellipse cx='12' cy='6.3' rx='2.5' ry='4' transform='rotate(216 12 12)'/%3E%3Cellipse cx='12' cy='6.3' rx='2.5' ry='4' transform='rotate(288 12 12)'/%3E%3Ccircle cx='12' cy='12' r='1.3' fill='%232f6b3f' stroke='none'/%3E%3C/svg%3E");
}

/* ---- Tokens: muthu. Pearl: a jewellery boutique. White, ink and hairlines; square tiles, pill buttons. */
:root[data-theme=muthu] {
  --bg: #efefec;
  --photo: url("assets/muthu.jpg"); --photo-pos: center 55%; --photo-opacity: .28; --photo-tint: #cfcfca; --photo-filter: contrast(1.05) brightness(1.5);
  --surface: #ffffff;
  --surface-2: #f4f4f1;
  --field: #ffffff;
  --ink: #161616;
  --ink-2: #45453f;
  --muted: #60605a;
  --line: #e7e7e3;
  --line-strong: #d3d3cd;
  --field-line: #8b8b84;
  --accent: #1b1b1b;
  --accent-hover: #000000;
  --on-accent: #fff;
  --accent-ink: #1b1b1b;
  --tint: #ebebe6;
  --good: #1f6b3e;
  --good-tint: #e3efe5;
  --bad: #b3261e;
  --focus: #1b1b1b;

  --radius: 0px;
  --radius-s: 0px;
  --radius-btn: 99px;
  --head-rule: var(--line);

  --display: Jost, "Avenir Next", Avenir, "Century Gothic", "Segoe UI", system-ui, sans-serif;
  --title-ink: var(--ink);
  --title-size: 25px;
  --title-weight: 500;
  --title-track: .1em;
  --tile-size: 12.5px;
  --tile-weight: 500;
  --tile-track: .16em;
  --tile-case: uppercase;

  --ground: none;
  --ground-size: auto;
  /* A strung row of pearls */
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='9'%3E%3Cpath d='M0 4.5h3M9 4.5h3' stroke='%231b1b1b' stroke-width='.8'/%3E%3Ccircle cx='6' cy='4.5' r='2.9' fill='%23fff' stroke='%231b1b1b' stroke-width='.9'/%3E%3C/svg%3E");
  --band-h: 9px;
  --band-size: 12px 9px;
  --band-opacity: .5;
  /* A pearl drop on its chain */
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1b1b' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M3 3.500c2.500 3.300 5.500 5 9 5s6.500-1.700 9-5M12 8.500v2.300'/%3E%3Ccircle cx='12' cy='16' r='5.200'/%3E%3Cpath d='M9.500 15a2.800 2.800 0 0 1 1.700-1.700' stroke-width='1.200'/%3E%3C/svg%3E");

  /* Used only by the "new themes" rules at the foot of this file */
  --shadow: 0 0 0 0 transparent;   /* flat: no shadow. Written this way because it sits in a list of shadows, where "none" is not allowed */
  --frame: transparent;
}

/* ---- Tokens: utsav. Festival: marigold garlands, rani pink and teal on warm white; soft and rounded. */
:root[data-theme=utsav] {
  --bg: #fbf0d9;
  --photo: url("assets/utsav.jpg"); --photo-pos: center; --photo-opacity: .16; --photo-tint: #f0a92c; --photo-filter: brightness(1.7);
  --surface: #fffdf8;
  --surface-2: #fcf2df;
  --field: #ffffff;
  --ink: #2b1a12;
  --ink-2: #594236;
  --muted: #705848;
  --line: #f1e4ca;
  --line-strong: #e2cfa8;
  --field-line: #a48a64;
  --accent: #b5145e;
  --accent-hover: #980e4d;
  --on-accent: #fff;
  --accent-ink: #0a655d;
  --tint: #ffe6a6;
  --good: #1f6b3e;
  --good-tint: #e2efd8;
  --bad: #b3261e;
  --focus: #0a655d;

  --radius: 18px;
  --radius-s: 11px;
  --radius-btn: 99px;
  --head-rule: transparent;

  --display: "DM Serif Display", Marcellus, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --title-ink: #a01252;
  --title-size: 34px;
  --title-weight: 400;
  --title-track: 0;
  --tile-size: 20px;
  --tile-weight: 400;
  --tile-track: .005em;
  --tile-case: none;

  --ground: none;
  --ground-size: auto;
  /* A marigold garland seen side on: flower heads strung in a row, orange and yellow by turns */
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='12'%3E%3Ccircle cx='6.5' cy='6' r='5.6' fill='%23f0941c'/%3E%3Ccircle cx='6.5' cy='6' r='2.6' fill='none' stroke='%23c96a08' stroke-width='1'/%3E%3Ccircle cx='19.500' cy='6' r='5.6' fill='%23f5bd2d'/%3E%3Ccircle cx='19.500' cy='6' r='2.6' fill='none' stroke='%23d18f0b' stroke-width='1'/%3E%3C/svg%3E");
  --band-h: 12px;
  --band-size: 26px 12px;
  --band-opacity: 1;
  /* A marigold head: eight petals round a rani-pink centre */
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23ee9a1f'%3E%3Ccircle cx='12' cy='5' r='3.6'/%3E%3Ccircle cx='16.950' cy='7.050' r='3.6'/%3E%3Ccircle cx='19' cy='12' r='3.6'/%3E%3Ccircle cx='16.950' cy='16.950' r='3.6'/%3E%3Ccircle cx='12' cy='19' r='3.6'/%3E%3Ccircle cx='7.050' cy='16.950' r='3.6'/%3E%3Ccircle cx='5' cy='12' r='3.6'/%3E%3Ccircle cx='7.050' cy='7.050' r='3.6'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='3.4' fill='%23b5145e'/%3E%3C/svg%3E");

  /* Used only by the "new themes" rules at the foot of this file */
  --shadow: 0 1px 2px rgba(60, 30, 0, .05), 0 14px 28px -18px rgba(60, 30, 0, .28);
  --frame: transparent;
}

/* ---- Tokens: kalyanam. Wedding: sindoor red and zari gold on sandal ivory, framed like an invitation card. */
:root[data-theme=kalyanam] {
  --bg: #f5e9d4;
  --photo: url("assets/kalyanam.jpg"); --photo-pos: center 40%; --photo-opacity: .26; --photo-tint: #d99a86; --photo-filter: brightness(1.55);
  --surface: #fffaf0;
  --surface-2: #f8eedb;
  --field: #fffdf8;
  --ink: #2c1014;
  --ink-2: #5a3935;
  --muted: #73524a;
  --line: #eedfc3;
  --line-strong: #dcc594;
  --field-line: #a2865a;
  --accent: #8e1b2f;
  --accent-hover: #741325;
  --on-accent: #fff;
  --accent-ink: #8e1b2f;
  --tint: #f8dcd2;
  --good: #2c6a3c;
  --good-tint: #e4eeda;
  --bad: #b3261e;
  --focus: #8e1b2f;

  --radius: 8px;
  --radius-s: 5px;
  --radius-btn: 5px;
  --head-rule: transparent;

  --display: "Cormorant Garamond", Marcellus, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --title-ink: #7f1629;
  --title-size: 38px;
  --title-weight: 600;
  --title-track: 0;
  --tile-size: 23px;
  --tile-weight: 600;
  --tile-track: 0;
  --tile-case: none;

  --ground: none;
  --ground-size: auto;
  /* A zari border, as on the edge of a silk sari: two rules with diamonds and dots between */
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='11'%3E%3Cpath d='M0 .75h18M0 10.250h18' stroke='%23b88a2c' stroke-width='1'/%3E%3Cpath d='M9 2.600l2.900 2.900L9 8.400 6.100 5.500z' fill='%238e1b2f'/%3E%3Ccircle cx='0' cy='5.500' r='1.100' fill='%23b88a2c'/%3E%3Ccircle cx='18' cy='5.500' r='1.100' fill='%23b88a2c'/%3E%3C/svg%3E");
  --band-h: 11px;
  --band-size: 18px 11px;
  --band-opacity: 1;
  /* Mango motif (paisley), the commonest figure on wedding silk */
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.500 21c-4.300 0-7.500-3.100-7.500-7.300C5 8.300 9.600 3.600 16.400 3c1.700-.1 3 .9 3 2.300 0 1.200-.9 2-2 2-.9 0-1.500-.6-1.500-1.300M12.500 21c4 0 7-3 7-6.700 0-2.800-1.700-4.900-3.900-6' stroke='%238e1b2f' stroke-width='1.5'/%3E%3Ccircle cx='12.200' cy='14.200' r='2.300' stroke='%23b88a2c' stroke-width='1.300'/%3E%3C/svg%3E");

  /* Used only by the "new themes" rules at the foot of this file */
  --shadow: 0 1px 2px rgba(70, 20, 10, .05), 0 14px 28px -18px rgba(70, 20, 10, .26);
  --frame: #d2b06a;
}

/* ---- Metal: gold or silver ----------------------------------------------------
   Gold keeps each theme's own colours and adds gold cues. Silver cools every theme to
   steel and grey, so the two can never be mistaken; the theme's shapes, type, motif and
   photo stay, only drained of colour. */
:root { --metal: #c99a2e; --metal-soft: #f4e3b2; --metal-ink: #2a1f06; --coins: url("assets/coins-gold.jpg"); --strip-h: 28px; }
:root[data-metal=silver] {
  --metal: #9aa4b0; --metal-soft: #e3e7ec; --metal-ink: #1b2026; --coins: url("assets/coins-silver.jpg");
  --bg: #e3e5e9;
  --surface: #f9fafb;
  --surface-2: #edeff2;
  --field: #ffffff;
  --ink: #1e2227;
  --ink-2: #454c55;
  --muted: #5c6470;
  --line: #dfe3e8;
  --line-strong: #c8ced6;
  --field-line: #848d98;
  --accent: #46586b;
  --accent-hover: #37475a;
  --accent-ink: #36475a;
  --tint: #dbe3ec;
  --focus: #46586b;
  --title-ink: var(--ink);
  --photo-tint: #a9b0b9;
}
:root[data-metal=silver] .band, :root[data-metal=silver] .mark { filter: grayscale(1); }

/* ---- Base ------------------------------------------------------------------- */
* { box-sizing: border-box; }
/* The ground sits on <html> so the fixed photo layer can show between it and the page content */
html { background: var(--bg) var(--ground) 0 0 / var(--ground-size); }
body {
  margin: 0; color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
/* Emphasised figures and the title: plain strong text */
.metal { color: var(--ink); }
h1.metal { color: var(--title-ink); }

/* ---- Coin strip: a skinny photo of coins pinned to the top of the window, on every page and in every theme.
        Gold coins in gold mode, silver coins in silver mode, so it is the first "which metal" cue the eye meets;
        it takes the place of the 5px metal line. It belongs to the site, not to a theme, so it never changes with the theme.
        It is drawn by the page body itself, so no page needs new markup. Sticky keeps it in the flow: it reserves its
        own height, so nothing shifts when it appears and nothing starts out hidden under it. */
body::before { content: ""; display: block; position: sticky; top: 0; z-index: 50; height: var(--strip-h);
               background: var(--metal) var(--coins) 0 0 / auto 100% repeat-x; box-shadow: 0 1px 0 rgba(0, 0, 0, .28); }
/* Anything the browser scrolls into view (a link target, a field given focus) stops clear of the strip */
html { scroll-padding-top: calc(var(--strip-h) + 12px); }
@media (max-width: 640px) { :root { --strip-h: 22px; } }
@media print { body::before { display: none; } }

/* ---- Background photo: fixed to the window, so it stays put while the page scrolls.
        Faded and tinted towards the theme's ground so it reads as atmosphere, not decoration. */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none;
            /* Luminosity blend keeps the photo's light and shade but takes its colour from the theme */
            background: var(--photo) var(--photo-pos, center) / cover no-repeat, var(--photo-tint, var(--bg));
            background-blend-mode: luminosity;
            opacity: var(--photo-opacity, .3); filter: var(--photo-filter, none); }
.credit { padding: 0 20px 28px; text-align: center; font-size: 11.5px; color: var(--muted); }
.credit span { display: none; }
:root:not([data-theme]) .credit [data-for=temple],
:root[data-theme=temple] .credit [data-for=temple],
:root[data-theme=terracotta] .credit [data-for=terracotta],
:root[data-theme=kolam] .credit [data-for=kolam],
:root[data-theme=lotus] .credit [data-for=lotus],
:root[data-theme=mayil] .credit [data-for=mayil],
:root[data-theme=deepam] .credit [data-for=deepam],
:root[data-theme=mandapam] .credit [data-for=mandapam],
:root[data-theme=malli] .credit [data-for=malli] { display: inline; }

/* Theme swatch: ground, a line of ink, a dot of the accent. Fixed colours, whichever theme is on. */
.sw { flex: none; position: relative; width: 20px; height: 14px; border-radius: 3px; background: var(--b); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .16); }
.sw::before { content: ""; position: absolute; top: 4px; left: 3px; width: 8px; height: 2px; border-radius: 1px; background: var(--f); }
.sw::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--a); }
#tTemple + label .sw     { --b: #f3eee4; --f: #26211c; --a: #a8301c; }
#tTerracotta + label .sw { --b: #f1d6c0; --f: #3a2118; --a: #b0512a; }
#tKolam + label .sw      { --b: #ffffff; --f: #20242a; --a: #2f4a6b; }
#tLotus + label .sw      { --b: #f6e3e7; --f: #2e1f26; --a: #a83a62; }
#tMayil + label .sw      { --b: #dcebe8; --f: #14282b; --a: #0f6b70; }
#tDeepam + label .sw     { --b: #f6e9c8; --f: #2b2113; --a: #9a5b00; }
#tMandapam + label .sw   { --b: #e8e3da; --f: #24211d; --a: #1f5f86; }
#tMalli + label .sw      { --b: #e4efe0; --f: #1c2a1f; --a: #2f6b3f; }
.dot { flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .28); }
.dot.gold { background: #e3b53f; }
.dot.silver { background: #d5dae0; }
.sw.now { --b: var(--surface); --f: var(--ink); --a: var(--accent); }

/* Flags */
.flag { display: inline-block; flex: none; width: 18px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 2px;
        background: center / cover no-repeat; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); }
.flag.us { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Cpath fill='%23fff' d='M0 0h18v12H0z'/%3E%3Cpath stroke='%23b22234' stroke-width='.923' d='M0 .46h18M0 2.31h18M0 4.15h18M0 6h18M0 7.85h18M0 9.69h18M0 11.54h18'/%3E%3Cpath fill='%233c3b6e' d='M0 0h8v6.46H0z'/%3E%3Cg fill='%23fff'%3E%3Ccircle cx='1.6' cy='1.4' r='.5'/%3E%3Ccircle cx='4' cy='1.4' r='.5'/%3E%3Ccircle cx='6.4' cy='1.4' r='.5'/%3E%3Ccircle cx='2.800' cy='3.200' r='.5'/%3E%3Ccircle cx='5.200' cy='3.200' r='.5'/%3E%3Ccircle cx='1.6' cy='5' r='.5'/%3E%3Ccircle cx='4' cy='5' r='.5'/%3E%3Ccircle cx='6.4' cy='5' r='.5'/%3E%3C/g%3E%3C/svg%3E"); }
.flag.in { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Cpath fill='%23ff9933' d='M0 0h18v4H0z'/%3E%3Cpath fill='%23fff' d='M0 4h18v4H0z'/%3E%3Cpath fill='%23138808' d='M0 8h18v4H0z'/%3E%3Ccircle cx='9' cy='6' r='1.5' fill='none' stroke='%23000080' stroke-width='.45'/%3E%3Ccircle cx='9' cy='6' r='.35' fill='%23000080'/%3E%3C/svg%3E"); }
.totals .k .flag { width: 22px; height: 15px; margin-right: 2px; }
th .flag { vertical-align: -1px; }


/* ---- Today's rates: three small cards, and for the curious how the estimate is reached ---- */
/* "section" keeps these apart from the form's shop-rate row, which is also class "rates" */
section.rates { margin: 0 0 20px; }
.ratecards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rate { min-width: 0; padding: 12px 16px 13px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-s); }
/* Label: coin (metal rates only), flag, words */
.rate .k { display: flex; align-items: center; gap: 6px; min-height: 18px; font-size: 12.5px; font-weight: 600; line-height: 18px; color: var(--ink-2); }
.rate .k .flag, .rate .k .coin { margin: 0; }
.rate .k span { min-width: 0; }
/* Figure, then what kind of figure it is. The note drops under the figure when the card is too narrow for both. */
.rate .r { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin-top: 3px; }
.rate .v { font-size: 20px; line-height: 26px; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rate .v .u { margin-left: 3px; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.rate .v .pre { font-weight: 500; color: var(--ink-2); }
/* No figure to show: loading, or nothing could be loaded */
.rate .v.none { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.rate .note { font-size: 12px; line-height: 18px; color: var(--muted); }
.rate .note.est, .rate .note.own { padding: 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
                                   color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 99px; }
.rate .note.own { color: var(--accent-ink); background: var(--tint); border-color: color-mix(in srgb, var(--accent-ink) 35%, transparent); }

/* How the estimate is worked out. Closed: a small button under the cards. Open: a full-width sheet under them. */
.how { width: fit-content; max-width: 100%; margin-top: 8px; font-size: 13px;
       background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-btn); }
.how > summary { min-height: 30px; padding: 5px 12px 5px 14px; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-radius: inherit; }
.how > summary:hover { color: var(--ink); }
.how > summary:focus-visible { outline-offset: 2px; }
.how > summary::after { width: 6px; height: 6px; margin: -3px 2px 0 0; }
.how:not([open]) > summary::after { margin-top: 0; }
.how[open] { width: auto; border-radius: var(--radius-s); }
.how[open] > summary { padding: 8px 16px; color: var(--ink); border-bottom: 1px solid var(--line); border-radius: var(--radius-s) var(--radius-s) 0 0; }
.how[open] > summary:focus-visible { outline-offset: -2px; }
.how[open] > summary::after { margin-left: auto; }
.howbody { padding: 2px 16px 16px; color: var(--ink-2); }
.howbody h3 { margin: 14px 0 4px; font-size: 13px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
.howbody p { margin: 4px 0 0; }
.howcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 40px; }
.howbody td { padding: 6px 0 6px 16px; }
.howbody tr.sum td { font-weight: 700; color: var(--ink); border-bottom: 0; }
.howbody ul { margin: 6px 0 0; padding-left: 18px; columns: 2; column-gap: 58px; }
.howbody li { margin: 0 0 6px; break-inside: avoid; }
.coin { flex: none; align-self: center; width: 14px; height: 14px; margin-right: -4px; }

/* Narrow frame: the two workings stack, and the list is one column */
@container app (max-width: 720px) {
  .howcols { grid-template-columns: minmax(0, 1fr); }
  .howbody ul { columns: 1; }
}
/* Two metal rates side by side, the exchange rate on its own line */
@container app (max-width: 600px) {
  .ratecards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rate.fx { grid-column: 1 / -1; }
}
@container app (max-width: 520px) {
  section.rates { margin-bottom: 14px; }
  .ratecards { gap: 8px; }
  .rate { padding: 10px 12px 11px; }
  .rate .v { font-size: 18px; line-height: 24px; }
  .rate .v .u { font-size: 12px; }
  .rate .v.none { font-size: 14px; }
  .howbody { padding: 2px 12px 14px; }
  .how[open] > summary { padding: 8px 12px; }
}
/* Small phones: the label loses its coin so "India silver, 925" stays on one line */
@container app (max-width: 400px) {
  .rate .k { gap: 5px; font-size: 12px; }
  .rate .k .coin { display: none; }
}
/* Narrower than any current phone: one card per line, as the form does */
@container app (max-width: 340px) {
  .ratecards { grid-template-columns: minmax(0, 1fr); }
}

h1 { display: flex; align-items: center; gap: 12px; margin: 0;
     font-family: var(--display); font-size: var(--title-size); font-weight: var(--title-weight); letter-spacing: var(--title-track); line-height: 1.15; }
.mark { flex: none; width: 26px; height: 26px; background: var(--mark) center / contain no-repeat; }
.status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.status :is(#status, [id$="-status"]) { margin-right: 4px; font-variant-numeric: tabular-nums; }


/* ---- Tiles ------------------------------------------------------------------ */
summary { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 12px 24px; cursor: pointer; list-style: none;
          border-radius: var(--radius); -webkit-tap-highlight-color: transparent; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: none; width: 7px; height: 7px; margin: -4px 2px 0 4px;
                 border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .18s; }
details:not([open]) > summary::after { transform: rotate(-45deg); margin-top: 0; }
details[open] > summary { border-bottom: 1px solid var(--head-rule); border-radius: var(--radius) var(--radius) 0 0; }
summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

.lede { color: var(--ink-2); font-size: 13.5px; margin: 0 0 16px; }
h3 { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 24px 0 12px; }

/* ---- Form ------------------------------------------------------------------- */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* Each cell is a column pinned to its foot, so fields line up even when one label wraps */
.fields > div { min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.fields.three { grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
.fields .wide { grid-column: 1 / -1; }
@container app (max-width: 340px) { .fields { grid-template-columns: 1fr; } }
label, .label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field { display: flex; align-items: stretch; min-height: 40px; background: var(--field); border: 1px solid var(--field-line); border-radius: var(--radius-s);
         overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.field:hover { border-color: var(--ink-2); }
.field:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 24%, transparent); }
.field input, .field select { border: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); outline: 0; min-width: 0; border-radius: 0; }
.field input { flex: 1; padding: 8px 12px; font-variant-numeric: tabular-nums; }
.field input::placeholder { color: var(--muted); opacity: .75; }
.field .u { display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.field .u:first-child { padding-right: 0; }
.field select { -webkit-appearance: none; appearance: none; padding: 8px 26px 8px 10px; border-left: 1px solid var(--line-strong); color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer;
                background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23777' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 9px center / 10px 6px no-repeat; }
.field.pick select { flex: 1; border-left: 0; padding-left: 12px; color: var(--ink); font-size: 16px; font-weight: 400; text-overflow: ellipsis; }
select option { background: #fff; color: #222; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }

.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 3px;
       background: var(--field); border: 1px solid var(--field-line); border-radius: var(--radius-s); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; padding: 6px 10px; text-align: center; border-radius: max(0px, calc(var(--radius-s) - 3px)); cursor: pointer; font-weight: 600; color: var(--ink-2);
             transition: background .15s, color .15s; }
.seg label:hover { color: var(--ink); background: var(--surface-2); }
.seg input:checked + label { background: var(--accent); color: var(--on-accent); }
.seg input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
:root[data-theme=terracotta] .seg, :root[data-theme=terracotta] .seg label, :root[data-theme=lotus] .seg, :root[data-theme=lotus] .seg label, :root[data-theme=malli] .seg, :root[data-theme=malli] .seg label { border-radius: 99px; }

button { font: inherit; font-size: 13px; font-weight: 600; min-height: 34px; padding: 6px 14px; border-radius: var(--radius-btn); cursor: pointer;
         color: var(--ink); background: var(--surface); border: 1px solid var(--field-line); transition: border-color .15s, background .15s; }
button:hover { border-color: var(--ink); background: var(--field); }
button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button:disabled { opacity: .6; cursor: progress; }
:is(#refresh, [id$="-refresh"]) { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
:is(#refresh, [id$="-refresh"]):hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ---- Tables ----------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 10px 0 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
th { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; vertical-align: bottom; }
td small, th small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
td.n { white-space: nowrap; }

/* ---- Invoice ---------------------------------------------------------------- */
.totals { border-top: 3px solid var(--metal) !important;
          display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 8px;
          background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-s); }
.totals > div { padding: 16px 20px 16px; min-width: 0; }
.totals > div + div { border-left: 1px solid var(--line-strong); }
.totals .k { display: flex; align-items: center; gap: 8px; min-height: 20px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.totals .v { font-size: clamp(25px, 3.4cqi, 40px); line-height: 1.1; font-weight: 700; letter-spacing: -0.022em; font-variant-numeric: tabular-nums;
             margin-top: 8px; max-width: 100%; overflow-wrap: anywhere; }
.totals .s { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; margin-top: 4px; }
.totals .o { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-strong); font-size: 14px; font-weight: 650; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.totals .o:empty { display: none; }
.tag { font-size: 11px; font-weight: 700; letter-spacing: .05em; line-height: 18px; color: var(--good); background: var(--good-tint);
       border: 1px solid color-mix(in srgb, var(--good) 45%, transparent); border-radius: 99px; padding: 0 8px; }
.bill tr.sum td { font-weight: 650; }
.bill tr.grand td { font-weight: 750; font-size: 17px; border-top: 1.5px solid var(--ink); border-bottom: 0; }
.bill tr.over td { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 650; color: var(--accent-ink); }
.bill tr.over td:first-child { color: var(--ink); }
.verdict { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line-strong); font-weight: 600; }
.verdict:empty { display: none; }
.verdict small { display: block; margin-top: 2px; font-weight: 400; color: var(--muted); font-size: 12.5px; }

/* ---- Discount to wastage ---------------------------------------------------- */
.asks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
@container app (max-width: 340px) { .asks { grid-template-columns: 1fr; } }
.ask { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 14px 16px; }
.ask .k { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.ask .v { font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -0.012em; font-variant-numeric: tabular-nums; margin: 6px 0 6px; }
.ask .v.no { color: var(--bad); font-size: 16px; letter-spacing: 0; }
.ask p { margin: 0; color: var(--muted); font-size: 12.5px; }
.ask p + p { margin-top: 4px; }

/* ---- Wastage table ---------------------------------------------------------- */
.scroll { container: ladder / inline-size; max-height: 420px; overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--field); }
/* Separate borders so the header's rule travels with it when it sticks */
.ladder { border-collapse: separate; border-spacing: 0; }
.ladder th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); border-bottom: 1px solid var(--line-strong); }
.ladder th, .ladder td { padding: 8px 12px; font-size: 14px; }
.ladder th { font-size: 11.5px; }
.ladder th:first-child, .ladder td:first-child { padding-left: 14px; }
.ladder td:first-child { color: var(--ink-2); font-weight: 600; }
/* The wastage column stays put if the table has to scroll sideways on a phone */
.ladder th:first-child, .ladder td:first-child { position: sticky; left: 0; }
.ladder th:first-child { z-index: 2; }
.ladder td:first-child { background: var(--field); }
.ladder tr:last-child td { border-bottom: 0; }
.ladder .x b { color: var(--accent-ink); font-weight: 700; }
.ladder small.dn { color: var(--good); font-weight: 600; }
.ladder small.up { color: var(--bad); font-weight: 600; }
/* The wastage entered above: tinted row, heavier figures, a bar of the accent down its left edge */
.ladder tr.now td { background: var(--tint); font-weight: 700; color: var(--ink); }
.ladder tr.now td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.ladder tr.now td small { color: var(--ink-2); font-weight: 500; }

/* ---- Narrow frame (phone) --------------------------------------------------- */
/* ---- Narrow detail cards and sheets (phone) ---------------------------------- */
@container app (max-width: 520px) {
  .status button { flex: 1; padding-inline: 8px; white-space: nowrap; }
  .status :is(#status, [id$="-status"]) { width: 100%; margin: 0 0 2px; }
  .fields { gap: 14px 12px; }
  .totals > div { padding: 14px 14px 14px; }
  .ask { padding: 12px 12px; }
  .ask .v { font-size: 18px; }
  .ask .v.no { font-size: 15px; }
  .totals .o { font-size: 13px; }
  .bill td.n small, .bill th small { white-space: normal; }
  th, td { padding-left: 10px; }
}

/* Wastage table: five columns need 530 to 600px, more than a tile has in the two-column layout, so the table
   answers to the width of its own box. Narrower than 620px, each row becomes wastage | USA | India,
   with the over-gold figure tucked under its total instead of in a column of its own. */
@container ladder (max-width: 619px) {
  .ladder, .ladder thead, .ladder tbody { display: block; }
  .ladder thead { position: sticky; top: 0; z-index: 1; box-shadow: 0 1px 0 var(--line-strong); }
  .ladder tr { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
  .ladder tbody tr:last-child { border-bottom: 0; }
  .ladder th, .ladder td { padding: 8px 12px 0 0; font-size: 13.5px; border-bottom: 0; }
  .ladder th { position: static; box-shadow: none; padding-bottom: 8px; font-size: 11px; }
  .ladder th:nth-child(3), .ladder th:nth-child(5) { display: none; }
  .ladder th:first-child, .ladder td:first-child { padding-left: 12px; }
  .ladder td:nth-child(1) { grid-row: 1 / span 2; }
  .ladder td:nth-child(2) { grid-area: 1 / 2; }
  .ladder td:nth-child(3) { grid-area: 2 / 2; }
  .ladder td:nth-child(4) { grid-area: 1 / 3; }
  .ladder td:nth-child(5) { grid-area: 2 / 3; }
  .ladder td.x { padding-top: 2px; padding-bottom: 9px; font-size: 12px; white-space: normal; }
  /* The two hidden "Over gold" headings move under the totals' headings, in the colour of the figures they name */
  .ladder th:nth-child(2)::after, .ladder th:nth-child(4)::after { content: "over metal"; display: block; margin-top: 1px;
    font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--accent-ink); }
  .ladder td.x small { display: inline; margin-left: 5px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---- Print: black on white (what prints is set in the print block at the end) ---- */
@media print {
  :root, :root[data-theme] { --ink: #000; --ink-2: #222; --muted: #444; --line: #ccc; --line-strong: #999; --accent-ink: #000; --good: #000;
                             --bg: #fff; --surface: #fff; --surface-2: #fff; --good-tint: #fff; --ground: none; }
  html, body { background: #fff; }
  .totals { background: none; }
  .metal { color: #000; }
}

/* The status line sits directly on the photo, so it gets a soft patch of surface behind it */
:is(#status, [id$="-status"]) { padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 82%, transparent); }
@media print { :is(#status, [id$="-status"]) { background: none; } }

/* ---- Guide pages (about, privacy, the four guides) --------------------------- */
.btn { display: inline-block; font: 600 13px/1.4 var(--font); padding: 8px 16px; border-radius: var(--radius-btn); text-decoration: none;
       color: var(--on-accent); background: var(--accent); border: 1px solid var(--accent); }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.docbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 24px;
          background: var(--surface); border-bottom: 1px solid var(--line-strong); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: var(--title-weight) 21px/1.2 var(--display); color: var(--title-ink); text-decoration: none; }
.article { max-width: 780px; margin: 28px auto; padding: 28px 36px 32px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.article h1 { display: block; margin: 0 0 10px; font: var(--title-weight) 32px/1.2 var(--display); color: var(--title-ink); letter-spacing: 0; }
.article h2 { margin: 30px 0 8px; font: 650 18px/1.3 var(--font); color: var(--ink); }
.article p, .article li { font-size: 16px; line-height: 1.65; color: var(--ink); }
.article p { margin: 0 0 14px; }
.article .lede { font-size: 17.5px; color: var(--ink-2); }
.article ul, .article ol { margin: 0 0 14px; padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article a:not(.btn) { color: var(--accent-ink); }
.article table { margin: 6px 0 14px; font-size: 15px; }
.article th, .article td { text-align: left; padding: 8px 14px 8px 0; }
.article td:last-child, .article th:last-child { text-align: right; padding-right: 0; white-space: nowrap; }
.article .twocol { max-width: 420px; }
/* A table whose last column is words, not an amount: it wraps and reads left to right. A long last heading may wrap too. */
.article .wordcol td:last-child, .article .wordcol th:last-child { text-align: left; white-space: normal; }
.article .wraphead th:last-child { white-space: normal; }
.article .note, .article .reviewed { font-size: 13.5px; color: var(--muted); }
.article .cta { margin: 28px 0 18px; }
.guides { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 22px; }
.guides a { font-size: 13px; font-weight: 600; padding: 4px 11px; border: 1px solid var(--line-strong); border-radius: 99px; text-decoration: none; color: var(--ink-2) !important; }
.guides a[aria-current] { background: var(--surface-2); color: var(--ink) !important; border-color: var(--field-line); }
.docfoot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 0 20px 32px; font-size: 13px; }
.docfoot a { color: var(--ink-2); }
.sitelinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 0 20px 14px; font-size: 13px; }
.sitelinks a { color: var(--ink-2); }
@media (max-width: 640px) { .article { margin: 16px 12px; padding: 20px 18px 24px; } .article h1 { font-size: 26px; } .docbar { padding: 10px 14px; } }
@media print { .docbar, .docfoot, .guides, .cta, .sitelinks { display: none !important; } .article { border: 0; margin: 0; padding: 0; max-width: none; } }

/* ==== New themes: muthu, utsav, kalyanam ========================================
   Everything below is scoped to these three, so the older eight are untouched.
   It reads the tokens above plus two of its own: --shadow and --frame. */

/* Background-photo credit and picker swatch */
:root[data-theme=muthu] .credit [data-for=muthu],
:root[data-theme=utsav] .credit [data-for=utsav],
:root[data-theme=kalyanam] .credit [data-for=kalyanam] { display: inline; }
#tMuthu + label .sw    { --b: #ffffff; --f: #161616; --a: #1b1b1b; }
#tUtsav + label .sw    { --b: #ffe6a6; --f: #2b1a12; --a: #b5145e; }
#tKalyanam + label .sw { --b: #f8eedb; --f: #2c1014; --a: #8e1b2f; }

/* Silver: the motif on the header card and the card frame lose their colour with everything else */
:root[data-metal=silver]:is([data-theme=utsav], [data-theme=kalyanam]) { --shadow: 0 1px 2px rgba(20, 30, 40, .05), 0 14px 28px -18px rgba(20, 30, 40, .24); }
:root[data-metal=silver][data-theme=kalyanam] { --frame: var(--line-strong); }
:root[data-metal=silver]:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) :is(.top, .article)::before { filter: grayscale(1); }

:root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) :is(.top, .article)::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: var(--band-h);
  opacity: var(--band-opacity); background: var(--band) 0 0 / var(--band-size) round no-repeat; }
:root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) :is(#status, [id$="-status"]) { background: var(--surface-2); }

/* 2. Cards: a soft shadow lifts them off the ground (none for muthu, which stays flat).
      --frame draws a second rule just inside a tile's edge; only kalyanam gives it a colour. */
:root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) :is(.rate, .how, .article) { box-shadow: var(--shadow); }

/* 3. Controls: fields and buttons tall enough for a thumb */
:root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) .field { min-height: 44px; }
:root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) button { min-height: 40px; }
:root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) .body .seg label { padding: 9px 10px; }

/* 4. Room to breathe on a wide screen: an 8px rhythm, larger rate figures. Phones keep the tighter layout. */
@container app (min-width: 721px) {
  :root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) .ratecards { gap: 16px; }
  :root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) .rate { padding: 16px 20px; }
  :root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) .rate .v { font-size: 22px; line-height: 28px; }
  :root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) .fields { gap: 20px 16px; }
}

:root[data-theme=utsav] .seg, :root[data-theme=utsav] .seg label { border-radius: 99px; }

/* 6. Muthu: the title and brand in spaced capitals; links underlined in ink, since there is no accent colour to mark them */
:root[data-theme=muthu] .top h1, :root[data-theme=muthu] .brand { text-transform: uppercase; }
:root[data-theme=muthu] .brand { font-size: 17px; letter-spacing: .12em; }
:root[data-theme=muthu] .article a:not(.btn) { text-decoration-color: currentColor; }
/* Kalyanam: Cormorant draws old-style figures small; lining figures keep "22K" level with the capitals */
:root[data-theme=kalyanam] :is(h1, .brand, summary .t) { font-variant-numeric: lining-nums; }

/* 7. Guide pages: the article card carries the same motif along its top edge */
:root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) .article {
  position: relative; overflow: hidden; padding-top: calc(var(--band-h) + 26px); }
@media (max-width: 640px) {
  :root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) .article { padding-top: calc(var(--band-h) + 18px); }
}

/* 8. Footers and the empty-column hint sit on the surface colour, so no words are ever straight on the photo */
:root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) :is(.sitelinks, .docfoot) {
  padding-top: 20px; background: var(--surface); border-top: 1px solid var(--line-strong); }
:root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) .credit { background: var(--surface); }
:root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) .docfoot { padding-bottom: 14px; }

/* 9. Print: none of the above belongs on paper */
@media print {
  :root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) :is(.panel, .article) { box-shadow: none; }
  :root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) .article { padding-top: 0; }
  :root:is([data-theme=muthu], [data-theme=utsav], [data-theme=kalyanam]) .article::before { display: none; }
}

/* ==== Floating layout ============================================================
   The calculator page as three planes: a far photo, cards floating above it, and one
   answer nearer still. Written once on the existing theme tokens; it adds a handful
   of its own (--far-*, --glass*, --e1..3, --r-*). Nothing here changes a theme's
   colours, type or motif. */

/* ---- New tokens ---------------------------------------------------------------- */
:root {
  /* Far plane: the theme's photo, small and soft. Each theme names its file below. */
  --far-photo: url("assets/far/temple.jpg");
  --far-blur: 9px;                 /* depth of field: far things are out of focus */
  --far-opacity: .5;               /* how much of the photo shows through the ground colour */
  --far-filter: saturate(1.1);
  --far-edge: color-mix(in srgb, var(--ink) 15%, transparent);   /* the corners fall away */

  /* Glass: the same surface colour, let through by degrees. Lower planes let more through. */
  --glass-lo: color-mix(in srgb, var(--surface) 84%, transparent);   /* chips, top bar, footer plate */
  --glass: color-mix(in srgb, var(--surface) 90%, transparent);      /* cards */
  --glass-hi: color-mix(in srgb, var(--surface) 96%, transparent);   /* the answer */
  --rim: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 0 0 1px rgba(255, 255, 255, .3);   /* light on the top edge */

  /* Elevation: a contact shadow, a key shadow and a wide ambient one, tinted with the theme's ink */
  --sh: var(--ink);
  --e1: 0 1px 1px color-mix(in srgb, var(--sh) 9%, transparent), 0 6px 14px -6px color-mix(in srgb, var(--sh) 24%, transparent);
  --e2: 0 1px 2px color-mix(in srgb, var(--sh) 9%, transparent), 0 10px 22px -8px color-mix(in srgb, var(--sh) 22%, transparent),
        0 30px 60px -20px color-mix(in srgb, var(--sh) 34%, transparent);
  --e3: 0 2px 3px color-mix(in srgb, var(--sh) 10%, transparent), 0 18px 34px -10px color-mix(in srgb, var(--sh) 26%, transparent),
        0 52px 96px -24px color-mix(in srgb, var(--sh) 46%, transparent);

  /* Corners follow the theme: square themes stay square, soft themes get softer as things get bigger */
  --r-card: calc(var(--radius) * 1.5);
  --r-slug: calc(var(--radius) * 1.2);
  --r-chip: var(--radius);
  --r-bar: min(var(--radius-btn), 28px);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-sheet: cubic-bezier(.22, 1, .36, 1);
}
:root[data-theme=terracotta] { --far-photo: url("assets/far/terracotta.jpg"); }
:root[data-theme=kolam]      { --far-photo: url("assets/far/kolam.jpg"); }
:root[data-theme=lotus]      { --far-photo: url("assets/far/lotus.jpg"); }
:root[data-theme=mayil]      { --far-photo: url("assets/far/mayil.jpg"); }
:root[data-theme=deepam]     { --far-photo: url("assets/far/deepam.jpg"); }
:root[data-theme=mandapam]   { --far-photo: url("assets/far/mandapam.jpg"); }
:root[data-theme=malli]      { --far-photo: url("assets/far/malli.jpg"); }
:root[data-theme=muthu]      { --far-photo: url("assets/far/muthu.jpg"); }
:root[data-theme=utsav]      { --far-photo: url("assets/far/utsav.jpg"); }
:root[data-theme=kalyanam]   { --far-photo: url("assets/far/kalyanam.jpg"); }

[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- Far plane -------------------------------------------------------------------
   Fixed to the window, blurred once (a still layer costs nothing while scrolling), larger than
   the window so its soft edges never show. It keeps the luminosity blend, so the photo still
   takes its colour from the theme and silver mode still drains it. */
.far { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.far-photo { position: absolute; inset: -8%;
             translate: calc(var(--px, 0) * -14px) calc(var(--py, 0) * -10px); transition: translate .6s ease-out;
             background: var(--far-photo) var(--photo-pos, center) / cover no-repeat, var(--photo-tint, var(--bg));
             background-blend-mode: luminosity;
             opacity: var(--far-opacity); filter: var(--far-filter) blur(var(--far-blur)); }
.far::after { content: ""; position: absolute; inset: 0;
              background: radial-gradient(120% 85% at 50% 32%, transparent 45%, var(--far-edge) 100%); }

/* ---- Stage: everything that floats ---- */
.stage { position: relative; z-index: 1; padding: 12px 12px 28px; }
.deck { display: grid; gap: 14px; max-width: 600px; margin: 14px auto 0; }
.flow { display: grid; gap: 14px; min-width: 0; }

/* The calculator's brand is h1.brand; the written pages' a.brand keeps its own rules. */
/* ---- Top bar: brand, metal, theme. A slim floating slug; it scrolls away (only the coin strip is pinned). ---- */
.bar { display: flex; align-items: center; gap: 8px; max-width: 600px; margin: 0 auto; padding: 6px 6px 6px 14px; min-height: 52px;
       border-radius: var(--r-bar); background: var(--glass-lo); box-shadow: var(--rim), var(--e1); }
h1.brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
         font: var(--title-weight) 19px/1.15 var(--display); letter-spacing: var(--title-track); color: var(--title-ink); }
h1.brand .mark { flex: none; width: 22px; height: 22px; background: var(--mark) center / contain no-repeat; }
:root[data-theme=muthu] h1.brand { text-transform: uppercase; font-size: 15px; }
:root[data-theme=kalyanam] h1.brand { font-size: 23px; }
.bar .seg { flex: none; padding: 2px; gap: 2px; background: var(--surface-2); border-color: var(--line-strong); }
.bar .seg label { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 5px 12px; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
/* Metal switch: the chosen side is filled in the metal's own colour, the strongest "you are here" on the page */
.bar .seg.metals input:checked + label { background: var(--metal); color: var(--metal-ink); }
.themebtn { flex: none; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }
.themebtn .tn { font-weight: 700; }
/* Phones: the swatch alone; the theme's name stays for screen readers */
@media (max-width: 639.98px) { .themebtn { padding: 6px 10px; gap: 0; }
  .themebtn .tn { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
@media (max-width: 419.98px) { .bar { padding-left: 12px; } .bar .seg label { padding: 5px 9px; } }

/* ---- Today's rates: three slim floating cards under the bar, visible on arrival ---- */
section.ratestrip { max-width: 600px; margin: 12px auto 0; }      /* "section." so it outranks the older rule for the rates section */
.ratestrip .ratecards { gap: 8px; }
.ratestrip .rate { min-width: 0; padding: 8px 10px 9px; overflow: hidden; border: 0; border-radius: var(--r-chip); background: var(--glass-lo); box-shadow: var(--rim), var(--e1); }
:root .ratestrip .rate { box-shadow: var(--rim), var(--e1); }      /* outranks the three newest themes' card shadow */
.ratestrip .rate .k { gap: 5px; min-height: 16px; font-size: 11.5px; line-height: 16px; white-space: nowrap; }
.ratestrip .rate .r { gap: 1px 6px; margin-top: 1px; }
.ratestrip .rate .v { font-size: 15px; line-height: 22px; }
.ratestrip .rate .v.none { font-size: 12.5px; }
.ratestrip .rate .note { font-size: 10.5px; line-height: 14px; }
.ratestrip .rate .note.est, .ratestrip .rate .note.own { padding: 0 6px; font-size: 10px; line-height: 15px; }
/* Phones: the flag says the country and "/g" moves up into the label, so each figure fits its card */
.ratestrip .coin, .ratestrip .rate .v .u { display: none; }
/* the country's name and the long label stay for screen readers */
.ratestrip .c, .ratestrip .long { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 359.98px) { .ratestrip .ratecards { gap: 6px; } .ratestrip .rate { padding: 7px 7px 8px; } .ratestrip .rate .v { font-size: 13px; letter-spacing: -.02em; } .ratestrip .rate .k { font-size: 11px; gap: 4px; } }
@media (min-width: 640px) {
  .ratestrip .ratecards { gap: 12px; }
  .ratestrip .rate { padding: 11px 16px 12px; }
  .ratestrip .rate .k { font-size: 12.5px; line-height: 18px; gap: 6px; }
  .ratestrip .rate .v { font-size: 20px; line-height: 26px; }
  .ratestrip .rate .v .u { display: inline; font-size: 13px; }
  .ratestrip .rate .note { font-size: 12px; line-height: 18px; }
  .ratestrip .rate .note.est, .ratestrip .rate .note.own { padding: 0 8px; font-size: 11px; line-height: 18px; }
  .ratestrip .coin { display: block; } .ratestrip .c, .ratestrip .long { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; } .ratestrip .short, .ratestrip .pg { display: none; }
}

/* ---- Cards ------------------------------------------------------------------------ */
.card { position: relative; min-width: 0; padding: 16px; border-radius: var(--r-card); background: var(--glass); box-shadow: var(--rim), var(--e2); }
/* Kalyanam keeps its invitation-card rule just inside the edge */
:root[data-theme=kalyanam] .card:not(.compare) { box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--frame), var(--e2); }
.card h2, .sheethead h2 { margin: 0; font-family: var(--display); font-size: var(--tile-size); font-weight: var(--tile-weight); letter-spacing: var(--tile-track);
                          text-transform: var(--tile-case); line-height: 1.25; color: var(--ink); }
:root[data-theme=kalyanam] :is(.card h2, .sheethead h2) { font-variant-numeric: lining-nums; }
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
/* Phones: the two themes with the largest headings come down a little, so the question stays on one line */
@media (max-width: 479.98px) { .card h2, .sheethead h2 { font-size: min(var(--tile-size), 19.5px); } }
:root .quiet { flex: none; min-height: 32px; padding: 4px 10px; font-size: 12.5px; color: var(--ink-2); background: none; border-color: var(--line-strong); }
/* The theme's one band of pattern runs along the top of the first card */
.motif { height: var(--band-h); margin: -2px 0 12px; opacity: var(--band-opacity); background: var(--band) 0 0 / var(--band-size) repeat-x; }
:root[data-metal=silver] .motif { filter: grayscale(1); }

/* ---- 1. The quote ------------------------------------------------------------------ */
.picks { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-bottom: 14px; }
.pick { min-width: 0; }
.pick.grow { flex: 1 1 150px; }
.pick .label, .a-bill .k { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pick .label { margin-bottom: 5px; }
.pick .seg label { min-height: 38px; display: flex; align-items: center; justify-content: center; padding: 6px 12px; }
.seg.where label .flag { margin-right: 6px; }
/* Small phones: tighter options, so country and purity still share one line at 360px */
@media (max-width: 389.98px) {
  .picks { gap: 10px 8px; }
  .pick.grow { flex: 1 1 128px; }
  .pick .seg label { padding: 6px 7px; font-size: 14px; }
  .seg.where label .flag { margin-right: 4px; }
}
.ratefield label, .fields.main label { font-size: 13px; }
.field.big { min-height: 52px; }
.field.big input { padding-left: 14px; font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
/* The grey estimate is a figure people read, so it gets the full caption colour (AA), not the faded placeholder */
.field.big input::placeholder { font-weight: 500; opacity: 1; }
.field.big .u:first-child { padding-left: 14px; font-size: 17px; }
/* The next thing to type: a ring in the accent, so a first-time visitor knows where to start */
.field.next { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent); }
.ratenote { display: flex; align-items: flex-start; gap: 8px; margin: 7px 0 14px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.note.est, .note.own { flex: none; padding: 0 8px; font-size: 11px; font-weight: 700; line-height: 18px; letter-spacing: .04em; white-space: nowrap;
                       color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 99px; }
.note.own { color: var(--accent-ink); background: var(--tint); border-color: color-mix(in srgb, var(--accent-ink) 35%, transparent); }
.fields.main { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; }
@media (max-width: 379.98px) { .fields.main label { font-size: 12.5px; letter-spacing: -.005em; } }

/* More in the quote: three small buttons, each opening its boxes. Filled, a button says what it adds or takes off. */
.adds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
:root .addbtn { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 5px 11px 5px 8px; font-size: 13px; font-weight: 650; white-space: nowrap;
                color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); font-variant-numeric: tabular-nums; }
.addbtn.has { background: var(--tint); border-color: color-mix(in srgb, var(--accent-ink) 40%, transparent); }
.addbtn[aria-expanded=true] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plus { flex: none; position: relative; width: 14px; height: 14px; }
.plus::before, .plus::after { content: ""; position: absolute; left: 2px; right: 2px; top: 6.25px; height: 1.5px; background: var(--ink-2); }
.plus::after { transform: rotate(90deg); }
.addbtn[aria-expanded=true] .plus::after { display: none; }
.addpanel { margin-top: 10px; padding: 12px; border-radius: var(--radius-s); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.addpanel h3 { margin: 0 0 10px; }
.addpanel .field select { border-left: 1px solid var(--line-strong); }
.addpanel .xhead { margin: 12px 0 0; }
.addpanel .hint { margin-top: 10px; }
.xrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 124px); gap: 8px; margin-top: 6px; }
.xl { min-width: 0; min-height: 40px; padding: 8px 12px; font: inherit; font-size: 16px; color: var(--ink); background: var(--field); border: 1px solid var(--field-line); border-radius: var(--radius-s); }
.xl::placeholder { color: var(--muted); opacity: 1; }
.xl:focus { outline: 0; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 24%, transparent); }
:root :is(#addExtra, [id$="-addExtra"]) { margin-top: 10px; }
.adds + .addpanel, .addpanel + .addpanel { margin-top: 10px; }
.addpanel:not([hidden]) ~ .taxline, .adds ~ .taxline { margin-top: 12px; }
.taxline { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 46px; padding: 0; text-align: left;
           font-size: 13.5px; font-weight: 400; color: var(--ink); background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.taxline:hover { background: none; }
.taxline .k { margin-right: 8px; font-weight: 650; }
.taxline .go { flex: none; font-weight: 650; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---- 2. The answer: nearest plane ------------------------------------------------- */
.answer { z-index: 2; padding: 18px 16px 16px; background: var(--glass-hi); box-shadow: var(--rim), var(--e3); }
:root[data-theme=kalyanam] .answer { box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--frame), var(--e3); }
.answer[data-state=ready] .a-empty, .answer:not([data-state=ready]) .a-ready { display: none; }

/* Before there is an answer: words, and a faint drawing of what will come */
.a-empty { padding: 6px 6px 4px; text-align: center; }
.a-empty .steps { display: flex; gap: 3px; width: min(220px, 70%); height: 10px; margin: 4px auto 16px; }
.a-empty .steps i { border-radius: 99px; background: var(--line-strong); }
.a-empty .steps i:nth-child(1) { flex: 7; } .a-empty .steps i:nth-child(2) { flex: 2; background: color-mix(in srgb, var(--accent) 45%, var(--surface)); } .a-empty .steps i:nth-child(3) { flex: 1; }
.a-empty .big { margin: 0; font: var(--tile-weight) 21px/1.25 var(--display); color: var(--ink); }
.a-empty p { margin: 0 auto; max-width: 34em; font-size: 14px; color: var(--ink-2); }
.ghost { margin-top: 14px; min-height: 40px; padding: 8px 18px; color: var(--accent-ink); background: none; border-color: color-mix(in srgb, var(--accent-ink) 50%, transparent); }

.a-bill .k { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-height: 20px; }
.a-bill .k .flag { width: 22px; height: 15px; margin: 0; }
.a-bill .k .note { text-transform: none; }
.a-bill .v { margin-top: 3px; line-height: 1.05; font-weight: 750; letter-spacing: -.028em; font-variant-numeric: tabular-nums;
             color: var(--ink); overflow-wrap: anywhere; }
.a-bill .s { margin-top: 3px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* The bill as one bar. The metal itself in the metal's colour; one box drawn round everything that is not the metal.
   The box is the over-gold figure, and its label says so. */
.splitbar { display: flex; align-items: center; gap: 3px; margin: 2px 0 0; }
.splitbar i { flex: 0 1 0; min-width: 0; height: 16px; }
.splitbar .g { min-width: 16px; border-radius: 99px 3px 3px 99px; background: linear-gradient(180deg, color-mix(in srgb, var(--metal) 72%, #fff), var(--metal) 60%);
               box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--metal-ink) 55%, transparent); }
.splitbar .rest { flex: 0 1 0; min-width: 22px; display: flex; gap: 2px; padding: 3px; border: 2px solid var(--accent-ink); border-radius: 7px; }
.splitbar .rest i { height: 14px; border-radius: 2px; }
.splitbar .w { background: var(--accent); }
/* The end of the charges that the ask would take off: hatched, still there, about to go */
.splitbar .cut { background: repeating-linear-gradient(-45deg, var(--accent) 0 2px, color-mix(in srgb, var(--accent) 16%, var(--surface)) 2px 5px); }
.splitbar .w:not([hidden]) + .cut { margin-left: -2px; }
.splitbar .st { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.splitbar .tx { background: var(--ink-2); }
/* The label stands on the box's right-hand end, where the box always is, however small or large it gets */
.boxlabel { position: relative; margin: 0; padding: 0 9px 5px 0; text-align: right; font-size: 13.5px; line-height: 1.35; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.boxlabel::before { content: ""; position: absolute; bottom: 0; right: 10px; width: 2px; height: 5px; background: var(--accent-ink); }
.boxlabel b { font-size: 17px; font-weight: 750; letter-spacing: -.01em; }
/* The answer is three rows: the quote, the controls, the result. Rows 1 and 3 are the same layout.
   A hairline rail down the left, with a small node at each row, ties them into one flow: quote, then ask, then result.
   It is the one connecting device between rows (there is no divider); it is drawn with pseudo-elements, so screen readers never meet it. */
.a-ready { --rail: color-mix(in srgb, var(--accent-ink) 45%, var(--surface)); position: relative; padding-left: 15px; }
.a-row { position: relative; }
.a-row + .a-row { margin-top: 16px; }
/* node: a 7px ring at the head of each row; the last one, the result, is filled */
.a-row::before { content: ""; position: absolute; left: -15px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--rail); }
.a-row.ctl::before { top: 10px; }
.a-row.result::before { background: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent-ink); }
.a-row.result[data-on="0"]::before { background: var(--surface); box-shadow: 0 0 0 1px var(--rail); }      /* nothing asked off: a hollow last node */
/* line: from this row's node to the next row's */
.a-row:not(.result)::after { content: ""; position: absolute; left: -12px; top: 14px; width: 1px; height: calc(100% + 8px); background: var(--rail); }
.a-row.ctl::after { top: 18px; height: calc(100% + 4px); }
.a-row.ctl:has(+ .result[data-on="none"])::after { display: none; }
/* Row 3: the new bill is the figure to watch */
.a-row.result .a-bill .k { color: var(--accent-ink); }
.a-row.result .a-bill .v { color: var(--accent-ink); }
.a-row.result .a-bill .s { font-weight: 650; color: var(--good); }
.a-row.result .invite { display: none; margin: 0; font-size: 14px; color: var(--ink-2); }
/* Nothing asked off: row 3 is one quiet line */
.a-row.result[data-on="0"] > :not(.invite) { display: none; }
.a-row.result[data-on="0"] .invite { display: block; }
.a-row.result[data-on="none"] { display: none; }

/* The break-up as a table: a name column and an amount column. Figures never wrap; names may. */
table.legend { width: 100%; margin-top: 10px; border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 1.3; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.legend th, .legend td { padding: 2px 0 2px 10px; border: 0; text-align: right; vertical-align: baseline; font-size: inherit; font-weight: 400; letter-spacing: 0; text-transform: none; color: inherit; white-space: nowrap; }
.legend th[scope=row] { width: 100%; padding-left: 0; text-align: left; white-space: normal; }
.legend .nm { display: flex; align-items: baseline; gap: 8px; }
.legend i { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.legend td { font-weight: 650; color: var(--ink); }
/* Each line's share of the metal's value, in a column of its own, so the amounts still line up on the right */
.legend td.pc { padding-left: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
/* Row 3: what changed is in the accent and bold; what did not is the same figure, quiet */
.legend td.chg { font-weight: 750; color: var(--accent-ink); }
.legend td.pc.chg { font-weight: 650; }
.legend td.same { font-weight: 400; color: var(--muted); }
/* the tax amount follows the ask by a little: shown plainly, not as a headline change */
.legend td.lite { font-weight: 500; color: var(--ink-2); }
.legend .g i { background: var(--metal); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--metal-ink) 55%, transparent); }
.legend .w i { background: var(--accent); }
.legend .st i { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.legend .tx i { background: var(--ink-2); }
.legend .less i { height: 2px; border-radius: 1px; background: var(--good); align-self: center; }
.legend .less td { color: var(--good); }
.legend .sum th, .legend .eq th { color: var(--ink); }
/* The metal's line stands outside the box and lines up with the rows inside it */
.legend tr > :first-child { padding-left: 11px; }
.legend tr > :last-child { padding-right: 11px; }
.legend tbody:first-of-type tr > * { padding-bottom: 5px; }
/* The boxed items sit in a box of their own, drawn like the one on the bar */
.legend .boxed tr:first-child > * { padding-top: 5px; border-top: 2px solid var(--accent-ink); }
.legend .boxed tr:last-child > * { padding-bottom: 5px; border-bottom: 2px solid var(--accent-ink); }
.legend .boxed tr > :first-child { padding-left: 9px; border-left: 2px solid var(--accent-ink); }
.legend .boxed tr > :last-child { padding-right: 9px; border-right: 2px solid var(--accent-ink); }
.legend .boxed tr:first-child > :first-child { border-top-left-radius: 7px; }
.legend .boxed tr:last-child > :first-child { border-bottom-left-radius: 7px; }
.legend .boxed tr:first-child > :last-child { border-top-right-radius: 7px; }
.legend .boxed tr:last-child > :last-child { border-bottom-right-radius: 7px; }
.legend .boxed .eq > *, .legend .boxed .sum > *, .legend .boxed .eq + tr > * { padding-top: 4px; box-shadow: inset 0 1px 0 var(--line-strong); }
.legend .boxed tr:first-child.eq > *, .legend .boxed tr:first-child.sum > * { box-shadow: none; }
@media (max-width: 359.98px) { .legend th, .legend td { padding-left: 7px; } .legend .nm { gap: 6px; } }

/* "Ask for": the charges part of the bar, drawn large enough to drag. A light card that belongs with the rows above and below it:
   the answer's own surface with a breath of the accent, a thin accent outline, dark text. It reads as the place to act by its position,
   the funnel from the bar, and the slider; the accent itself is kept for small things (the coin's track, the hatch, the changed figures in row 3). */
.a-ask { margin-top: 0; }
.askcard, .funnel { --ask-ground: color-mix(in srgb, var(--accent) 6%, var(--surface)); --ask-line: color-mix(in srgb, var(--accent-ink) 50%, var(--surface));
                    --ask-edge: color-mix(in srgb, var(--field-line) 70%, var(--ink)); }
/* The funnel's top corners are set by the script to the ends of the charges segment in the bar above */
.funnel { height: 13px; margin: 2px 0 0; background: color-mix(in srgb, var(--accent-ink) 22%, var(--surface)); clip-path: polygon(var(--fl, 70%) 0, var(--fr, 90%) 0, 100% 100%, 0 100%); }
.a-ask[data-kind=none] .funnel { display: none; }
.askcard { min-width: 0; margin: 0; padding: 4px 13px 9px; border-radius: 0 0 var(--r-slug) var(--r-slug); color: var(--ink);
           background: var(--ask-ground); border: 1.5px solid var(--ask-line); border-top-width: 0;
           box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--sh) 30%, transparent); }
.askcard .k { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.figs { display: flex; align-items: flex-start; gap: 8px; margin-top: 3px; }
.askcard label.figcol { flex: 0 1 auto; min-width: 0; margin: 0; display: grid; align-content: start; justify-items: start; gap: 2px; color: inherit; cursor: text; }
.askcard label.figcol.end { flex: 1 1 auto; justify-items: stretch; }
.figcol small { font-size: 11.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.figcol.end small { text-align: right; }
.figs .or { align-self: flex-start; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
/* Each ask number is a text box like the quote card's fields: the field colour, a visible edge, ink figures, its % or currency sign inside */
.askcard .fig { display: flex; align-items: center; gap: 3px; min-width: 76px; height: 38px; padding: 0 10px; color: var(--ink);
                background: var(--field); border: 1px solid var(--ask-edge); border-radius: var(--radius-s); transition: border-color .15s, box-shadow .15s; }
.askcard .figcol.end .fig { justify-content: flex-end; }
.askcard .fig:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 24%, transparent); }
.askcard .u { flex: none; font-size: 17px; font-weight: 650; color: var(--ink-2); }
.askcard .fig input { flex: 0 1 auto; width: 3ch; min-width: 1.5ch; max-width: 100%; padding: 0; font: 800 24px/1.15 var(--font); letter-spacing: -.02em;
                      font-variant-numeric: tabular-nums; color: var(--ink); background: none; border: 0; border-radius: 0; outline: 0; }
.askcard .fig input.long { font-size: 21px; }
/* The slider: the whole track is the shop's charges as quoted. Filled up to the coin is what stays; hatched beyond it is what the ask takes off,
   the same fill and hatch as in the bar above. A 44px-tall strip takes the thumb; the page still scrolls up and down through it. */
.askcard input[type=range] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 44px; margin: 0; padding: 0; background: none; border: 0; cursor: grab; touch-action: pan-y; }
.askcard input[type=range]::-webkit-slider-runnable-track { height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--accent);
  background: linear-gradient(90deg, var(--accent) var(--p, 75%), transparent var(--p, 75%)),
              repeating-linear-gradient(-45deg, var(--accent) 0 2px, color-mix(in srgb, var(--accent) 12%, var(--field)) 2px 5px); }
.askcard input[type=range]::-moz-range-track { height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--accent);
  background: linear-gradient(90deg, var(--accent) var(--p, 75%), transparent var(--p, 75%)),
              repeating-linear-gradient(-45deg, var(--accent) 0 2px, color-mix(in srgb, var(--accent) 12%, var(--field)) 2px 5px); }
/* The handle is a coin in the metal's colour */
.askcard input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; margin-top: -10px; border-radius: 50%; border: 2px solid #fff;
  background: radial-gradient(circle, transparent 0 46%, color-mix(in srgb, var(--metal-ink) 40%, transparent) 47% 52%, transparent 53%),
              radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--metal) 45%, #fff), var(--metal) 70%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--metal-ink) 55%, transparent), 0 3px 7px rgba(0, 0, 0, .3); }
.askcard input[type=range]::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--metal) 45%, #fff), var(--metal) 70%); box-shadow: 0 0 0 1px color-mix(in srgb, var(--metal-ink) 55%, transparent), 0 3px 7px rgba(0, 0, 0, .3); }
.askcard input[type=range]:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-radius: 6px; }
/* − and + for each number, under its own side, and the way back to the quote between them: quiet outlined 44px circles */
.steprow { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; }
.steprow .pair { display: flex; gap: 10px; }
:root .step { flex: none; width: 44px; height: 44px; min-height: 0; padding: 0 0 2px; font-size: 24px; font-weight: 400; line-height: 1; border-radius: 50%;
              color: var(--ink); background: var(--field); border: 1px solid var(--ask-edge); }
:root .step:hover { background: var(--surface-2); border-color: var(--ink); }
.step:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
:root .step.reset { font-size: 20px; padding: 0; border-style: dashed; color: var(--ink-2); }
:root .step.reset:disabled { opacity: .45; cursor: default; }
/* 320px phones: the answer and the card give back a few pixels each so five 44px buttons still stand apart (the reset is 40px there) */
@media (max-width: 359.98px) { .answer { padding-left: 12px; padding-right: 12px; } .a-ready { padding-left: 13px; } .a-row::before { left: -13px; } .a-row:not(.result)::after { left: -10px; }
  .askcard { padding: 4px 8px 9px; } .askcard .fig { padding: 0 8px; min-width: 68px; } .askcard .fig input { font-size: 22px; } .askcard .fig input.long { font-size: 19px; }
  .figs .or { display: none; } .steprow .pair { gap: 4px; } :root .step.reset { width: 40px; height: 40px; } }

/* One quiet line when there is nothing to bargain on */
.askmsg:empty { display: none; }
/* No wastage typed yet: the cards and the coin wait; one quiet line says what to do */
.a-ask[data-kind=none] .askcard { display: none; }
.askmsg { margin: 7px 0 0; padding: 12px 14px; font-size: 14px; color: var(--ink-2); border-radius: var(--r-slug); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* The chips are painted above the answer's long shadow, which would otherwise grey the words under it */
.more { position: relative; z-index: 3; }

/* ---- 3. More: four chips ------------------------------------------------------------ */
.more { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip { display: grid; align-content: center; gap: 1px; min-width: 0; min-height: 58px; padding: 9px 14px; text-align: left; font-weight: 400;
        border: 0; background: var(--glass-lo); box-shadow: var(--rim), var(--e1); border-radius: var(--r-chip); }
.chip b { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.chip:hover { background: var(--glass); }
.chip[aria-expanded=true] { background: var(--surface); box-shadow: inset 0 -3px 0 var(--accent), var(--rim), var(--e1); }
@media (hover: hover) {
  .chip { transition: transform .16s ease-out, box-shadow .16s ease-out, background .16s; }
  .chip:hover { transform: translateY(-2px); box-shadow: var(--rim), var(--e2); }
  .chip[aria-expanded=true]:hover { box-shadow: inset 0 -3px 0 var(--accent), var(--rim), var(--e2); }
}

/* ---- Details: a card in the page on a laptop, a sheet from the bottom on a phone ----- */
.sheet { display: none; outline: 0; }
.sheet.on { display: block; }
:is(#detailHost, [id$="-detailHost"]):empty { display: none; }
:is(#detailHost, [id$="-detailHost"]) .sheet.on { border-radius: var(--r-card); background: var(--glass); box-shadow: var(--rim), var(--e2); }
:root[data-theme=kalyanam] :is(#detailHost, [id$="-detailHost"]) .sheet.on { box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--frame), var(--e2); }
.sheethead { display: flex; align-items: center; gap: 12px; padding: 16px 18px 6px; }
.sheethead h2 { min-width: 0; }
.sheetbody { container: app / inline-size; padding: 10px 18px 20px; }
.sheetbody .lede { margin-bottom: 12px; }
.sheetbody .status { margin-bottom: 12px; justify-content: space-between; }
.sheetbody :is(#slotOther, [id$="-slotOther"]) { margin: 0 0 4px; }
.sheetbody .how { margin-top: 14px; }
.sheetbody .how > summary { min-height: 40px; }
.sheetbody .asks { margin: 0 0 16px; }
/* Narrower than any current phone: the bill's first column may break mid-word so the two money columns always fit */
@container app (max-width: 330px) {
  .bill { font-size: 13px; }
  .bill td:first-child { overflow-wrap: anywhere; }
  .bill tr.grand td { font-size: 15px; }
  .bill th, .bill td { padding-left: 6px; }
}
.printrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 16px 0 0; }
.printrow .hint { margin: 0; }
/* An explanation that waits to be asked for */
.what { margin-top: 10px; font-size: 12.5px; }
.what > summary { display: inline-flex; min-height: 32px; padding: 0; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border: 0 !important; text-decoration: underline; text-underline-offset: 2px; }
.what > summary::after { margin-top: -3px; }
.what .hint { margin-top: 4px; }
/* Theme choices: every theme with its swatch, two to a row */
.seg.themes { grid-auto-flow: row; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0; background: none; border: 0; }
.seg.themes label { display: flex; align-items: center; justify-content: flex-start; gap: 9px; min-height: 44px; padding: 8px 12px; font-size: 14px;
                    border: 1px solid var(--line-strong); background: var(--field); }

/* ---- The floating answer: hangs under the coin strip when the answer itself is out of sight ---- */
.pill { position: fixed; z-index: 55; top: calc(var(--strip-h) + 8px + var(--vv-top, 0px)); left: 50%; display: flex; align-items: stretch; max-width: calc(100vw - 24px);
        min-height: 50px; padding: 0; overflow: hidden; text-align: left; color: var(--ink); border: 0; border-radius: 99px;
        background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6);
        box-shadow: var(--rim), var(--e3); transform: translate(-50%, -170%); opacity: 0; transition: transform .28s var(--ease-sheet), opacity .2s; }
:root:is([data-theme=mandapam], [data-theme=muthu], [data-theme=temple]) .pill { border-radius: var(--radius); }
.pill.show { transform: translate(-50%, 0); opacity: 1; }
.pill:hover { background: color-mix(in srgb, var(--surface) 96%, transparent); }
.pill > span { display: grid; align-content: center; padding: 6px 20px; white-space: nowrap; }
/* When something is asked off the pill carries the bill at the ask: the same light pill, the figure in the accent like row 3's */
.pill.ask b, .pill.ask small { color: var(--accent-ink); }
.pill small { font-size: 10.5px; font-weight: 700; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pill b { font-size: 17px; font-weight: 750; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pill .pa { padding: 6px 20px 6px 16px; color: var(--on-accent); background: linear-gradient(180deg, var(--accent), var(--accent-hover)); }
.pill .pa small { color: inherit; }

/* ---- The advertisement, the footer plate --------------------------------- */
.adslot, .plate { max-width: 600px; margin-left: auto; margin-right: auto; }
/* Reserved height, so the page does not jump when the advertisement arrives (the slot stays hidden until there is ad code) */
.adslot { display: grid; place-items: center; min-height: 280px; margin-top: 40px; margin-bottom: 40px; border-radius: var(--r-chip);
          font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
          background: var(--glass-lo); }
.plate { margin-top: 28px; padding: 16px 16px 14px; border-radius: var(--r-card); background: var(--glass); box-shadow: var(--rim), var(--e1); }
:root .plate .sitelinks { padding: 0 0 12px; border: 0; background: none; }
:root .plate .credit { padding: 12px 0 0; border-top: 1px solid var(--line); background: none; }
.plate .sitelinks a { padding: 4px 0; }

/* A wide answer card (a laptop). The three rows stay stacked. In rows 1 and 3 the bill sits beside its list, the same way in both.
   The control row runs the full width: the slider across the top, and under it, on one line, the title, each number with its own − / +, and ↺. */
.answer { container: ans / inline-size; }
@container ans (min-width: 660px) {
  .a-row:not(.ctl) { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); gap: 0 32px; align-items: start; }
  .a-row:not(.ctl) table.legend { margin-top: 0; }
  .a-row.result[data-on="0"] { display: block; }
  .a-row + .a-row { margin-top: 20px; }
  .a-row:not(.result)::after { height: calc(100% + 12px); }
  .a-row.ctl::after { height: calc(100% + 8px); }
  .askcard { display: grid; grid-template: "sl sl sl sl sl" auto "ti pp fg op rs" auto / auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 0 12px; padding: 6px 20px 14px; }
  .askcard input[type=range] { grid-area: sl; }
  .askcard .k { grid-area: ti; }
  .askcard .figs { grid-area: fg; justify-content: center; gap: 10px; margin-top: 0; }
  .askcard label.figcol, .askcard label.figcol.end { flex: 0 0 auto; }
  .askcard .fig { height: 44px; min-width: 96px; }
  .askcard .fig input { flex: none; }
  .figs .or { margin-top: 13px; }
  .steprow .pair { gap: 8px; }
  .steprow { display: contents; }
  .steprow .pair:first-child { grid-area: pp; }
  .steprow .pair:last-child { grid-area: op; }
  .steprow .reset { grid-area: rs; }
}

/* ---- Laptop: the quote stays put on the left; the answer and the details run down the right ---- */
@media (min-width: 960px) {
  .stage { padding: 18px 24px 40px; }
  .bar, .ratestrip, .deck, .adslot, .plate { max-width: 1180px; }
  section.ratestrip { max-width: 1180px; margin-top: 16px; }
  .bar { padding: 8px 8px 8px 20px; }
  h1.brand { font-size: 23px; } h1.brand .mark { width: 26px; height: 26px; }
  :root[data-theme=muthu] h1.brand { font-size: 18px; }
  :root[data-theme=kalyanam] h1.brand { font-size: 28px; }
  .deck { grid-template-columns: minmax(360px, 420px) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 22px; }
  .flow { gap: 18px; }
  .card { padding: 22px; }
  .quote { position: sticky; top: calc(var(--strip-h) + 16px); }
  .answer { padding: 26px 26px 24px; }
  .askcard { padding: 8px 18px 16px; }
  .askcard .fig input { font-size: 26px; }
  .askcard .fig input.long { font-size: 23px; }
  .more { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .sheethead { padding: 20px 24px 6px; }
  .sheetbody { padding: 12px 24px 24px; }
  .adslot { max-width: 728px; }
}
/* A short laptop window cannot hold the whole quote card, so there it scrolls with the page instead of staying put */
@media (min-width: 960px) and (max-height: 699.98px) { .quote { position: static; } }
/* Phone and tablet: the answer overlaps the foot of the quote card, one plane above it */
@media (max-width: 959.98px) {
  .quote { padding-bottom: 30px; }
  .flow { margin-top: -30px; }
}

/* ---- Motion: things arrive from behind; the far photo falls away -------------------- */
@media (prefers-reduced-motion: no-preference) {
  .far-photo { animation: far-recede 1.3s var(--ease-out) both; }
  @keyframes far-recede { from { scale: 1.22; } }
  /* While the page scrolls the far photo drifts a twentieth as fast: far things barely move */
  @supports (animation-timeline: scroll()) {
    .far-photo { animation: far-recede 1.3s var(--ease-out) both, far-drift linear both; animation-timeline: auto, scroll(root block); }
    @keyframes far-drift { to { transform: translate3d(0, -5%, 0); } }
  }
  .rise { animation: rise .6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
  @keyframes rise { from { transform: translateY(28px) scale(.965); opacity: 0; } }
  /* The first card carries the page's first words, so it is never transparent */
  .bar.rise, .ratestrip.rise, .quote.rise { animation-name: rise-solid; }
  @keyframes rise-solid { from { transform: translateY(28px) scale(.965); } }
  :is(#detailHost, [id$="-detailHost"]) .sheet.on { animation: rise .42s var(--ease-out) both; }
  .answer.arrive { animation: arrive .5s cubic-bezier(.2, 1.3, .3, 1) both; }
  @keyframes arrive { from { transform: translateY(16px) scale(.97); box-shadow: var(--rim), var(--e1); } }
  .field.next { animation: nudge 1.8s ease-in-out 2 both; }
  @keyframes nudge { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .far-photo { translate: none; }
}

/* ---- Print: the full bill only, black on white --------------------------------------- */
@media print {
  .far, .bar, .ratestrip, .quote, .answer, .more, .adslot, .plate, .pill,
  .sheet:not(:is(#sheetBill, [id$="-sheetBill"])), .printrow { display: none !important; }
  html { overflow: visible !important; }
  .stage { padding: 0 !important; transform: none !important; }
  .deck, .flow { display: block !important; max-width: none !important; margin: 0 !important; }
  :is(#sheetBill, [id$="-sheetBill"]) { display: block !important; position: static !important; width: auto !important; max-height: none !important; transform: none !important; opacity: 1 !important;
               background: none !important; box-shadow: none !important; animation: none !important; }
  :is(#sheetBill, [id$="-sheetBill"]) .sheethead { padding: 0 0 8px; }
  :is(#sheetBill, [id$="-sheetBill"]) .sheethead::before { display: none; }
  :is(#sheetBill, [id$="-sheetBill"]) .sheetbody { padding: 0; overflow: visible !important; }
  /* A bill with separate charges and a discount has up to ten more lines: rows are set closer so it still fits one page */
  :is(#sheetBill, [id$="-sheetBill"]) .bill th, :is(#sheetBill, [id$="-sheetBill"]) .bill td { padding-top: 5px; padding-bottom: 5px; }
  :is(#sheetBill, [id$="-sheetBill"]) .totals > div { padding: 10px 14px; }
  :is(#sheetBill, [id$="-sheetBill"]) .totals .v { font-size: 26px; margin-top: 4px; }
  :is(#sheetBill, [id$="-sheetBill"]) .totals .o { margin-top: 8px; padding-top: 6px; }
  :is(#sheetBill, [id$="-sheetBill"]) .verdict { margin-top: 10px; padding-top: 10px; }
}

/* ==== REV5 START: slim controls (calculator only) ===============================
   Controls in the manner of current phone and desktop system controls: light, thin, precise.
   Every rule starts with ":root body:not(.doc)", so the written pages (body.doc) are untouched.
   Nothing here changes a theme's colours, corners, fonts or motif: heights, strokes, fills and
   weights only. Where a control is drawn slimmer than 44px, an invisible ::after (or a transparent
   border) keeps the place a thumb can hit at 44px. To undo: delete from REV5 START to REV5 END. */

/* ---- Tokens ---- */
:root body:not(.doc) {
  --c-fill: color-mix(in srgb, var(--ink) 6%, transparent);      /* quiet fill: tracks, capsule buttons, inset panels */
  --c-fill-2: color-mix(in srgb, var(--ink) 11%, transparent);   /* the same, under the pointer */
  --c-hair: color-mix(in srgb, var(--ink) 20%, transparent);     /* hairlines inside a control */
  --c-r: min(var(--radius-s), 10px);                             /* control corners: the theme's own, never rounder than 10px */
  --c-knob: 0 0 0 .5px rgba(0, 0, 0, .05), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px -1px rgba(0, 0, 0, .12);   /* a raised white part */
}

/* ---- Type: lighter weights; tabular figures stay as they are ---- */
:root body:not(.doc) :is(label, .label) { font-weight: 500; }
:root body:not(.doc) :is(.pick .label, .a-bill .k, .askcard .k) { font-size: 12px; font-weight: 600; letter-spacing: .05em; }
:root body:not(.doc) .a-bill .v { font-weight: 600; letter-spacing: -.03em; }
:root body:not(.doc) .a-row.result .a-bill .s { font-weight: 500; }
:root body:not(.doc) .rate .v { font-weight: 600; }
:root body:not(.doc) :is(.note.est, .note.own) { font-weight: 600; border: 0; background: var(--c-fill); }
:root body:not(.doc) .note.own { background: var(--tint); }
:root body:not(.doc) .chip b { font-size: 13px; font-weight: 600; }

/* ---- Text fields: 44px for the three main ones, 40px drawn inside a 44px hit area for the rest; one hairline ---- */
:root body:not(.doc) .field { min-height: 44px; border: 0 solid transparent; border-width: 2px 0; background-clip: padding-box; border-radius: var(--c-r);
           box-shadow: inset 0 0 0 1px var(--field-line); }
:root body:not(.doc) .field:hover { box-shadow: inset 0 0 0 1px var(--ink-2); }
:root body:not(.doc) .field:focus-within { box-shadow: inset 0 0 0 2px var(--focus); }
:root body:not(.doc) .field input { padding: 6px 12px; }
:root body:not(.doc) .field select { font-weight: 500;
                  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
:root body:not(.doc) .field.pick select { font-weight: 400; }
:root body:not(.doc) .field.big { min-height: 44px; border-width: 0; }
:root body:not(.doc) .field.big input { padding-left: 12px; font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
:root body:not(.doc) .field.big input::placeholder { font-weight: 400; }
:root body:not(.doc) .field.big .u:first-child { padding-left: 12px; font-size: 15px; }
:root body:not(.doc) .field.next { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
:root body:not(.doc) label:has(+ .field:not(.big)) { margin-bottom: 4px; }
:root body:not(.doc) .xrow { margin-top: 2px; }
:root body:not(.doc) .xl { min-height: 44px; padding: 6px 12px; border: 0 solid transparent; border-width: 2px 0; background-clip: padding-box; border-radius: var(--c-r);
        box-shadow: inset 0 0 0 1px var(--field-line); }
:root body:not(.doc) .xl:focus { box-shadow: inset 0 0 0 2px var(--focus); }
:root body:not(.doc) .addpanel { padding: 10px 12px 12px; border-radius: min(var(--radius-s), 12px); background: var(--c-fill); box-shadow: none; }
:root body:not(.doc) .addpanel .field select { border-left-color: var(--c-hair); }
:root body:not(.doc) .askmsg { background: var(--c-fill); box-shadow: none; }

/* ---- Segmented choices: a quiet track, the chosen one a raised white part with a hairline in the theme's accent ---- */
:root body:not(.doc) .seg { padding: 2px; gap: 0; background: var(--c-fill); border: 0; }
:root body:not(.doc) .seg label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 32px; padding: 4px 12px;
               font-size: 14px; font-weight: 500; color: var(--ink-2); background: none; }
:root body:not(.doc) .seg label::after { content: ""; position: absolute; inset: -6px 0; }
:root body:not(.doc) .seg label:hover { color: var(--ink); background: none; }
:root body:not(.doc) .seg input:checked + label { color: var(--ink); font-weight: 600; background: var(--field);
                               box-shadow: inset 0 0 0 1px var(--accent-ink), var(--c-knob); }
@media (max-width: 389.98px) { :root body:not(.doc) .pick .seg label { padding: 4px 7px; } }
/* top bar: metal switch and theme button */
:root body:not(.doc) .bar { min-height: 44px; padding: 4px 6px 4px 14px; }
:root body:not(.doc) .bar .seg { padding: 2px; gap: 0; background: var(--c-fill); }
:root body:not(.doc) .bar .seg label { min-height: 28px; padding: 3px 11px; font-size: 13px; font-weight: 500; letter-spacing: 0; }
:root body:not(.doc) .bar .seg label::after { inset: -8px 0; }
:root body:not(.doc) .bar .seg input:checked + label { font-weight: 600; }
/* the chosen metal keeps a wash of its own colour: still the "you are here" of the page */
:root body:not(.doc) .bar .seg.metals input:checked + label { color: var(--ink); background: color-mix(in srgb, var(--metal) 30%, var(--field));
                                            box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--metal-ink) 45%, var(--metal)), var(--c-knob); }
:root body:not(.doc) .themebtn { position: relative; min-height: 32px; padding: 4px 12px; gap: 7px; background: var(--c-fill); border: 0; }
:root body:not(.doc) .themebtn::after { content: ""; position: absolute; inset: -6px 0; }
:root body:not(.doc) .themebtn:hover { background: var(--c-fill-2); }
:root body:not(.doc) .themebtn .tn { font-weight: 500; }
@media (max-width: 639.98px) { :root body:not(.doc) .themebtn { padding: 4px 12px; gap: 0; } }
@media (max-width: 419.98px) { :root body:not(.doc) .bar { padding-left: 12px; } :root body:not(.doc) .bar .seg label { padding: 3px 9px; } }
@media (min-width: 960px) { :root body:not(.doc) .bar { padding: 6px 8px 6px 20px; } }
/* theme picker: a list of quiet tiles; the chosen one is the raised white part */
:root body:not(.doc) .seg.themes { gap: 6px; padding: 0; background: none; }
:root body:not(.doc) .seg.themes label { justify-content: flex-start; min-height: 44px; padding: 8px 12px; gap: 9px; border: 0; background: var(--c-fill); }
:root body:not(.doc) .seg.themes label::after { content: none; }
:root body:not(.doc) .seg.themes label:hover { background: var(--c-fill-2); }
:root body:not(.doc) .seg.themes input:checked + label { background: var(--field); }

/* ---- Buttons: slim capsules on the quiet fill, no outline; 44px to the thumb ---- */
/* (:where keeps these general rules weak, so the particular ones below them win) */
:root body:not(.doc) :where(.quiet, .addbtn, .ghost, :is(#printBill, [id$="-printBill"]), :is(#refresh, [id$="-refresh"])) { position: relative; min-height: 30px; padding: 4px 13px; font-size: 13px; font-weight: 500; border: 0; }
:root body:not(.doc) :where(.quiet, .addbtn, .ghost, :is(#printBill, [id$="-printBill"]), :is(#refresh, [id$="-refresh"]))::after { content: ""; position: absolute; inset: -7px 0; }
:root body:not(.doc) :where(.quiet, .addbtn, :is(#printBill, [id$="-printBill"])) { color: var(--ink); background: var(--c-fill); }
:root body:not(.doc) :where(.quiet, .addbtn, :is(#printBill, [id$="-printBill"])):hover { background: var(--c-fill-2); }
:root body:not(.doc) :is(.quiet, .sheethead .close) { min-width: 44px; }
:root body:not(.doc) .ghost { min-height: 34px; padding: 6px 18px; color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 10%, transparent); }
:root body:not(.doc) .ghost::after { inset: -5px 0; }
:root body:not(.doc) .ghost:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
:root body:not(.doc) .adds { gap: 14px 6px; }
:root body:not(.doc) .addbtn { gap: 4px; padding: 4px 12px 4px 8px; }
:root body:not(.doc) .addbtn.has { background: var(--tint); }
:root body:not(.doc) .addbtn[aria-expanded=true] { box-shadow: inset 0 0 0 1px var(--accent-ink); }
:root body:not(.doc) .plus::before, :root body:not(.doc) .plus::after { top: 6.4px; height: 1.2px; background: var(--ink); }
/* a row that opens something: plain words and a small chevron, no underline */
:root body:not(.doc) .taxline { min-height: 44px; font-size: 13px; }
:root body:not(.doc) .taxline .go { font-weight: 500; text-decoration: none; }
:root body:not(.doc) .taxline .go::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 2px 0 5px; border: solid currentColor; border-width: 1.25px 1.25px 0 0; transform: rotate(45deg); vertical-align: 1px; }

/* ---- Chips: slimmer, a chevron in place of weight; open = a hairline in the accent ---- */
:root body:not(.doc) .chip { position: relative; min-height: 50px; padding: 7px 28px 7px 13px; }
:root body:not(.doc) .chip::after { content: ""; position: absolute; right: 14px; top: 50%; width: 6px; height: 6px; margin-top: -4px; border: solid var(--muted); border-width: 1.25px 1.25px 0 0; transform: rotate(45deg); }
:root body:not(.doc) .chip[aria-expanded=true] { box-shadow: inset 0 0 0 1px var(--accent-ink), var(--rim), var(--e1); }
:root body:not(.doc) .chip[aria-expanded=true]::after { margin-top: -5px; border-color: var(--accent-ink); transform: rotate(135deg); }
@media (max-width: 359.98px) { :root body:not(.doc) .chip { padding-right: 13px; } :root body:not(.doc) .chip::after { content: none; } }      /* no room for the chevron on the narrowest phones */

/* ---- The answer: thinner strokes on the bar, the boxed list and the rail ---- */
:root body:not(.doc) .splitbar i { height: 10px; }
:root body:not(.doc) .splitbar .rest { padding: 2px; border-width: 1px; border-radius: 5px; }
:root body:not(.doc) .splitbar .rest i { height: 8px; }
:root body:not(.doc) .legend td { font-weight: 500; }
:root body:not(.doc) .legend td.pc { font-weight: 400; }
:root body:not(.doc) .legend td.chg { font-weight: 600; }
:root body:not(.doc) .legend td.pc.chg { font-weight: 500; }
:root body:not(.doc) .legend td.same { font-weight: 400; }
:root body:not(.doc) .legend td.lite { font-weight: 400; }
:root body:not(.doc) .legend i { width: 7px; height: 7px; }
:root body:not(.doc) .legend .less i { height: 1.5px; }
:root body:not(.doc) .legend .boxed tr:first-child > * { border-top-width: 1px; }
:root body:not(.doc) .legend .boxed tr:last-child > * { border-bottom-width: 1px; }
:root body:not(.doc) .legend .boxed tr > :first-child { padding-left: 10px; border-left-width: 1px; }
:root body:not(.doc) .legend .boxed tr > :last-child { padding-right: 10px; border-right-width: 1px; }
:root body:not(.doc) .legend .boxed tr:first-child > :first-child { border-top-left-radius: 8px; }
:root body:not(.doc) .legend .boxed tr:last-child > :first-child { border-bottom-left-radius: 8px; }
:root body:not(.doc) .legend .boxed tr:first-child > :last-child { border-top-right-radius: 8px; }
:root body:not(.doc) .legend .boxed tr:last-child > :last-child { border-bottom-right-radius: 8px; }
:root body:not(.doc) :is(.legend .boxed .eq, .legend .boxed .sum, .legend .boxed .eq + tr) > * { box-shadow: inset 0 1px 0 var(--c-hair); }
:root body:not(.doc) .legend .boxed tr:first-child:is(.eq, .sum) > * { box-shadow: none; }
/* rail: 5px nodes on the same hairline */
:root body:not(.doc) .a-row::before { left: -14px; top: 7px; width: 5px; height: 5px; }
:root body:not(.doc) .a-row.ctl::before { top: 4.5px; }
:root body:not(.doc) .a-row:not(.result)::after { top: 13px; height: calc(100% + 7.5px); }
:root body:not(.doc) .a-row.ctl::after { top: 10.5px; height: calc(100% + 12.5px); }
@media (max-width: 359.98px) { :root body:not(.doc) .a-row::before { left: -12px; } }
@container ans (min-width: 660px) {
  :root body:not(.doc) .a-row + .a-row { margin-top: 24px; }
  :root body:not(.doc) .a-row:not(.result)::after { height: calc(100% + 15.5px); }
  :root body:not(.doc) .a-row.ctl::after { height: calc(100% + 20.5px); }
}

/* ---- "Ask for": thin slider, slim boxes, one joined stepper per number ---- */
/* The block is a plain slug: the card's own surface, a hairline all round, a soft shadow. A small notch on its top edge points up
   at the boxed part of the bar. The notch is drawn by the bar's box itself (a pseudo-element hanging under it), so it follows the
   box as the figures change, with no script. The old funnel element is now only the gap between the bar and the slug. */
/* The slug is a pane of frosted glass: a light translucent fill with a breath of the theme's accent, a sheen that is brightest at the top,
   a bright line on its top edge, and a soft layered shadow. Light, never a filled dark block. Where the browser cannot blur what is behind,
   the same look is painted as an opaque light fill (the first background below). The notch is filled with the colour of the pane's top edge,
   so there is no seam where they meet. */
:root body:not(.doc) .a-row.ctl { --ask-r: min(var(--r-slug), 10px);
               --ask-line: color-mix(in srgb, var(--accent-ink) 40%, var(--surface));
               --ask-tint: color-mix(in srgb, var(--accent) 16%, var(--surface));                                          /* the pane at its foot, were it solid */
               --ask-top: color-mix(in srgb, #fff 72%, color-mix(in srgb, var(--accent) 8%, var(--surface)));             /* the pane along its top edge; the notch is filled with it */
               /* the shine: an even sheen from the top, and a soft glow in the top left corner. The glow stays in the left 45%, the notch is
                  always in the right half (the bar's box is at the right-hand end), so the notch and the pane's top edge are one colour */
               --ask-sheen: radial-gradient(ellipse 45% 130% at 0 0, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 100%),
                            linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .1) 46%, rgba(255, 255, 255, 0) 80%); }
/* the bar stands 16px clear of the list above it and of the slug below it; the notch reaches halfway up to it */
:root body:not(.doc) .splitbar { margin-top: 0; }
:root body:not(.doc) .funnel { height: 16px; margin: 0; background: none; clip-path: none; }
:root body:not(.doc) .askcard { padding: 4px 12px 8px; border: 1px solid var(--ask-line); border-radius: var(--ask-r);
             background: var(--ask-sheen), var(--ask-tint);
             box-shadow: inset 0 1.5px 0 #fff, inset 0 0 0 1px rgba(255, 255, 255, .5), inset 0 -10px 14px -12px color-mix(in srgb, var(--accent) 34%, transparent),
                         0 1px 1px color-mix(in srgb, var(--sh) 7%, transparent), 0 4px 10px -4px color-mix(in srgb, var(--sh) 16%, transparent), 0 18px 32px -16px color-mix(in srgb, var(--sh) 38%, transparent); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root body:not(.doc) .askcard { background: var(--ask-sheen), color-mix(in srgb, var(--ask-tint) 50%, transparent);
               -webkit-backdrop-filter: blur(16px) saturate(1.8); backdrop-filter: blur(16px) saturate(1.8); }
}
:root body:not(.doc) .splitbar .rest { position: relative; }
:root body:not(.doc) .splitbar .rest::after { content: ""; position: absolute; z-index: 2; top: calc(100% + 10.5px); right: max(calc(50% - 6.5px), calc(var(--ask-r) + 2px)); width: 12px; height: 12px;
                           border: solid var(--ask-line); border-width: 1px 0 0 1px; border-top-left-radius: 2px; background: var(--ask-top);
                           box-shadow: inset 1.5px 1.5px 0 #fff; transform: rotate(45deg); pointer-events: none; }
:root body:not(.doc) .splitbar:has(+ .a-ask[data-kind=none]) .rest::after { content: none; }
:root body:not(.doc) .figs { margin-top: 4px; }
:root body:not(.doc) .figs .or { margin-top: 9px; font-weight: 500; }
:root body:not(.doc) .figcol small { font-size: 12px; font-weight: 500; }
:root body:not(.doc) .askcard label.figcol { gap: 4px; }
:root body:not(.doc) .askcard .fig { height: 36px; min-width: 72px; padding: 0 10px; border: 0; border-radius: var(--c-r); box-shadow: inset 0 0 0 1px var(--ask-edge); }
:root body:not(.doc) .askcard .fig:focus-within { box-shadow: inset 0 0 0 2px var(--focus); }
:root body:not(.doc) .askcard .u { font-size: 13px; font-weight: 500; }
:root body:not(.doc) .askcard .fig input { font: 600 17px/1.15 var(--font); letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
:root body:not(.doc) .askcard .fig input.long { font-size: 16px; }
/* the slider: a 6px track inside a 44px strip that only takes 28px of the card's height */
:root body:not(.doc) .askcard input[type=range] { position: relative; z-index: 1; height: 44px; margin: -7px 0 -9px; }
:root body:not(.doc) .askcard input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: min(var(--radius-s), 3px); box-shadow: none;
  background: linear-gradient(90deg, var(--accent) var(--p, 75%), transparent var(--p, 75%)),
              repeating-linear-gradient(-45deg, color-mix(in srgb, var(--accent) 62%, var(--field)) 0 1.5px, color-mix(in srgb, var(--accent) 14%, var(--field)) 1.5px 4px); }
:root body:not(.doc) .askcard input[type=range]::-moz-range-track { height: 6px; border-radius: min(var(--radius-s), 3px); box-shadow: none;
  background: linear-gradient(90deg, var(--accent) var(--p, 75%), transparent var(--p, 75%)),
              repeating-linear-gradient(-45deg, color-mix(in srgb, var(--accent) 62%, var(--field)) 0 1.5px, color-mix(in srgb, var(--accent) 14%, var(--field)) 1.5px 4px); }
/* the handle: still a coin (the page says "Slide the coin"), drawn small and pale: a white knob with a face and rim in the metal's colour */
:root body:not(.doc) .askcard input[type=range]::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -10px; border: 2px solid #fff;
  background: radial-gradient(circle, transparent 0 6.5px, color-mix(in srgb, var(--metal-ink) 30%, var(--metal)) 7px 7.6px, transparent 8.1px),
              radial-gradient(circle at 38% 30%, color-mix(in srgb, var(--metal) 30%, #fff), color-mix(in srgb, var(--metal) 88%, #fff) 80%);
  box-shadow: 0 0 0 .5px color-mix(in srgb, var(--metal-ink) 45%, transparent), 0 1px 2px rgba(0, 0, 0, .2), 0 3px 7px -1px rgba(0, 0, 0, .18); }
:root body:not(.doc) .askcard input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border: 2px solid #fff;
  background: radial-gradient(circle at 38% 30%, color-mix(in srgb, var(--metal) 30%, #fff), color-mix(in srgb, var(--metal) 88%, #fff) 80%);
  box-shadow: 0 0 0 .5px color-mix(in srgb, var(--metal-ink) 45%, transparent), 0 1px 2px rgba(0, 0, 0, .2), 0 3px 7px -1px rgba(0, 0, 0, .18); }
/* − and + joined into one stepper under each number; the way back is a bare glyph */
:root body:not(.doc) .steprow { margin-top: 8px; }
:root body:not(.doc) .steprow .pair { gap: 0; border-radius: var(--c-r); background: var(--c-fill); }
:root body:not(.doc) .step { position: relative; width: 44px; height: 30px; min-height: 0; padding: 0 0 1px; font-size: 17px; font-weight: 300; border: 0; border-radius: 0; background: none; color: var(--ink); }
:root body:not(.doc) .step::after { content: ""; position: absolute; inset: -7px 0; }
:root body:not(.doc) .step:hover { background: var(--c-fill-2); }
:root body:not(.doc) .pair .step:first-child { border-radius: var(--c-r) 0 0 var(--c-r); }
:root body:not(.doc) .pair .step:last-child { border-radius: 0 var(--c-r) var(--c-r) 0; }
:root body:not(.doc) .pair .step + .step::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 1px; background: var(--c-hair); }
:root body:not(.doc) .step.reset { width: 30px; height: 30px; padding: 0; font-size: 16px; border: 0; border-radius: 50%; color: var(--ink-2); background: none; }
:root body:not(.doc) .step.reset::after { inset: -7px; }
:root body:not(.doc) .step.reset:hover { background: var(--c-fill); }
:root body:not(.doc) .step.reset:disabled { opacity: .35; }
@media (max-width: 359.98px) {
  :root body:not(.doc) .askcard { padding: 4px 8px 8px; }
  :root body:not(.doc) .askcard .fig { min-width: 64px; padding: 0 8px; }
}
@container ans (min-width: 660px) {
  :root body:not(.doc) .askcard { padding: 8px 16px 12px; }
  :root body:not(.doc) .askcard .figs { margin-top: 0; }
  :root body:not(.doc) .askcard .fig { height: 36px; min-width: 88px; }
  :root body:not(.doc) .askcard :is(.k, .pair, .reset) { align-self: start; margin-top: 3px; }
  :root body:not(.doc) .askcard .k { margin-top: 11px; }
}
@media (min-width: 960px) {
}

/* ---- Sheets and the floating pill ---- */
:root body:not(.doc) :is(.quiet, .sheethead .close) { min-height: 28px; padding: 3px 12px; font-size: 12.5px; }
:root body:not(.doc) :is(.quiet, .sheethead .close)::after { inset: -8px 0; }
:root body:not(.doc) .pill { min-height: 44px; }
:root body:not(.doc) .pill > span { padding: 4px 18px; }
:root body:not(.doc) .pill b { font-size: 16px; font-weight: 600; }
:root body:not(.doc) .pill small { font-size: 10px; font-weight: 600; letter-spacing: .06em; }

/* small things that were already under 44px to the thumb: the same invisible margin (nothing drawn changes) */
:root body:not(.doc) .sheetbody summary { position: relative; }
:root body:not(.doc) .sheetbody summary::before { content: ""; position: absolute; inset: -6px 0; }

/* ---- Type scale: 12 caption · 13 label, list, button · 16 anything typed · 17 heading · 30 the two bill figures (26 on the narrowest phones, 32 on a laptop).
        Themes keep their own display faces; sizes are evened out so a serif theme and a sans theme read the same size. ---- */
:root body:not(.doc) h1.brand { font-size: 17px; }
:root[data-theme=muthu] body:not(.doc) h1.brand { font-size: 13px; }
:root[data-theme=kalyanam] body:not(.doc) h1.brand { font-size: 20px; }
:root body:not(.doc) :is(.card h2, .sheethead h2) { font-size: clamp(13px, var(--tile-size), 17px); }
:root[data-theme=kalyanam] body:not(.doc) :is(.card h2, .sheethead h2) { font-size: 19px; }
:root[data-theme=muthu] body:not(.doc) :is(.card h2, .sheethead h2) { font-size: 12px; letter-spacing: .12em; }
:root body:not(.doc) .a-empty .big { font-size: 17px; }
:root[data-theme=kalyanam] body:not(.doc) .a-empty .big { font-size: 19px; }
:root body:not(.doc) .seg label, :root body:not(.doc) .pick .seg label { font-size: 13px; }
:root body:not(.doc) :is(label, .label, .ratefield label, .fields.main label) { font-size: 13px; letter-spacing: 0; }
:root body:not(.doc) .pick .label { font-size: 12px; letter-spacing: .05em; }
:root body:not(.doc) .field.big input { font-size: 16px; }
:root body:not(.doc) .field.big .u:first-child { font-size: 13px; }
:root body:not(.doc) .ratenote { font-size: 12px; }
:root body:not(.doc) :is(.note.est, .note.own) { font-size: 12px; letter-spacing: .02em; }
:root body:not(.doc) .ratestrip .rate .k { font-size: 12px; }
:root body:not(.doc) .ratestrip .rate .v { font-size: 15px; }
:root body:not(.doc) .ratestrip .rate :is(.note.est, .note.own) { font-size: 12px; line-height: 16px; }
:root body:not(.doc) :is(.quiet, .sheethead .close) { font-size: 13px; }
:root body:not(.doc) .plate .credit { font-size: 12px; }
:root body:not(.doc) :is(.hint, .what, .what > summary) { font-size: 12px; }
:root body:not(.doc) .lede { font-size: 13px; }
:root body:not(.doc) .pill b { font-size: 15px; }
:root body:not(.doc) .pill small { font-size: 12px; letter-spacing: .04em; }
@media (max-width: 359.98px) { :root body:not(.doc) .ratestrip .rate .v { font-size: 13px; } }
@media (min-width: 640px) { :root body:not(.doc) .ratestrip .rate .v { font-size: 17px; } :root body:not(.doc) .ratestrip .rate .note { font-size: 12px; } }
@media (min-width: 960px) {
  :root body:not(.doc) h1.brand { font-size: 19px; }
  :root[data-theme=muthu] body:not(.doc) h1.brand { font-size: 15px; }
  :root[data-theme=kalyanam] body:not(.doc) h1.brand { font-size: 22px; }
}

/* ---- Spacing scale: 4 · 8 · 12 · 16 · 24. Cards 16 inside (24 on a laptop) and 12 apart (24 / 16 on a laptop); a label sits 4 above its box. ---- */
:root body:not(.doc) .deck { gap: 12px; margin-top: 12px; }
:root body:not(.doc) .flow { gap: 12px; }
:root body:not(.doc) .answer { padding: 16px; }
:root body:not(.doc) .cardhead { margin-bottom: 12px; }
:root body:not(.doc) .picks { gap: 12px; margin-bottom: 16px; }
:root body:not(.doc) .pick .label { margin-bottom: 4px; }
:root body:not(.doc) :is(label, .label) { margin-bottom: 4px; }
:root body:not(.doc) label:has(+ .field:not(.big)) { margin-bottom: 2px; }      /* these boxes carry 2px of invisible margin, so the eye still sees 4 */
:root body:not(.doc) .seg label, :root body:not(.doc) .askcard label.figcol { margin-bottom: 0; }
:root body:not(.doc) .ratenote { margin: 8px 0 16px; }
:root body:not(.doc) .fields { gap: 12px; }
:root body:not(.doc) .adds { gap: 16px 8px; margin-top: 16px; padding-top: 12px; }
:root body:not(.doc) .addpanel { margin-top: 12px; padding: 12px; }
:root body:not(.doc) .addpanel .xhead { margin: 12px 0 2px; }
:root body:not(.doc) :is(#extraRows, [id$="-extraRows"]):first-child, :root body:not(.doc) .addpanel > [hidden] + :is(#extraRows, [id$="-extraRows"]) { margin-top: -2px; }      /* the Charges panel is only the list of lines: no heading above the first row */
:root body:not(.doc) .xrow { margin-top: 0; }
:root body:not(.doc) :is(#addExtra, [id$="-addExtra"]) { margin-top: 8px; }
:root body:not(.doc) .hint, :root body:not(.doc) .addpanel .hint { margin-top: 8px; }
:root body:not(.doc) .a-bill .v, :root body:not(.doc) .a-bill .s { margin-top: 4px; }
:root body:not(.doc) table.legend { margin-top: 12px; line-height: 16px; }      /* 20px rows */
:root body:not(.doc) .legend tbody:first-of-type tr > * { padding-bottom: 4px; }
:root body:not(.doc) .legend .boxed tr:first-child > * { padding-top: 4px; }
:root body:not(.doc) .legend .boxed tr:last-child > * { padding-bottom: 4px; }
:root body:not(.doc) .more { gap: 8px; }
:root body:not(.doc) .chip { padding: 8px 28px 8px 12px; }
:root body:not(.doc) .plate { margin-top: 24px; }
:root body:not(.doc) .sheethead { padding: 16px 16px 4px; }
:root body:not(.doc) .sheetbody { padding: 8px 16px 24px; }
:root body:not(.doc) .ratestrip .ratecards { gap: 8px; }
:root body:not(.doc) .ratestrip .rate { padding: 8px; }
:root body:not(.doc) .bar { padding: 4px 8px 4px 16px; }
@media (max-width: 419.98px) { :root body:not(.doc) .bar { padding: 4px 6px 4px 12px; } }
@media (max-width: 359.98px) { :root body:not(.doc) .chip { padding-right: 12px; } :root body:not(.doc) .answer { padding: 16px 12px; } }
@container ans (min-width: 660px) { :root body:not(.doc) .a-row:not(.ctl) table.legend { margin-top: 0; } }
@media (min-width: 960px) {
  :root body:not(.doc) .bar { padding: 6px 8px 6px 24px; }
  :root body:not(.doc) .deck { gap: 24px; margin-top: 16px; }
  :root body:not(.doc) .flow { gap: 16px; }
  :root body:not(.doc) .card:not(.compare) { padding: 24px; }
  :root body:not(.doc) .answer { padding: 24px; }
  :root body:not(.doc) .more { gap: 12px; }
  :root body:not(.doc) .ratestrip .ratecards { gap: 12px; }
  :root body:not(.doc) .ratestrip .rate { padding: 12px 16px; }
  :root body:not(.doc) .sheethead { padding: 24px 24px 4px; }
  :root body:not(.doc) .sheetbody { padding: 12px 24px 24px; }
}

/* ---- Remove a line under "Other charges": a small round × at the end of each row (needs the button from drawExtras, see rev5.md) ---- */
:root body:not(.doc) .xrow { grid-template-columns: minmax(0, 1fr) minmax(0, 112px) 24px; align-items: center; }
:root body:not(.doc) .xdel { position: relative; width: 44px; height: 44px; min-height: 0; margin: 0 -10px; padding: 0; border: 0; border-radius: 50%; background: none; }
:root body:not(.doc) .xdel::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--c-fill-2); transition: background .15s; }
:root body:not(.doc) .xdel::after { content: ""; position: absolute; inset: 11px; transform: rotate(45deg);
                 background: linear-gradient(var(--ink-2), var(--ink-2)) center / 10px 1.25px no-repeat, linear-gradient(var(--ink-2), var(--ink-2)) center / 1.25px 10px no-repeat; }
:root body:not(.doc) .xdel:hover { background: none; }
:root body:not(.doc) .xdel:hover::before { background: color-mix(in srgb, var(--ink) 18%, transparent); }
:root body:not(.doc) .xdel:focus-visible { outline: 0; }
:root body:not(.doc) .xdel:focus-visible::before { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the one empty starter row has nothing to remove: its button keeps its place but is not shown */
:root body:not(.doc) .xrow:only-child:has(.xl:placeholder-shown):has(.xa:placeholder-shown) .xdel { visibility: hidden; }
@media (max-width: 359.98px) { :root body:not(.doc) .xrow { grid-template-columns: minmax(0, 1fr) minmax(0, 88px) 24px; gap: 6px; } :root body:not(.doc) .xl { padding: 6px 8px; } :root body:not(.doc) .xrow .field .u { padding: 0 6px 0 8px; } :root body:not(.doc) .xrow .field input { padding: 6px 8px 6px 0; } }

/* ---- The floating pill: frosted glass with a lit rim. (Bending of what is behind it comes from the liquid-glass library, wired in separately:
        see "Liquid glass placement" in rev5.md. This is the look wherever that does not render.) ---- */
:root body:not(.doc) .pill { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 0 0 1px rgba(255, 255, 255, .45), inset 0 -7px 9px -8px color-mix(in srgb, var(--accent) 34%, transparent), var(--e3); }
/* people who ask their device for less transparency get solid surfaces */
@media (prefers-reduced-transparency: reduce) {
  :root body:not(.doc) .pill, :root body:not(.doc) .pill:hover { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  :root body:not(.doc) .askcard { background: var(--ask-sheen), var(--ask-tint); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-reduced-motion: no-preference) {
  :root body:not(.doc) .field.next { animation: nudge5 1.8s ease-in-out 2 both; }
  @keyframes nudge5 { 50% { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent); } }
}
@media print { :root body:not(.doc) :is(#sheetBill, [id$="-sheetBill"]) .field { box-shadow: none; } }
/* ==== REV5 END ==== */

/* ==== LIQUID GLASS START (calculator only; dist/glass.js) =====================================
   dist/glass.js puts the liquid-glass library's layer inside the pill, the "Ask for" card and the laptop theme picker, as an
   empty <lg-glass> element behind their content. It runs in Chromium browsers only; elsewhere, and when it does not load, the
   CSS glass above is the whole look. Once a layer is drawn the element gets the class "lg": its own blur and inner highlights
   step back (the library's blur and lit rim replace them), its light fill and outer shadow stay. Layout never changes. */
:root body:not(.doc) lg-glass { position: absolute; inset: 0; z-index: -2; display: block; overflow: hidden; border-radius: inherit;
                                pointer-events: none; font-size: 0; line-height: 0; }
:root body:not(.doc) lg-glass * { pointer-events: none !important; }      /* the library's top layers are meant to be "pointer-events-none" by a class this site does not have */
:root body:not(.doc) lg-glass .glass { box-shadow: none !important; }    /* the library's own dark drop shadow; ours stays on the element */
/* The library lights its rim with two layers in screen and overlay blending. Behind an element's content the layer has to be its own
   stack, and in Chromium a blended layer there cuts the library's glass off from the page: no blur and no bending, only the rim.
   In normal blending the glass sees the page; the rim stays a thin lit edge. */
:root body:not(.doc) lg-glass [style*="mix-blend-mode"] { mix-blend-mode: normal !important; }
:root body:not(.doc) .askcard { position: relative; isolation: isolate; } /* a box for the layer, and its own stack so the layer sits behind the card's content */
/* the pill: a thinner fill at the rim, where the bending shows, and a dense one behind the words. The words' own span sits above
   the library's layer, so its fill is never bent or blurred: captions keep 4.5:1 over the darkest thing that scrolls under (measured) */
:root body:not(.doc) .pill.lg { -webkit-backdrop-filter: none; backdrop-filter: none; background: color-mix(in srgb, var(--surface) 66%, transparent); box-shadow: var(--e3); }
:root body:not(.doc) .pill.lg:hover { background: color-mix(in srgb, var(--surface) 74%, transparent); }
:root body:not(.doc) .pill.lg > .pb { position: relative; z-index: 1; }
:root body:not(.doc) .pill.lg::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
                                        background: color-mix(in srgb, var(--surface) 90%, transparent);
                                        -webkit-mask: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent), linear-gradient(transparent, #000 5px, #000 calc(100% - 5px), transparent);
                                        -webkit-mask-composite: source-in; mask-composite: intersect; }
:root body:not(.doc) .askcard.lg { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--ask-sheen), color-mix(in srgb, var(--ask-tint) 50%, transparent);
                                   box-shadow: 0 1px 1px color-mix(in srgb, var(--sh) 7%, transparent), 0 4px 10px -4px color-mix(in srgb, var(--sh) 16%, transparent), 0 18px 32px -16px color-mix(in srgb, var(--sh) 38%, transparent); }
@media print { :root body:not(.doc) lg-glass { display: none !important; } }
/* ==== LIQUID GLASS END ==== */

/* ==== REV6 START: fewer tiles (calculator only) ====================================
   The page is four tiles: a header (title, metal, theme, and today's rates under a hairline), the quote, the answer
   ("What to ask for", which now also holds the other-country line, the four detail buttons and an open detail), and the footer.
   An arrow between the two main tiles (rev15; it was a small round chevron) shows the way from the first to the second: pointing right on a laptop,
   down on a phone. Everything from REV5 stays. To undo: delete from REV6 START to REV6 END (and restore the two markup changes in rev6.md). */

/* ---- Header tile: the top bar and the rates are one tile ---- */
:root body:not(.doc) { --r6: min(var(--r-card), 20px); }
:root body:not(.doc) .bar { border-radius: var(--r6) var(--r6) 0 0; }
:root body:not(.doc) section.ratestrip { display: flex; align-items: center; gap: 8px; margin-top: 0; padding: 0 8px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r6) var(--r6);
                      background: var(--glass-lo); box-shadow: var(--e1); }
:root body:not(.doc) .ratestrip .ratecards { flex: 1; min-width: 0; gap: 0; }
:root body:not(.doc) .ratestrip .rate { padding: 8px; border-radius: 0; background: none; box-shadow: none; }
:root body:not(.doc) .ratestrip .rate + .rate { border-left: 1px solid var(--line); }
@media (min-width: 640px) {
  :root body:not(.doc) section.ratestrip { padding: 0 8px 0 12px; }
  :root body:not(.doc) .ratestrip .rate { padding: 8px 16px 8px 12px; }
}

/* ---- The two main tiles ---- */
:root body:not(.doc) .deck { gap: 12px; }
/* second tile: the answer, the detail buttons and an open detail share one surface */
:root body:not(.doc) .flow { position: relative; z-index: 2; gap: 0; margin-top: 0; padding: 16px; border-radius: var(--r-card); background: var(--glass-hi); box-shadow: var(--rim), var(--e3); }
:root[data-theme=kalyanam] body:not(.doc) .flow { box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--frame), var(--e3); }
:root body:not(.doc) .card.answer, :root[data-theme=kalyanam] body:not(.doc) .card.answer { padding: 0 0 16px; border-radius: 0; background: none; box-shadow: none; }
@media (max-width: 359.98px) { :root body:not(.doc) .flow { padding: 16px 12px; } }
@media (max-width: 959.98px) { :root body:not(.doc) .quote { padding-bottom: 16px; } }
/* both headings are set alike, so they read as a pair */
:root body:not(.doc) .answer > h2 { margin: 0 0 8px; }
/* the four details: one row of quiet buttons under a hairline (two by two on the narrowest phones) */
:root body:not(.doc) .more { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 -8px -8px; padding-top: 4px; border-top: 1px solid var(--line); }
:root body:not(.doc) .chip, :root body:not(.doc) .chip:hover, :root body:not(.doc) .chip[aria-expanded=true], :root body:not(.doc) .chip[aria-expanded=true]:hover { min-height: 44px; padding: 6px 4px; justify-items: center; text-align: center; border-radius: var(--c-r); background: none; box-shadow: none; transform: none; }
:root body:not(.doc) .chip::after { content: none; }
:root body:not(.doc) .chip b { font-weight: 500; line-height: 1.25; color: var(--ink); text-wrap: balance; }
:root body:not(.doc) .chip:hover { background: var(--c-fill); }
:root body:not(.doc) .chip[aria-expanded=true] { background: var(--c-fill); }
:root body:not(.doc) .chip[aria-expanded=true] b { font-weight: 600; color: var(--accent-ink); }
@media (max-width: 359.98px) { :root body:not(.doc) .more { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* an open detail (laptop) is a section of the same tile */
:root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on, :root[data-theme=kalyanam] body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on { margin-top: 16px; border-top: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
:root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheethead { padding: 16px 0 4px; }
:root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheetbody { padding: 8px 0 0; }

/* ---- From the first tile to the second: an arrow between them (rev15: drawn in the REV15 block) ---- */

@media (min-width: 960px) {
  :root body:not(.doc) .deck { gap: 32px; margin-top: 16px; }
  :root body:not(.doc) .flow { padding: 24px; }
  :root body:not(.doc) .answer > h2 { display: flex; align-items: center; min-height: 28px; margin: calc(var(--band-h) + 10px) 0 12px; }      /* level with the first tile's heading, which sits under its band of pattern */
  :root body:not(.doc) .more { margin: 0 -12px -12px; }
  :root body:not(.doc) .chip, :root body:not(.doc) .chip:hover, :root body:not(.doc) .chip[aria-expanded=true], :root body:not(.doc) .chip[aria-expanded=true]:hover { min-height: 52px; padding: 8px; }
  :root body:not(.doc) .chip, :root body:not(.doc) .chip:hover, :root body:not(.doc) .chip[aria-expanded=true], :root body:not(.doc) .chip[aria-expanded=true]:hover { justify-items: stretch; }
}
@media print {
  :root body:not(.doc) .flow, :root[data-theme=kalyanam] body:not(.doc) .flow { padding: 0; background: none; box-shadow: none; }      /* (Kalyanam's frame rule above outranks the plain one) */
  :root body:not(.doc) .chev { display: none; }
  :root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on, :root[data-theme=kalyanam] body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on { margin-top: 0; border-top: 0; }
}
/* ==== REV6 END ==== */

/* ==== REV7 START: library glass on every floating surface, tax in place, calmer bill figures (calculator only) ====
   Every rule starts with ":root body:not(.doc)", so the written pages (body.doc) are untouched. Design: spec revision 7.
   Each glass surface has a two-zone fill: a thin fill along its edge, where the glass bends the photo, and a dense one
   ("core") under all text. The element's own background is the edge fill; its ::before adds the rest of the core, fading
   in over the band, so the core is exactly the table's figure. dist/app.js puts the liquid-glass library's pane (<lg-glass>)
   under both while the surface carries the class "lg"; without it the CSS glass below is the same design. */

/* ---- The header tile: the top bar and the rates under one pane ---- */
:root body:not(.doc) .head { position: relative; max-width: 600px; margin: 0 auto; border-radius: var(--r6); }
:root body:not(.doc) .head > .bar, :root body:not(.doc) .head > section.ratestrip { background: none; box-shadow: none; }
@media (min-width: 960px) { :root body:not(.doc) .head { max-width: 1180px; } }
@media (prefers-reduced-motion: no-preference) { :root body:not(.doc) .head.rise { animation-name: rise-solid; } }
:root body:not(.doc) .plate { position: relative; }
/* A short laptop window let the quote scroll with the page by making it static; the fill needs it positioned */
@media (min-width: 960px) and (max-height: 699.98px) { :root body:not(.doc) .quote { position: relative; } }
/* Taller than the window (the tax box open in a short window): the quote scrolls with the page while it does not fit */
@media (min-width: 960px) { :root body:not(.doc) .quote.tall { position: relative; top: auto; } }

/* ---- Fills: edge band width, edge fill and core fill per surface (rev7 1.2) ---- */
:root body:not(.doc) .head  { --gl-band: 8px;  --gl-e: .56; --gl-c: .88; }      /* rev7 said 86%; raised one step, see checklist item 3 in the report */
:root body:not(.doc) .quote { --gl-band: 12px; --gl-e: .56; --gl-c: .90; }      /* rev7 said 88%; raised one step, the same */
:root body:not(.doc) .flow  { --gl-band: 12px; --gl-e: .56; --gl-c: .90; }
:root body:not(.doc) .plate { --gl-band: 12px; --gl-e: .56; --gl-c: .88; }
@media (min-width: 960px) { :root body:not(.doc) :is(.quote, .flow) { --gl-band: 16px; } }
:root body:not(.doc) :is(.head, .quote, .flow, .plate) { isolation: isolate; background: color-mix(in srgb, var(--surface) calc(var(--gl-e) * 100%), transparent); }
:root body:not(.doc) :is(.head, .quote, .flow, .plate)::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: color-mix(in srgb, var(--surface) calc((1 - (1 - var(--gl-c)) / (1 - var(--gl-e))) * 100%), transparent);
  -webkit-mask: linear-gradient(90deg, transparent, #000 var(--gl-band), #000 calc(100% - var(--gl-band)), transparent), linear-gradient(transparent, #000 var(--gl-band), #000 calc(100% - var(--gl-band)), transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
/* Elevation and the lit top edge stay on the element; with the library's pane drawn, its lit edge replaces ours */
:root body:not(.doc) .head { box-shadow: var(--rim), var(--e1); }
:root body:not(.doc) .plate { box-shadow: var(--rim), var(--e1); }
:root body:not(.doc) .head.lg, :root body:not(.doc) .plate.lg { box-shadow: var(--e1); }
:root body:not(.doc) .quote.lg { box-shadow: var(--e2); }
:root body:not(.doc) .flow.lg { box-shadow: var(--e3); }
/* Kalyanam: the invitation frame just inside the edge is drawn above the pane and the fills */
:root[data-theme=kalyanam] body:not(.doc) .quote { box-shadow: var(--e2); }
:root[data-theme=kalyanam] body:not(.doc) .flow { box-shadow: var(--e3); }
:root[data-theme=kalyanam] body:not(.doc) :is(.quote, .flow)::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
                                                                       box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--frame); }


/* ---- CSS glass: where the library's pane is not drawn (Safari, Firefox, every iPhone browser, off screen, over budget, before the script) ---- */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root body:not(.doc) :is(.head, .quote, .flow, .plate):not(.lg) { -webkit-backdrop-filter: blur(12px) saturate(1.35); backdrop-filter: blur(12px) saturate(1.35); }
  :root[data-metal=silver] body:not(.doc) :is(.head, .quote, .flow, .plate):not(.lg) { -webkit-backdrop-filter: blur(12px) saturate(1); backdrop-filter: blur(12px) saturate(1); }
}
/* No backdrop blur at all: the core fill over the whole surface, no band */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root body:not(.doc) :is(.head, .quote, .flow, .plate) { background: color-mix(in srgb, var(--surface) calc(var(--gl-c) * 100%), transparent); }
  :root body:not(.doc) :is(.head, .quote, .flow, .plate)::before { content: none; }
}
/* Less transparency asked for, or forced colours: solid surfaces */
@media (prefers-reduced-transparency: reduce), (forced-colors: active) {
  :root body:not(.doc) :is(.head, .quote, .flow, .plate) { background: var(--surface); }
  :root body:not(.doc) :is(.head, .quote, .flow, .plate):not(.lg), :root[data-metal=silver] body:not(.doc) :is(.head, .quote, .flow, .plate):not(.lg) { -webkit-backdrop-filter: none; backdrop-filter: none; }
  :root body:not(.doc) :is(.head, .quote, .flow, .plate)::before { content: none; }
}
/* While a tile carries a pane, the photo does not drift with scrolling (a moving backdrop repaints every pane every frame) */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) { html.lg-tiles .far-photo { animation: far-recede 1.3s var(--ease-out) both; animation-timeline: auto; } }
}

/* ---- 2. Tax: the state and its rate open in the quote tile ---- */
:root body:not(.doc) .taxline .go::after { transform: rotate(135deg); vertical-align: 3px; }                 /* "Change": the chevron points down */
:root body:not(.doc) .taxline[aria-expanded=true] .go::after { transform: rotate(-45deg); vertical-align: -1px; }   /* "Done": up */
:root body:not(.doc) .addpanel.taxbox { margin-top: 4px; padding: 12px; border-radius: min(var(--radius-s), 12px); background: var(--c-fill); }
:root body:not(.doc) .taxfields { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; }
:root body:not(.doc) .taxbox label { font-size: 13px; }
:root body:not(.doc) .taxbox .hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
@media (max-width: 359.98px) { :root body:not(.doc) .taxfields { grid-template-columns: minmax(0, 1fr); } }
/* "Tax and currency": this country's tax as one read-only line, with the way to change it in the quote */
:root body:not(.doc) .taxhome { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; font-size: 13px; line-height: 1.35; color: var(--ink); }
:root body:not(.doc) .taxhome .t { min-width: 0; }
:root body:not(.doc) .linkbtn { position: relative; flex: none; min-height: 0; padding: 2px 0; font-size: 13px; font-weight: 500; color: var(--accent-ink); background: none; border: 0; border-radius: 0; }
:root body:not(.doc) .linkbtn:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
:root body:not(.doc) .linkbtn::after { content: ""; position: absolute; inset: -12px -8px; }

/* ---- 3. Calmer bill figures: the ask wins by size, weight and colour; the quote is plain ink at a medium weight ---- */
:root body:not(.doc) .a-bill .k .flag { width: 18px; height: 12px; }
:root body:not(.doc) .a-bill .v { margin-top: 2px; font-size: 20px; font-weight: 500; line-height: 1.15; letter-spacing: -.015em; color: var(--ink); }
:root body:not(.doc) .a-row.result .a-bill .v { font-size: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--accent-ink); }
:root body:not(.doc) .a-bill .s { margin-top: 2px; font-size: 13px; font-weight: 500; line-height: 16px; letter-spacing: 0; }
:root body:not(.doc) .a-row.result .a-bill .s { font-weight: 500; color: var(--good); }
:root body:not(.doc) .a-row:not(.ctl) table.legend { margin-top: 8px; }
@container ans (min-width: 660px) { :root body:not(.doc) .a-row:not(.ctl) table.legend { margin-top: 0; } }
@media (max-width: 359.98px) {
  :root body:not(.doc) .a-row.result .a-bill .v { font-size: 22px; }
  :root body:not(.doc) .a-bill .s { font-size: 12px; }
}
@media (min-width: 960px) {
  :root body:not(.doc) .a-bill .v { font-size: 22px; }
  :root body:not(.doc) .a-row.result .a-bill .v { font-size: 26px; }
}
/* Full bill: its two totals never shout over the ask (the printed bill keeps its own sizes) */
@media screen { :root body:not(.doc) .totals .v { font-size: 20px; font-weight: 600; } }

/* ---- Full hit areas: − / + and ↺ sit above the slider's strip ---- */
:root body:not(.doc) .askcard .step { z-index: 2; }

/* ---- Print: no panes, fills or shadows; the printed bill is unchanged ---- */
@media print {
  :root body:not(.doc) .head, :root body:not(.doc) .chev, :root body:not(.doc) lg-glass { display: none !important; }
  :root body:not(.doc) :is(.quote, .flow, .plate)::before, :root body:not(.doc) :is(.quote, .flow, .plate)::after { content: none !important; }
  :root body:not(.doc) .flow, :root[data-theme=kalyanam] body:not(.doc) .flow { background: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
/* ==== REV7 END ==== */

/* ==== REV8 START: "My Gold Bill", the rates explanation in place, details that open and close by their own button (calculator only) ====
   Every rule starts with ":root body:not(.doc)", so the written pages (body.doc) are untouched. To undo: delete from REV8 START
   to REV8 END and restore the markup in src/app.tsx and src/view.tsx. */

/* ---- rev8: the heading "My Gold Bill" / "My Silver Bill" on one line beside the metal switch and the theme button ----
   Under 420px the switch drops its coloured dots (the chosen side is still filled in the metal's colour); under 360px the
   mark beside the name goes too, and the theme button and Muthu's wide letter spacing tighten a little. */
@media (max-width: 419.98px) { :root body:not(.doc) .bar { gap: 6px; } :root body:not(.doc) .bar .seg.metals .dot { display: none; } }
@media (max-width: 359.98px) {
  :root body:not(.doc) h1.brand .mark { display: none; }
  :root body:not(.doc) .themebtn { padding: 4px 10px; }
  :root[data-theme=muthu] body:not(.doc) h1.brand { letter-spacing: .06em; }
}

/* ---- rev8: the chevron on the four detail buttons (rev12: the header's "How these are worked out" link and panel are gone;
   the explanation is reached from Today's rates at every width) ---- */
:root body:not(.doc) .chip .tw { display: inline-block; width: 6px; height: 6px; margin: 0 2px 0 6px; border: solid currentColor; border-width: 1.25px 1.25px 0 0;
                                    transform: rotate(135deg); vertical-align: 2px; }                                   /* closed: points down */
:root body:not(.doc) .chip[aria-expanded=true] .tw { transform: rotate(-45deg); vertical-align: -1px; }              /* open: up */

/* ==== REV8 END ==== */

/* ==== REV10 START: the photo seen through a dark glass window (calculator only) ====================
   Owner: "The backgrounds should be like a window cutout. Something similar to my deckfront project", then "the photo
   cutout has a dark glass like feel to it", then "Just make it darker window and publish it."
   The theme's photograph, sharp and fixed to the screen, lies under a dark glass plate (deckfront's Dark glass strength,
   60%, in the theme's own dark colour). That window runs from under the coin strip to just below the two main tiles, the
   full width of the screen; the header, quote and answer tiles float in front of it as light glass. Below it the page is
   a plain light sheet carrying the footer as a solid card. Every rule is scoped to "body:not(.doc)": the written pages
   are untouched. Needs the eleven files in assets/window/ (rev10.md, section 3). Design and measurements: rev10.md.
   To undo: delete from REV10 START to REV10 END. */

/* ---- 1. The photo: the sharper file ---- */
:root body:not(.doc)                        { --far-photo: url("assets/window/temple.jpg"); }
:root[data-theme=terracotta] body:not(.doc) { --far-photo: url("assets/window/terracotta.jpg"); }
:root[data-theme=kolam] body:not(.doc)      { --far-photo: url("assets/window/kolam.jpg"); }
:root[data-theme=lotus] body:not(.doc)      { --far-photo: url("assets/window/lotus.jpg"); }
:root[data-theme=mayil] body:not(.doc)      { --far-photo: url("assets/window/mayil.jpg"); }
:root[data-theme=deepam] body:not(.doc)     { --far-photo: url("assets/window/deepam.jpg"); }
:root[data-theme=mandapam] body:not(.doc)   { --far-photo: url("assets/window/mandapam.jpg"); }
:root[data-theme=malli] body:not(.doc)      { --far-photo: url("assets/window/malli.jpg"); }
:root[data-theme=muthu] body:not(.doc)      { --far-photo: url("assets/window/muthu.jpg"); }
:root[data-theme=utsav] body:not(.doc)      { --far-photo: url("assets/window/utsav.jpg"); }
:root[data-theme=kalyanam] body:not(.doc)   { --far-photo: url("assets/window/kalyanam.jpg"); }

:root body:not(.doc) {
  --win-plate: color-mix(in srgb, var(--ink) 60%, transparent);      /* the dark glass: the theme's own ink at deckfront's 60% */
  --win-sheen: linear-gradient(rgba(255, 255, 255, .07), transparent 180px);      /* a faint light along the top of the pane */
  --win-grey: grayscale(0);           /* silver: 1 */
  --win-pad: 28px;                    /* how much window shows below the tiles */
  --win-ground: color-mix(in srgb, var(--bg) 60%, var(--photo-tint));      /* the light sheet below the window */
  --r10-ring: 0 0 0 1px color-mix(in srgb, var(--ink) 20%, transparent);                                                        /* the footer card's outline */
  --r10-near: 0 2px 5px -1px color-mix(in srgb, var(--sh) 22%, transparent);
  --r10-lift: 0 1px 3px color-mix(in srgb, #000 28%, transparent), 0 6px 14px -4px color-mix(in srgb, #000 30%, transparent);   /* tiles over the window */
}
:root[data-theme=utsav] body:not(.doc)  { --win-ground: color-mix(in srgb, var(--bg) 78%, var(--photo-tint)); }      /* its tint is loud; less of it in the sheet */
:root[data-metal=silver] body:not(.doc) { --win-grey: grayscale(1); }      /* silver: the photo in black and white; plate and sheet are steel because the tokens are */

:root body:not(.doc) .far { background: var(--win-ground); }
:root body:not(.doc) .far-photo { inset: 0; opacity: 1; translate: none; transition: none; animation: none !important;      /* still: no arrival zoom, no drift, no pointer shift */
  filter: var(--win-grey);
  background: var(--far-photo) var(--photo-pos, center) / cover no-repeat; background-blend-mode: normal; }
:root body:not(.doc) .far::after { background: var(--win-sheen), var(--win-plate); }      /* the plate over the whole photo (was the vignette) */

/* ---- 2. The cut-out: a box from above the page top to just below the two main tiles, as wide as the screen;
        everything outside it (that is, everything below it) is painted in the sheet colour ---- */
:root body:not(.doc) { overflow-x: clip; }
/* The body's clip passes to the page as "hidden", which a script or a jump to a link can still scroll sideways. Where a scrollbar
   takes room (Windows), 100vw is wider than the page, so the box itself is clipped one level down, where clipping is final. */
@media screen { :root body:not(.doc) #app { overflow-x: clip; } }
:root body:not(.doc) .deck { position: relative; margin-bottom: calc(16px + var(--win-pad)); }
:root body:not(.doc) .deck::before { content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: -100vmax; bottom: calc(-1 * var(--win-pad)); left: calc(50% - 50vw); right: calc(50% - 50vw);
  box-shadow: 0 0 0 200vmax var(--win-ground),                    /* the sheet */
              inset 0 -1px 0 rgba(255, 255, 255, .22),            /* the pane's lit bottom edge */
              inset 0 -2px 0 rgba(0, 0, 0, .35),
              inset 0 -18px 22px -18px rgba(0, 0, 0, .5); }       /* depth where the pane meets the sheet */
:root body:not(.doc) .plate { margin-top: 0; }

/* ---- 3. Footer: a solid card on the sheet (nothing to see through, so no pane) ---- */
:root body:not(.doc) .plate { --gl-e: 1; --gl-c: 1; }
:root body:not(.doc) .plate > lg-glass { display: none; }
:root body:not(.doc) .plate, :root body:not(.doc) .plate.lg { box-shadow: var(--rim), var(--r10-ring), var(--r10-near), var(--e1); }

/* ---- 4. Header, quote and answer: light glass in front of the dark window. Edge band .60 (rev7 .56), core .96 (rev7 .88 and .90) ---- */
:root body:not(.doc) :is(.head, .quote, .flow) { --gl-e: .60; --gl-c: .96; }
:root body:not(.doc) .head { box-shadow: var(--rim), var(--r10-lift), var(--e1); }
:root body:not(.doc) .head.lg { box-shadow: var(--r10-lift), var(--e1); }
:root body:not(.doc) .quote { box-shadow: var(--rim), var(--r10-lift), var(--e2); }
:root body:not(.doc) .flow { box-shadow: var(--rim), var(--r10-lift), var(--e3); }
:root body:not(.doc) .quote.lg, :root[data-theme=kalyanam] body:not(.doc) .quote { box-shadow: var(--r10-lift), var(--e2); }
:root body:not(.doc) .flow.lg, :root[data-theme=kalyanam] body:not(.doc) .flow { box-shadow: var(--r10-lift), var(--e3); }

/* ---- 5. The small things that can sit straight on the window ---- */
:root body:not(.doc) .pill { background: color-mix(in srgb, var(--surface) 96%, transparent); }                        /* was 90% */
:root body:not(.doc) .pill.lg { background: color-mix(in srgb, var(--surface) 66%, transparent); }                     /* unchanged rim */
:root body:not(.doc) .pill.lg::before { background: color-mix(in srgb, var(--surface) 96%, transparent); }             /* core, was 90% */

/* ---- Print: no cut-out (the far plane, header, quote and footer are already not printed) ---- */
@media print {
  :root body:not(.doc) .deck::before { content: none !important; }
  :root body:not(.doc) .deck { margin: 0 !important; }
}
/* ==== REV10 END ==== */
/* ==== REV11 START: the open detail in its own shade with its button joined to it like a tab; the two main tiles end level on a laptop (calculator only) ====
   Owner: "The expanded portion should have a different shade all together and the button that is expanded should carry that shade",
   and "make them always look equal when things expand. This is only a problem in desktop view."
   Every rule starts with ":root body:not(.doc)", so the written pages are untouched. Needs two markup changes in src/app.tsx
   (data-on on nav.more; div.quote-in inside the quote tile, which the "tall" check now measures) and one script (the chevron's
   --chev-y, section 7). The four buttons also lost their second line in src/app.tsx (and its three rules in REV5/REV6 went with it).
   To undo: delete from REV11 START to REV11 END and take the script changes out. */

/* ---- 1. Tokens: one tint of the theme for the open button and its panel. Solid colours (no transparency), so the text on them
        reads the same with the library glass, the CSS glass or no glass. Silver follows by itself: its tokens are steel. ---- */
:root body:not(.doc) {
  --open-fill: color-mix(in srgb, var(--accent-ink) 20%, var(--surface));      /* the shade */
  --open-edge: color-mix(in srgb, var(--accent-ink) 45%, var(--surface));      /* its 1px edge */
  --open-line: color-mix(in srgb, var(--accent-ink) 26%, var(--surface));      /* hairlines inside the shade */
  --open-muted: color-mix(in srgb, var(--muted) 55%, var(--ink));              /* muted text on the shade (plain --muted would fall under 4.5:1) */
  --open-r: min(var(--radius-s), 12px);
}

/* ---- 2. The open button: the shade, an edge on three sides, square at the bottom where it meets the panel ---- */
:root body:not(.doc) .more[data-on] { margin-bottom: 0; }
:root body:not(.doc) .chip[aria-expanded=true], :root body:not(.doc) .chip[aria-expanded=true]:hover {
  z-index: 1; --muted: var(--open-muted); background: var(--open-fill); border-radius: var(--open-r) var(--open-r) 0 0;
  box-shadow: inset 1px 0 0 var(--open-edge), inset -1px 0 0 var(--open-edge), inset 0 1px 0 var(--open-edge); }
:root body:not(.doc) .chip[aria-expanded=true]:focus-visible { outline-offset: -4px; }      /* the ring sits inside the tab, clear of the panel */

/* The four buttons carry their titles only (rev11: the second line is gone from the markup, owner: "the earlier buttons with just
   the titles was enough"). One line where it fits; the last word and its chevron are kept together (span.nw). 44px tall on a laptop
   too (it was 52px for two lines). */
:root body:not(.doc) .chip .nw { white-space: nowrap; }
@media (min-width: 960px) {
  :root body:not(.doc) .chip, :root body:not(.doc) .chip:hover, :root body:not(.doc) .chip[aria-expanded=true], :root body:not(.doc) .chip[aria-expanded=true]:hover { min-height: 44px; }
}
/* The four buttons stay one row down to 320px (two by two before), so the open one always sits on its panel */
@media (max-width: 359.98px) {
  :root body:not(.doc) .more { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  :root body:not(.doc) .chip b { font-size: 12px; }
}

/* ---- 3. The open panel: the same shade and edge, tucked 1px under the button row so the open button covers the edge beneath it ---- */
:root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on, :root[data-theme=kalyanam] body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on {
  --muted: var(--open-muted); --line: var(--open-line);
  margin: -1px -8px -8px; padding: 0 8px 8px; border: 1px solid var(--open-edge); border-radius: var(--open-r); background: var(--open-fill); box-shadow: none; }
:root body:not(.doc) .more[data-on=bill] + :is(#detailHost, [id$="-detailHost"]) .sheet.on { border-top-left-radius: 0; }       /* first button: flush with the panel's left edge */
:root body:not(.doc) .more[data-on=rates] + :is(#detailHost, [id$="-detailHost"]) .sheet.on { border-top-right-radius: 0; }     /* last button: flush right */
:root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheethead { padding: 12px 0 4px; }
@media (min-width: 960px) {
  :root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on, :root[data-theme=kalyanam] body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on { margin: -1px -12px -12px; padding: 0 16px 16px; }
}
/* It appears in place (a fade), so it never parts from its button on the way in */
@media (prefers-reduced-motion: no-preference) {
  :root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on { animation: r11-open .18s ease-out both; }
  @keyframes r11-open { from { opacity: 0; } }
}

/* ---- 4. Laptop: the two main tiles always end level ---- */
@media (min-width: 960px) {
  :root body:not(.doc) .deck { align-items: stretch; }
  /* The quote tile is as tall as the row; what is in it stays in view while the page scrolls (as the whole tile did before) */
  :root body:not(.doc) .quote, :root body:not(.doc) .quote.tall { position: relative; top: auto; }
  :root body:not(.doc) .quote-in { position: sticky; top: calc(var(--strip-h) + 16px); }
  :root body:not(.doc) .quote.tall .quote-in { position: static; }
  /* The answer tile: the buttons never move (they sit right under the ask). Spare height goes below them: into the open panel,
     which then reaches the bottom of the tile, or left plain while all four are closed */
  :root body:not(.doc) .flow { display: flex; flex-direction: column; }
  :root body:not(.doc) .flow > :is(.answer, .more) { flex: none; }
  :root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) { flex: 1 0 auto; display: flex; flex-direction: column; }
  :root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on { flex: 1 0 auto; }
}
@media (min-width: 960px) and (max-height: 699.98px) { :root body:not(.doc) .quote-in { position: static; } }

/* ---- 5. Forced colours: the shade is not drawn there, so the edge carries it ---- */
@media (forced-colors: active) {
  :root body:not(.doc) .chip[aria-expanded=true], :root body:not(.doc) .chip[aria-expanded=true]:hover { box-shadow: none; border: 2px solid Highlight; border-bottom: 0; }
  :root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on, :root[data-theme=kalyanam] body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on { border: 2px solid Highlight; margin-top: -2px; }
}

/* ---- 6. Print: the invoice on plain paper, no shade, no edge ---- */
@media print {
  :root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on, :root[data-theme=kalyanam] body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheet.on { margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; animation: none !important; }
  :root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) .sheethead { padding: 0 0 8px; }
  :root body:not(.doc) .flow, :root body:not(.doc) :is(#detailHost, [id$="-detailHost"]) { display: block !important; }
}

/* ---- 7. Laptop: the arrow in the middle of the gap between the two tiles, halfway down them; when the row is taller than the
        window, src/app.tsx sets --chev-y so it stays in the middle of the part on screen (rev15: the rule is in the REV15 block). ---- */
/* ==== REV11 END ==== */

/* ==== REV13 START: stage 1 of the rev13 spec (items 3 and 4). Calculator only: every rule starts ":root body:not(.doc)".
   Item 4a: the theme list drops from the theme button at every width and closes from the same button (also Escape, a tap
   elsewhere, or focus leaving it); it replaced the theme sheet (its scrim, its fall-back of the page, its Close button, glass tier H).
   Item 3: one line under the two totals of "Invoice US vs India" when the cheaper country shows the higher "% over gold value".
   Item 4b ("Estimate" in the quote tile is a plain label now) needs no rule here.
   Stage 2, item 8: "Share" at the right of the answer tile's heading, its WhatsApp / Copy row, and the "Shared bill" notice.
   Stage 3, item 10: the old gold box in the quote tile, and the "Old gold" / "To pay" lines under the answer's two lists.
   To undo: delete from REV13 START to REV13 END and take the changes in src/app.tsx and src/glass.tsx out
   (stage 2 alone: the rules under "Item 8" below, and src/share.ts with its uses). ==== */
/* ---- Item 4a: the list hangs below the header tile, over the tiles under it. A solid card (no pane, no blur): it sits inside
        the header tile, where a blur cannot see the photo, so it looks the same with the library glass, the CSS glass or none ---- */
:root body:not(.doc) .head { z-index: 6; }
:root body:not(.doc) .bar { position: relative; }
:root body:not(.doc) .themepop { position: absolute; z-index: 5; top: calc(100% + 4px); right: 6px; width: min(320px, calc(100vw - 36px)); padding: 8px;
  max-height: calc(100vh - var(--strip-h) - 96px); max-height: calc(100dvh - var(--strip-h) - 96px); overflow: auto; overscroll-behavior: contain;
  border-radius: var(--open-r); background: var(--surface); box-shadow: 0 0 0 1px var(--open-edge), var(--e3); }
:root body:not(.doc) .themepop[hidden] { display: none; }
@media (min-width: 420px) { :root body:not(.doc) .themepop { right: 8px; } }      /* the bar's own right padding: the list's edge lines up with the button's */
:root body:not(.doc) .themebtn[aria-expanded=true] { background: var(--c-fill-2); }
@media (prefers-reduced-motion: no-preference) { :root body:not(.doc) .themepop { animation: r11-open .18s ease-out both; } }
@media (forced-colors: active) { :root body:not(.doc) .themepop { border: 2px solid CanvasText; } }
@media print { :root body:not(.doc) .themepop { display: none !important; } }
/* ---- Item 3: why the cheaper country can show the higher %. Inside the open detail --muted is --open-muted (REV11) ---- */
:root body:not(.doc) .why { margin: 10px 0 4px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
/* ---- Item 8: Share. The heading of the answer tile is a row now, like the quote tile's; the old ".answer > h2" rules no longer match ---- */
:root body:not(.doc) .answer > .ahead { margin: 0 0 8px; min-height: 28px; }
:root body:not(.doc) .answer > .ahead h2 { margin: 0; }
@media (min-width: 960px) { :root body:not(.doc) .answer > .ahead { margin: calc(var(--band-h) + 10px) 0 12px; } }      /* what ".answer > h2" had */
:root body:not(.doc) :is(#share, [id$="-share"])[aria-expanded=true] { background: var(--c-fill-2); }
:root body:not(.doc) .sharebox { display: flex; justify-content: flex-end; gap: 8px; margin: -4px 0 12px; }
:root body:not(.doc) .sharebox[hidden] { display: none; }
:root body:not(.doc) a.quiet { display: inline-flex; align-items: center; justify-content: center; border-radius: 99px; text-decoration: none; }
:root body:not(.doc) :is(#shareCopy, [id$="-shareCopy"]) { display: inline-grid; }
:root body:not(.doc) :is(#shareCopy, [id$="-shareCopy"]) > span { grid-area: 1 / 1; }
:root body:not(.doc) :is(#shareCopy, [id$="-shareCopy"]) > .off { visibility: hidden; }
:root body:not(.doc) .sharelink { flex: 1 1 auto; min-width: 0; height: 32px; padding: 0 10px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--c-r); }
/* the notice at the top of the quote tile while a shared bill is shown and the visitor's own is kept */
:root body:not(.doc) .guest { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 12px; font-size: 12px; color: var(--muted); }
:root body:not(.doc) .guest span { flex: 1 1 auto; }
@media print { :root body:not(.doc) :is(:is(#share, [id$="-share"]), .sharebox, .guest) { display: none !important; } }
/* ---- Item 10 (stage 3): old gold. The box is laid out like the tax box above it; "Old gold" and "To pay" sit under the boxed
        list, outside the box (the box is everything that is not the metal) ---- */
:root body:not(.doc) .oldfields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
:root body:not(.doc) .oldbox label { font-size: 13px; }
:root body:not(.doc) .oldtax { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
:root body:not(.doc) .oldtax .label { flex: none; margin: 0; }
:root body:not(.doc) .oldtax .seg { flex: 1; display: grid; grid-template-columns: 1fr 1fr; }
:root body:not(.doc) .oldbox .hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
:root body:not(.doc) .legend tr.pay :is(th, td) { font-weight: 600; color: var(--ink); }
:root body:not(.doc) .legend .payrows tr:first-child :is(th, td) { padding-top: 6px; }
/* ==== REV13 END ==== */

/* ==== REV14 START: several items on one invoice (calculator only; every rule starts ":root body:not(.doc)") ==== */
/* The list of items in the quote tile: one row per item, like the lines of the shop's bill. Shown once there is a second item. */
:root body:not(.doc) .items { display: grid; gap: 4px; }
:root body:not(.doc) .irow { display: grid; grid-template-columns: 18px minmax(0, 60px) minmax(0, 1fr) minmax(0, 1fr) 22px; gap: 5px; align-items: center; }
:root body:not(.doc) .ihead { align-items: end; font-size: 12px; line-height: 1.25; color: var(--muted); }
:root body:not(.doc) .ihead > :first-child { grid-column: 1 / 3; }
:root body:not(.doc) .ino { text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
:root body:not(.doc) .irow .field { min-width: 0; }
:root body:not(.doc) .irow .field input { padding: 6px 0 6px 8px; }
:root body:not(.doc) .irow .field .u { padding: 0 7px 0 2px; }
:root body:not(.doc) .irow .field.pick select { padding: 6px 16px 6px 8px; font-size: 16px; background-position: right 4px center; }
:root body:not(.doc) .irow .xdel { margin: 0 -11px; }
@media (min-width: 400px) {
  :root body:not(.doc) .irow { grid-template-columns: 18px minmax(0, 74px) minmax(0, 1fr) minmax(0, 1fr) 24px; gap: 6px; }
  :root body:not(.doc) .irow .field input { padding-left: 10px; }
  :root body:not(.doc) .irow .field .u { padding-right: 8px; }
  :root body:not(.doc) .irow .field.pick select { padding: 6px 20px 6px 10px; background-position: right 6px center; }
}
:root body:not(.doc) .additem { display: flex; justify-content: flex-end; margin: 8px 0 0; }
:root body:not(.doc) .additem .hint { margin: 0; font-size: 12px; color: var(--muted); }
:root body:not(.doc) .additem + .adds { margin-top: 8px; }
/* Invoice: a small row per item under the rate rows (its metal; under it what its Wastage/Making adds) */
:root body:not(.doc) .bill tr.it td { padding-top: 3px; padding-bottom: 3px; font-size: 12.5px; color: var(--muted); border-bottom: 0; }
:root body:not(.doc) .bill tr.it td:first-child { padding-left: 14px; }
/* Bargaining table: the ask, item by item */
:root body:not(.doc) .itemasks { width: auto; margin: 0 0 16px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
:root body:not(.doc) .itemasks caption { text-align: left; margin-bottom: 4px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
:root body:not(.doc) .itemasks :is(th, td) { padding: 2px 12px 2px 0; text-align: left; font-weight: 400; border: 0; }
:root body:not(.doc) .itemasks th { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--muted); }
:root body:not(.doc) .itemasks td { text-align: right; }
:root body:not(.doc) .itemasks b { font-weight: 600; }
/* Forced colours drop the gradients that draw the ×: draw it in the system's button text colour (the item's only remove control) */
@media (forced-colors: active) {
  :root body:not(.doc) .irow .xdel::after { forced-color-adjust: none;
    background: linear-gradient(ButtonText, ButtonText) center / 10px 1.5px no-repeat, linear-gradient(ButtonText, ButtonText) center / 1.5px 10px no-repeat; }
}
@media print {
  :root body:not(.doc) .additem { display: none !important; }
  /* an item takes one line on paper: "Item 1 · 24 g 22K · 12%   $3,840.00 + $460.80" */
  :root body:not(.doc) :is(#sheetBill, [id$="-sheetBill"]) .bill tr.it td { padding-top: 1px; padding-bottom: 1px; font-size: 11px; }
  :root body:not(.doc) :is(#sheetBill, [id$="-sheetBill"]) .bill tr.it td small { display: inline; margin-left: 6px; font-size: inherit; }
  :root body:not(.doc) :is(#sheetBill, [id$="-sheetBill"]) .bill tr { break-inside: avoid; }
  /* a long invoice runs onto a second page: the verdict and its small line go over together */
  :root body:not(.doc) :is(#sheetBill, [id$="-sheetBill"]) .verdict { break-inside: avoid; }
}
/* ---- rev14b: each item's own charges, under its row; the weight of the invoice at the foot of the list ---- */
:root body:not(.doc) .items { gap: 14px; }                      /* was 4px: an item is now a row plus its Charges button */
:root body:not(.doc) .item { display: grid; gap: 2px; min-width: 0; }
:root body:not(.doc) .ihead + .item { margin-top: -4px; }
:root body:not(.doc) .ich { min-width: 0; }
:root body:not(.doc) .ich > .addbtn { margin-left: 23px; min-height: 26px; padding: 2px 10px 2px 6px; font-size: 12.5px; }
:root body:not(.doc) .ich > .addbtn::after { inset: -3px 0 -15px; }   /* a 44px tap area, 1px clear of the boxes of its own row and of the next row's */
:root body:not(.doc) .ich > .addbtn[aria-expanded=true]::after { bottom: -7px; }   /* open: into its own box's top padding only (36px) */
:root body:not(.doc) .ich > .addbtn:not(.has):not([aria-expanded=true]) { color: var(--muted); background: none; }
:root body:not(.doc) .ich > .addbtn:not(.has):not([aria-expanded=true]):hover { background: var(--c-fill); }
:root body:not(.doc) .ich > .addpanel { margin: 6px 0 4px; padding: 8px 10px 10px; }
:root body:not(.doc) .ich .xrows:first-child { margin-top: -2px; }
:root body:not(.doc) .itot { display: grid; grid-template-columns: 18px minmax(0, 60px) minmax(0, 1fr) minmax(0, 1fr) 22px; gap: 0 5px; align-items: baseline;
  margin: 0; font-size: 13px; line-height: 1.35; font-variant-numeric: tabular-nums; }
:root body:not(.doc) .itot .itl { grid-column: 1 / 3; font-size: 12px; color: var(--muted); }
:root body:not(.doc) .itot b { grid-column: 3; padding-left: 8px; font-weight: 600; color: var(--ink); }
:root body:not(.doc) .itot .itb { grid-column: 4 / -1; font-size: 12px; color: var(--muted); }
:root body:not(.doc) .itot .itb > span { white-space: nowrap; }
@media (min-width: 400px) {
  :root body:not(.doc) .ich > .addbtn { margin-left: 24px; }
  :root body:not(.doc) .itot { grid-template-columns: 18px minmax(0, 74px) minmax(0, 1fr) minmax(0, 1fr) 24px; column-gap: 6px; }
  :root body:not(.doc) .itot b { padding-left: 10px; }
}
/* Invoice: under an item, its own charges, then what the item comes to */
@media (min-width: 400px) { :root body:not(.doc) .bill tr.it:is(.sub, .tot) td:first-child { padding-left: 26px; } }
:root body:not(.doc) .bill tr.it.tot td { color: var(--ink); font-weight: 600; }
:root body:not(.doc) .bill tr.it.tot td:first-child { font-weight: 400; color: var(--muted); }
@media print {
  :root body:not(.doc) .ich > .addbtn:not(.has) { display: none !important; }
  /* an item, its charge lines and its total stay on one page */
  :root body:not(.doc) :is(#sheetBill, [id$="-sheetBill"]) .bill tr.it:has(+ tr.it.sub), :root body:not(.doc) :is(#sheetBill, [id$="-sheetBill"]) .bill tr.it.sub { break-after: avoid; }
}
/* ==== REV14 END ==== */
/* ==== REV15 START: sections, one per shop (calculator only; every rule starts ":root body:not(.doc)") ====
   The page holds one to ten sections; each is one shop's bill (the quote tile, the answer tile and its details).
   With one unnamed section nothing here shows except the "Add shop" pill under the tiles.
   Owner: "Make the most shops as 10", "The shades can be alternating. As opposed to distinct shades": shops 1, 3, 5 … wear
   shade 0 and shops 2, 4, 6 … shade 1, by position (src/app.tsx sets data-c); the number and the name tell them apart.
   Ids inside a bill carry "s{n}-" from the second shop on, so every older rule above that names an id inside a bill (detailHost,
   sheetBill, status, refresh, printBill, share, shareCopy, extraRows, addExtra, slotOther) was widened to ":is(#id, [id$="-id"])",
   which matches the same elements for shop 1 with the same weight.
   To undo: delete from REV15 START to REV15 END, narrow those rules back and restore main.deck in src/app.tsx. */

/* ---- 1. Tokens. Two shades that take turns: shade 0 is the theme's own accent; shade 1 is the same accent turned half way round
        the colour wheel at one fixed lightness and strength, so it differs from the theme's colour in every theme. ---- */
:root body:not(.doc) { --sec-l: .44; --sec-ch: .115; }
:root[data-metal=silver] body:not(.doc) { --sec-ch: .06; }                       /* silver stays steel: a hint of the hue only */
:root body:not(.doc) .shop { --sec: var(--accent-ink); }
:root body:not(.doc) .shop[data-c="1"] { --sec: #1f6f86; }                        /* fallback where relative colours are not understood */
@supports (color: oklch(from red l c h)) {
  :root body:not(.doc) .shop[data-c="1"] { --sec: oklch(from var(--accent-ink) var(--sec-l) var(--sec-ch) calc(h + 180)); }
}
:root body:not(.doc) .shop { --sec-ink: color-mix(in oklab, var(--sec) 82%, var(--ink)); }       /* the shop's colour as text on its cap */
/* rev15c (owner: "Only the cards can have alternating tint, the background can stay the way it was before"): nothing is drawn on the
   window. Shade 0 (shops 1, 3, 5 …) is today's tile, untouched. Shade 1 (shops 2, 4, 6 …) tints the cards themselves: the cap, the
   quote tile and the answer tile take a tinted --surface, so every fill inside them that is made from --surface follows. One dial. */
:root body:not(.doc) { --sec-tint: 8%; }
:root body:not(.doc) .shop[data-c="1"] { --sec-surface: color-mix(in oklab, var(--sec) var(--sec-tint), var(--surface)); --sec-good: color-mix(in oklab, var(--good) 85%, var(--ink)); }
:root body:not(.doc) .shop[data-c="1"] :is(.shopbar, .quote, .flow) { --surface: var(--sec-surface); --muted: var(--open-muted); --good: var(--sec-good); }      /* muted and green text one step darker on the tint (muted as inside an open detail, REV11) */

/* ---- 2. The sections' box carries the window (it was on .deck) ---- */
:root body:not(.doc) .shops { position: relative; max-width: 600px; margin: 12px auto calc(16px + var(--win-pad)); }
:root body:not(.doc) .shops::before { content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: -100vmax; bottom: calc(-1 * var(--win-pad)); left: calc(50% - 50vw); right: calc(50% - 50vw);
  box-shadow: 0 0 0 200vmax var(--win-ground), inset 0 -1px 0 rgba(255, 255, 255, .22), inset 0 -2px 0 rgba(0, 0, 0, .35), inset 0 -18px 22px -18px rgba(0, 0, 0, .5); }
:root body:not(.doc) .shops .deck { margin: 0; max-width: none; }
:root body:not(.doc) .shops .deck::before { content: none; }
:root body:not(.doc) .shop { position: relative; }
@media (min-width: 960px) { :root body:not(.doc) .shops { max-width: 1180px; margin-top: 16px; } }

/* ---- 3. Bars shown (two or more sections, or a named one): each section is a band of the window in its own shade ---- */
:root body:not(.doc) .shops.bars .shop { --bar-h: 44px; }      /* src/app.tsx sets each shop's own, the bar's height */
/* rev15c (owner: "I don't like the summary pill being separate as a pill"): the bar is the CAP of its shop's cards: the same fill,
   the same corner and lift as the tiles, square underneath, sitting on the tiles with no gap. Its fill runs on for one corner's
   height behind the tops of the tiles (.shopbody::before), so no window shows at the tiles' rounded top corners and the tiles and
   their library glass keep their shape. Shops are spaced wider apart than the tiles inside one. */
:root body:not(.doc) .shops.bars { --cap-r: var(--r6); --shop-gap: 24px; }
@media (min-width: 960px) { :root body:not(.doc) .shops.bars { --shop-gap: 28px; } }
:root body:not(.doc) .shops.bars .shop + .shop { margin-top: var(--shop-gap); }
:root body:not(.doc) .shops.bars .shop[data-open="0"] + .shop { margin-top: 10px; }      /* after a collapsed shop: closer, so collapsed caps read as a list */
:root body:not(.doc) .shops.bars .shopbody { position: relative; }
:root body:not(.doc) .shops.bars .shopbody::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: var(--cap-r); pointer-events: none;
  background: color-mix(in srgb, var(--surface) 96%, transparent); }
:root body:not(.doc) .shop[data-c="1"] .shopbody::before { background: color-mix(in srgb, var(--sec-surface) 96%, transparent); }

/* ---- 4. The bar: number, flag of the country bought in, name (typed in place), the shop's summary, collapse / expand, remove.
        Owner: each shop says "how much percentage and value over the gold", and the summary "should show all the time": the quote and
        the ask each carry their "% over gold value" (the figure to compare, emphasised) and that money (quieter), open or collapsed,
        laid out the same in both, so toggling never changes the bar's height. Stuck under the coin strip on a phone it keeps only the
        name, the flag and the two figures with their % (src/app.tsx marks it data-stuck and keeps the page from jumping). ---- */
:root body:not(.doc) .shopbar { position: sticky; z-index: 20; top: calc(var(--strip-h) + var(--vv-top, 0px));
  scroll-margin-top: -12px;      /* html has scroll-padding-top strip + 12px; the two add up to rest the cap flush under the strip */
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto auto; align-items: center; column-gap: 8px;
  min-height: var(--bar-min); margin: 0; padding: 0 4px 0 14px; color: var(--ink); border-radius: var(--cap-r) var(--cap-r) 0 0; cursor: pointer;
  background: var(--surface); box-shadow: inset 0 -1px 0 var(--line), var(--r10-lift); }
:root body:not(.doc) .shops.bars { --bar-min: 44px; }
:root body:not(.doc) .shop[data-open="0"] .shopbar { border-radius: var(--cap-r); box-shadow: var(--rim), var(--r10-lift); }      /* collapsed: the cap alone, a card like the tiles */
:root body:not(.doc) .shop[data-stuck] .shopbar { border-radius: 0; box-shadow: inset 0 -1px 0 var(--line-strong), 0 10px 14px -10px color-mix(in srgb, #000 55%, transparent); }      /* stuck: square, flush under the coin strip */
:root body:not(.doc) .sno { grid-row: 1; grid-column: 1; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 13px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: #fff; background: var(--sec); }
:root body:not(.doc) .shopbar > .flag { grid-row: 1; grid-column: 2; margin: 0; }
:root body:not(.doc) .sname { grid-row: 1; grid-column: 3; min-width: 0; width: 100%; height: 32px; padding: 0 6px; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); text-overflow: ellipsis;
  border: 0; border-radius: var(--c-r); background: none; box-shadow: none; cursor: text; }
:root body:not(.doc) .sname::placeholder { font-weight: 400; color: var(--open-muted); opacity: 1; }
:root body:not(.doc) .sname:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
:root body:not(.doc) .sname:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; background: var(--field); }
/* the collapse button and × keep their place in both states (decision 46) */
:root body:not(.doc) .shopbar > .stog { grid-row: 1; grid-column: 5; }
:root body:not(.doc) .shopbar > :last-child { grid-row: 1; grid-column: 6; }
/* the summary: a line under the name, wrapping as it needs */
:root body:not(.doc) .ssum { grid-row: 2; grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; min-width: 0; padding: 0 0 0 2px; }
:root body:not(.doc) .ssum:not(:empty) { margin-bottom: 8px; }      /* no bill yet: an empty summary, the bar is one row (flag and name) */
:root body:not(.doc) .sfig { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; }
:root body:not(.doc) .sfq, :root body:not(.doc) .sov { display: inline-flex; align-items: baseline; gap: 0 4px; white-space: nowrap; }
:root body:not(.doc) .sfq { gap: 6px; }
:root body:not(.doc) .sdot { margin-left: -2px; }
:root body:not(.doc) .sfig small, :root body:not(.doc) .sow, :root body:not(.doc) .som { font-size: 12px; color: var(--open-muted); }
/* the shop's total weight, first in its summary (owner: "add total gold weight in the summary bars") */
:root body:not(.doc) .swt { font-size: 13px; font-weight: 500; color: var(--open-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* the total weight after "Gold itself" in the answer's two lists, muted like the bracketed figures beside it; it moves under the
   name as a whole if the name column is too narrow, never the amount */
:root body:not(.doc) .legend .gw { font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }
:root body:not(.doc) .sfig b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
:root body:not(.doc) .sov em { font-size: 15px; font-weight: 700; font-style: normal; font-variant-numeric: tabular-nums; }
:root body:not(.doc) .sfig.mine :is(b, em) { color: var(--sec-ink); }
:root body:not(.doc) .shopbar .tag { flex: none; align-self: center; }
/* a wide bar (a laptop, the bar 1,100 px or more): everything on one row */
@media (min-width: 1150px) {
  :root body:not(.doc) .ssum { grid-row: 1; grid-column: 4; flex-wrap: nowrap; white-space: nowrap; }
  :root body:not(.doc) .ssum:not(:empty) { margin-bottom: 0; }
}
:root body:not(.doc) .stog { position: relative; width: 44px; height: 44px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--sec-ink); }
:root body:not(.doc) .stog::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: color-mix(in oklab, var(--sec) 12%, transparent); transition: background .15s; }
:root body:not(.doc) .stog:hover::before { background: color-mix(in oklab, var(--sec) 24%, transparent); }
:root body:not(.doc) .stog::after { content: ""; position: absolute; left: 18px; top: 19px; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.75px 1.75px 0; transform: rotate(-135deg); }   /* open: points up */
:root body:not(.doc) .stog[aria-expanded=false]::after { top: 15.5px; transform: rotate(45deg); }                                                                                                        /* collapsed: points down */
:root body:not(.doc) .shopbar .xdel { margin: 0 0 0 -8px; }
@media (max-width: 599.98px) {
  :root body:not(.doc) .shopbar { column-gap: 4px; padding: 0 2px 0 10px; }
  :root body:not(.doc) .ssum { gap: 0 12px; }
  /* stuck under the coin strip: name, flag and the two "% over gold" after their labels, on one line ("Quote 13.4% over gold  Ask 11.3%");
     the amounts, To pay and the tag are left to the bar in place and to the tiles */
  :root body:not(.doc) .shop[data-stuck] :is(.sfq b, .sdot, .som, .sfig.pay, .tag) { display: none; }
}

/* ---- 5. "Add shop": a small pill on a hairline, on the window under the last section (the look of deckfront's "Add a section") ---- */
:root body:not(.doc) .addshop { position: relative; display: flex; justify-content: center; margin: 14px 0 0; }
:root body:not(.doc) .shops.bars .addshop { margin-top: 0; padding-top: 14px; }
:root body:not(.doc) .addshop::before { content: ""; position: absolute; left: calc(50% - 50vw); right: calc(50% - 50vw); top: calc(100% - 15px); height: 1px; background: rgba(255, 255, 255, .22); }
:root body:not(.doc) .addshop > * { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 14px 3px 6px; font-size: 13px; font-weight: 500; color: var(--ink);
  border: 0; border-radius: 99px; background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: var(--r10-lift); }
:root body:not(.doc) .addshop > span { padding-left: 14px; color: var(--muted); }
:root body:not(.doc) .addshop button::after { content: ""; position: absolute; inset: -7px 0; }
:root body:not(.doc) .addshop button:hover { background: var(--surface); }
:root body:not(.doc) .addshop .plus { display: block; width: 20px; height: 20px; border-radius: 50%; background: var(--c-fill-2); }
:root body:not(.doc) .addshop .plus::before, :root body:not(.doc) .addshop .plus::after { left: 5px; right: 5px; top: 9.25px; }

/* ---- 6. "Shop removed · Undo": a light pill at the foot of the window for eight seconds ---- */
:root body:not(.doc) .undo { position: fixed; z-index: 60; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 2px;
  min-height: 44px; padding: 0 2px 0 16px; font-size: 13px; color: var(--ink); white-space: nowrap; border-radius: 99px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong), var(--e3); }
:root body:not(.doc) .undo button.linkbtn { min-height: 44px; padding: 0 12px; font-weight: 600; }
:root body:not(.doc) .undo .xdel { margin: 0; }

/* ---- 7. Laptop: the quote tile rests under the stuck bar ---- */
@media (min-width: 960px) { :root body:not(.doc) .shops.bars .quote-in { top: calc(var(--strip-h) + var(--bar-h) + 10px); } }

/* the theme list drops from the header tile over the first bar */
:root body:not(.doc):has(.shops.bars) .head { z-index: 25; }

/* ---- 8. Forced colours, print ---- */
@media (forced-colors: active) { :root body:not(.doc) .shopbar { border: 1px solid CanvasText; } :root body:not(.doc) .sno { border: 1px solid CanvasText; forced-color-adjust: none; color: Canvas; background: CanvasText; } }
@media print {
  :root body:not(.doc) .shops { margin: 0 !important; max-width: none !important; }
  :root body:not(.doc) .shops::before, :root body:not(.doc) .shop::before, :root body:not(.doc) .addshop, :root body:not(.doc) .undo, :root body:not(.doc) .shopbar { display: none !important; }
  :root body:not(.doc) .shop { margin: 0 !important; }
  :root body:not(.doc) .shopbody::before { content: none !important; }
  :root body[data-print]:not(.doc) .shop:not(.printing) { display: none !important; }      /* one shop's invoice per print */
  :root body:not(.doc) #app .pname { display: block; margin: 0 0 2px; font-size: 13px; font-weight: 600; }
}
:root body:not(.doc) .pname { display: none; }      /* the shop's name above the printed invoice; on paper only */
/* ---- rev15: from the first tile to the second, a plain arrow on the window (was a small round glass disc with ">").
        Owner: "The > looks like a collapsable thing. Is there some way to indicate that it is the flow?" Every other chevron on the
        page now opens or closes something, so this one has a shaft (an arrow, not a chevron) and no disc, no glass, no shadow plate:
        nothing to press. White with a thin dark edge, straight on the dark window. Decorative: aria-hidden, no pointer events. ---- */
:root body:not(.doc) .chev { position: absolute; z-index: 3; top: -12px; left: 50%; width: 12px; height: 12px; margin-left: -6px;      /* phone: fills the 12px gap, pointing down */
  color: #fff; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .6)); pointer-events: none; cursor: default; forced-color-adjust: none; }
/* Owner: "a little bolder, larger, not longer", then "Can you make the arrow head solid?": a 3px shaft and a filled head, drawn as
   clipped boxes in the text colour (crisp at any zoom), the same length (about 10px on a phone, inside the 12px gap and 1px off
   each tile; 24px on a laptop). The shaft stays clearly visible, so it reads as an arrow, not an open/close triangle. */
:root body:not(.doc) .chev::before { content: ""; position: absolute; left: 4.5px; top: 1px; width: 3px; height: 5px; background: currentColor; border-radius: 1px 1px 0 0; }      /* the shaft */
:root body:not(.doc) .chev::after { content: ""; position: absolute; left: 1px; top: 5.5px; width: 10px; height: 5.5px; background: currentColor;
  clip-path: polygon(0 0, 100% 0, 50% 100%); }      /* the solid head, pointing down; its point 1px above the lower tile */
@media (min-width: 960px) {      /* laptop: 24px long in the 32px gap, pointing right, halfway down the tiles (or the part of them on screen: --chev-y) */
  :root body:not(.doc) .chev { top: calc(var(--chev-y, 50%) - 8px); left: -28px; width: 24px; height: 16px; margin-left: 0; }
  :root body:not(.doc) .chev::before { left: 0; top: 6.5px; width: 13.5px; height: 3px; border-radius: 1px 0 0 1px; }
  :root body:not(.doc) .chev::after { left: 13px; top: 1.5px; width: 11px; height: 13px; clip-path: polygon(0 0, 100% 50%, 0 100%); }      /* 13px across, pointing right */
}
@media (forced-colors: active) { :root body:not(.doc) .chev { filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000); } }      /* the photo stays behind it: white with a black edge */
@media print { :root body:not(.doc) .chev { display: none; } }
/* ==== REV15 END ==== */
/* ==== REV16 START: the shop bar's summary as a small table (owner: "Give the summary a structure, the summary on the shop bar is
   jumbled up in phone"). Below 960 px (the page is one column there) the summary is a grid with FIXED tracks, the same in every
   bar, so the figures line up down a list of collapsed shops:
        24 g                  over gold
        Quote   $4,569.60    19%  $729.60
        Ask     $4,447.20  15.8%  $607.20
        [Lower % over gold]
   label | bill amount | % over gold (the figure to compare, heaviest) | that money (quiet). "over gold" is said once, as the
   heading of the last two columns, on the weight's line. Under 360 px the money column goes (the % stays). From 960 px the summary
   stays one sentence-like line, in the same order with the same labels. Same colours as REV15 (no new colour).
   To undo: delete this block and put the brackets back round {b.over} and {b.askOver} in src/app.tsx. ==== */
/* the brackets round the money over gold belong to the one-line form only: drawn here, not typed in the markup */
:root body:not(.doc) .som::before { content: "("; }
:root body:not(.doc) .som::after { content: ")"; }
@media (max-width: 959.98px) {
  :root body:not(.doc) .shops.bars { --t1: 44px; --t2: 90px; --t3: 54px; --t4: 62px; --tg: 8px; }
  :root body:not(.doc) .ssum { display: grid; grid-template-columns: var(--t1) var(--t2) var(--t3) var(--t4); justify-content: start; align-items: baseline; gap: 0 var(--tg);
    line-height: 20px; font-variant-numeric: tabular-nums; }
  :root body:not(.doc) .sfig, :root body:not(.doc) .sfq, :root body:not(.doc) .sov { display: contents; }
  :root body:not(.doc) .sdot, :root body:not(.doc) .som::before, :root body:not(.doc) .som::after { display: none; content: none; }
  /* line 1: the weight, and the heading of the two "over gold" columns with a hairline under it */
  :root body:not(.doc) .ssum > .swt { grid-row: 1; grid-column: 1 / 3; font-size: 12px; line-height: 18px; }
  :root body:not(.doc) .sow { grid-row: 1; grid-column: 3 / 5; text-align: left; font-size: 12px; line-height: 17px; white-space: nowrap; box-shadow: 0 1px 0 var(--line-strong); }
  /* the rows: each cell names its column, so the rows fill themselves in order (Quote, To pay, Ask) */
  :root body:not(.doc) .sfig small { grid-column: 1; white-space: nowrap; }
  :root body:not(.doc) .sfig b { grid-column: 2; justify-self: end; white-space: nowrap; font-size: 14px; font-weight: 500; }
  :root body:not(.doc) .sov em { grid-column: 3; justify-self: end; white-space: nowrap; }
  :root body:not(.doc) .som { grid-column: 4; justify-self: end; white-space: nowrap; }
  /* To pay / Shop pays you: no "over gold" figures; its amount ends under the bill amounts, and a long label pushes it right into the empty cells */
  :root body:not(.doc) .sfig.pay .sfq { grid-column: 1 / -1; justify-self: start; display: flex; justify-content: space-between; align-items: baseline; gap: var(--tg); min-width: calc(var(--t1) + var(--tg) + var(--t2)); }
  /* the tag: a line of its own under the table */
  :root body:not(.doc) .shopbar .tag { grid-column: 1 / -1; justify-self: start; align-self: auto; margin: 3px 0 1px; }
}
@media (max-width: 359.98px) {      /* a narrow phone: the money over gold goes, the % stays */
  :root body:not(.doc) .ssum { grid-template-columns: var(--t1) var(--t2) var(--t3); }
  :root body:not(.doc) .sow { grid-column: 3; justify-self: end; }      /* ends in line with the %; "over silver", a little wider than the track, grows to the left */
  :root body:not(.doc) .som { display: none; }
}
@media (max-width: 599.98px) {
  /* stuck under the coin strip: the same order on one line, "20 g  Quote 13.4% over gold  Ask 11.3%" (the amounts, the money, To pay
     and the tag are left to the bar in place and to the tiles); under 360 px "over gold" goes too */
  :root body:not(.doc) .shop[data-stuck] .ssum { display: flex; flex-wrap: nowrap; align-items: baseline; gap: 0 12px; white-space: nowrap; }
  :root body:not(.doc) .shop[data-stuck] .sfig { display: flex; align-items: baseline; gap: 0 4px; }
  :root body:not(.doc) .shop[data-stuck] :is(.sfq, .sov) { display: inline-flex; align-items: baseline; gap: 0 4px; }
  :root body:not(.doc) .shop[data-stuck] .ssum > .swt { font-size: 13px; line-height: inherit; }
  :root body:not(.doc) .shop[data-stuck] .sow { box-shadow: none; line-height: inherit; }
  :root body:not(.doc) .shop[data-stuck] :is(.sfq b, .som, .sfig.pay, .tag) { display: none; }
}
@media (max-width: 359.98px) { :root body:not(.doc) .shop[data-stuck] .sow { display: none; } }
/* forced colours drop box-shadows: the heading's line as a real 1px border there (same place, same row height) */
@media (forced-colors: active) and (max-width: 959.98px) {
  :root body:not(.doc) .sow { box-shadow: none; border-bottom: 1px solid CanvasText; }
}
@media (forced-colors: active) and (max-width: 599.98px) { :root body:not(.doc) .shop[data-stuck] .sow { border-bottom: 0; } }      /* the stuck one-line form has no line */
/* ==== REV16 END ==== */
