/* ORVELLE · the fortune-cookie consent panel, stage 6: as stage 4. Sizes are custom properties; each layout retunes only those. */
.fc { --w: 452px; --stage: 184px; --pad: 22px;
  position: fixed; right: 24px; bottom: 24px; z-index: 50; width: var(--w); max-height: calc(100dvh - 48px); overflow: auto; overscroll-behavior: contain;
  display: none; flex-direction: column; gap: 0; padding: var(--pad) var(--pad) 16px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 30px 80px -20px rgba(59, 42, 32, .35), 0 8px 24px rgba(59, 42, 32, .1);
  scrollbar-width: thin; }
.js .fc { display: flex; }
.fc[data-state="closed"] { opacity: 0; pointer-events: none; }
.fc-head { position: relative; padding-right: 44px; }
.fc-eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 600 11px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.fc-eyebrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.fc h2 { font: 600 32px/1 var(--serif); letter-spacing: -0.01em; }
#fc-desc { margin: 8px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.fc-x { position: absolute; right: -8px; top: -8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); }
.fc-x:hover { background: rgba(28, 25, 23, .06); color: var(--ink); }
.fc-x svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; }

/* stage: the canvas draws the plate and cookies; the buttons are a 4-column grid over it and set where the cookies sit */
.fc-stage { position: relative; height: var(--stage); margin: 14px calc(var(--pad) * -.5) 0; flex: none; }
.fc-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fc-plate { display: none; position: absolute; left: 4%; right: 4%; top: 30%; height: 44%; border-radius: 40px / 30px;
  background: radial-gradient(120% 140% at 50% 30%, #FBF8F2 0%, #F1ECE2 60%, #E2D9CB 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .9), inset 0 -6px 14px rgba(120, 95, 70, .12), 0 14px 26px -12px rgba(80, 55, 35, .35); }
.fc-cookies { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0 6px; }
.fc-cookies li { display: flex; min-width: 0; contain: size layout style; }   /* status text changes re-lay only this column */
.fc [data-live] { contain: strict; }
.fc-cookie { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px;
  padding: 0 2px 6px; border: 0; background: transparent; border-radius: 16px; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.fc-cookie:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.fc-cookie::after { content: ''; position: absolute; inset: 4px; border-radius: 14px; background: rgba(161, 98, 7, .06); opacity: 0; transition: opacity .2s; pointer-events: none; }
.fc-cookie:hover::after { opacity: .7; }
.fc-cookie[aria-expanded="true"] .fc-name { color: var(--gold); }
.fc-cookie[aria-expanded="true"]::before { content: ''; position: absolute; left: 50%; bottom: -9px; width: 12px; height: 12px; margin-left: -6px; background: #FFFDF7; transform: rotate(45deg); box-shadow: -1px -1px 0 rgba(80, 55, 35, .06); z-index: 2; }
.fc-name .short { display: none; }
.fc-name { font: 600 12.5px/1.2 var(--sans); color: var(--ink); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.fc-status { display: inline-flex; align-items: center; gap: 5px; font: 600 10px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.fc-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.fc-cookie[data-status="on"] .fc-status { color: #3F6212; }
.fc-cookie[data-status="on"] .fc-status::before, .fc-cookie[data-status="locked"] .fc-status::before { background: #65A30D; }
.fc-cookie[data-status="locked"] .fc-status { color: var(--gold); }
.fc-cookie[data-status="off"] .fc-status { color: var(--red); }
.fc-cookie[data-status="off"] .fc-status::before { background: var(--red); }

/* static sprites: shown for reduced motion and when WebGL is missing (the cookie art is the same studio render) */
.fc-sprite { display: none; position: absolute; left: 50%; top: 14%; width: 118%; max-width: 150px; aspect-ratio: 26 / 18; transform: translateX(-50%); pointer-events: none; }
.fc-sprite img { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .45s var(--ease); }
.fc-sprite [data-open] { opacity: 0; }
.fc-cookie.cracked .fc-sprite [data-open] { opacity: 1; }
.fc-cookie.cracked .fc-sprite [data-whole] { opacity: 0; }
.fc.static .fc-sprite, .fc.static .fc-plate { display: block; }
.fc.static .fc-canvas { display: none; }

/* the paper slip */
.fc-slip { position: relative; margin: 10px 0 0; flex: none; }
.fc-paper { position: relative; padding: 14px 18px 12px; background:
    repeating-linear-gradient(90deg, rgba(160, 130, 100, .025) 0 2px, transparent 2px 5px), #FFFDF7;
  border-radius: 3px; box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 10px 22px -10px rgba(80, 55, 35, .35), 0 1px 3px rgba(80, 55, 35, .12);
  clip-path: polygon(0 0, 100% 0, 99.2% 12%, 100% 25%, 99.4% 38%, 100% 50%, 99.1% 63%, 100% 76%, 99.3% 88%, 100% 100%, 0 100%, .7% 88%, 0 76%, .9% 63%, 0 50%, .6% 38%, 0 25%, .8% 12%); }
.fc-slip-cat { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font: 600 10.5px/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--red); }
.fc-slip-no { font-variant-numeric: tabular-nums; letter-spacing: .1em; }
.fc-slip-text { margin: 6px 0 0; font: italic 500 19px/1.3 var(--serif); color: var(--ink); min-height: 2.6em; }
.fc-slip-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(168, 50, 42, .3); }
.fc-slip-meta { margin: 0; font: 500 10.5px/1.35 var(--sans); color: var(--muted); letter-spacing: .02em; min-width: 0; }
.fc-slip-meta b { color: var(--red); font-weight: 600; }
.fc-slip[data-cat=""] .fc-slip-foot { display: none; }
.fc-slip[data-cat=""] .fc-slip-text { color: var(--muted); }

/* the switch printed on the slip: a real role=switch button */
.fc-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 2px; border: 0; background: none; flex: none; border-radius: 999px; }
.fc-switch-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.fc-switch-opt { font: 600 11.5px/1 var(--sans); color: var(--muted); transition: color .2s; white-space: nowrap; }
.fc-switch[aria-checked="false"] [data-off], .fc-switch[aria-checked="true"] [data-on] { color: var(--ink); }
.fc-switch-track { position: relative; width: 46px; height: 26px; border-radius: 13px; background: #D9CFC2; transition: background .25s var(--ease); flex: none; }
.fc-switch-track i { position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.fc-switch[aria-checked="true"] .fc-switch-track { background: #4D7C0F; }
.fc-switch[aria-checked="true"] .fc-switch-track i { transform: translateX(20px); }
.fc-switch[aria-disabled="true"] { cursor: not-allowed; }
.fc-switch[aria-disabled="true"] [data-off] { display: none; }
.fc-switch[aria-disabled="true"] .fc-switch-track { background: var(--gold-2); }

.fc-switch.nudge .fc-switch-track { animation: nudge .4s var(--ease); }
@keyframes nudge { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* actions: reject and accept carry equal weight (same size, same style) */
.fc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; flex: none; }
.fc-btn, .fc-save { min-height: 46px; padding: 0 12px; border-radius: 999px; font: 600 13px/1.1 var(--sans); transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); }
.fc-btn { border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); }
.fc-btn:hover { background: var(--ink); color: var(--paper); }
.fc-save { grid-column: 1 / -1; border: 0; background: var(--ink); color: var(--paper); }
.fc-save:hover { background: var(--cocoa); }
.fc-policy { margin: 10px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); text-align: center; }
.fc-policy a { color: var(--ink-2); text-underline-offset: 2px; display: inline-block; padding: 15px 4px; margin: -15px -4px; min-width: 44px; }

/* ---------------------------------------------------------- layouts */
@media (min-width: 1800px) { .fc { --w: 500px; --stage: 220px; } }
@media (max-height: 760px) and (min-width: 641px) { .fc { --stage: 170px; } .fc h2 { font-size: 28px; } #fc-desc { font-size: 13px; } .fc-slip-text { font-size: 17px; min-height: 0; } }
/* phone: a bottom sheet, cookies in a row */
@media (max-width: 640px) {
  .fc { --w: 100%; --stage: 148px; --pad: 16px; right: 0; left: 0; bottom: 0; border-radius: 22px 22px 0 0; border-bottom: 0;
    max-height: min(86dvh, 640px); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .fc h2 { font-size: 26px; }
  #fc-desc { font-size: 12.5px; }
  #fc-desc .more { display: none; }
  .fc-stage { margin-top: 8px; }
  .fc-name { font-size: 11px; }
  .fc-status { font-size: 9px; letter-spacing: .06em; }
  .fc-slip-text { font-size: 16.5px; min-height: 0; }
  .fc-slip-meta { font-size: 10px; }
  .fc-paper { padding: 12px 14px 10px; }
  .fc-actions { margin-top: 10px; }
  .fc-btn, .fc-save { font-size: 12.5px; }
  .fc-policy { margin-top: 8px; }
}
@media (max-width: 420px) { .fc-name .short { display: inline; } .fc-name .full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }
@media (max-width: 360px) { .fc-name { font-size: 10px; } .fc-status { font-size: 8.5px; } .fc-btn { font-size: 12px; padding: 0 8px; } }
/* phones on their side and short tablets: stage left, copy and buttons right */
@media (max-height: 500px) and (min-width: 641px) {
  .fc { --w: min(760px, calc(100vw - 32px)); --stage: 150px; right: 16px; bottom: 12px; max-height: calc(100dvh - 24px); display: grid;
    grid-template-columns: 1.05fr 1fr; grid-template-areas: "head head" "stage slip" "stage actions" "policy policy"; column-gap: 16px; padding: 14px 16px 10px; }
  .fc-head { grid-area: head; } .fc-stage { grid-area: stage; margin: 6px 0 0; } .fc-slip { grid-area: slip; margin-top: 6px; }
  .fc-actions { grid-area: actions; align-self: end; margin-top: 8px; } .fc-policy { grid-area: policy; margin-top: 6px; }
  .fc h2 { font-size: 24px; } #fc-desc { font-size: 12px; margin-top: 4px; } .fc-eyebrow { margin-bottom: 6px; }
  .fc-slip-text { font-size: 15px; min-height: 0; } .fc-btn, .fc-save { min-height: 44px; }
  .js .fc[data-state] { display: grid; }
}
@media (prefers-reduced-motion: reduce) { .fc-sprite img { transition: opacity .3s linear !important; } }
