/* chart-well.css: the chart well, the one container every chart and graph in the v8 layer sits in (22 October 2026, README 79).
   Janne, 22 October 2026, with a reference (a rounded panel, a 1 px light outline, a faint dotted grid of square cells, soft
   rounded-square items in one pale tint): "every kind of graph and chart we show would be inside this kind of little container.
   Take the same edge curvature as we use in the containers, but there should be this faint grid in the background. The charts and
   bars should be these cute, soft little items ... something like the deeper yellow, and then there are lighter yellow lines ...
   go nicely with this shade of light yellow, that butter yellow we use."

   The well: the boxes' 8 px corner (--v8-r-sm, README 63 rule 1), a 1 px butter-yellow outline, the lightest butter fill and a
   dotted grid of 20 px square cells a step deeper. The grid is a mask over the grid colour on ::before, so its colour stays a token.
   The items: soft chubby bars (.v8-cw-u.v8-cw-bar, 4 px corners) and, for single marks only, small rounded squares (.v8-cw-u,
   3 px corners), never circles (README 70).
   Contrast (WCAG 1.4.11, 3:1 for a meaningful mark), measured on the well's fill #FCFDEB:
     mark #869212 3.32:1 (3.42 on white, 3.16 on the butter #F6FAC3) | you #770F67 9.95:1 | avg #004C07 10.01:1 | ink #5E5E5E 6.30:1
     soft #ECF2B4 1.14:1, so a soft item always carries the mark's 1 px edge (the edge carries the 3:1, as README 30's light data
     colours do) | grid #E6EDA6 1.20:1 and edge #D8E185 1.36:1 are decoration: the well's shape is never information.
   Loaded before squares.css (index.html), which leaves these classes alone. */
