/* LUT expiry line (Prompt 590): colour and words, never colour alone */
.lut-line { margin: 0 0 16px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card, #fff); font-size: 14px; overflow-wrap: anywhere; }
.lut-line a { margin-left: 6px; white-space: nowrap; }
.lut-line.lut-amber { border-color: #D9A441; background: #FFF8E6; color: #6B4A00; }
.lut-line.lut-red, .lut-line.lut-expired { border-color: #D14B4B; background: #FDEDED; color: #8A1C1C; }
.lut-line.lut-red .lut-text::before, .lut-line.lut-expired .lut-text::before { content: "! "; font-weight: 700; }
.lut-line.lut-amber a, .lut-line.lut-red a, .lut-line.lut-expired a { color: inherit; text-decoration: underline; }
/* Dashboard cards (Prompt 544): turning cards, receivables and payables, upcoming filings. */
.rot { position: relative; min-width: 0; }
.rot-stage { display: grid; }
.rot-slide { grid-area: 1 / 1; min-width: 0; visibility: hidden; opacity: 0; transition: opacity 0.35s ease; }
.rot-slide.is-active { visibility: visible; opacity: 1; }
.rot-dots { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.rot-dot { width: 24px; height: 24px; padding: 0; border: none; background: none; cursor: pointer; position: relative; }
.rot-dot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--border); }
.rot-dot.is-active::after { background: var(--primary); }
.rot-dot:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; border-radius: 4px; }
/* reduce motion: nothing turns, every slide is shown, one under the other */
.rot-static .rot-stage { display: block; }
.rot-static .rot-slide { visibility: visible; opacity: 1; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); transition: none; }
.rot-static .rot-slide:last-child { margin-bottom: 0; border-bottom: none; }
@media (prefers-reduced-motion: reduce) { .rot-slide { transition: none; } }
.cash-accounts a, .dash-open { color: var(--link); }
.dash-open { display: inline-block; margin-top: 8px; font-size: 13px; }
.dash-note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.dash-more { margin-top: 6px; font-size: 13px; }
.dash-more summary { cursor: pointer; color: var(--link); }
.party-card { display: block; text-decoration: none; color: inherit; }
.party-card:hover .stat-value { text-decoration: underline; }
.party-overdue { margin-top: 8px; font-size: 13px; color: var(--muted); }
.party-overdue.is-late { color: var(--negative); font-weight: 600; }
.filing-date { font-family: 'Fraunces', serif; font-size: 20px; overflow-wrap: anywhere; }
.filing-when { display: inline-block; font-family: inherit; font-size: 12px; color: var(--muted); margin-left: 6px; }
.filing-today .filing-when { color: var(--negative); font-weight: 600; }
.filing-name { margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; }
.filing-amount { margin-top: 4px; font-size: 13px; }
#dash-top .stat-card, .stat-grid .stat-card { min-width: 0; }
.dash-back { display: inline-block; margin: 0 0 12px; }
/* The page flip of the filings card (Prompt 584, batch 2; a 3D hinge turn in Prompt 611; the corner curl, now the default effect, in Prompt 619). Only where dashboard-rotator.js put .rot-flip on the box: the switch is on, the browser can
   draw 3D, there is more than one page and the person has not asked for reduced motion. Each slide is a LEAF: a front face (the page, on solid paper), a back face (the paper back) and a shade on
   each face. The hinge is the top edge: the old leaf turns up and over (rotateX 0 to 180 degrees; a positive angle lifts the bottom edge toward the viewer), the front is hidden by
   backface-visibility once it passes edge-on and the back takes over; the new page waits underneath and receives a soft shadow. Going back is the same turn played the other way: the earlier page
   comes down from above and lands on top. 0.8 s. Without .rot-flip nothing below applies and the plain cross-fade above is used. */
