/* BEagent: the front page and its chat.
   Purdue's black and gold: a warm paper ground (Home's behind two faint concentration-time curves), gold on the
   actions, near-black ink, a serif face throughout. No external resource: the page's policy allows only this file,
   so every colour and shape is here and every icon is inline SVG. */

:root {
  --bg: #fcfbf8;
  --ink: #111111;
  --ink-2: #464138;
  --muted: #555960;
  --faint: #928c84;
  --line: #e4e0d6;
  --line-soft: #efebe3;
  --white: #ffffff;
  --accent: #8e6f3e;
  --accent-dark: #6b5430;
  --accent-pale: #efe0c0;
  --accent-tint: #fbf6ea;
  /* Boilermaker Gold fills the actions, with near-black on it (9.9:1); the deeper gold draws the logo's ring and
     the sliders' fill, where the light gold would fade into the paper. */
  --gold: #cfb991;
  --gold-deep: #b59a63;
  --gold-hover: #c0a77b;
  --on-gold: #111111;
  --danger: #b23a30;
  /* A held API key's dot (Uhan3, 2026-10-18): green, the one status colour outside the black and gold. */
  --ok: #2f8a4c;
  --danger-pale: #fbeeed;
  --warn-ink: #8a4a12;
  --warn-bg: #fdf0e1;
  --serif: Georgia, "Noto Serif SC", "Songti SC", "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow-sm: 0 1px 2px rgba(26, 20, 0, 0.06), 0 2px 8px rgba(26, 20, 0, 0.05);
  --shadow-md: 0 2px 4px rgba(26, 20, 0, 0.04), 0 8px 26px rgba(26, 20, 0, 0.08);
  --gutter: 16px;
  --rail-w: 68px;
  --panel-w: 280px;
  --side-bg: #f5f0e1;
  /* The intro's curves (Emil Kowalski's): a strong ease-out for what enters, a strong ease-in-out for what moves. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: var(--serif);
  /* Lining figures everywhere: the serif's old-style ones make "S03" read as "So3" (Uhan3, 2026-10-17) */
  font-variant-numeric: lining-nums;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  /* A soft light in the middle of the page; Home adds the two curves below. */
  background-image: radial-gradient(ellipse at 50% 38%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 62%);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  /* The sidebar is fixed at the left: the page sits beside it, a rail or an open panel wide. */
  --side-w: var(--rail-w);
  padding-left: var(--side-w);
  /* The Data panel slides over the page at the right and moves nothing (Uhan3, 2026-10-16): no room is kept for it. */
}
body.side-open { --side-w: var(--panel-w); }
/* Home's picture: two concentration-time curves, a Test (solid) and a Reference (dashed), the pair a bioequivalence
   study compares, faint in gold, the area under the Reference lightly filled and none under the Test. They are drawn
   close, as a passing pair's means are (Cmax T/R 1.03, AUC 1.01: one-compartment oral curves, the Test a touch faster
   in). A fixed layer under
   the page, as wide as the main column with the sidebar open, centred on the main column: closing the sidebar slides
   it left with the content, at the content's pace, and keeps its size. A layer of its own rather than the body's
   background, so it appears in place when Home opens instead of sliding in. The Data panel slides over its right end
   and leaves it in place. Its lines keep their width (non-scaling-stroke). The conversation views keep the plain
   ground. (A smaller picture was tried on 2026-10-16; Uhan3 kept this one.) */
body.is-home::before {
  content: "";
  position: fixed;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: calc((var(--side-w) + var(--panel-w)) / 2);
  width: calc(100% - var(--panel-w));
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1000' preserveAspectRatio='none'%3E%3Cg opacity='0.6'%3E%3Cpath d='M40.0 1000.0 L46.3 890.2 L52.7 793.7 L59.0 709.1 L65.3 635.1 L71.7 570.5 L78.0 514.4 L84.3 465.9 L90.7 424.0 L97.0 388.2 L103.3 357.7 L109.7 332.0 L116.0 310.5 L122.3 292.8 L128.7 278.5 L135.0 267.1 L141.3 258.4 L147.7 252.0 L154.0 247.7 L160.3 245.2 L166.7 244.3 L173.0 244.9 L179.3 246.7 L185.7 249.7 L192.0 253.6 L198.3 258.3 L204.7 263.8 L211.0 269.9 L217.3 276.6 L223.7 283.7 L230.0 291.3 L236.3 299.2 L242.7 307.4 L249.0 315.8 L255.3 324.4 L261.7 333.2 L268.0 342.1 L274.3 351.1 L280.7 360.2 L287.0 369.3 L293.3 378.4 L299.7 387.5 L306.0 396.7 L312.3 405.7 L318.7 414.8 L325.0 423.8 L331.3 432.7 L337.7 441.6 L344.0 450.4 L350.3 459.1 L356.7 467.7 L363.0 476.2 L369.3 484.6 L375.7 493.0 L382.0 501.2 L388.3 509.3 L394.7 517.3 L401.0 525.2 L407.3 533.0 L413.7 540.7 L420.0 548.3 L426.3 555.8 L432.7 563.1 L439.0 570.4 L445.3 577.5 L451.7 584.5 L458.0 591.4 L464.3 598.2 L470.7 604.9 L477.0 611.5 L483.3 618.0 L489.7 624.4 L496.0 630.7 L502.3 636.9 L508.7 643.0 L515.0 649.0 L521.3 654.9 L527.7 660.6 L534.0 666.3 L540.3 671.9 L546.7 677.5 L553.0 682.9 L559.3 688.2 L565.7 693.5 L572.0 698.6 L578.3 703.7 L584.7 708.7 L591.0 713.6 L597.3 718.4 L603.7 723.1 L610.0 727.8 L616.3 732.4 L622.7 736.9 L629.0 741.3 L635.3 745.7 L641.7 749.9 L648.0 754.2 L654.3 758.3 L660.7 762.4 L667.0 766.4 L673.3 770.3 L679.7 774.2 L686.0 778.0 L692.3 781.7 L698.7 785.4 L705.0 789.0 L711.3 792.6 L717.7 796.1 L724.0 799.5 L730.3 802.9 L736.7 806.2 L743.0 809.5 L749.3 812.7 L755.7 815.8 L762.0 818.9 L768.3 822.0 L774.7 825.0 L781.0 827.9 L787.3 830.8 L793.7 833.7 L800.0 836.5 L806.3 839.3 L812.7 842.0 L819.0 844.6 L825.3 847.2 L831.7 849.8 L838.0 852.4 L844.3 854.8 L850.7 857.3 L857.0 859.7 L863.3 862.1 L869.7 864.4 L876.0 866.7 L882.3 868.9 L888.7 871.1 L895.0 873.3 L901.3 875.4 L907.7 877.5 L914.0 879.6 L920.3 881.6 L926.7 883.6 L933.0 885.6 L939.3 887.5 L945.7 889.4 L952.0 891.3 L958.3 893.1 L964.7 894.9 L971.0 896.7 L977.3 898.4 L983.7 900.1 L990.0 901.8 L996.3 903.5 L1002.7 905.1 L1009.0 906.7 L1015.3 908.3 L1021.7 909.8 L1028.0 911.3 L1034.3 912.8 L1040.7 914.3 L1047.0 915.7 L1053.3 917.2 L1059.7 918.6 L1066.0 919.9 L1072.3 921.3 L1078.7 922.6 L1085.0 923.9 L1091.3 925.2 L1097.7 926.5 L1104.0 927.7 L1110.3 928.9 L1116.7 930.1 L1123.0 931.3 L1129.3 932.5 L1135.7 933.6 L1142.0 934.7 L1148.3 935.8 L1154.7 936.9 L1161.0 938.0 L1167.3 939.0 L1173.7 940.0 L1180.0 941.0 L1186.3 942.0 L1192.7 943.0 L1199.0 944.0 L1205.3 944.9 L1211.7 945.8 L1218.0 946.8 L1224.3 947.7 L1230.7 948.5 L1237.0 949.4 L1243.3 950.3 L1249.7 951.1 L1256.0 951.9 L1262.3 952.7 L1268.7 953.5 L1275.0 954.3 L1281.3 955.1 L1287.7 955.8 L1294.0 956.6 L1300.3 957.3 L1306.7 958.0 L1313.0 958.7 L1319.3 959.4 L1325.7 960.1 L1332.0 960.8 L1338.3 961.5 L1344.7 962.1 L1351.0 962.7 L1357.3 963.4 L1363.7 964.0 L1370.0 964.6 L1376.3 965.2 L1382.7 965.8 L1389.0 966.4 L1395.3 966.9 L1401.7 967.5 L1408.0 968.0 L1414.3 968.6 L1420.7 969.1 L1427.0 969.6 L1433.3 970.1 L1439.7 970.6 L1446.0 971.1 L1452.3 971.6 L1458.7 972.1 L1465.0 972.6 L1471.3 973.0 L1477.7 973.5 L1484.0 973.9 L1490.3 974.4 L1496.7 974.8 L1503.0 975.2 L1509.3 975.6 L1515.7 976.1 L1522.0 976.5 L1528.3 976.9 L1534.7 977.2 L1541.0 977.6 L1547.3 978.0 L1553.7 978.4 L1560.0 978.7 L1560 1000 L40 1000 Z' fill='%23cfb991' fill-opacity='0.05' stroke='none'/%3E%3Cg fill='none' stroke='%23b59a63' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M40.0 1000.0 L46.3 890.2 L52.7 793.7 L59.0 709.1 L65.3 635.1 L71.7 570.5 L78.0 514.4 L84.3 465.9 L90.7 424.0 L97.0 388.2 L103.3 357.7 L109.7 332.0 L116.0 310.5 L122.3 292.8 L128.7 278.5 L135.0 267.1 L141.3 258.4 L147.7 252.0 L154.0 247.7 L160.3 245.2 L166.7 244.3 L173.0 244.9 L179.3 246.7 L185.7 249.7 L192.0 253.6 L198.3 258.3 L204.7 263.8 L211.0 269.9 L217.3 276.6 L223.7 283.7 L230.0 291.3 L236.3 299.2 L242.7 307.4 L249.0 315.8 L255.3 324.4 L261.7 333.2 L268.0 342.1 L274.3 351.1 L280.7 360.2 L287.0 369.3 L293.3 378.4 L299.7 387.5 L306.0 396.7 L312.3 405.7 L318.7 414.8 L325.0 423.8 L331.3 432.7 L337.7 441.6 L344.0 450.4 L350.3 459.1 L356.7 467.7 L363.0 476.2 L369.3 484.6 L375.7 493.0 L382.0 501.2 L388.3 509.3 L394.7 517.3 L401.0 525.2 L407.3 533.0 L413.7 540.7 L420.0 548.3 L426.3 555.8 L432.7 563.1 L439.0 570.4 L445.3 577.5 L451.7 584.5 L458.0 591.4 L464.3 598.2 L470.7 604.9 L477.0 611.5 L483.3 618.0 L489.7 624.4 L496.0 630.7 L502.3 636.9 L508.7 643.0 L515.0 649.0 L521.3 654.9 L527.7 660.6 L534.0 666.3 L540.3 671.9 L546.7 677.5 L553.0 682.9 L559.3 688.2 L565.7 693.5 L572.0 698.6 L578.3 703.7 L584.7 708.7 L591.0 713.6 L597.3 718.4 L603.7 723.1 L610.0 727.8 L616.3 732.4 L622.7 736.9 L629.0 741.3 L635.3 745.7 L641.7 749.9 L648.0 754.2 L654.3 758.3 L660.7 762.4 L667.0 766.4 L673.3 770.3 L679.7 774.2 L686.0 778.0 L692.3 781.7 L698.7 785.4 L705.0 789.0 L711.3 792.6 L717.7 796.1 L724.0 799.5 L730.3 802.9 L736.7 806.2 L743.0 809.5 L749.3 812.7 L755.7 815.8 L762.0 818.9 L768.3 822.0 L774.7 825.0 L781.0 827.9 L787.3 830.8 L793.7 833.7 L800.0 836.5 L806.3 839.3 L812.7 842.0 L819.0 844.6 L825.3 847.2 L831.7 849.8 L838.0 852.4 L844.3 854.8 L850.7 857.3 L857.0 859.7 L863.3 862.1 L869.7 864.4 L876.0 866.7 L882.3 868.9 L888.7 871.1 L895.0 873.3 L901.3 875.4 L907.7 877.5 L914.0 879.6 L920.3 881.6 L926.7 883.6 L933.0 885.6 L939.3 887.5 L945.7 889.4 L952.0 891.3 L958.3 893.1 L964.7 894.9 L971.0 896.7 L977.3 898.4 L983.7 900.1 L990.0 901.8 L996.3 903.5 L1002.7 905.1 L1009.0 906.7 L1015.3 908.3 L1021.7 909.8 L1028.0 911.3 L1034.3 912.8 L1040.7 914.3 L1047.0 915.7 L1053.3 917.2 L1059.7 918.6 L1066.0 919.9 L1072.3 921.3 L1078.7 922.6 L1085.0 923.9 L1091.3 925.2 L1097.7 926.5 L1104.0 927.7 L1110.3 928.9 L1116.7 930.1 L1123.0 931.3 L1129.3 932.5 L1135.7 933.6 L1142.0 934.7 L1148.3 935.8 L1154.7 936.9 L1161.0 938.0 L1167.3 939.0 L1173.7 940.0 L1180.0 941.0 L1186.3 942.0 L1192.7 943.0 L1199.0 944.0 L1205.3 944.9 L1211.7 945.8 L1218.0 946.8 L1224.3 947.7 L1230.7 948.5 L1237.0 949.4 L1243.3 950.3 L1249.7 951.1 L1256.0 951.9 L1262.3 952.7 L1268.7 953.5 L1275.0 954.3 L1281.3 955.1 L1287.7 955.8 L1294.0 956.6 L1300.3 957.3 L1306.7 958.0 L1313.0 958.7 L1319.3 959.4 L1325.7 960.1 L1332.0 960.8 L1338.3 961.5 L1344.7 962.1 L1351.0 962.7 L1357.3 963.4 L1363.7 964.0 L1370.0 964.6 L1376.3 965.2 L1382.7 965.8 L1389.0 966.4 L1395.3 966.9 L1401.7 967.5 L1408.0 968.0 L1414.3 968.6 L1420.7 969.1 L1427.0 969.6 L1433.3 970.1 L1439.7 970.6 L1446.0 971.1 L1452.3 971.6 L1458.7 972.1 L1465.0 972.6 L1471.3 973.0 L1477.7 973.5 L1484.0 973.9 L1490.3 974.4 L1496.7 974.8 L1503.0 975.2 L1509.3 975.6 L1515.7 976.1 L1522.0 976.5 L1528.3 976.9 L1534.7 977.2 L1541.0 977.6 L1547.3 978.0 L1553.7 978.4 L1560.0 978.7' stroke-width='2' stroke-dasharray='8 8' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M40.0 1000.0 L46.3 879.1 L52.7 774.0 L59.0 682.7 L65.3 603.8 L71.7 535.7 L78.0 477.2 L84.3 427.3 L90.7 384.8 L97.0 349.0 L103.3 318.9 L109.7 294.1 L116.0 273.8 L122.3 257.4 L128.7 244.6 L135.0 234.9 L141.3 227.9 L147.7 223.3 L154.0 220.7 L160.3 220.0 L166.7 220.9 L173.0 223.1 L179.3 226.6 L185.7 231.0 L192.0 236.4 L198.3 242.6 L204.7 249.4 L211.0 256.8 L217.3 264.7 L223.7 272.9 L230.0 281.5 L236.3 290.4 L242.7 299.5 L249.0 308.8 L255.3 318.2 L261.7 327.7 L268.0 337.3 L274.3 346.9 L280.7 356.6 L287.0 366.2 L293.3 375.9 L299.7 385.4 L306.0 395.0 L312.3 404.5 L318.7 413.9 L325.0 423.2 L331.3 432.4 L337.7 441.6 L344.0 450.6 L350.3 459.5 L356.7 468.4 L363.0 477.1 L369.3 485.7 L375.7 494.2 L382.0 502.5 L388.3 510.8 L394.7 518.9 L401.0 526.9 L407.3 534.8 L413.7 542.6 L420.0 550.2 L426.3 557.8 L432.7 565.2 L439.0 572.5 L445.3 579.7 L451.7 586.7 L458.0 593.7 L464.3 600.5 L470.7 607.3 L477.0 613.9 L483.3 620.4 L489.7 626.8 L496.0 633.1 L502.3 639.3 L508.7 645.4 L515.0 651.4 L521.3 657.3 L527.7 663.1 L534.0 668.8 L540.3 674.4 L546.7 679.9 L553.0 685.3 L559.3 690.7 L565.7 695.9 L572.0 701.1 L578.3 706.1 L584.7 711.1 L591.0 716.0 L597.3 720.8 L603.7 725.5 L610.0 730.2 L616.3 734.8 L622.7 739.3 L629.0 743.7 L635.3 748.0 L641.7 752.3 L648.0 756.5 L654.3 760.6 L660.7 764.7 L667.0 768.7 L673.3 772.6 L679.7 776.4 L686.0 780.2 L692.3 784.0 L698.7 787.6 L705.0 791.2 L711.3 794.8 L717.7 798.2 L724.0 801.7 L730.3 805.0 L736.7 808.3 L743.0 811.6 L749.3 814.8 L755.7 817.9 L762.0 821.0 L768.3 824.0 L774.7 827.0 L781.0 829.9 L787.3 832.8 L793.7 835.7 L800.0 838.5 L806.3 841.2 L812.7 843.9 L819.0 846.5 L825.3 849.1 L831.7 851.7 L838.0 854.2 L844.3 856.7 L850.7 859.1 L857.0 861.5 L863.3 863.8 L869.7 866.2 L876.0 868.4 L882.3 870.7 L888.7 872.8 L895.0 875.0 L901.3 877.1 L907.7 879.2 L914.0 881.3 L920.3 883.3 L926.7 885.2 L933.0 887.2 L939.3 889.1 L945.7 891.0 L952.0 892.8 L958.3 894.6 L964.7 896.4 L971.0 898.2 L977.3 899.9 L983.7 901.6 L990.0 903.3 L996.3 904.9 L1002.7 906.5 L1009.0 908.1 L1015.3 909.7 L1021.7 911.2 L1028.0 912.7 L1034.3 914.2 L1040.7 915.6 L1047.0 917.1 L1053.3 918.5 L1059.7 919.9 L1066.0 921.2 L1072.3 922.6 L1078.7 923.9 L1085.0 925.2 L1091.3 926.4 L1097.7 927.7 L1104.0 928.9 L1110.3 930.1 L1116.7 931.3 L1123.0 932.5 L1129.3 933.6 L1135.7 934.7 L1142.0 935.8 L1148.3 936.9 L1154.7 938.0 L1161.0 939.0 L1167.3 940.1 L1173.7 941.1 L1180.0 942.1 L1186.3 943.1 L1192.7 944.0 L1199.0 945.0 L1205.3 945.9 L1211.7 946.8 L1218.0 947.7 L1224.3 948.6 L1230.7 949.5 L1237.0 950.4 L1243.3 951.2 L1249.7 952.0 L1256.0 952.8 L1262.3 953.6 L1268.7 954.4 L1275.0 955.2 L1281.3 956.0 L1287.7 956.7 L1294.0 957.4 L1300.3 958.2 L1306.7 958.9 L1313.0 959.6 L1319.3 960.2 L1325.7 960.9 L1332.0 961.6 L1338.3 962.2 L1344.7 962.9 L1351.0 963.5 L1357.3 964.1 L1363.7 964.7 L1370.0 965.3 L1376.3 965.9 L1382.7 966.5 L1389.0 967.1 L1395.3 967.6 L1401.7 968.2 L1408.0 968.7 L1414.3 969.2 L1420.7 969.8 L1427.0 970.3 L1433.3 970.8 L1439.7 971.3 L1446.0 971.8 L1452.3 972.2 L1458.7 972.7 L1465.0 973.2 L1471.3 973.6 L1477.7 974.1 L1484.0 974.5 L1490.3 974.9 L1496.7 975.4 L1503.0 975.8 L1509.3 976.2 L1515.7 976.6 L1522.0 977.0 L1528.3 977.4 L1534.7 977.8 L1541.0 978.2 L1547.3 978.5 L1553.7 978.9 L1560.0 979.2' stroke-width='2.2' vector-effect='non-scaling-stroke'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
  pointer-events: none;
  transition: left 0.22s ease, width 0.22s ease;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid rgba(142, 111, 62, 0.55); outline-offset: 2px; }