:root {
  --v8-cw-bg: #FCFDEB;      /* the fill: lighter than the butter yellow (--v8-insight-panel #F6FAC3), so a well reads inside the frame */
  --v8-cw-grid: #E6EDA6;    /* the dotted grid lines, a step deeper */
  --v8-cw-edge: #D8E185;    /* the 1 px outline and the baseline, a step deeper again */
  --v8-cw-ink: #5E5E5E;     /* axis words and captions inside a well (= --v8-ink-2), 6.30:1 on the fill */
  --v8-cw-mark: #869212;    /* the items: a deeper yellow-olive, 3.32:1 on the fill */
  --v8-cw-soft: #ECF2B4;    /* a light item (a future step, the rest of a whole), always with the mark's edge */
  --v8-cw-you: var(--v8-data-yours, #770F67);   /* her own mark (plum, 9.95:1); it always keeps its "You" label too */
  --v8-cw-avg: var(--v8-deep, #004C07);          /* the reference mark, the average (Fennia deep green, 10.01:1; 3.01:1 against the
                                                    mark beside it); it always keeps its "Average" word too */
  --v8-cw-cell: 20px;       /* the grid's square cell */
  --v8-cw-r-item: 3px;      /* an item's corner */
}

/* The dark well (Janne, 22 October 2026: "make the background somehow darker, and the bars should appear lighter so they kind of
   stand out more, but the color scheme should still go together with this light yellow ... those grids in the background, also the
   grid line, should be lighter as well, the dotted ones"). A modifier, .v8-chartwell.is-dark, that remaps the well's tokens, so every
   chart inside follows. Contrast on the dark fill #3D4220: mark #E9F368 8.75:1 | avg #8ADC94 6.38:1 | you #F3C6EC 7.05:1 |
   soft #6E7536 with the mark's edge | ink #F6FAC3 9.70:1 (axis words, light on dark) | her tag's dark words on #F3C6EC 7.05:1 */
:root {
  --v8-cwd-bg: #3D4220;                         /* a dark olive in the butter-yellow world, beside the #F6FAC3 frame */
  --v8-cwd-grid: rgb(246 250 195 / .2);         /* the dotted grid, the butter yellow faint */
  --v8-cwd-edge: #3D4220;                       /* the outline is the fill itself */
  --v8-cwd-base: rgb(246 250 195 / .45);        /* the baseline */
  --v8-cwd-ink: #F6FAC3;                        /* the butter yellow (--v8-insight-panel) */
  --v8-cwd-mark: var(--fennia-secondary-200, #E9F368);
  --v8-cwd-soft: #6E7536;
  --v8-cwd-you: #F3C6EC;                        /* a light plum, hers */
  --v8-cwd-you-ink: #3D4220;                    /* words on her tag */
  --v8-cwd-avg: var(--fennia-primary-40, #8ADC94);   /* Fennia's light green, the average */
}
#v8 :is(#app, .v8-dlgw) .v8-chartwell.is-dark { --v8-cw-bg: var(--v8-cwd-bg); --v8-cw-grid: var(--v8-cwd-grid); --v8-cw-edge: var(--v8-cwd-edge);
  --v8-cw-ink: var(--v8-cwd-ink); --v8-cw-mark: var(--v8-cwd-mark); --v8-cw-soft: var(--v8-cwd-soft); --v8-cw-you: var(--v8-cwd-you);
  --v8-cw-avg: var(--v8-cwd-avg); }
#v8 :is(#app, .v8-dlgw) .v8-chartwell.is-dark .v8-cw-base-l { border-bottom-color: var(--v8-cwd-base); }

#v8 :is(#app, .v8-dlgw) .v8-chartwell { position: relative; isolation: isolate; min-width: 0; padding: var(--v8-4); border: 1px solid var(--v8-cw-edge);
  border-radius: var(--v8-r-sm); background: var(--v8-cw-bg); color: var(--v8-cw-ink); }
/* The grid: 1 px dots, 1 on and 3 off, along the top and left edge of every 20 px cell */
#v8 :is(#app, .v8-dlgw) .v8-chartwell::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: var(--v8-cw-grid);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M0 .5H20M.5 0V20' stroke='%23000' stroke-dasharray='1 3' fill='none'/%3E%3C/svg%3E") 0 0 / var(--v8-cw-cell) var(--v8-cw-cell) repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M0 .5H20M.5 0V20' stroke='%23000' stroke-dasharray='1 3' fill='none'/%3E%3C/svg%3E") 0 0 / var(--v8-cw-cell) var(--v8-cw-cell) repeat; }
/* A tighter well for a small chart (Home's suggestion cards) */
#v8 :is(#app, .v8-dlgw) .v8-chartwell.v8-cw-sm { padding: var(--v8-3); }

/* The items */
#v8 :is(#app, .v8-dlgw) .v8-cw-u { display: block; flex: none; border-radius: var(--v8-cw-r-item); background: var(--v8-cw-mark); }
#v8 :is(#app, .v8-dlgw) .v8-cw-u.v8-cw-you { background: var(--v8-cw-you); }
#v8 :is(#app, .v8-dlgw) .v8-cw-u.v8-cw-avg { background: var(--v8-cw-avg); }
/* The soft chubby bar (Janne: "cute little chubby bars"): a solid bar about 1.5 to 2 times as wide as its gap, 4 px corners all
   round (3 when narrow), never a pill or a circle. Squares (.v8-cw-u alone, a fixed square size) are only for single marks */
#v8 :is(#app, .v8-dlgw) .v8-cw-u.v8-cw-bar { border-radius: 4px; }
#v8 :is(#app, .v8-dlgw) .v8-cw-u.v8-cw-soft { background: var(--v8-cw-soft); box-shadow: inset 0 0 0 1px var(--v8-cw-mark); }
/* A semantic colour keeps its meaning inside a well: blue for what Fennia pays, the hatch for what stays with her (README 30) */
#v8 :is(#app, .v8-dlgw) .v8-cw-u.v8-cw-base { background: var(--v8-data-base); }
#v8 :is(#app, .v8-dlgw) .v8-cw-u.v8-cw-left { background: repeating-linear-gradient(-45deg, #8C8C8C 0 1.5px, var(--v8-white) 1.5px 4.5px); box-shadow: inset 0 0 0 1px var(--v8-data-edge); }
/* A chubby bar split in parts (a whole by share): 12 high, the parts 3 apart, each sized by its own flex from the markup */
#v8 :is(#app, .v8-dlgw) .v8-cw-row { display: flex; gap: 3px; height: 12px; }
#v8 :is(#app, .v8-dlgw) .v8-cw-row > .v8-cw-u { flex: 1 1 0; min-width: 2px; height: 100%; }
/* The baseline under stacked items */
#v8 :is(#app, .v8-dlgw) .v8-cw-base-l { border-bottom: 1px solid var(--v8-cw-edge); }

/* Motion: none. The items stand still (README rule: motion explains, never decorates), so reduced motion has nothing to stop; a
   later rise-in must sit inside prefers-reduced-motion: no-preference and leave the items visible without it */
@media (prefers-reduced-motion: reduce) { #v8 :is(#app, .v8-dlgw) .v8-chartwell * { animation: none !important; transition: none !important; } }

/* Forced colours: the fill and grid give way to the system's colours, the outline becomes CanvasText, the items CanvasText, her
   own Highlight (her "You" label still says it), a soft item an outline only, the hatch an outline */
@media (forced-colors: active) {
  #v8 :is(#app, .v8-dlgw) .v8-chartwell { border-color: CanvasText; }
  #v8 :is(#app, .v8-dlgw) .v8-chartwell::before { display: none; }
  #v8 :is(#app, .v8-dlgw) .v8-cw-u { forced-color-adjust: none; background: CanvasText; }
  #v8 :is(#app, .v8-dlgw) .v8-cw-u.v8-cw-you { background: Highlight; }
  #v8 :is(#app, .v8-dlgw) .v8-cw-u.v8-cw-avg { background: Canvas; box-shadow: inset 0 0 0 2px CanvasText; }
  #v8 :is(#app, .v8-dlgw) .v8-cw-u:is(.v8-cw-soft, .v8-cw-left) { background: Canvas; box-shadow: inset 0 0 0 1px CanvasText; }
}

/* The dark well, round two (Janne, 22 October 2026: "I like the dark ... the yellows ... could be even more buttery yellow, and the
   back, like the grid, could be a bit more recognizable"): the bars a warmer, creamier butter (#F7F0A8, between Fennia's
   Secondary-100 #F7FF96 and the butter panel #F6FAC3), the grid's dots at 38 % instead of 20 %, the baseline at 60 %. The dark well
   is the default on Your claims compared (?well=light shows the light one) */
:root {
  --v8-cwd-mark: #F7F0A8;
  --v8-cwd-grid: rgb(246 250 195 / .38);
  --v8-cwd-base: rgb(246 250 195 / .6);
}

/* The blue well (Janne, 22 October 2026: "the green looks a bit poisonous ... create one that would be done with blues ... the
   background could be more like a darker blue, and then the bars would be lighter blue ... the shades of blues we use"). Fennia's
   own blues: the fill Blue-200 #0042AA, the dotted grid Blue-30 at 30 %, the baseline Blue-30 at 55 %, the bars Blue-30 #C9DDFF,
   the average Blue-10 #F2F5FF (near white), hers the butter yellow #F7F0A8 (it ties her to the insight's yellow frame), the words
   Blue-10. Contrast on #0042AA: bars 6.9:1, average 8.6:1, hers 8.0:1, words 8.6:1 */
:root {
  --v8-cwb-bg: var(--fennia-blue-200, #0042AA);
  --v8-cwb-grid: rgb(201 221 255 / .3);
  --v8-cwb-base: rgb(201 221 255 / .55);
  --v8-cwb-ink: var(--fennia-blue-10, #F2F5FF);
  --v8-cwb-mark: var(--fennia-blue-30, #C9DDFF);
  --v8-cwb-avg: var(--fennia-blue-10, #F2F5FF);
  --v8-cwb-you: #F7F0A8;
  --v8-cwb-you-ink: var(--fennia-blue-200, #0042AA);
}
#v8 :is(#app, .v8-dlgw) .v8-chartwell.is-blue { --v8-cw-bg: var(--v8-cwb-bg); --v8-cw-grid: var(--v8-cwb-grid); --v8-cw-edge: var(--v8-cwb-bg);
  --v8-cw-ink: var(--v8-cwb-ink); --v8-cw-mark: var(--v8-cwb-mark); --v8-cw-soft: rgb(201 221 255 / .35); --v8-cw-you: var(--v8-cwb-you); --v8-cw-avg: var(--v8-cwb-avg); }
#v8 :is(#app, .v8-dlgw) .v8-chartwell.is-blue .v8-cw-base-l { border-bottom-color: var(--v8-cwb-base); }
#v8 #app .ixp-well.is-blue .ixp-pin { color: var(--v8-cwb-you-ink); }
/* The average stands apart (Janne, 22 October 2026: "this average color is not recognizable enough amidst the lighter blue ones"):
   Fennia's Primary-40 green #8ADC94, its own hue between the light blue bars and her butter yellow (5.0:1 on Blue-200) */
:root { --v8-cwb-avg: var(--fennia-primary-40, #8ADC94); }