.rot-face .rot-shade, .rot-back, .rot-foldshade, .rot-cast, .rot-flapwrap { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .rot-flip .rot-stage { perspective: 1100px; perspective-origin: 50% 0; }
  .rot-flip .rot-slide { position: relative; transition: none; transform-style: preserve-3d; transform-origin: 50% 0; }
  .rot-flip .rot-slide.is-active { z-index: 1; }
  .rot-flip .rot-face { border-radius: 8px; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
  .rot-flip .rot-front { position: relative; background: var(--card, #fff); }
  .rot-flip .rot-back { display: block; position: absolute; inset: 0; transform: rotateX(180deg); background: #E7ECF2 repeating-linear-gradient(to bottom, transparent 0 17px, rgba(28, 54, 114, 0.07) 17px 18px); box-shadow: inset 0 0 0 1px var(--border); }
  .rot-flip .rot-shade { display: block; position: absolute; inset: 0; border-radius: inherit; background: #0B1B3A; opacity: 0; pointer-events: none; }
  .rot-flip .rot-slide.is-under { visibility: visible; opacity: 1; z-index: 1; }
  .rot-flip .rot-slide.is-leaving, .rot-flip .rot-slide.is-arriving { visibility: visible; opacity: 1; z-index: 3; will-change: transform; }
  .rot-flip .rot-slide.is-leaving .rot-face, .rot-flip .rot-slide.is-arriving .rot-face { box-shadow: 0 8px 16px rgba(11, 27, 58, 0.22); }
  .rot-flip .rot-slide.is-leaving { animation: rot-turn var(--flip-ms, 800ms) cubic-bezier(0.45, 0.05, 0.2, 1) both; }
  .rot-flip .rot-slide.is-arriving { animation: rot-turn var(--flip-ms, 800ms) cubic-bezier(0.45, 0.05, 0.2, 1) reverse both; }
  .rot-flip .rot-slide.is-leaving .rot-front .rot-shade, .rot-flip .rot-slide.is-arriving .rot-front .rot-shade { animation: rot-shade-front var(--flip-ms, 800ms) cubic-bezier(0.45, 0.05, 0.2, 1) both; }
  .rot-flip .rot-slide.is-leaving .rot-back .rot-shade, .rot-flip .rot-slide.is-arriving .rot-back .rot-shade { animation: rot-shade-back var(--flip-ms, 800ms) cubic-bezier(0.45, 0.05, 0.2, 1) both; }
  .rot-flip .rot-slide.is-arriving .rot-front .rot-shade, .rot-flip .rot-slide.is-arriving .rot-back .rot-shade { animation-direction: reverse; }
  .rot-flip .rot-slide.is-under::after { content: ""; position: absolute; inset: 0; border-radius: 8px; pointer-events: none; background: linear-gradient(to bottom, rgba(11, 27, 58, 0.38), rgba(11, 27, 58, 0) 75%); animation: rot-under var(--flip-ms, 800ms) ease both; }
  .rot-flip .rot-slide.is-under.is-reverse::after { animation-direction: reverse; }
  @keyframes rot-turn { from { transform: rotateX(0deg); } to { transform: rotateX(180deg); } }
  @keyframes rot-shade-front { from { opacity: 0; } to { opacity: 0.4; } }
  @keyframes rot-shade-back { from { opacity: 0.4; } to { opacity: 0.04; } }
  @keyframes rot-under { 0% { opacity: 0; } 45% { opacity: 1; } 100% { opacity: 0; } }
  /* The corner curl (Prompt 619): dashboard-rotator.js draws every frame (clip-path on the page that peels, the flap = its paper back as a reflected, clipped layer, gradients for the crease,
     the highlight and the shadow on the page underneath). The whole turn stays inside the stage (overflow hidden), so it cannot spill into the scroll areas or over other cards. */
  .rot-flip.rot-curl .rot-stage { position: relative; overflow: hidden; border-radius: 8px; perspective: none; isolation: isolate; }
  .rot-flip.rot-curl .rot-back, .rot-flip.rot-curl .rot-shade { display: none; }
  .rot-flip.rot-curl .rot-front { padding: 8px 10px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--border); }
  .rot-flip.rot-curl .rot-slide { transform-style: flat; }
  .rot-flip.rot-curl .rot-slide.is-curl-top { visibility: visible; opacity: 1; z-index: 3; }
  .rot-flip.rot-curl .rot-slide.is-curl-under { visibility: visible; opacity: 1; z-index: 1; }
  .rot-flip.rot-curl .rot-foldshade, .rot-flip.rot-curl .rot-cast { display: block; position: absolute; inset: 0; border-radius: 8px; pointer-events: none; }
  .rot-flip.rot-curl .rot-flapwrap { display: none; position: absolute; inset: 0; z-index: 4; pointer-events: none; filter: drop-shadow(0 5px 7px rgba(11, 27, 58, 0.35)); }
  .rot-flip.rot-curl .rot-flap { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
}
.rot-plain { margin-top: 8px; font-size: 12px; padding: 4px 10px; }

/* The TDS card (S6, Prompt 595) and the activity feed's Show more (S7) */
.tds-card { flex: 1 1 240px; min-width: 0; }
.tds-link { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; color: inherit; text-decoration: none; }
.tds-link:hover .tds-value, .tds-link:hover .tds-val2 { text-decoration: underline; }
.tds-key { color: var(--muted); font-size: 13px; }
.tds-value { margin: 0; }
.tds-val2 { font-weight: 600; }
.tds-basis, .tds-next { overflow-wrap: anywhere; }
.tds-sub { margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.tds-sections { list-style: none; margin: 4px 0 8px; padding: 0; font-size: 13px; }
.tds-sections li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 2px 0; }
.tds-fig { color: var(--muted); }
.tds-warn { color: #8A1C1C; }
.act-more { margin: 8px 0 0; }

/* The compliance card (S3, Prompt 601): the colour is the server's worst_level, always with words as well */
.compliance-card { flex: 1 1 260px; min-width: 0; }
.compliance-card.cmp-amber { border-color: #D9A441; background: #FFF8E6; }
.compliance-card.cmp-red, .compliance-card.cmp-overdue { border-color: #D14B4B; background: #FDEDED; }
.cmp-list { list-style: none; margin: 4px 0 8px; padding: 0; font-size: 13px; }
.cmp-list li { padding: 3px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; overflow-wrap: anywhere; }
.cmp-list li.cmp-amber .cmp-when { color: #6B4A00; font-weight: 600; }
.cmp-list li.cmp-red .cmp-when, .cmp-list li.cmp-overdue .cmp-when { color: #8A1C1C; font-weight: 700; }