.ico {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-fill { fill: currentColor; stroke: none; }

/* ------------------------------------------------------------------ the sidebar (desktop widths) */

.side {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--side-w);
  padding: 10px 14px 12px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--side-bg);
}
.side-top { flex: none; display: flex; align-items: center; height: 48px; margin-bottom: 6px; }
.side-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  height: 40px;
  padding: 0 6px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--ink);
}
.side-logo:hover { background: #ece6d6; }
.side-logo .logo { width: 28px; height: 28px; }
/* The name, a button of its own that goes Home (Uhan3, 2026-10-20); it sits where it sat inside the logo's button. */
.side-brand {
  height: 40px;
  margin-left: -2px;
  padding: 0 6px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font-size: 17px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.side-brand:hover { background: #ece6d6; }
.side-items { flex: none; display: flex; flex-direction: column; gap: 2px; }
.side-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--ink-2);
  font-size: 15px;
  text-align: left;
  white-space: nowrap;
}
.side-item:hover { background: #ece6d6; color: var(--ink); }
.side-item .ico { width: 18px; height: 18px; stroke-width: 1.8; }
.side-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side-live { color: var(--accent-dark); font-weight: 700; }
.side-live:hover { color: var(--accent-dark); background: var(--accent-pale); }
.live-dot {
  flex: none;
  width: 10px;
  height: 10px;
  margin: 0 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(142, 111, 62, 0.45);
  animation: beat 1.6s ease-out infinite;
}
@keyframes beat {
  0% { box-shadow: 0 0 0 0 rgba(142, 111, 62, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(142, 111, 62, 0); }
  100% { box-shadow: 0 0 0 0 rgba(142, 111, 62, 0); }
}

/* Collapsed: icons only. The sidebar's width eases between the rail and the panel, and the labels, the brand and the
   history panel fade rather than vanish: the icons stay where they are (the rail's 68 px, a little wider than its
   first 60 (Uhan3, 2026-10-16), puts an 18 px icon at its centre: 14 px of the sidebar's padding, 11 of the item's
   and half the icon), so nothing jumps while the width moves. */
.side { transition: width 0.22s ease; }
body { transition: padding-left 0.22s ease; }
.side-label { transition: opacity 0.16s ease; }
.side-brand, .side-panel { transition: opacity 0.16s ease, visibility 0s linear 0s; }
body:not(.side-open) .side-label { opacity: 0; }
/* The name is a button: faded out, it is hidden too, so the rail's edge takes no click and Tab skips it. */
body:not(.side-open) .side-brand,
body:not(.side-open) .side-panel { opacity: 0; visibility: hidden; transition: opacity 0.12s ease, visibility 0s linear 0.12s; }
@media (prefers-reduced-motion: reduce) {
  .side, body, body::before, body.is-home::before, .side-brand, .side-label, .side-panel { transition: none; }
}
/* At phone widths the open sidebar lies over the page, which keeps the rail's room and so its width (browser tests,
   2026-10-20: pushed aside by the open panel's 280 px, the page was crushed and wider than the screen). A pick in it,
   or a tap outside it, closes it (beagent.js onPhoneSideClick); with no choice kept it starts closed. */
@media (max-width: 640px) {
  body.side-open { --side-w: var(--rail-w); }
  body.side-open .side { width: var(--panel-w); box-shadow: 10px 0 28px rgba(26, 20, 0, 0.12); }
}
/* While the page sets itself up (from beagent-boot.js until beagent.js is done), nothing slides: a reload draws the
   sidebar and the Data panel as the user left them, at once (Uhan3, 2026-10-16). */
body.is-loading, body.is-loading::before, body.is-loading *, body.is-loading *::before, body.is-loading *::after {
  transition: none !important;
}

.side-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 12px; }
.side-search {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--muted);
}
.side-search:focus-within { border-color: #d2c1a4; box-shadow: 0 0 0 3px rgba(142, 111, 62, 0.1); }
.side-search .ico { width: 15px; height: 15px; }
.side-search input { flex: 1; min-width: 0; padding: 0; border: none; outline: none; background: none; font-size: 14px; }
.side-title { flex: none; margin: 4px 10px 4px; color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.side-list { flex: 1; min-height: 0; margin: 0; padding: 0 0 8px; overflow-y: auto; list-style: none; }
.side-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  text-align: left;
}
/* The row stays lit while the pointer is on its delete, which is the entry's, not the row's */
.side-entry:hover > .side-row { background: #ece6d6; }
.side-row.is-active, .side-entry:hover > .side-row.is-active { background: var(--accent-pale); }
.side-row-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.side-row-label { flex: 1; min-width: 0; overflow: hidden; font-size: 14px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.side-row-meta { overflow: hidden; color: var(--faint); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
/* A row's delete (spec of 2026-10-18, 3.1): at the row's right edge, over its top line, danger on hover as the Data
   panel's delete; at rest in --muted, which keeps 3:1 on the sidebar and on the active row (WCAG 1.4.11; --faint did
   not, review 2026-10-18). It shows while the pointer is over the row, or the row or the delete has keyboard focus
   (hidden, it stays in the tab order; a click's focus does not show it, nor the focus a delete moves to the next row),
   and the label's ellipsis then leaves it room. A screen that cannot hover, or a touch screen beside a mouse, shows it
   always: there a tap on the label's right end would meet the hidden delete. The running row has none. Each rule
   with :focus-visible or :has stands alone: a browser without them drops that rule only. */
.side-entry { position: relative; }
.side-del {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  padding: 5px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  opacity: 0;
}
.side-del:hover { background: var(--danger-pale); color: var(--danger); }
.side-del .ico { width: 14px; height: 14px; }
.side-entry:hover > .side-del { opacity: 1; }
.side-row:focus-visible + .side-del { opacity: 1; }
.side-del:focus-visible { opacity: 1; }
.side-entry.can-del:hover .side-row-top { padding-right: 20px; }
.side-entry.can-del > .side-row:focus-visible .side-row-top { padding-right: 20px; }
.side-entry.can-del:has(> .side-del:focus-visible) .side-row-top { padding-right: 20px; }
@media (hover: none), (any-pointer: coarse) {
  .side-del { opacity: 1; }
  .side-entry.can-del .side-row-top { padding-right: 20px; }
}
.side-running {
  flex: none;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--on-gold);
  font-size: 11px;
  line-height: 17px;
}
.side-empty { margin: 6px 10px; color: var(--faint); font-size: 13px; font-style: italic; }

/* ------------------------------------------------------------------ the Data panel (desktop widths, spec L1) */

/* Built like the sidebar, at the right edge, under the top bar (Uhan3, 2026-10-16). It slides out over the page,
   which stays where it is (Uhan3, 2026-10-16), with a soft shadow at its edge; closed, it slides out past the edge
   and leaves the tab order. */
:root { --data-panel-w: 300px; --topbar-h: 56px; }
.data-panel {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--data-panel-w);
  padding: 10px 0 12px;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--side-bg);
  box-shadow: -10px 0 28px rgba(26, 20, 0, 0.08);
  transition: transform 0.22s ease, visibility 0s linear 0s;
}
body:not(.data-open) .data-panel { visibility: hidden; transform: translateX(100%); transition: transform 0.22s ease, visibility 0s linear 0.22s; }
@media (prefers-reduced-motion: reduce) {
  .data-panel, body:not(.data-open) .data-panel, .run-chev { transition: none; }
}

/* The left edge widens the panel (Uhan3, 2026-10-19; beagent.js onPanelEdgeDown): a strip along the edge, with a thin
   line in the accent under the pointer, with the focus and while it is dragged. Hidden with the closed panel, so out of
   the tab order with it. The width is not among the panel's transitions, so the panel follows a drag at once; while
   the drag lasts nothing on the page is selected and the pointer is a resize arrow wherever it goes. */
.data-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
}
.data-resize::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--accent); opacity: 0; }
.data-resize:hover::after, .data-resize:focus-visible::after, body.data-resizing .data-resize::after { opacity: 1; }
.data-resize:focus-visible { outline: none; }
body.data-resizing { -webkit-user-select: none; user-select: none; }
body.data-resizing, body.data-resizing * { cursor: col-resize !important; }

.data-head { flex: none; display: flex; align-items: center; height: 48px; margin: 0 18px 6px; }
.data-title { margin: 0; font-size: 17px; font-weight: 400; letter-spacing: 0.01em; }
.data-out { margin: 6px 18px; color: var(--faint); font-size: 13px; font-style: italic; }
.data-in { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* The tabs are the Task selector's own setting (spec L2) */
.data-tabs { flex: none; display: flex; gap: 4px; margin: 0 12px 10px; padding: 3px; border-radius: 999px; background: var(--line-soft); }
.data-tab {
  flex: 1;
  padding: 5px 10px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 14px;
}
.data-tab:hover { color: var(--ink); }
.data-tab.is-on { background: var(--white); box-shadow: var(--shadow-sm); color: var(--accent-dark); font-weight: 700; }

.data-pane { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 8px; }
.data-sec { margin: 0 0 8px; padding: 8px 6px 6px; border: 1px dashed transparent; border-radius: 12px; }
.data-sec.is-missing { border-color: var(--danger); }
.data-sec.is-missing .data-sec-title { color: var(--danger); }
.data-sec-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 4px 4px; }
/* What a list is for, under its name while the pointer is on the name (Uhan3, 2026-10-20). Result has none. */
.data-sec-title[aria-describedby] { cursor: help; }
.data-tip {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 5;
  width: max-content;
  max-width: min(260px, 100%);
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-size: 12.5px;
  line-height: 1.4;
  box-shadow: 0 6px 18px rgba(26, 20, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0s linear 0.12s;
}
.data-sec-title:hover + .data-tip { opacity: 1; visibility: visible; transition: opacity 0.12s ease 0.2s, visibility 0s linear 0.2s; }
@media (prefers-reduced-motion: reduce) {
  .data-tip, .data-sec-title:hover + .data-tip { transition: none; }
}
.data-sec-title { margin: 0; color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.data-sec-ext { margin-left: 4px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.data-add {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink-2);
}
.data-add:hover { border-color: var(--accent); color: var(--accent-dark); }
.data-add .ico { width: 15px; height: 15px; }
/* A list's other tools (test review fixes, stream D2): the form and the blank template, left of its +, built like it. */
.data-sec-tool { margin-left: auto; text-decoration: none; }
.data-sec-tool + .data-sec-tool, .data-sec-tool + .data-add { margin-left: 0; }

/* What the last upload said (beagent.js drawInfo): its name, a duplicate's names, the hint, and the first rows. */
.data-info { margin: 6px 4px 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); font-size: 12.5px; line-height: 1.45; }
.data-info-head { display: flex; align-items: center; gap: 6px; }
.data-info-head .ico { width: 14px; height: 14px; color: var(--accent); }
.data-info-name { flex: 1; min-width: 0; overflow: hidden; color: var(--ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.data-info-x { flex: none; display: inline-flex; padding: 3px; border: none; border-radius: 50%; background: none; color: var(--muted); }
.data-info-x:hover { background: var(--line-soft); color: var(--ink); }
.data-info-x .ico { width: 12px; height: 12px; color: inherit; }
.data-info p { margin: 4px 0 0; color: var(--ink-2); }
.data-info .data-info-dup { color: var(--warn-ink); }
.data-info-table { margin-top: 6px; overflow-x: auto; }
.data-info-table table { border-collapse: collapse; font-family: var(--mono); font-size: 11px; }
.data-info-table th, .data-info-table td { padding: 2px 6px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
.data-info-table th { color: var(--muted); font-weight: 700; }
/* The columns a wide preview does not draw, counted under it; it stays in view while the table scrolls. */
.data-info .data-info-more { position: sticky; left: 0; color: var(--muted); font-size: 11.5px; }

/* One file: its pick circle, its name (the preview) over its time and source, its delete */
.data-list { margin: 0; padding: 0; list-style: none; }
.data-row { display: flex; align-items: center; gap: 4px; padding: 3px 2px; border-radius: 10px; }
.data-row:hover { background: var(--accent-tint); }
.data-row.is-picked { background: var(--accent-pale); }
.data-pick {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
}
.data-pick-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--faint);
  border-radius: 50%;
  background: var(--white);
  color: var(--white);
}
.data-pick-mark .ico { width: 11px; height: 11px; stroke-width: 3; opacity: 0; }
.data-pick:hover .data-pick-mark { border-color: var(--accent); }
.is-picked .data-pick-mark { border-color: var(--accent); background: var(--accent); }
.is-picked .data-pick-mark .ico { opacity: 1; }
/* A blank template is downloaded and filled in, never picked: its circle is dashed and takes no click */
.data-pick:disabled { cursor: default; }
.is-template .data-pick-mark { border-style: dashed; }
.is-template .data-pick:hover .data-pick-mark { border-color: var(--faint); }
.is-template .data-meta { color: var(--accent-dark); }
.data-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.data-name {
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: none;
  background: none;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-name:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.data-meta { max-width: 100%; overflow: hidden; color: var(--faint); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.data-del { flex: none; display: inline-flex; padding: 5px; border: none; border-radius: 50%; background: none; color: var(--faint); }
.data-del:hover { background: var(--danger-pale); color: var(--danger); }
.data-del .ico { width: 14px; height: 14px; }
/* A settings file's "Edit in the form" (test review fixes, stream D2), built like its delete. */
.data-edit { flex: none; display: inline-flex; padding: 5px; border: none; border-radius: 50%; background: none; color: var(--muted); }
.data-edit:hover { background: var(--accent-pale); color: var(--accent-dark); }
.data-edit .ico { width: 14px; height: 14px; }
.data-row.is-uploading { gap: 8px; padding: 6px 8px; color: var(--muted); font-size: 13px; font-style: italic; }
.data-row.is-uploading:hover { background: none; }
.data-row.is-uploading .spinner { flex: none; margin: 0 6px; }
.data-row.is-uploading > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-empty { margin: 2px 4px; color: var(--faint); font-size: 13px; font-style: italic; }
/* One refusal per line, each with its file's name */
.data-note { margin: 4px 4px 0; color: var(--danger); font-size: 12.5px; white-space: pre-line; overflow-wrap: anywhere; }
.data-tab-note { flex: none; margin: 0 18px 8px; }

/* Projects, at the top of the Analyze tab (spec 3.1): each a folder, its name over its counts, its rename and its
   delete, opening in place as a Result folder does; the name field of a project being made or renamed. */
.project-list { margin: 0; padding: 0; list-style: none; }
.project-row { border-radius: 10px; }
.project-head { display: flex; align-items: flex-start; gap: 2px; }
.project-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 4px 4px 6px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  text-align: left;
}
.project-toggle:hover { background: var(--accent-tint); }
.project-ico { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }
.project-toggle[aria-expanded="true"] .project-ico { fill: var(--accent-pale); }
.project-words { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.project-name, .project-meta { overflow: hidden; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.project-name { font-size: 14px; }
.project-meta { color: var(--faint); font-size: 12px; }
.project-btn { flex: none; display: inline-flex; padding: 6px; border: none; border-radius: 50%; background: none; color: var(--faint); }
.project-btn:hover { background: var(--accent-pale); color: var(--accent-dark); }
.project-btn .ico { width: 14px; height: 14px; }
.project-head .data-del { padding: 6px; }
.project-edit { flex-wrap: wrap; gap: 6px; margin: 2px 0; padding: 6px; background: var(--accent-tint); }
.project-edit:hover { background: var(--accent-tint); }
.project-input {
  flex: 1 1 100%;
  min-width: 0;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-size: 14px;
}
.project-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-pale); }
.project-edit .btn-soft, .project-edit .btn-ghost { padding: 4px 13px; font-size: 13px; }
.project-edit .btn-soft { margin-left: auto; }
/* "Already in …" is no refusal: it reads in the deep gold, as Use in Analyze's "Added" does */
.project-note.is-brief { color: var(--accent-dark); }
/* An open project, indented under its row: Files, then Results, each item with its remove (×) at the right */
.project-body { padding: 0 0 6px 22px; }
.project-group { margin: 4px 6px 1px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.project-body > .data-empty { margin: 0 6px 2px; font-size: 12.5px; }
.project-files .data-row { padding: 1px 2px 1px 6px; }
.project-remove { flex: none; display: inline-flex; padding: 6px; border: none; border-radius: 50%; background: none; color: var(--faint); }
.project-remove:hover { background: var(--danger-pale); color: var(--danger); }
.project-remove .ico { width: 13px; height: 13px; }
/* A row dragged towards the projects (spec 3.3): every project shows it takes a drop, the one under the pointer more
   strongly; plain gold outlines, no fade */
.project-list.takes-drop .project-row { outline: 1px dashed var(--accent); outline-offset: -1px; }
.project-list .project-row.is-target { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-tint); }
/* Add to project on the lists' rows and Result's, and its menu under it */
.data-proj-add { flex: none; display: inline-flex; padding: 5px; border: none; border-radius: 50%; background: none; color: var(--faint); }
.data-proj-add:hover, .data-proj-add[aria-expanded="true"] { background: var(--accent-pale); color: var(--accent-dark); }
.data-proj-add .ico { width: 15px; height: 15px; }
.run-head > .data-proj-add { padding: 6px; }
.run-head > .data-proj-add .ico { width: 14px; height: 14px; }
.has-menu { position: relative; z-index: 3; }
.project-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 4;
  min-width: 168px;
  max-width: 240px;
  max-height: 240px;
  padding: 4px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}
.project-menu-item {
  display: block;
  width: 100%;
  padding: 6px 10px;
  overflow: hidden;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--ink);
  font-size: 13.5px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-menu-item:hover, .project-menu-item:focus { background: var(--accent-pale); color: var(--accent-dark); }
.project-menu-new { margin-top: 2px; border-top: 1px solid var(--line-soft); border-radius: 0 0 7px 7px; color: var(--accent-dark); }

/* Result: the tab's run folders, each opening to its files (spec L10), with the way back to its conversation (L11)
   and, for a design run, its setups for Analyze (L9) */
.run-head { display: flex; align-items: flex-start; gap: 2px; }
.run-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 4px 4px 4px 2px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  text-align: left;
}
.run-toggle:hover { background: var(--accent-tint); }
.run-chev { flex: none; width: 14px; height: 14px; margin: 3px 2px 0; color: var(--faint); transition: transform 0.15s ease; }
.run-toggle[aria-expanded="true"] .run-chev { transform: rotate(90deg); }
.run-words { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.run-title, .run-meta { overflow: hidden; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.run-title { font-size: 14px; }
.run-meta { color: var(--faint); font-size: 12px; }
.run-status.is-running { padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--white); }
.run-status.is-completed { color: var(--accent-dark); }
.run-status.is-stopped, .run-status.is-abandoned { color: var(--muted); }
.run-back, .data-dl { flex: none; display: inline-flex; padding: 6px; border: none; border-radius: 50%; background: none; color: var(--faint); }
.run-back:hover, .data-dl:hover { background: var(--accent-pale); color: var(--accent-dark); }
.run-back .ico, .data-dl .ico { width: 14px; height: 14px; }
/* A folder's delete, the head's last button (launch fixes, ticket 15): drawn and shown as the way back is, red on
   hover as every delete of the page is */
.run-del { flex: none; display: inline-flex; padding: 6px; border: none; border-radius: 50%; background: none; color: var(--faint); }
.run-del:hover { background: var(--danger-pale); color: var(--danger); }
.run-del .ico { width: 14px; height: 14px; }
.run-body { padding: 0 0 6px 20px; }
.run-body > .data-empty { margin: 2px 6px; }
.run-files .data-row { padding: 1px 2px 1px 6px; }
.data-name.is-plain { cursor: default; }
.data-name.is-plain:hover { color: var(--ink); text-decoration: none; }
.run-setup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0 6px; }
.run-setup .btn-soft { padding: 5px 12px; font-size: 13px; text-align: left; }
.setup-note.setup-done { color: var(--accent-dark); }

/* Where a dragged file would land: a section, the rest of the panel, or the message box (spec L4) */
.data-sec.is-drop { border-color: var(--accent); background: var(--accent-tint); }
.data-panel.is-drop { box-shadow: inset 0 0 0 2px var(--accent); }
.composer.is-drop .pill, .home.is-drop .pill { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-pale), var(--shadow-md); }

/* The panel's own close: the Data button sits in the message box's row, which a replay does not show, and at phone
   widths the open panel covers it (Uhan3, 2026-10-16). */
.data-close {
  display: inline-flex;
  margin-left: auto;
  padding: 6px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--muted);
}
.data-close:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
.data-close .ico { width: 18px; height: 18px; }

/* The narrow end of desktop widths: the panel is a little narrower. At phone widths the open panel covers the whole
   page, top bar included, and has no edge to drag. */
@media (max-width: 1180px) {
  :root { --data-panel-w: 264px; }
}
@media (max-width: 640px) {
  .data-panel { top: 0; left: 0; width: auto; border-left: none; box-shadow: none; }
  .data-resize { display: none; }
}

/* ------------------------------------------------------------------ the top bar, the alerts */

.chrome { position: sticky; top: 0; z-index: 20; }

/* Three columns: the brand, the task switch in the middle, the account buttons. The side columns share the room
   equally, so the switch sits over the main column's centre, the message box's; neither shrinks below its content,
   so a wide side pushes the switch over rather than under it. The Data panel opens under the bar, so the account
   buttons keep the top right. */
.topbar {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 20px;
  background: var(--white);
  box-shadow: 0 1px 0 rgba(26, 20, 0, 0.05), 0 4px 16px rgba(26, 20, 0, 0.05);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 4px; min-width: 0; }
.topbar-left { grid-column: 1; }
.topbar-right { grid-column: 3; justify-self: end; }

/* The task, Analyze or Design: two halves of one switch, a white thumb sliding under the chosen one (Uhan3,
   2026-10-15, in place of the Task select in the message box). Home only: a conversation's task is fixed. */
.task-toggle {
  position: relative;
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: 999px;
  background: #f1ede5;
}
.task-toggle::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}
/* Design is the left half, Analyze the right (Uhan3, 2026-10-20). */
.task-toggle.is-analyze::before { transform: translateX(100%); }
.task-opt {
  position: relative;
  min-width: 112px;
  padding: 6px 22px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.task-opt:hover { color: var(--ink-2); }
.task-opt[aria-pressed="true"] { color: var(--ink); cursor: default; }
.is-chat .task-toggle { display: none; }

.brand { display: flex; align-items: center; gap: 9px; margin-right: 10px; min-width: 0; }
/* The name goes Home, as New task does (Uhan3, 2026-10-20); the text stays where it stood before it was a button. */
.brand-name {
  height: 36px;
  margin-left: -8px;
  padding: 0 8px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font-size: 17px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand-name:hover { background: #f6f3ef; }
/* The open sidebar names BEagent itself: the bar keeps no room for the name. */
.side-open .brand { display: none; }

.logo { width: 28px; height: 28px; flex: none; }
.logo circle { fill: none; stroke-linecap: round; }
.logo .logo-outer { stroke: var(--gold-deep); stroke-width: 3; stroke-dasharray: 55 20.4; }
.logo .logo-inner { stroke: var(--ink); stroke-width: 2.6; stroke-dasharray: 28 12.8; }
.logo .logo-dot { fill: var(--ink); stroke: none; }

.top-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font-size: 15px;
  white-space: nowrap;
}
.top-btn:hover { background: #f6f3ef; }
.top-btn .ico { width: 16px; height: 16px; color: var(--ink-2); stroke-width: 1.8; }
/* The buttons at the top right: Menu, which unfolds Examples, the user guide and the API key under it, and Log in (or
   Log out) (Uhan3, 2026-10-16), and since 2026-11-20 MCP left of Menu where the public route is on (a.top-btn, below).
   Menu is its three lines alone; aria-label names it. */
.menu-btn { padding: 7px 9px; }
.menu-btn .ico { width: 20px; height: 20px; }
.menu-btn[aria-expanded="true"] { background: #f6f3ef; }
.top-menu { position: relative; display: flex; }
/* The open list drops onto the Data panel, which stands over the page (z-index 30): the bar's layer rises over it
   while the list is open (beagent.js setMenu). The alerts under the bar rise with it, so they stop at the panel. */
body.menu-open .chrome { z-index: 40; }
body.menu-open.data-open .alerts { clip-path: inset(0 var(--data-panel-w) 0 0); }
.menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  /* A long name ends in "…" rather than pushing the list off the left edge: the list ends at Menu, left of Log in. */
  max-width: min(300px, calc(100vw - 140px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 16px 40px rgba(26, 20, 0, 0.16), 0 2px 6px rgba(26, 20, 0, 0.06);
}
.menu-user {
  margin: 0 0 4px;
  padding: 6px 10px 10px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-user-name { color: var(--ink); font-weight: 700; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 9px;
  background: none;
  color: var(--ink);
  font-size: 15px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}
.menu-item:hover { background: #f6f3ef; }
.menu-item .ico { width: 17px; height: 17px; color: var(--ink-2); stroke-width: 1.8; }
.menu-item .key-dot { margin-left: auto; }
/* Delete account (Uhan3, 2026-10-18): last in the list, red, set off by a thin rule. */
.menu-item-danger { margin-top: 6px; border-top: 1px solid var(--line-soft); border-radius: 0 0 9px 9px; padding-top: 11px; color: var(--danger); }
.menu-item-danger .ico { color: var(--danger); }
.menu-item-danger:hover { background: var(--danger-pale); }
.menu-item-danger[hidden] { display: none; }
/* Examples, while its page is on screen */
.menu-item.is-on { background: var(--accent-tint); color: var(--accent-dark); }
.menu-item.is-on .ico { color: var(--accent); }
/* The user guide is a link, so it opens for anyone with no script: it looks like the items beside it, without a
   link's underline, and shows the same focus ring. */
a.menu-item:focus-visible { outline: 2px solid rgba(142, 111, 62, 0.55); outline-offset: 2px; }
/* The bar's own width decides, since the sidebar changes it at any window width: Log out keeps its label until the
   brand, the switch and both buttons no longer fit. */
.topbar { container: topbar / inline-size; }
@container topbar (max-width: 449px) {
  #logout-btn .top-btn-text { display: none; }
}
/* A phone's bar beside the open sidebar: the icons close up, and the switch on its own row narrows to its words.
   (.topbar .top-btn: the phone rule's .top-btn padding, later in this file, would win otherwise.) */
@container topbar (max-width: 299px) {
  .topbar-right { gap: 0; }
  .topbar .top-btn { padding: 7px 6px; }
  .task-opt { min-width: 0; padding: 6px 14px; }
}
/* MCP (Uhan3, 2026-11-20), left of Menu where the public route is on: a link to the Claude Code install page, in a new
   tab, that looks like the bar's buttons. */
a.top-btn { text-decoration: none; }
/* It reads "MCP: Use BEagent in Claude Code" where the bar has room for the words and "MCP" alone where it has not
   (Uhan3, 2026-11-20; launch fixes, ticket 10); its aria-label gives the whole words at every width. The words run on
   from MCP, with none of the button's gap. The bar's own width decides, as for Log out: from 1080px inside its padding
   (a window of 1188px with the sidebar closed, 1400px with it open) the words leave the switch, Menu and Log in where
   "MCP" alone leaves them. Signed in, they need a 1032px bar in Georgia and 1078px in Noto Serif SC, the page's first
   two faces (headless Chrome, 2026-11-20); on a narrower bar they pushed the switch off the message box's centre. */
.mcp-btn { gap: 0; }
.mcp-btn-more { display: none; }
@container topbar (min-width: 1080px) {
  .mcp-btn-more { display: inline; }
}

.key-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #ccc8c1; }
.key-dot.is-on { background: var(--ok); box-shadow: 0 0 0 3px rgba(47, 138, 76, 0.18); }

.alerts { display: flex; flex-direction: column; }
.alert {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px var(--gutter);
  border-bottom: 1px solid transparent;
  font-size: 13.5px;
  line-height: 1.4;
}
.alert-ico { width: 15px; height: 15px; }
.alert-text { min-width: 0; overflow-wrap: anywhere; }
.alert-detail { margin-left: 8px; font-size: 12.5px; opacity: 0.78; }
.alert-info { background: #f5f1e8; border-color: #eae0d0; color: #60491c; }
.alert-warning { background: var(--warn-bg); border-color: #f3d3ad; color: var(--warn-ink); }
.alert-error { background: var(--danger-pale); border-color: #f0d2cf; color: var(--danger); }
/* No API key yet (Uhan3, 2026-10-18): yellow, not the error's red; its last words open the Examples page. */
.alert-nokey { background: #fdf5d3; border-color: #efdb8c; color: #5c4a0f; }
.alert-link {
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.alert-link:hover { text-decoration-thickness: 2px; }
.alert-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 3px; }
.alert-x {
  display: inline-flex;
  padding: 4px;
  border: none;
  border-radius: 6px;
  background: none;
  color: inherit;
  opacity: 0.7;
}
.alert-x:hover { background: rgba(0, 0, 0, 0.05); opacity: 1; }
.alert-x .ico { width: 14px; height: 14px; }
.alert-action {
  padding: 2px 12px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: var(--white);
  color: inherit;
  font-size: 13px;
}

/* ------------------------------------------------------------------ home */

.main { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* The title and the message box sit at a fixed height from the top, not centred on everything below them: the chips
   and the note under the box come and go, and the box must not move when they do. The box's middle is at 60% of the
   window's height, a little below the middle (Uhan3, 2026-10-16: "much lower"; it was 35%, then 45%): above it are
   the top bar, the title's line (64px x 1.05), its 30px margin and half the 60px box. */
.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(40px, calc(60vh - var(--topbar-h) - 127px)) var(--gutter) 13vh;
}

.wordmark {
  margin: 0 0 30px;
  font-size: 64px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.wm-be { color: var(--accent); font-weight: 700; }
.wm-agent { color: var(--ink); }

.composer-slot { width: 100%; display: flex; justify-content: center; }
.composer { position: relative; width: 100%; max-width: 760px; }
.composer-row { display: flex; align-items: center; gap: 14px; }

/* The Data button: a sixth of the row (half the first third, Uhan3, 2026-10-16), left of the message box, built like it
   (Uhan3, 2026-10-16, in place of the top bar's Data and the box's +). It opens and closes the Data panel and shows its
   name alone (Uhan3, 2026-10-16): the picked files are the chips under the box, and the line naming them stays only as
   the button's description for screen readers. */
.data-btn {
  flex: 0 0 calc((100% - 14px) / 6);
  /* Never narrower than its icon and name: a sixth of a row narrowed by the Data panel at its widest let the name run
     under the message box (browser tests, 2026-10-20). */
  min-width: max-content;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  text-align: left;
}
.data-btn:hover { border-color: #d0c6b3; }
.data-btn > .ico { flex: none; width: 20px; height: 20px; stroke-width: 1.8; color: var(--muted); }
.data-btn:hover > .ico, .data-btn[aria-expanded="true"] > .ico { color: var(--accent); }
.data-btn-text { min-width: 0; display: flex; flex-direction: column; }
.data-btn .sec-label { margin: 0; font-size: 14px; }
.data-btn-sub { display: none; }

.pill {
  flex: 1;
  min-width: 0;
  min-height: 60px;
  display: flex;
  align-items: center;
  padding: 8px 8px 8px 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}
.pill:focus-within { border-color: #d6c8af; }

.pill-sec { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.msg-sec { flex: 1 1 auto; padding: 0 12px 0 0; }
.sec-label { margin-bottom: 2px; color: var(--ink); font-size: 12.5px; font-weight: 700; line-height: 1.3; }

#msg {
  display: block;
  width: 100%;
  height: 24px;
  max-height: 180px;
  padding: 1px 0;
  border: none;
  outline: none;
  resize: none;
  overflow-y: hidden;
  background: transparent;
  color: var(--ink);
  font-size: 15.5px;
  line-height: 22px;
}
#msg::placeholder { color: #a49f96; opacity: 1; }

/* The gear: model and effort for the next start or continuation (E1). A white circle right of the message box, built
   like the box and the Data button (Uhan3, 2026-10-16: it stood in the box, left of Send); its menu opens from it,
   its right edge on the gear's. */
.gear-wrap { position: relative; flex: none; display: flex; }
.gear-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-md);
  color: var(--muted);
}
.gear-btn:hover, .gear-btn[aria-expanded="true"] { border-color: #d2c1a4; color: var(--accent-dark); }
.gear-btn .ico { width: 20px; height: 20px; stroke-width: 1.7; }
/* A live chat's messages go to the session as it is: the gear is for starts and continuations. */
.is-chat:not(.is-browse) .gear-wrap { display: none; }
/* Above the Data panel (z-index 30; test review fixes, Decision 3): on Home the menu is in the page's own layer, and in a
   conversation the dock's layer rises while the menu is open (body.gear-open). */
.gear-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  z-index: 35;
  width: 324px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 16px 40px rgba(26, 20, 0, 0.16), 0 2px 6px rgba(26, 20, 0, 0.06);
}
.is-home .gear-menu { bottom: auto; top: calc(100% + 12px); }
/* A short desktop window has no room under Home's box, which stands at 60% of its height: the menu opens above it. */
@media (min-width: 641px) and (max-height: 640px) {
  .is-home .gear-menu { top: auto; bottom: calc(100% + 12px); }
}
.gear-group + .gear-group { margin-top: 12px; }
.gear-title { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.gear-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.gear-opt {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fdfcf9;
  color: var(--ink);
  font-size: 14px;
}
.gear-opt:hover { border-color: #d2c0a1; background: var(--white); }
.gear-opt.is-on { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-dark); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 700; }
.gear-note { margin: 12px 0 0; color: var(--faint); font-size: 12px; }
/* Effort: a slider, low to max, the chosen level named over it and every level under its stop */
.gear-effort { --thumb: 18px; }
.gear-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 4px; }
.gear-head .gear-title { margin: 0; }
.gear-value { color: var(--accent-dark); font-size: 14px; font-weight: 700; }
.gear-slider { height: 24px; }
.gear-ticks { position: relative; height: 18px; margin-top: 2px; }
.gear-tick {
  position: absolute;
  top: 0;
  left: calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--at, 0));
  transform: translateX(-50%);
  color: var(--faint);
  font-size: 11.5px;
  line-height: 18px;
  white-space: nowrap;
  cursor: pointer;
}
.gear-tick:hover { color: var(--ink); }
.gear-tick.is-on { color: var(--accent-dark); font-weight: 700; }

/* The page's sliders (the effort, a replay's position): a thin track filled up to the thumb in the accent colour.
   The page sets --frac, how far along the thumb is (0 to 1); the fill ends under the thumb's centre. */
.gear-slider, .replay-seek {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.gear-slider:disabled, .replay-seek:disabled { cursor: default; opacity: 0.55; }
.gear-slider:focus-visible, .replay-seek:focus-visible { outline: none; }
.gear-slider::-webkit-slider-runnable-track, .replay-seek::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--gold-deep) calc(var(--thumb, 16px) / 2 + (100% - var(--thumb, 16px)) * var(--frac, 0)), #eae4da 0);
}
.gear-slider::-moz-range-track, .replay-seek::-moz-range-track { height: 6px; border-radius: 999px; background: #eae4da; }
.gear-slider::-moz-range-progress, .replay-seek::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--gold-deep); }
.gear-slider::-webkit-slider-thumb, .replay-seek::-webkit-slider-thumb {
  box-sizing: border-box;
  width: var(--thumb, 16px);
  height: var(--thumb, 16px);
  margin-top: calc(3px - var(--thumb, 16px) / 2);
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(26, 20, 0, 0.35);
  transition: transform 0.12s ease;
  -webkit-appearance: none;
  appearance: none;
}
.gear-slider::-moz-range-thumb, .replay-seek::-moz-range-thumb {
  box-sizing: border-box;
  width: var(--thumb, 16px);
  height: var(--thumb, 16px);
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(26, 20, 0, 0.35);
}
.gear-slider:hover::-webkit-slider-thumb, .replay-seek:hover::-webkit-slider-thumb, .replay-seek:active::-webkit-slider-thumb { transform: scale(1.15); }
.gear-slider:focus-visible::-webkit-slider-thumb, .replay-seek:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(142, 111, 62, 0.28), 0 1px 4px rgba(26, 20, 0, 0.35); }
.gear-slider:focus-visible::-moz-range-thumb, .replay-seek:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(142, 111, 62, 0.28), 0 1px 4px rgba(26, 20, 0, 0.35); }
.gear-slider:disabled::-webkit-slider-thumb, .replay-seek:disabled::-webkit-slider-thumb { background: #bbb09b; box-shadow: none; transform: none; }
.gear-slider:disabled::-moz-range-thumb, .replay-seek:disabled::-moz-range-thumb { background: #bbb09b; box-shadow: none; }

.send-btn, .stop-btn {
  flex: none;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
}
.send-btn {
  border: none;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 2px 6px rgba(142, 111, 62, 0.3);
  color: var(--on-gold);
}
.send-btn:hover { background: var(--gold-hover); }
.send-btn .ico { width: 19px; height: 19px; stroke-width: 2.2; }
.send-btn.is-dim { background: #e3d6b8; box-shadow: none; color: rgba(17, 17, 17, 0.45); }
.send-btn:disabled { background: #ebe5d7; box-shadow: none; color: rgba(17, 17, 17, 0.3); cursor: default; }

/* The chat's box after the session ended: off until Resume connects */
.composer.is-off .pill { background: #f9f7f4; box-shadow: var(--shadow-sm); }
#msg:disabled { cursor: not-allowed; }
#msg:disabled::placeholder { color: #b2ada4; }
.stop-btn {
  margin-right: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
}
.stop-btn .ico { width: 17px; height: 17px; }
.stop-btn:hover { border-color: var(--danger); color: var(--danger); }

/* The attachment chips */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
/* Only picked files show (Uhan3, 2026-10-16: no empty slots under the box), so with no pick the row takes no room.
   Analyze's two files stand one per row. */
.chips:empty { display: none; }
.task-analyze .chips { flex-direction: column; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  line-height: 1.3;
}
.chip .ico { width: 14px; height: 14px; }
.chip.is-filled {
  padding: 4px 6px 4px 6px;
  border: 1px solid #e3daca;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}
/* The file's name opens its preview */
.chip-open {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 2px 6px 2px 7px;
  border: none;
  border-radius: 999px;
  background: none;
  color: inherit;
  font-size: inherit;
}
.chip-open:hover { background: var(--accent-tint); color: var(--accent-dark); }
.chip-open .ico { color: var(--accent); }
.chip-name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-x {
  display: inline-flex;
  padding: 3px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--faint);
}
.chip-x:hover { background: #f4f1ed; color: var(--danger); }
.chip-x .ico { width: 13px; height: 13px; }

.chip-note { margin: 8px 0 0; color: var(--danger); font-size: 13px; text-align: center; }
.note-action {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-dark);
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.note-action:hover { color: var(--accent); }

/* ------------------------------------------------------------------ the Examples page */

/* Examples in the top bar's Menu opens it (Uhan3, 2026-10-16, in place of the list under the message box): a title, a
   line on what an example is, then each task's examples under its name, as cards one under another (Uhan3,
   2026-10-17: two abreast was crowded, names and file lists wrapping in half the column). */
.examples { flex: 1; padding: 48px var(--gutter) 72px; }
.examples-col { width: 100%; max-width: 792px; margin: 0 auto; }
/* The title, with the Data button at its right, as a replay's head has it: the page has no message box either. */
.examples-top { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; }
.examples-title { min-width: 0; margin: 0; font-size: 34px; font-weight: 400; line-height: 1.2; }
.examples-title:focus { outline: none; }
.examples-sub { margin: 0 0 30px; color: var(--muted); font-size: 15px; }
.examples-empty { margin: 0; color: var(--muted); font-size: 15px; }
.example-group + .example-group { margin-top: 36px; }
.example-group-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.example-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.example-item { display: flex; min-width: 0; }
/* Each example is a card that opens its replay: its name with the replay mark, and its note or its files under it */
.example-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 18px 22px;
  border: 1px solid #e3daca;
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-align: left;
}
.example-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.example-card-top { display: flex; align-items: flex-start; gap: 10px; }
.example-card .example-ico { width: 20px; height: 20px; margin-top: 1px; color: var(--accent); }
.example-name { min-width: 0; font-size: 16px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.example-card:hover .example-name { color: var(--accent-dark); }
.example-card-sub { padding-left: 30px; color: var(--muted); font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ chat */

.chat { flex: 1; display: flex; flex-direction: column; }
.chat-col { flex: 1; width: 100%; max-width: 792px; margin: 0 auto; padding: 28px var(--gutter) 20px; }

.dock {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 14px var(--gutter) 18px;
  background: linear-gradient(to bottom, rgba(252, 251, 248, 0), var(--bg) 42%);
}
.dock-inner { max-width: 760px; margin: 0 auto; }
body.gear-open .dock { z-index: 35; }

/* The open Data panel covers no part of the message bar (test review fixes, stream D2, Layout): Home's box and a
   conversation's dock keep a right padding that moves the 760px bar left of the panel, by as little as it takes and not
   at all when the page is wide enough, and narrows the bar only when there is no other room. The panel still slides
   over the page and moves nothing else. --bar-room is the bar's room with no padding (the main column less its
   gutters), a share of each element's own box: 100vw counts the page's scrollbar, which the fixed panel's right: 0
   does not, and brought the bar 7.5px closer in a conversation long enough to scroll. Home's box sits inside .home's
   gutters; the dock has its own. --bar-clear is how far a whole bar keeps from the panel (its width and 8px of air,
   24px with the gutter it covers first). A bar the panel narrows keeps 8px of air, the gutter less (browser tests,
   2026-10-20: the 16px went from a message box 63px wide at 641px); between the two the air shrinks as the window does,
   with no jump. */
@media (min-width: 641px) {
  body { --bar-clear: calc(var(--data-panel-w) + 8px); }
  .composer-slot { --bar-room: 100%; }
  .dock { --bar-room: calc(100% - 2 * var(--gutter)); }
  .composer-slot, .dock { transition: padding-right 0.22s ease; }
  body.data-open .composer-slot {
    padding-right: clamp(0px, calc(760px + 2 * var(--bar-clear) - var(--bar-room)), calc(var(--bar-clear) - var(--gutter)));
  }
  body.data-open .dock {
    padding-right: calc(var(--gutter) + clamp(0px, calc(760px + 2 * var(--bar-clear) - var(--bar-room)), calc(var(--bar-clear) - var(--gutter))));
  }
}
@media (prefers-reduced-motion: reduce) {
  .composer-slot, .dock { transition: none; }
}

.is-chat .chips,
.is-chat .chip-note { display: none !important; }
.is-chat .pill { min-height: 58px; }
/* In a conversation the Data button keeps only its name: it opens the panel, and the box is for messages. */
.is-chat .data-btn { flex: none; min-height: 58px; padding: 8px 18px 8px 16px; }

/* A message row too narrow for the Data button's name beside a message box of about 160px (a narrow window, the
   sidebar or the Data panel open; 112px beside the open sidebar at 680px) is the phone's row: the button its folder
   alone, a circle, its name still its accessible name and title, the gear a circle of the same size, and the gaps and
   the box's padding as narrow as a phone's (browser tests, 2026-10-20). The composer is the container, so the row's own
   gap can change; the rule comes after the ones it changes, the chat's button among them. */
.composer { container-type: inline-size; }
@container (max-width: 415px) {
  .composer-row { gap: 10px; }
  .data-btn, .is-chat .data-btn { flex: none; width: 44px; min-width: 0; height: 44px; min-height: 0; padding: 0; justify-content: center; border-radius: 50%; }
  .data-btn-text { display: none; }
  .pill { padding-left: 16px; }
  .msg-sec { padding-right: 8px; }
  .gear-btn { width: 44px; height: 44px; }
}

/* Bubbles: the request that started the task, and the user's messages */
.request { display: flex; flex-direction: column; align-items: flex-end; }
/* The request's bubble row spans the column, as the feed's do, so the bubble's 84% is of the column. */
.request > .bubble-row { align-self: stretch; }
.bubble-row { display: flex; justify-content: flex-end; margin: 14px 0; }
.bubble {
  max-width: min(84%, 560px);
  padding: 10px 16px;
  border: 1px solid #e8ddca;
  border-radius: 20px 20px 6px 20px;
  background: #f4ede0;
  color: var(--ink);
  overflow-wrap: break-word;
}
.req-top { color: var(--accent-dark); font-size: 12.5px; font-weight: 700; }
.req-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.req-file {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 10px;
  border: 1px solid #e4daca;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 12.5px;
  text-align: left;
}
.req-file > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.req-file:hover { border-color: var(--accent); background: var(--white); color: var(--accent-dark); }
.req-file .ico { width: 12px; height: 12px; color: var(--accent); }
.req-text, .user-text { margin: 7px 0 0; font-size: 15.5px; line-height: 1.5; white-space: pre-wrap; }
.user-text { margin: 0; }
.bubble-note { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.bubble-note.is-bad { color: var(--danger); }

/* What the start's checks left to the run, under the request bubble */
.req-notes { max-width: min(84%, 560px); margin: -8px 4px 12px 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.req-notes-title { margin: 0 0 2px; font-weight: 700; }
.req-notes ul + .req-notes-title { margin-top: 6px; }
.req-notes ul { margin: 0; padding-left: 1.2em; }
.req-notes li { margin: 1px 0; overflow-wrap: anywhere; }

/* Claude's narration */
.say { margin: 16px 0; font-size: 16.5px; line-height: 1.65; overflow-wrap: break-word; }

/* The server's chat checks under a message (design 8.5 to 8.8): small marks, never a block on the message */
.chk-row { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 6px 0 0; font-size: 12.5px; line-height: 1.4; }
.chk { display: inline-block; max-width: 100%; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); color: var(--ink-2); cursor: help; overflow-wrap: anywhere; }
.chk-verified, .chk-cited { border-color: var(--ok); color: var(--ok); }
.chk-what-if, .chk-from-your-message, .chk-superseded { border-color: var(--gold-deep); color: var(--accent-dark);
  background: var(--accent-tint); }
.chk-unverified, .chk-uncited, .chk-unknown-card, .chk-flag { border-color: var(--danger); color: var(--danger);
  background: var(--danger-pale); }

/* Rendered Markdown: narration and reports */
.doc > :first-child { margin-top: 0; }
.doc > :last-child { margin-bottom: 0; }
.doc p { margin: 0 0 0.75em; }
.doc h1, .doc h2, .doc h3, .doc h4, .doc h5, .doc h6 { margin: 1.3em 0 0.5em; color: var(--ink); font-weight: 700; line-height: 1.3; }
.doc h1 { font-size: 1.6em; }
.doc h2 { font-size: 1.35em; padding-bottom: 0.2em; border-bottom: 1px solid var(--line-soft); }
.doc h3 { font-size: 1.15em; }
.doc h4, .doc h5, .doc h6 { font-size: 1em; }
.doc ul, .doc ol { margin: 0 0 0.8em; padding-left: 1.4em; }
.doc li { margin: 0.2em 0; }
.doc li > p { margin: 0.2em 0; }
.doc a { color: var(--accent-dark); text-underline-offset: 2px; }
.doc .lt { color: var(--muted); }
.doc code {
  padding: 0.05em 0.35em;
  border: 1px solid #e9e5dd;
  border-radius: 5px;
  background: #f4f1ec;
  font-family: var(--mono);
  font-size: 0.85em;
}
.doc pre {
  margin: 0 0 0.9em;
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #faf8f5;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
}
.doc pre code { padding: 0; border: none; background: none; font-size: inherit; }
.doc blockquote { margin: 0 0 0.9em; padding: 2px 0 2px 14px; border-left: 3px solid #e5dbc8; color: var(--ink-2); }
.doc hr { margin: 1.4em 0; border: none; border-top: 1px solid var(--line); }
.doc table {
  display: block;
  max-width: 100%;
  margin: 0 0 1em;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.92em;
}
.doc th, .doc td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc th { background: #f7f4f0; font-weight: 700; }
.doc tbody tr:nth-child(even) td { background: #fcfaf6; }
.doc [data-align="right"] { text-align: right; }
.doc [data-align="center"] { text-align: center; }

/* Tool calls: one light row each, grouped under a thin rule */
.steps { margin: 10px 0 12px; padding-left: 12px; border-left: 2px solid #e7e3da; }
.step { color: var(--muted); font-size: 13.5px; }
.step-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 3px 6px 3px 0;
  border: none;
  border-radius: 6px;
  background: none;
  color: inherit;
  line-height: 1.45;
  text-align: left;
}
.step-head:hover { color: var(--ink); }
.step-head:hover .step-chev { opacity: 0.9; }
.step-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; }
.step-icon .ico { width: 14px; height: 14px; stroke-width: 2.4; }
.step-icon .ico-fill { width: 11px; height: 11px; }
.is-ok .step-icon { color: var(--accent); }
.is-fail .step-icon { color: var(--danger); }
.is-stopped .step-icon, .is-unknown .step-icon { color: #a7a198; }
.is-fail .step-label { color: #8c3a32; }
.step-label { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-chev { width: 13px; height: 13px; opacity: 0.35; transition: transform 0.15s ease; }
.is-open .step-chev { transform: rotate(90deg); opacity: 0.8; }
.step-body {
  margin: 4px 0 10px 24px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-2);
  font-size: 12.5px;
}
.kv { display: flex; gap: 10px; margin: 2px 0; }
.kv-k { flex: none; width: 74px; color: var(--faint); }
.kv-v { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.kv-v.is-mono { font-family: var(--mono); font-size: 12px; }
.step-out {
  max-height: 300px;
  margin: 8px 0 0;
  padding: 8px 10px;
  overflow: auto;
  border-radius: 8px;
  background: #f8f6f2;
  color: #3a352c;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.step-more { margin: 4px 0 0; color: var(--faint); font-size: 11.5px; font-style: italic; }

/* The progress list: one compact line per step of the run, built by the page from the run screen's chain */
.progress { margin: 10px 0 12px; padding-left: 12px; border-left: 2px solid #e7e3da; color: var(--muted); font-size: 13.5px; }
.progress-head { margin: 0 0 2px; color: var(--faint); font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; }
/* Its head: the count and the run's clock beside the word Progress (spec 2026-10-19 U-wait) */
.progress-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 2px; }
.progress-top .progress-head { margin: 0; }
.progress-count { color: var(--ink); font-size: 13.5px; font-weight: 700; }
.progress-time { color: var(--muted); font-size: 13px; font-variant-numeric: lining-nums tabular-nums; }
.progress-note { margin: 2px 0 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.progress-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.progress-list > .progress-step { display: block; }
.progress-sub { margin: 0 0 4px; padding: 0 0 0 24px; list-style: none; }
.progress-step.is-current > .progress-line .progress-mark { color: var(--accent); }
.progress-step.is-todo { color: var(--faint); }
.progress-step.is-todo .progress-mark { color: var(--line); }
.progress-list { margin: 0; padding: 0; list-style: none; }
.progress-step { display: flex; align-items: center; gap: 8px; padding: 2px 0; line-height: 1.45; }
.progress-mark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; }
.progress-mark .ico { width: 14px; height: 14px; stroke-width: 2.4; }
.progress-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-step.is-done { color: var(--faint); }
.progress-step.is-done .progress-mark { color: var(--accent); }
.progress-step.is-current { color: var(--ink); }
.progress-step.is-current .progress-mark { color: var(--faint); }
.progress-step.is-waiting { color: var(--ink); }
.progress-step.is-waiting .progress-mark { color: var(--accent); }
.progress-step.is-stopped { color: #8c3a32; }
.progress-step.is-stopped .progress-mark { color: var(--danger); }

/* The data review box: the run's conduct records and what became of each, kept directly after the progress list.
   Lining, tabular numerals, so S03 does not read as "So3" in the serif face; its own width decides when the records
   stack (the @container rule below). */
.data-review {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  font-size: 13.5px;
  font-variant-numeric: lining-nums tabular-nums;
  container: data-review / inline-size;
}
.data-review.is-waiting { border-left-color: var(--accent); }
.data-review.is-locked { border-left-color: var(--gold-deep); }
.data-review.is-stopped { border-left-color: var(--danger); }
.data-review-head { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.45; }
/* A locked review folds its records */
.data-review-more { margin-top: 6px; }
.data-review-summary { width: fit-content; color: var(--accent-dark); font-size: 13px; font-weight: 700; cursor: pointer; }
.data-review-summary:hover { color: var(--ink); }
/* The records table: per record, a row of cells and a row under it across all of them */
.data-review-table { width: 100%; margin: 8px 0 0; border-collapse: collapse; }
.data-review-table th {
  padding: 2px 10px 6px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.data-review-record { border-top: 1px solid var(--line-soft); }
.data-review-cells td { padding: 8px 10px 0 0; color: var(--ink-2); vertical-align: baseline; }
.data-review-cells td:last-child { padding-right: 0; }
.data-review-id { font-family: var(--mono); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.data-review-cells .data-review-id { color: var(--ink); }
.data-review-detail { padding: 2px 0 8px; }
.data-review-cells:last-child td { padding-bottom: 8px; }
.data-review-decision { color: var(--muted); }
.data-review-mark { width: 14px; height: 14px; margin-right: 6px; stroke-width: 2.4; vertical-align: -2px; }
.data-review-decision.mark-check .data-review-mark { color: var(--accent); }
.data-review-decision.mark-clock { color: var(--accent-dark); font-weight: 700; }
.data-review-decision.mark-clock .data-review-mark { color: var(--accent); }
.data-review-decision.mark-cross { color: var(--ink); font-weight: 700; }
.data-review-decision.mark-cross .data-review-mark { color: var(--danger); }
.data-review-decision.mark-alert { font-weight: 700; }
.data-review-decision.mark-alert .data-review-mark { color: var(--danger); }
.data-review-desc { margin: 0; color: var(--ink-2); line-height: 1.45; overflow-wrap: anywhere; }
.data-review-query { margin: 2px 0 0; color: var(--warn-ink); overflow-wrap: anywhere; }
.data-review-effect { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
/* A narrow box: each record a block, each cell under its column's name */
@container data-review (max-width: 559px) {
  .data-review-table thead { display: none; }
  .data-review-table, .data-review-table tbody, .data-review-table tr, .data-review-table td { display: block; }
  .data-review-record { padding: 6px 0 8px; }
  .data-review-cells td, .data-review-cells:last-child td { padding: 1px 0; }
  .data-review-cells td::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 76px;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 12px;
    font-weight: 700;
  }
  .data-review-detail { padding: 4px 0 0; }
}
/* A conversation's box shows no "Message" over it (Uhan3, 2026-10-20: it repeated the placeholder's "Message
   BEagent…"); screen readers still hear the label, the box's name. */
.visually-hidden,
.is-chat .msg-sec > .sec-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.spinner {
  width: 11px;
  height: 11px;
  border: 1.6px solid #d9d2c7;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Question and approval cards: where the user picks the design */
.qcard {
  margin: 18px 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}
.qcard-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.qcard-head .ico { width: 17px; height: 17px; }
.q + .q { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.q-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-pale);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}
.q-text { margin: 9px 0 12px; font-size: 17px; line-height: 1.45; }
.q-hint { margin: -6px 0 10px; color: var(--faint); font-size: 12.5px; }
.q-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.q-opts.has-desc { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 16px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fdfcf9;
  color: inherit;
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.has-desc .opt { padding: 11px 14px 12px 12px; border-radius: 16px; }
.opt:hover { border-color: #d2c0a1; background: var(--white); }
.opt.is-on { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.opt:disabled { cursor: default; opacity: 0.6; }
.opt-mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  border: 1.5px solid #c7beaf;
  border-radius: 50%;
  background: var(--white);
  color: var(--on-gold);
}
.is-multi .opt-mark { border-radius: 5px; }
.opt-mark .ico { width: 11px; height: 11px; stroke-width: 3; opacity: 0; }
.opt.is-on .opt-mark { border-color: var(--gold-deep); background: var(--gold); }
.opt.is-on .opt-mark .ico { opacity: 1; }
.opt-text { min-width: 0; }
.opt-label { display: block; font-size: 15px; font-weight: 700; line-height: 1.35; }
.opt-desc { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.opt-other { border-style: dashed; }
/* A data review card: lining numerals; the record under the question; one option per full-width row; and in place of
   "Other…", a text button under the options */
.qcard.is-data-review { font-variant-numeric: lining-nums tabular-nums; }
.q-record { margin: -4px 0 14px; }
.q-record-facts { margin: 0; color: var(--ink-2); font-size: 14.5px; font-weight: 700; line-height: 1.45; }
.q-record-desc { margin: 2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.q-opts.is-stacked { display: flex; flex-direction: column; gap: 8px; }
.q-opts.is-stacked .opt { width: 100%; padding: 11px 14px 12px 12px; border-radius: 14px; }
.q-note {
  display: inline-block;
  margin: 10px 0 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--accent-dark);
  font-size: 13.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.q-note:hover, .q-note.is-on { color: var(--ink); }
.q-note:disabled { cursor: default; opacity: 0.6; }
.other-input {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fdfcf9;
  font-size: 15px;
}
.other-input:focus { border-color: var(--accent); background: var(--white); box-shadow: 0 0 0 3px rgba(142, 111, 62, 0.12); }
/* A data review card's line under the text box: typed text stops the review */
.other-stops { margin: 8px 2px 0; color: var(--warn-ink); font-size: 13px; line-height: 1.45; }
.qcard-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }
/* An option that asks for a typed value, chosen: what to type, over its box */
.q-entry-label { display: block; margin: 12px 2px 0; color: var(--ink-2); font-size: 14px; font-weight: 700; line-height: 1.45; }
.q-entry-label + .other-input { margin-top: 6px; }
/* Enter on a card not yet complete: what is still to answer, at the left of Send answer */
.qcard-missing { margin: 0 auto 0 0; color: var(--warn-ink); font-size: 13.5px; line-height: 1.45; }
.approval-tool { display: inline-block; margin-bottom: 8px; font-family: var(--mono); font-size: 13px; }
.approval-summary {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f9f7f3;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.card-done {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0;
  padding: 8px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 14px;
}
.card-done .ico { width: 15px; height: 15px; margin-top: 3px; color: var(--accent); }
.card-done.is-off .ico { color: var(--faint); }
.card-done.is-data-review { font-variant-numeric: lining-nums tabular-nums; }

/* A question card once closed stays as it was (Uhan3, 2026-10-19): every question open, the answer marked at full
   strength, nothing to press, and where Send answer stood, a line of the button's height says Answered */
.qcard.is-closed { box-shadow: var(--shadow-sm); }
.qcard.is-closed .opt.is-on:disabled { opacity: 1; }
.qcard-done {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 10px 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.qcard-done .ico { width: 15px; height: 15px; color: var(--accent); }
.qcard-done.is-off .ico { color: var(--faint); }

/* A replay's choice: the recorded card offers the options that have a recorded run, counting down to the default,
   and a hairline note under it says which run plays from there */
.qcard.is-choice { border-color: #d2c1a4; }
.qcard.is-choice .opt:not(:disabled) { cursor: pointer; }
.qcard.is-choice .opt:not(:disabled):hover { border-color: var(--accent); background: var(--accent-tint); }
.qcard.is-choice .opt.is-on:disabled { opacity: 1; }
.opt.is-unoffered { border-style: dashed; }
.choice-count {
  margin: 14px 0 0;
  color: var(--accent-dark);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.choice-note {
  margin: -6px 0 14px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

/* A line across the feed: "Session ended", "Session resumed" */
.note-line { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--faint); font-size: 13px; }
.note-line::before, .note-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* The session's end: the line, then Resume (when it can be resumed) and New task */
.ended { margin: 18px 0; }
.ended .note-line { margin: 0; }
.ended-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }

/* The start's refusal: the checks that failed */
.notice {
  margin: 18px 0;
  padding: 18px 22px;
  border: 1px solid #eed4d1;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.notice-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--danger); font-size: 17px; }
.notice-title .ico { width: 18px; height: 18px; }
.notice-text { margin: 0 0 12px; font-size: 15px; overflow-wrap: anywhere; }
.findings { margin: 0 0 12px; padding: 0; list-style: none; }
.finding { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; font-size: 14.5px; }
.finding .ico { width: 15px; height: 15px; margin-top: 4px; stroke-width: 2.4; }
.finding.is-ok .ico { color: var(--accent); }
.finding.is-bad .ico { color: var(--danger); }
.finding-text { min-width: 0; overflow-wrap: anywhere; }
.notice-sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; }

/* The result card */
.result {
  position: relative;
  margin: 22px 0;
  padding: 20px 24px 20px 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}
.result::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 4px; background: var(--accent); }
.result.is-bad::before { background: var(--danger); }
.result.is-neutral::before { background: #c5bfb4; }
.result-top { display: flex; align-items: baseline; gap: 10px; color: var(--faint); font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.result-id { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0; text-transform: none; }
/* The person's study ID from the settings, before the run's own suffix (spec 2026-10-19 U-results) */
.result-study { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.02em; text-transform: none; overflow-wrap: anywhere; }
.result-head { margin: 6px 0 10px; font-size: 22px; font-weight: 700; line-height: 1.3; }
.result-head.is-good { color: var(--accent-dark); }
.result-head.is-bad { color: var(--danger); }
.result-sub { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; }
.result-lines { margin: 0; padding: 0; list-style: none; }
.result-lines li { padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 15px; font-variant-numeric: lining-nums tabular-nums; }
/* The table fills its card, and in a narrower card scrolls inside it rather than squeeze its Power column to a word a
   line (browser tests, 2026-10-20, at 390 px). */
.table-wrap { overflow-x: auto; }
.result-table { width: 100%; min-width: 420px; margin-top: 4px; border-collapse: collapse; font-size: 14px; }
.result-table th { padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 700; text-align: left; }
.result-table td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); }
.result-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.result-table tr.is-chosen td { background: var(--accent-tint); font-weight: 700; }
/* The Power column: the sizing power, and the joint figure labelled on a line under it; a design sized only as a
   reference, dimmed, with why it is not recommended under its name (review round 1, D8) */
.result-table .power-joint,
.result-table .reference-why { display: block; margin-top: 1px; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.result-table tr.is-reference td { color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
/* Why a run stopped, and what resolves it (spec 2026-10-19 U-stop) */
.result-stop { margin: 0 0 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.result-stop-line { margin: 0 0 6px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.result-stop-line:last-of-type { margin-bottom: 0; }
.result-stop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* Run again with the same files, under the documents (U-back) */
.result-rerun { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
/* The forest plot (U-results): every colour a token, so it follows the page's theme; at a phone's width it keeps a
   readable size and scrolls in its own box */
.forest-wrap { overflow-x: auto; margin: 2px 0 10px; }
.forest { display: block; width: 100%; min-width: 440px; max-width: 640px; height: auto; font-family: inherit; }
.forest-band { fill: var(--accent-tint); }
.forest-limit { stroke: var(--gold-deep); stroke-width: 1; }
.forest-ref { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
.forest-ci { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.forest-point { fill: var(--ink); }
.forest-label { fill: var(--ink); font-size: 14px; }
.forest-tick { fill: var(--muted); font-size: 12px; font-variant-numeric: lining-nums tabular-nums; }
/* A design run's analysis setups, under its reports: a final case's note, picker and refusal take a line of their own */
.result-setup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.setup-link { text-decoration: none; }
.result-setup .btn-soft { text-align: left; }
.btn-soft .setup-chev { width: 13px; height: 13px; opacity: 0.7; transition: transform 0.15s ease; }
.btn-soft[aria-expanded="true"] .setup-chev { transform: rotate(90deg); }
.setup-below { flex-basis: 100%; }
.setup-note { margin: 0; color: var(--faint); font-size: 12.5px; }
.setup-picker { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 2px; }
.setup-picker .setup-note { margin-bottom: 4px; }
.setup-run {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font-size: 13.5px;
  text-align: left;
}
.setup-run:hover { border-color: #e3d9c8; background: var(--accent-tint); }
.setup-run-time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.setup-error .setup-note { margin-top: 6px; }

/* The working line under the feed */
.working { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; color: var(--muted); font-size: 14px; font-style: italic; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.3; animation: pulse 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

/* ------------------------------------------------------------------ replays and past conversations */

.browse-head { margin: 0 0 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.browse-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.browse-kind {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-pale);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.browse-title { min-width: 0; font-size: 18px; overflow-wrap: anywhere; }
/* The Data button of a view with no message box (a replay, a conversation that cannot go on, the Examples page), at
   the head's right. */
.browse-data {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 13.5px;
}
.browse-data:hover { border-color: #d0c6b3; }
.browse-data .ico { width: 16px; height: 16px; stroke-width: 1.8; color: var(--muted); }
.browse-data[aria-expanded="true"] .ico { color: var(--accent); }
.browse-has-box .browse-data { display: none; }
.browse-sub { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.browse-wait { margin: 24px 0; color: var(--faint); font-size: 14px; font-style: italic; text-align: center; }
.browse-note { margin: 0 auto 8px; max-width: 760px; color: var(--danger); font-size: 13.5px; text-align: center; overflow-wrap: anywhere; }
.browse-reason {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 14.5px;
  text-align: center;
}
.browse-reason .ico { width: 16px; height: 16px; color: var(--faint); }
.qcard.is-read-only { box-shadow: var(--shadow-sm); }
.qcard.is-read-only .opt:disabled { opacity: 0.8; }
/* A replay marks each recorded answer on its card while the card is open: the pick at full strength, typed text in
   its box as a pick */
.qcard.is-read-only .opt.is-on:disabled { opacity: 1; }
/* The question a pick brings into view clears the top bar, and the replay's controls over the bottom of the page */
.qcard.is-read-only .q { scroll-margin: 120px 0 130px; }
.qcard.is-read-only .other-input:disabled, .qcard.is-closed .other-input:disabled {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  opacity: 1;
}
/* A closed card looks the same live, replayed or past: the options not picked as dim as while the answer was sent, and
   a data review's note for the site at full strength when it was the answer */
.qcard.is-closed .opt:disabled { opacity: 0.6; }
.qcard.is-closed .q-note.is-on:disabled, .qcard.is-read-only .q-note.is-on:disabled { opacity: 1; }
.note-line.continued { color: var(--accent-dark); }
.note-line.continued::before, .note-line.continued::after { background: #e0d5c1; }

/* The replay's controls, where the box would be, as a video player has them: the position bar across the top (drag
   or click it to seek), Play / Pause, the time, the state, the speeds and Skip to end under it */
.replay-bar {
  --thumb: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-md);
}
.replay-seek { height: 24px; }
/* The controls wrap onto a second row where one is too narrow for them (browser tests, 2026-10-20: at 390 px their one
   row made the page about 600 px wide, the speeds and Skip to end off screen). */
.replay-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.replay-time { flex: none; color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.replay-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
}
.replay-btn:hover { border-color: #d2c1a4; color: var(--accent-dark); }
.replay-btn:disabled { opacity: 0.5; cursor: default; }
.replay-btn .ico { width: 15px; height: 15px; }
.replay-toggle { border: none; background: var(--gold); box-shadow: 0 2px 6px rgba(142, 111, 62, 0.3); color: var(--on-gold); }
.replay-toggle:hover { background: var(--gold-hover); color: var(--on-gold); }
.replay-toggle:disabled { background: #ebe5d7; box-shadow: none; color: rgba(17, 17, 17, 0.35); }
.replay-speeds { flex: none; display: inline-flex; padding: 3px; border-radius: 999px; background: #f5f2ed; }
.replay-speed {
  min-width: 40px;
  padding: 5px 9px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.replay-speed:hover { color: var(--ink); }
.replay-speed.is-on { background: var(--white); box-shadow: var(--shadow-sm); color: var(--accent-dark); font-weight: 700; }
.replay-speed:disabled { cursor: default; }
/* Cut with an ellipsis where its row is too narrow (a phone's), rather than pushing the page wider; under 120px it takes
   a row of its own rather than shrink to nothing beside the end's Play again (browser tests, 2026-10-20). */
.replay-status { flex: 1 1 120px; min-width: 0; overflow: hidden; color: var(--muted); font-size: 13px; font-style: italic; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ buttons */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 2px 6px rgba(142, 111, 62, 0.25);
  color: var(--on-gold);
  font-size: 15px;
  font-weight: 700;
}
.btn-primary:hover { background: var(--gold-hover); }
.btn-primary:disabled { background: #ebe5d7; box-shadow: none; color: rgba(17, 17, 17, 0.35); cursor: not-allowed; }
.btn-ghost {
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
}
.btn-ghost:hover { border-color: #d0c6b3; }
.btn-ghost:disabled { opacity: 0.6; cursor: default; }
.btn-block { width: 100%; }
.key-forget { margin-top: 10px; color: var(--danger); }
.key-forget[hidden] { display: none; }
.btn-soft {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border: 1px solid #e3d9c8;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-dark);
  font-size: 14px;
}
.btn-soft:hover { border-color: #d3c1a2; background: var(--accent-pale); }
.btn-soft:disabled { opacity: 0.65; cursor: default; }
.btn-soft .ico { width: 15px; height: 15px; }
.btn-small { padding: 6px 16px; font-size: 14px; }
.btn-primary.is-danger { background: var(--danger); box-shadow: 0 2px 6px rgba(178, 58, 48, 0.25); color: #fff; }
.btn-primary.is-danger:hover { background: #962f27; }
/* A disabled danger button reads as disabled (browser tests, 2026-10-20: a disabled Delete account kept its full red):
   its red faded, with no shadow, and the same under the pointer. */
.btn-primary.is-danger:disabled, .btn-primary.is-danger:disabled:hover { background: var(--danger); opacity: 0.45; box-shadow: none; color: #fff; cursor: not-allowed; }

/* ------------------------------------------------------------------ modals */

dialog.modal {
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 28px 28px 24px;
  border: none;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 24px 60px rgba(26, 20, 0, 0.22), 0 2px 8px rgba(26, 20, 0, 0.08);
  color: var(--ink);
}
dialog.modal::backdrop { background: rgba(17, 15, 10, 0.4); }

/* The first-visit tour (Uhan3, 2026-10-17): a modal dialog as large as the window and clear itself. The ring's wide
   shadow dims the page round the button the card points at (beagent.js placeTour places both); with no button on
   screen the dialog dims the page itself. */
dialog.tour {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: none;
  background: transparent;
  color: var(--ink);
}
dialog.tour::backdrop { background: transparent; }
dialog.tour.no-target { background: rgba(17, 15, 10, 0.4); }
.tour-ring {
  position: fixed;
  border-radius: 14px;
  box-shadow: 0 0 0 2px var(--gold-deep), 0 0 0 200vmax rgba(17, 15, 10, 0.4);
  pointer-events: none;
}
/* From one card's button to the next only: when a resize or a scroll moves the button, ring and card move at once. */
.tour-ring.is-gliding { transition: left 0.2s ease, top 0.2s ease, width 0.2s ease, height 0.2s ease; }
.tour-card {
  position: fixed;
  width: min(320px, calc(100vw - 2 * var(--gutter)));
  padding: 18px 20px 16px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 24px 60px rgba(26, 20, 0, 0.22), 0 2px 8px rgba(26, 20, 0, 0.08);
}
.tour-count { margin: 0 0 4px; color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.tour-title { margin: 0 0 6px; font-size: 20px; font-weight: 400; }
.tour-text { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* Open examples or Next: one at a time, at the right even with Skip hidden (the card on the Examples page). */
.tour-actions .btn-primary { margin-left: auto; }
/* The History card's picture (Uhan3, 2026-10-17): made-up rows in a frame, drawn as the sidebar draws its own. */
.tour-pic { margin: -4px 0 16px; padding: 8px 6px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--side-bg); }
.tour-pic-title { margin: 0 8px 4px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.tour-pic-list { margin: 0; padding: 0; list-style: none; }
.tour-pic-row { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 8px; }
.tour-pic-row:first-child { background: var(--accent-pale); }
.tour-pic-label, .tour-pic-meta { overflow: hidden; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.tour-pic-label { color: var(--ink); font-size: 13px; }
.tour-pic-meta { color: var(--faint); font-size: 11.5px; }
/* The card on the Examples page (openTourExamples): the dialog is modeless and lets presses through to the page,
   over everything else on it, the top bar's open Menu included (z-index 40). */
/* While the History card shows its picture, the sidebar's empty line ("Log in to see your history.") is not shown. */
body.tour-pic-on .side-empty { visibility: hidden; }
dialog.tour.is-pick { z-index: 60; pointer-events: none; }
dialog.tour.is-pick .tour-card { pointer-events: auto; }

/* ------------------------------------------------------------------ the intro */

/* The intro (Uhan3, 2026-10-17): a modal dialog over the whole window, opened by beagent-intro.js before the page is
   drawn, the picture scaled to the room left above its caption and its button. A kid at a desk, seen from behind
   over the shoulder (Uhan3: cute, not a stick figure), in two scenes (Uhan3's storyboard), a press between them
   (Uhan3, 2026-10-19):
   1. before (0-4.7 s): the kid hunches over the keys and types and types; on the screen a spreadsheet fills and R
      code runs; the wall clock's minute hand turns six times, coffee cups pile up, and a draft report comes at last.
      The kid then types on for as long as the scene waits, and With our BEagent comes up under it (4.7 s);
   2. now, from that press (is-now, which beagent-intro.js sets; 0-4.3 s): the kid's arms, hanging at the sides,
      lift out from the shoulders into a stretch and settle, hands clasped behind the head, while the screen works by
      itself (the agent draws a Test and a Reference curve and lands the 90% CI inside 80-125%), the minute hand moves
      five minutes, and a BE report slides out of the screen. Continue comes up with it.
   Each part is placed by the SVG and moved here, by transform and opacity only (the wipe, a rect the colour of the
   screen, uncovers the curves), as CSS animations that keep running while beagent.js loads. Each part waits in its
   first frame (fill both). The second scene's moves are set only under is-now, so they start at the press. The last
   scene holds until Continue or Esc (Uhan3: wait for the press), when beagent-intro.js fades it (is-leaving) and
   closes it, over the front page (beagent-front.css). */
dialog.intro[open] {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 32px var(--gutter) 36px;
  overflow: hidden;
  border: none;
  background: var(--bg);
  color: var(--ink);
}
dialog.intro::backdrop { background: transparent; }
/* The dialog holds the focus only between its buttons (beagent-intro.js): no ring round the whole window. */
dialog.intro:focus-visible { outline: none; }
dialog.intro.is-leaving { animation: i-hide 0.32s var(--ease-out) forwards; }
.intro-stage { flex: 0 1 auto; width: min(780px, 100%); min-height: 0; aspect-ratio: 720 / 440; }
.intro-svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* The captions share one cell, so the line below the picture keeps its height as they change; so do the buttons. */
.intro-caps { flex: none; display: grid; width: min(660px, 100%); text-align: center; }
.intro-cap { grid-area: 1 / 1; margin: 0; color: var(--ink-2); font-size: 19px; line-height: 1.45; }
.intro-acts { flex: none; display: grid; margin-top: 4px; }
.intro-acts .btn-primary { grid-area: 1 / 1; justify-self: center; padding: 11px 26px; }

/* The picture's parts. Text sizes are the SVG's units: they scale with the picture. */
.intro-svg text { fill: var(--ink-2); font-family: var(--serif); }
.i-wall { fill: #f4eee2; }
.i-floor { fill: #ebe2d0; }
.i-clock-face { fill: var(--white); stroke: var(--ink-2); stroke-width: 4; }
.i-clock-ticks { fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; }
.i-hour, .i-min { fill: none; stroke: var(--ink); stroke-linecap: round; }
.i-hour { stroke-width: 5; }
.i-min { stroke-width: 3.2; }
.i-clock-pin { fill: var(--gold-deep); }
.i-desk { fill: #e6d6b6; }
.i-desk-edge { fill: #d3bf98; }
.i-keys { fill: #ddd5c5; }
.i-key-rows { fill: none; stroke: #c2b8a4; stroke-width: 3; stroke-dasharray: 7 3; }
.i-stand { fill: #5b564d; }
.i-stand-base { fill: #4d4942; }
.i-bezel { fill: #2f2c27; }
.i-screen { fill: var(--white); }
.i-chair { fill: #b9b1a5; }
/* The kid, from behind: a big round head of brown hair (a whorl at the crown, a tuft on top), a crescent of cheek and
   an ear at the right, a gold hoodie with its hood on the back, arms with mitten hands. */
.i-hoodie { fill: var(--gold); }
.i-hood { fill: var(--gold-deep); }
/* The sleeve runs to the wrist; its ends are square, hidden in the hoodie at the shoulder and under the cuff. An arm
   in two parts has a round elbow where they meet. */
.i-sleeve { fill: none; stroke: var(--gold); stroke-width: 26; stroke-linecap: butt; }
.i-cuff { fill: none; stroke: var(--gold-deep); stroke-width: 26; stroke-linecap: butt; }
.i-elbow { fill: var(--gold); }
.i-hand, .i-skin { fill: #f6d7bf; }
/* A typing hand's fingertips, a shade deeper than the hand over them, so each reads as a finger; on a raised hand,
   the lines between the fingers. */
.i-tip { fill: #efc6a8; }
.i-knuckle { fill: none; stroke: #e2b597; stroke-width: 1.3; stroke-linecap: round; }
.i-blush { fill: #f2a49a; opacity: 0.7; }
.i-ear-line { fill: none; stroke: #e2b597; stroke-width: 2; stroke-linecap: round; }
.i-hair { fill: #6e5440; }
.i-hair-light { fill: none; stroke: #8f7259; stroke-width: 6; stroke-linecap: round; }
.i-hair-strand { fill: none; stroke: #5a4433; stroke-width: 2; stroke-linecap: round; opacity: 0.55; }
.i-whorl { fill: none; stroke: #4c392b; stroke-width: 2.4; stroke-linecap: round; }
.i-eye { fill: none; stroke: #4c392b; stroke-width: 2.4; stroke-linecap: round; }
.i-sweat { fill: #9fbfd0; }
.i-strain { fill: none; stroke: var(--ink-2); stroke-width: 2.6; stroke-linecap: round; }
.i-sparkle { fill: var(--gold-deep); }
.i-mug-handle { fill: none; stroke: var(--ink-2); stroke-width: 3.5; }
.i-coffee { fill: #7a5a40; }
.i-mug-body { fill: var(--accent-pale); stroke: var(--ink-2); stroke-width: 2; }
.i-steam { fill: none; stroke: #b9b1a5; stroke-width: 2.2; stroke-linecap: round; }
/* The scenes' names, at the bottom right: "Traditional" in a script (its outlines are in the SVG), "Modern" in a
   plain sans-serif. The wipe is the floor's colour (.i-floor). */
.i-script { fill: var(--accent-dark); }
.i-script-wipe { fill: #ebe2d0; }
.intro-svg .i-label-modern {
  fill: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-anchor: end;
}
/* The screen: a spreadsheet and an R console before, the agent's plot now. */
.intro-svg .i-sc-title { fill: var(--muted); font: 7px var(--mono); }
.i-sc-head { fill: #f2eee4; }
.i-sc-grid { fill: none; stroke: var(--line); stroke-width: 0.8; }
.i-row rect { fill: var(--ink-2); opacity: 0.55; }
.intro-svg .i-code { font: 6.5px var(--mono); white-space: pre; }
.intro-svg .i-prompt { fill: var(--accent); }
.intro-svg .i-out { fill: var(--muted); }
.i-note-box { fill: var(--warn-bg); stroke: #f0d6b0; }
.intro-svg .i-note-text { fill: var(--warn-ink); font-size: 8.5px; }
.intro-svg .i-note-quiet { font-style: italic; }
.i-mini-outer { fill: none; stroke: var(--gold-deep); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 25.2 9.4; }
.i-mini-inner { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 12.5 5.7; }
/* On the screen, BEagent's name in a heavy sans-serif (Uhan3: 粗写黑体), the rest of the line in the same face. */
.intro-svg .i-badge-text { fill: var(--muted); font: 8px "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; }
.intro-svg .i-brand { fill: var(--ink); font-weight: 800; }
/* The plot is drawn at the old intro's size and scaled into the screen: its lines keep their width. */
.i-axis, .i-ref, .i-test, .i-ci-axis, .i-bar-line { vector-effect: non-scaling-stroke; }
.i-axis { fill: none; stroke: var(--faint); stroke-width: 1; }
.i-ref-fill { fill: var(--gold); fill-opacity: 0.14; }
.i-ref { fill: none; stroke: var(--gold-deep); stroke-width: 1.4; stroke-dasharray: 3 2.5; stroke-linejoin: round; }
.i-test { fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.i-wipe { fill: var(--white); }
.i-band { fill: var(--accent-tint); stroke: var(--accent-pale); }
.i-ci-axis { fill: none; stroke: var(--faint); stroke-width: 0.8; }
.i-bar-line { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.i-est { fill: var(--ink); }
.i-check { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.intro-svg .i-verdict-text { fill: var(--accent-dark); font-size: 7.5px; font-weight: 700; }
/* The reports: a grey draft before, BEagent's gold-headed one now. */
.i-paper { fill: var(--white); stroke: var(--line); }
.i-paper-head { fill: var(--gold); }
.i-paper-head-old { fill: #e4dfd5; }
.intro-svg .i-paper-title { fill: var(--ink); font-size: 7.5px; font-weight: 700; }
.i-paper-mark { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 15.6 5.8; }
.i-paper-lines { fill: none; stroke: var(--line); stroke-width: 2.4; stroke-linecap: round; }
.i-paper-curve { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.intro-svg .i-paper-draft { fill: var(--warn-ink); font-size: 8px; font-style: italic; }
.i-stamp-ring { fill: var(--accent-tint); stroke: var(--accent); stroke-width: 1.6; }
.i-stamp-check { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Every moved part turns and scales about its own middle, but for those that turn about a joint (a shoulder, an
   elbow, the tuft's root) or the clock's pin: those name their point in the picture's units. A forearm names its
   elbow as drawn: its group sits in the upper arm's, so the point moves with it. A fingertip only slides. */
.i-work, .i-note, .i-cup, .i-rep-1, .i-rep-2, .i-stamp, .i-badge, .i-spin, .i-ci-bar, .i-est, .i-verdict, .i-sweat,
.i-strain, .i-sparkle { transform-box: fill-box; transform-origin: center; }
.i-hour, .i-min, .i-hand-far, .i-hand-near, .i-arm, .i-fore, .i-tuft { transform-box: view-box; }
.i-hour, .i-min { transform-origin: 86px 96px; }
.i-hand-far { transform-origin: 164px 370px; }
.i-hand-near { transform-origin: 266px 370px; }
.i-arm-l { transform-origin: 164px 370px; }
.i-fore-l { transform-origin: 112.1px 296.5px; }
.i-arm-r { transform-origin: 266px 370px; }
.i-fore-r { transform-origin: 290.4px 283.4px; }
.i-tuft { transform-origin: 218px 226px; }

@keyframes i-show { from { opacity: 0; } }
@keyframes i-hide { to { opacity: 0; } }
@keyframes i-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes i-pop { from { opacity: 0; transform: scale(0.9); } }
/* A button comes and goes with its visibility too: it takes no click or focus before it shows or once it has gone. */
@keyframes i-arrive { from { opacity: 0; transform: translateY(8px); visibility: hidden; } }
@keyframes i-appear { from { opacity: 0; visibility: hidden; } }
@keyframes i-depart { to { opacity: 0; visibility: hidden; } }
/* Typing, for as long as the first scene waits: each fingertip lifts off its key and strikes once a run, each
   forearm drifts along the keys, the head nods. Every finger and arm has a run of its own length, so no two keep step
   and the pattern does not visibly repeat. */
@keyframes i-tap { 0%, 18%, 100% { transform: translateY(0); } 8% { transform: translateY(2.8px); } }
@keyframes i-drift { 0%, 100% { transform: rotate(0deg); } 22% { transform: rotate(-1.3deg); } 48% { transform: rotate(0.7deg); } 74% { transform: rotate(-0.5deg); } }
@keyframes i-bob { 0%, 100% { transform: translateY(0); } 28% { transform: translateY(2.2px); } 52% { transform: translateY(0.6px); } 78% { transform: translateY(2.6px); } }
@keyframes i-wobble { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(10deg); } }
@keyframes i-drop { 0% { opacity: 0; transform: translateY(-2px); } 5% { opacity: 1; } 22%, 100% { opacity: 0; transform: translateY(14px); } }
/* Before, six hours go by (the hour hand from nine to three); now, five minutes. */
@keyframes i-min-before { from { transform: rotate(0deg); } to { transform: rotate(2160deg); } }
@keyframes i-hour-before { from { transform: rotate(-90deg); } to { transform: rotate(90deg); } }
@keyframes i-min-now { from { transform: rotate(2160deg); } to { transform: rotate(2190deg); } }
@keyframes i-hour-now { from { transform: rotate(90deg); } to { transform: rotate(92.5deg); } }
/* The stretch: each arm's turns from its drawn pose, the hands clasped behind the head (100%). Hanging at the sides
   (to 9%), the arm lifts out from the shoulder, the elbow leading; the forearm swings forward (away from us), so it
   shortens along its length (scaleX, between two turns that lay its axis on x), turns over while it is a stub under
   the elbow, and lengthens upward (the elbows level with the shoulders at 32%), opens into the stretch (52%),
   reaches a little higher, the shoulders up (52-71%), and folds down behind the head (71-100%). The stops are a
   smooth path sampled every 0.1 s (eased in the sampling, so linear between them): the upper arm and the forearm turn
   together, with no stop between poses. */
@keyframes i-arm-l { 0% { transform: translateY(0) rotate(-129.8deg); } 8.9% { transform: translateY(0) rotate(-129.8deg); } 10.7% { transform: translateY(0) rotate(-128.9deg); } 14.3% { transform: translateY(0) rotate(-122deg); } 17.9% { transform: translateY(0) rotate(-110.8deg); } 21.4% { transform: translateY(0) rotate(-101.5deg); } 23.2% { transform: translateY(0) rotate(-96.8deg); } 25% { transform: translateY(0) rotate(-91.1deg); } 25.7% { transform: translateY(0) rotate(-88.8deg); } 28.6% { transform: translateY(0) rotate(-75.1deg); } 32.1% { transform: translateY(0) rotate(-57.9deg); } 35.7% { transform: translateY(0) rotate(-40.8deg); } 39.3% { transform: translateY(0) rotate(-30.8deg); } 42.9% { transform: translateY(0) rotate(-20.8deg); } 43.6% { transform: translateY(0) rotate(-18.8deg); } 46.4% { transform: translateY(0) rotate(-11.4deg); } 50% { transform: translateY(0) rotate(-5.4deg); } 53.6% { transform: translateY(-1.4px) rotate(-3.4deg); } 57.1% { transform: translateY(-3.8px) rotate(-1.5deg); } 60.7% { transform: translateY(-4.9px) rotate(-0.6deg); } 64.3% { transform: translateY(-4.5px) rotate(-0.9deg); } 67.9% { transform: translateY(-2.7px) rotate(-2.4deg); } 71.4% { transform: translateY(-0px) rotate(-4.6deg); } 75% { transform: translateY(0) rotate(-4.4deg); } 78.6% { transform: translateY(0) rotate(-3.9deg); } 82.1% { transform: translateY(0) rotate(-3.2deg); } 85.7% { transform: translateY(0) rotate(-2.3deg); } 89.3% { transform: translateY(0) rotate(-1.4deg); } 92.9% { transform: translateY(0) rotate(-0.7deg); } 96.4% { transform: translateY(0) rotate(-0.2deg); } 100% { transform: translateY(0) rotate(0deg); } }
@keyframes i-fore-l { 0% { transform: rotate(227.8deg) scaleX(1) rotate(-3.1deg); } 8.9% { transform: rotate(227.8deg) scaleX(1) rotate(-3.1deg); } 10.7% { transform: rotate(226.5deg) scaleX(0.98) rotate(-3.1deg); } 14.3% { transform: rotate(216.7deg) scaleX(0.81) rotate(-3.1deg); } 17.9% { transform: rotate(200.8deg) scaleX(0.55) rotate(-3.1deg); } 21.4% { transform: rotate(190.1deg) scaleX(0.25) rotate(-3.1deg); } 23.2% { transform: rotate(184.8deg) scaleX(0.1) rotate(-3.1deg); } 25% { transform: rotate(57.7deg) scaleX(0.1) rotate(-3.1deg); } 25.7% { transform: rotate(6.8deg) scaleX(0.1) rotate(-3.1deg); } 28.6% { transform: rotate(-8.1deg) scaleX(0.27) rotate(-3.1deg); } 32.1% { transform: rotate(-26.6deg) scaleX(0.49) rotate(-3.1deg); } 35.7% { transform: rotate(-45.2deg) scaleX(0.7) rotate(-3.1deg); } 39.3% { transform: rotate(-55.7deg) scaleX(0.82) rotate(-3.1deg); } 42.9% { transform: rotate(-66.1deg) scaleX(0.95) rotate(-3.1deg); } 43.6% { transform: rotate(-68.2deg) scaleX(0.97) rotate(-3.1deg); } 46.4% { transform: rotate(-75.2deg) scaleX(0.99) rotate(-3.1deg); } 50% { transform: rotate(-80.9deg) scaleX(1) rotate(-3.1deg); } 53.6% { transform: rotate(-83.9deg) scaleX(1) rotate(-3.1deg); } 57.1% { transform: rotate(-87.7deg) scaleX(1) rotate(-3.1deg); } 60.7% { transform: rotate(-89.6deg) scaleX(1) rotate(-3.1deg); } 64.3% { transform: rotate(-89deg) scaleX(1) rotate(-3.1deg); } 67.9% { transform: rotate(-86deg) scaleX(1) rotate(-3.1deg); } 71.4% { transform: rotate(-81.7deg) scaleX(1) rotate(-3.1deg); } 75% { transform: rotate(-78.5deg) scaleX(1) rotate(-3.1deg); } 78.6% { transform: rotate(-69.3deg) scaleX(1) rotate(-3.1deg); } 82.1% { transform: rotate(-55.5deg) scaleX(1) rotate(-3.1deg); } 85.7% { transform: rotate(-39.3deg) scaleX(1) rotate(-3.1deg); } 89.3% { transform: rotate(-23.1deg) scaleX(1) rotate(-3.1deg); } 92.9% { transform: rotate(-9.3deg) scaleX(1) rotate(-3.1deg); } 96.4% { transform: rotate(-0.2deg) scaleX(1) rotate(-3.1deg); } 100% { transform: rotate(3.1deg) scaleX(1) rotate(-3.1deg); } }
@keyframes i-arm-r { 0% { transform: translateY(0) rotate(149.3deg); } 8.9% { transform: translateY(0) rotate(149.3deg); } 10.7% { transform: translateY(0) rotate(148.4deg); } 14.3% { transform: translateY(0) rotate(141.5deg); } 17.9% { transform: translateY(0) rotate(130.3deg); } 21.4% { transform: translateY(0) rotate(121deg); } 23.2% { transform: translateY(0) rotate(116.3deg); } 25% { transform: translateY(0) rotate(110.6deg); } 25.7% { transform: translateY(0) rotate(108.3deg); } 28.6% { transform: translateY(0) rotate(94.6deg); } 32.1% { transform: translateY(0) rotate(77.4deg); } 35.7% { transform: translateY(0) rotate(60.3deg); } 39.3% { transform: translateY(0) rotate(50.3deg); } 42.9% { transform: translateY(0) rotate(40.3deg); } 43.6% { transform: translateY(0) rotate(38.3deg); } 46.4% { transform: translateY(0) rotate(26.8deg); } 50% { transform: translateY(0) rotate(17.5deg); } 53.6% { transform: translateY(-1.4px) rotate(15.1deg); } 57.1% { transform: translateY(-3.8px) rotate(13.2deg); } 60.7% { transform: translateY(-4.9px) rotate(12.3deg); } 64.3% { transform: translateY(-4.5px) rotate(12.6deg); } 67.9% { transform: translateY(-2.7px) rotate(14.1deg); } 71.4% { transform: translateY(-0px) rotate(16.3deg); } 75% { transform: translateY(0) rotate(15.6deg); } 78.6% { transform: translateY(0) rotate(13.9deg); } 82.1% { transform: translateY(0) rotate(11.2deg); } 85.7% { transform: translateY(0) rotate(8.1deg); } 89.3% { transform: translateY(0) rotate(5deg); } 92.9% { transform: translateY(0) rotate(2.4deg); } 96.4% { transform: translateY(0) rotate(0.6deg); } 100% { transform: translateY(0) rotate(0deg); } }
@keyframes i-fore-r { 0% { transform: rotate(-67.3deg) scaleX(1) rotate(-168.7deg); } 8.9% { transform: rotate(-67.3deg) scaleX(1) rotate(-168.7deg); } 10.7% { transform: rotate(-66deg) scaleX(0.98) rotate(-168.7deg); } 14.3% { transform: rotate(-56.2deg) scaleX(0.81) rotate(-168.7deg); } 17.9% { transform: rotate(-40.3deg) scaleX(0.55) rotate(-168.7deg); } 21.4% { transform: rotate(-29.6deg) scaleX(0.25) rotate(-168.7deg); } 23.2% { transform: rotate(-24.3deg) scaleX(0.1) rotate(-168.7deg); } 25% { transform: rotate(102.8deg) scaleX(0.1) rotate(-168.7deg); } 25.7% { transform: rotate(153.7deg) scaleX(0.1) rotate(-168.7deg); } 28.6% { transform: rotate(168.6deg) scaleX(0.27) rotate(-168.7deg); } 32.1% { transform: rotate(187.1deg) scaleX(0.49) rotate(-168.7deg); } 35.7% { transform: rotate(205.7deg) scaleX(0.7) rotate(-168.7deg); } 39.3% { transform: rotate(216.2deg) scaleX(0.82) rotate(-168.7deg); } 42.9% { transform: rotate(226.6deg) scaleX(0.95) rotate(-168.7deg); } 43.6% { transform: rotate(228.7deg) scaleX(0.97) rotate(-168.7deg); } 46.4% { transform: rotate(233.3deg) scaleX(0.99) rotate(-168.7deg); } 50% { transform: rotate(237.1deg) scaleX(1) rotate(-168.7deg); } 53.6% { transform: rotate(239.8deg) scaleX(1) rotate(-168.7deg); } 57.1% { transform: rotate(243.6deg) scaleX(1) rotate(-168.7deg); } 60.7% { transform: rotate(245.5deg) scaleX(1) rotate(-168.7deg); } 64.3% { transform: rotate(244.9deg) scaleX(1) rotate(-168.7deg); } 67.9% { transform: rotate(241.9deg) scaleX(1) rotate(-168.7deg); } 71.4% { transform: rotate(237.6deg) scaleX(1) rotate(-168.7deg); } 75% { transform: rotate(235deg) scaleX(1) rotate(-168.7deg); } 78.6% { transform: rotate(227.5deg) scaleX(1) rotate(-168.7deg); } 82.1% { transform: rotate(216.3deg) scaleX(1) rotate(-168.7deg); } 85.7% { transform: rotate(203.1deg) scaleX(1) rotate(-168.7deg); } 89.3% { transform: rotate(190deg) scaleX(1) rotate(-168.7deg); } 92.9% { transform: rotate(178.8deg) scaleX(1) rotate(-168.7deg); } 96.4% { transform: rotate(171.3deg) scaleX(1) rotate(-168.7deg); } 100% { transform: rotate(168.7deg) scaleX(1) rotate(-168.7deg); } }
@keyframes i-steam { 0% { opacity: 0; transform: translateY(2px); } 50% { opacity: 0.9; } 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes i-wipe { to { transform: translateX(600px); } }
@keyframes i-write { to { transform: translateX(215px); } }
@keyframes i-spin { to { transform: rotate(360deg); } }
@keyframes i-grow { from { opacity: 0; transform: scaleX(0.06); } }
@keyframes i-slide-out { from { opacity: 0; transform: translateX(-56px) scale(0.85); } }

.i-room { animation: i-show 0.5s var(--ease-out) 0.1s both; }

/* 1. Before. The clock turns at an even pace: it is time passing. The typing never stops. */
.i-work { animation: i-rise 0.6s var(--ease-out) 0.2s both; }
.i-hand-far { animation: i-drift 3.1s var(--ease-in-out) 0.9s infinite both; }
.i-hand-near { animation: i-drift 2.6s var(--ease-in-out) 1.3s infinite both; }
.i-tip { animation: i-tap 1s var(--ease-in-out) infinite both; }
.i-tap-1 { animation-duration: 1.18s; animation-delay: 0.95s; }
.i-tap-2 { animation-duration: 0.94s; animation-delay: 1.31s; }
.i-tap-3 { animation-duration: 1.36s; animation-delay: 1.07s; }
.i-tap-4 { animation-duration: 1.06s; animation-delay: 1.52s; }
.i-tap-5 { animation-duration: 1.02s; animation-delay: 0.9s; }
.i-tap-6 { animation-duration: 1.28s; animation-delay: 1.2s; }
.i-tap-7 { animation-duration: 0.88s; animation-delay: 1.43s; }
.i-tap-8 { animation-duration: 1.44s; animation-delay: 1.11s; }
.i-head-bob { animation: i-bob 2.4s var(--ease-in-out) 0.9s infinite both; }
.i-strain { animation: i-pop 0.3s var(--ease-out) 2.6s both; }
.i-min { animation: i-min-before 3.4s linear 0.8s both; }
.i-hour { animation: i-hour-before 3.4s linear 0.8s both; }
.i-sc1 { animation: i-show 0.3s var(--ease-out) 0.8s both; }
.i-row { animation: i-show 0.15s var(--ease-out) both; }
.i-row-1 { animation-delay: 0.95s; }
.i-row-2 { animation-delay: 1.15s; }
.i-row-3 { animation-delay: 1.35s; }
.i-row-4 { animation-delay: 1.55s; }
.i-row-5 { animation-delay: 1.75s; }
.i-row-6 { animation-delay: 1.95s; }
.i-row-7 { animation-delay: 2.15s; }
.i-row-8 { animation-delay: 2.35s; }
.i-line { animation: i-show 0.15s var(--ease-out) both; }
.i-line-1 { animation-delay: 2.55s; }
.i-line-2 { animation-delay: 2.8s; }
.i-line-3 { animation-delay: 3.05s; }
.i-line-4 { animation-delay: 3.3s; }
.i-line-5 { animation-delay: 3.55s; }
.i-note { animation: i-pop 0.35s var(--ease-out) 3.6s both; }
.i-cup { animation: i-pop 0.3s var(--ease-out) both; }
.i-cup-1 { animation-delay: 1.5s; }
.i-cup-2 { animation-delay: 2.5s; }
.i-cup-3 { animation-delay: 3.5s; }
.i-sweat { animation: i-drop 4.4s var(--ease-out) infinite both; }
.i-sweat-1 { animation-delay: 2s; }
.i-sweat-2 { animation-delay: 3.1s; }
.i-rep-1 { animation: i-pop 0.45s var(--ease-out) 4s both; }
/* Written at an even pace, as a hand writes. */
.i-script-wipe { animation: i-write 1.6s linear 0.7s both; }
.intro-cap-1 { animation: i-rise 0.5s var(--ease-out) 0.3s both; }
.intro-go { animation: i-arrive 0.5s var(--ease-out) 4.7s both; }

/* 2. Now, from the press: the first scene, its caption and its button go, and the second comes. Until the press the
   second scene and its caption are hidden, and Continue takes no press. The stretch runs from 0.3 s for 2.8 s
   (its easing in its stops); the forearms' copy over the head shows as the hands begin to fold (2.3 s), up and clear
   of the hair. The curves are drawn at an even pace, time on their axis. */
.intro:not(.is-now) .i-s2, .intro:not(.is-now) .intro-cap-2 { opacity: 0; }
.intro:not(.is-now) .intro-enter { visibility: hidden; }
.is-now .i-s1 { animation: i-hide 0.5s var(--ease-out) forwards; }
.is-now .intro-cap-1 { animation: i-hide 0.4s var(--ease-out) forwards; }
.is-now .intro-go { animation: i-depart 0.2s var(--ease-out) forwards; }
.is-now .i-s2 { animation: i-show 0.6s var(--ease-out) 0.15s both; }
.is-now .intro-cap-2 { animation: i-rise 0.5s var(--ease-out) 0.3s both; }
.is-now .intro-enter { animation: i-arrive 0.5s var(--ease-out) 0.5s both; }
.is-now .i-min { animation: i-min-now 4s linear 0.3s both; }
.is-now .i-hour { animation: i-hour-now 4s linear 0.3s both; }
.is-now .i-arm-l { animation: i-arm-l 2.8s linear 0.3s both; }
.is-now .i-fore-l { animation: i-fore-l 2.8s linear 0.3s both; }
.is-now .i-arm-r { animation: i-arm-r 2.8s linear 0.3s both; }
.is-now .i-fore-r { animation: i-fore-r 2.8s linear 0.3s both; }
.is-now .i-over { animation: i-show 0.05s linear 2.3s both; }
.is-now .i-head-after .i-tuft { animation: i-wobble 0.6s var(--ease-in-out) 1.7s 2 both; }
.is-now .i-sparkle { animation: i-pop 0.35s var(--ease-out) both; }
.is-now .i-sparkle-1 { animation-delay: 1.8s; }
.is-now .i-sparkle-2 { animation-delay: 1.92s; }
.is-now .i-sparkle-3 { animation-delay: 2.04s; }
/* The mug steams for as long as the last scene waits for the press (Uhan3). */
.is-now .i-steam { animation: i-steam 1.8s var(--ease-in-out) 0.6s infinite both; }
.is-now .i-label-modern { animation: i-rise 0.6s var(--ease-out) 0.6s both; }
.is-now .i-badge { animation: i-rise 0.4s var(--ease-out) 0.5s both; }
.is-now .i-spin { animation: i-spin 1.6s linear 0.5s 2 both; }
.is-now .i-badge-busy { animation: i-hide 0.25s var(--ease-out) 3s forwards; }
.is-now .i-badge-done { animation: i-show 0.25s var(--ease-out) 3s both; }
.is-now .i-wipe { animation: i-wipe 1.6s linear 0.8s both; }
.is-now .i-ci-frame { animation: i-show 0.4s var(--ease-out) 2.3s both; }
.is-now .i-est { animation: i-pop 0.25s var(--ease-out) 2.45s both; }
.is-now .i-ci-bar { animation: i-grow 0.45s var(--ease-out) 2.55s both; }
.is-now .i-verdict { animation: i-rise 0.35s var(--ease-out) 2.9s both; }
.is-now .i-rep-2 { animation: i-slide-out 0.7s var(--ease-out) 3.3s both; }
.is-now .i-stamp { animation: i-pop 0.3s var(--ease-out) 3.9s both; }

/* Reduced motion: the same two scenes as fades, the press between them. Nothing types, nods, turns, stretches,
   wobbles, slides, drips or steams; the arms of now rest as drawn, the hands behind the head; the curves fade in
   whole. Each rule names its part as the motion rule does (.is-now ...), so it wins by coming later. */
@media (prefers-reduced-motion: reduce) {
  .intro-cap-1, .i-work, .i-note, .i-cup, .i-rep-1, .i-strain { animation-name: i-show; }
  .intro-go, .is-now .intro-enter { animation-name: i-appear; }
  .is-now .intro-cap-2, .is-now .i-badge, .is-now .i-est, .is-now .i-ci-bar, .is-now .i-verdict, .is-now .i-rep-2,
  .is-now .i-stamp, .is-now .i-sparkle, .is-now .i-label-modern { animation-name: i-show; }
  .i-hand-near, .i-hand-far, .i-tip, .i-head-bob, .i-min, .i-hour, .is-now .i-min, .is-now .i-hour, .is-now .i-spin,
  .is-now .i-arm-l, .is-now .i-fore-l, .is-now .i-arm-r, .is-now .i-fore-r, .is-now .i-over,
  .is-now .i-head-after .i-tuft { animation: none; }
  .i-wipe, .i-script-wipe, .i-sweat, .i-steam { display: none; }
}

@media (max-width: 640px) {
  dialog.intro[open] { gap: 14px; padding-top: 20px; padding-bottom: 24px; }
  .intro-cap { font-size: 16px; }
}

.modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--muted);
}
.modal-x:hover { background: #f6f3ef; color: var(--ink); }
.modal-x .ico { width: 18px; height: 18px; }
.modal-title { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.modal-sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
/* A confirm's words in bold (askConfirm's {strong} parts, e.g. Data → Result) are in the page's ink, not grey. */
.modal-sub strong { color: var(--ink); font-weight: 700; }
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 700; }
.field input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fdfcf9;
  font-size: 15px;
}
.field input:focus { border-color: var(--accent); background: var(--white); box-shadow: 0 0 0 3px rgba(142, 111, 62, 0.12); }
.modal-error { margin: -4px 0 12px; color: var(--danger); font-size: 13.5px; }

/* The study settings form (test review fixes, stream D2): a wider dialog whose fields scroll between its title and its
   buttons; each group under a small heading, the optional parts shown once ticked. */
dialog.modal-settings { width: min(560px, calc(100vw - 32px)); padding: 26px 26px 20px; }
dialog.modal-settings[open] { display: flex; flex-direction: column; }
.sf-body { flex: 1 1 auto; min-height: 0; margin: 0 -6px 12px; padding: 0 6px; overflow-y: auto; }
.sf-group { margin: 0 0 14px; padding: 12px 14px 2px; border: 1px solid var(--line); border-radius: 14px; }
.sf-group legend { padding: 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.sf-opt { margin-left: 4px; color: var(--faint); font-size: 11.5px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.field select, .sf-sub input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fdfcf9;
  font-size: 14.5px;
}
.field select:focus, .sf-sub input:focus { border-color: var(--accent); background: var(--white); box-shadow: 0 0 0 3px rgba(142, 111, 62, 0.12); }
.sf-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.sf-check { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 14px; }
.sf-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.sf-sub { display: block; margin-top: 2px; }
.sf-kept { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.sf-sub-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12.5px; }
.sf-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) {
  .sf-row { grid-template-columns: 1fr; gap: 0; }
}

/* A failed pre-flight line's fix (test review fixes, stream D2, U-fix): a small button under the line, and what the fix
   did, said under the lines. */
.finding-fix { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
/* A fix whose re-check passed (review round 1, W8): the card reads as passed, and Send now stands before Back. */
.notice.is-passed { border-color: var(--line); }
.notice.is-passed .notice-title { color: var(--ink); }
.notice.is-passed .notice-title .ico { color: var(--accent); }
.findings-send { margin-right: 8px; }
.finding-fix .btn-soft { padding: 5px 12px; font-size: 13.5px; }
.findings-said { margin: 10px 0 12px; color: var(--ink-2); font-size: 14px; }

/* The login dialog's sign-up (Uhan3, 2026-10-17): Google's button, the divider, and the quiet links under the buttons. */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.btn-google:hover { border-color: #d0c6b3; background: #fdfcf9; }
.ico-google { flex: none; width: 18px; height: 18px; }
.login-or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--faint); font-size: 13px; }
.login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login-sent { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.login-link {
  display: block;
  margin: 12px auto 0;
  padding: 4px 6px;
  border: none;
  background: none;
  color: var(--accent-dark);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.login-link:hover { color: var(--ink); }
.login-link:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.login-links { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
/* The six code boxes (Uhan3, 2026-10-18): one large digit each, sharing the field's width. */
.code-boxes { display: flex; gap: 10px; }
.field .code-box {
  flex: 1 1 0;
  min-width: 0;
  height: 60px;
  padding: 0;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  caret-color: var(--accent);
}
.login-links .login-link { margin: 0; }
/* Delete my account (Uhan3, 2026-10-18): the address or name to type stands under the label, bold, and wraps. */
#delete-target { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
/* While the request is out the dialog cannot be closed, so its X goes. */
#delete-dialog.is-deleting .modal-x { display: none; }
/* Feedback (Uhan3, 2026-10-20): the text box looks like the dialog's other fields, full width, and is resized in height
   only; while the feedback is sent the dialog cannot be closed (its X goes) and the locked fields read grey. */
.field textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fdfcf9;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
}
.field textarea:focus { border-color: var(--accent); background: var(--white); box-shadow: 0 0 0 3px rgba(142, 111, 62, 0.12); }
.feedback-from { margin: -2px 0 14px; color: var(--ink-2); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
#feedback-dialog.is-sending .modal-x { display: none; }
#feedback-dialog.is-sending .field textarea, #feedback-dialog.is-sending .field input { color: var(--muted); cursor: default; }
.key-state { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }

/* New task while a turn runs */
dialog.modal-confirm { width: min(500px, calc(100vw - 32px)); padding: 26px 26px 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

dialog.modal-report { width: min(920px, calc(100vw - 32px)); height: min(88vh, 1100px); padding: 0; }
dialog.modal-report[open] { display: flex; flex-direction: column; }
.report-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 14px 32px;
  border-bottom: 1px solid var(--line-soft);
}
.report-head .modal-title { min-width: 0; margin: 0; overflow: hidden; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
.report-head .modal-x { position: static; }
.report-tools { flex: none; display: flex; align-items: center; gap: 8px; }
/* At phone widths the tools may shrink and wrap, so the close stays inside the dialog (browser tests, 2026-10-20: at
   390 px the two downloads pushed it past the dialog's right edge). */
@media (max-width: 640px) {
  .report-tools { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
}
.dl-link { text-decoration: none; white-space: nowrap; }
.dl-link .ico { width: 14px; height: 14px; }
.report-body { flex: 1; min-height: 0; overflow: auto; padding: 24px 32px 40px; font-size: 15.5px; line-height: 1.65; }

/* A data file's preview: the file as it is, a CSV as a table */
.preview-meta { flex: none; margin: 0; padding: 8px 32px; border-bottom: 1px solid var(--line-soft); background: var(--accent-tint); color: var(--muted); font-size: 13px; }
.preview-body { padding: 18px 24px 28px; }
.preview-wait, .preview-error { margin: 12px 8px; color: var(--muted); font-size: 14px; font-style: italic; }
.preview-error { color: var(--danger); font-style: normal; }
.preview-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.preview-table { min-width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; }
.preview-table th, .preview-table td { padding: 5px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
.preview-table th { position: sticky; top: 0; background: #f5f2ed; color: var(--ink); font-weight: 700; }
.preview-table tbody tr:nth-child(even) td { background: #fcfaf6; }
.preview-text {
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #faf8f5;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
}
/* A blank template's long lists of choices wrap inside the preview */
.preview-text.is-template { white-space: pre-wrap; overflow-wrap: anywhere; }
/* A run's page (.html) previews as itself: the frame fills the dialog under its head, and stays hidden until it has
   loaded and been scrubbed (beagent.js drawPage). */
.preview-body.is-page { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.preview-body.is-page > .preview-wait { flex: none; margin: 18px 32px 0; }
.preview-frame { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: var(--white); visibility: hidden; }
.preview-frame.is-ready { visibility: visible; }

/* ------------------------------------------------------------------ narrow screens */

@media (max-width: 640px) {
  .topbar { height: 52px; padding: 0 8px 0 12px; }
  .brand { margin-right: 2px; }
  #logout-btn .top-btn-text { display: none; }
  .top-btn { padding: 7px 8px; }
  /* Home's task switch takes a row of its own under the brand and the buttons. */
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar-right { grid-column: 2; }
  .task-toggle { grid-row: 2; grid-column: 1 / -1; justify-self: center; margin-bottom: 8px; }
  .is-home .topbar { height: auto; grid-template-rows: 52px auto; }

  .home { padding-top: 32px; }
  .wordmark { margin-bottom: 22px; font-size: 48px; }
  /* Home's curves span the column beside the rail: the desktop width, the window less the open sidebar's, is a sliver
     on a phone. */
  body.is-home::before { left: var(--side-w); width: calc(100% - var(--side-w)); }
  .examples { padding-top: 28px; }
  .examples-title { font-size: 28px; }
  /* At phone widths the Data button is its folder alone, a circle where the + was, so the box keeps its width; the
     gear beside the box's right end is a circle of the same size. */
  .composer-row { align-items: flex-start; gap: 10px; }
  .data-btn, .is-chat .data-btn {
    flex: none;
    width: 44px;
    height: 44px;
    min-height: 0;
    margin-top: 8px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
  }
  .data-btn-text { display: none; }
  .pill { padding: 10px 8px 8px 16px; border-radius: 22px; }
  .gear-btn { width: 44px; height: 44px; margin-top: 8px; box-shadow: var(--shadow-sm); }
  /* The gear's menu, from the gear's right edge, is as wide as the message row at most, so it stays on screen. */
  .gear-menu { width: min(324px, calc(100vw - var(--side-w) - 2 * var(--gutter))); }
  .is-home .gear-menu { top: calc(100% + 8px); }
  .msg-sec { flex: 1 1 0; padding: 0 8px 0 0; }

  .chat-col { padding-top: 20px; }
  .say { font-size: 16px; }
  .bubble { max-width: 92%; }
  .qcard, .notice { padding: 16px; }
  .result { padding: 16px 16px 16px 20px; }
  .q-opts.has-desc { grid-template-columns: 1fr; }
  .report-head { padding-left: 18px; }
  .report-body { padding: 18px 18px 32px; }
  dialog.modal-report { height: calc(100vh - 32px); }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
}

/* Home's bar beside the open sidebar at the narrow end of desktop widths: the window less the sidebar's 280px leaves no
   row for the switch and both buttons (signed out, the bar ran past the window up to about 700px), so the bar takes the
   phone's two rows, the switch under the buttons. --topbar-h grows by the switch's row (the 12px gap, its 38px and 8px
   under it), so the Data panel opens under the switch and the message box keeps its place. */
@media (min-width: 641px) and (max-width: 720px) {
  body.side-open.is-home { --topbar-h: 114px; }
  body.side-open.is-home .topbar { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 56px auto; }
  body.side-open.is-home .topbar-right { grid-column: 2; }
  body.side-open.is-home .task-toggle { grid-row: 2; grid-column: 1 / -1; justify-self: center; margin-bottom: 8px; }
}
/* While MCP is shown (Uhan3, 2026-11-20; the public route on), the row needs about 757px signed out, MCP and its gap
   more than Menu and Log in: up to 780px Home's bar beside the open sidebar takes the same two rows. With the route off
   the link is hidden and nothing here applies. */
@media (min-width: 721px) and (max-width: 780px) {
  body.side-open.is-home:has(#mcp-link:not([hidden])) { --topbar-h: 114px; }
  body.side-open.is-home:has(#mcp-link:not([hidden])) .topbar { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 56px auto; }
  body.side-open.is-home:has(#mcp-link:not([hidden])) .topbar-right { grid-column: 2; }
  body.side-open.is-home:has(#mcp-link:not([hidden])) .task-toggle { grid-row: 2; grid-column: 1 / -1; justify-self: center; margin-bottom: 8px; }
}

@media (max-width: 400px) {
  .is-chat .brand-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner, .dots i { animation-duration: 2.4s; }
  .live-dot { animation: none; }
  .opt, .step-chev, .btn-soft .setup-chev, .task-toggle::before, .tour-ring.is-gliding { transition: none; }
  .gear-slider::-webkit-slider-thumb, .replay-seek::-webkit-slider-thumb { transition: none; }
}
