/* investbriefs-1128: corner II Investment Briefs (public/briefs.js). Own file so theme.css (touched by other branches) stays
 * untouched. Original TriCity design: engraved-paper prospectus cards, one ink colour per issuer, a guilloche frame drawn with
 * two interfering ring patterns (no image), seal + pen signature as inline SVG, chamfered plates and folder tabs (clip-path,
 * never rounded). Contrast: body ink #1d1910 on paper #f7f0dd = 15.9:1; muted #4b4331 = 8.6:1; plate cream #fff7e0 on each
 * issuer ink >= 9:1; tab text on the dark card >= 7:1. */
.ib-desk { --ib-text: #1d1910; --ib-mute: #4b4331; --ib-rule: rgba(29, 25, 16, .26);
  display: flex; flex-direction: column; gap: 8px; min-width: 0; container-type: inline-size; }
.ib-head { font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: #f1d58a; }

/* folder tabs: series, name and price (or the holder) */
.ib-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.ib-tab { --cut: 7px; --ib-ink: #1f3a68; position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-width: 0; min-height: 46px;
  padding: 5px 9px 5px 10px; border: 0; border-radius: 0; cursor: pointer; font: inherit; text-align: left; color: #efe6cf;
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03)); box-shadow: inset 0 0 0 1px rgba(239, 230, 207, .32), inset 3px 0 0 var(--ib-tabc, #6f8fc9);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }
.ib-tab.ib-jail { --ib-ink: #6b1d24; --ib-tabc: #d9737b; } .ib-tab.ib-util { --ib-ink: #0b5a52; --ib-tabc: #5cc2b5; } .ib-tab.ib-trans { --ib-ink: #1f3a68; --ib-tabc: #86a6e0; }
.ib-tab-k { display: flex; align-items: center; gap: 4px; max-width: 100%; font-size: 10px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; overflow: hidden; opacity: .92; }
.ib-tab-k i { flex: 0 0 auto; display: inline-grid; place-items: center; width: 13px; height: 13px; font-style: normal; font-size: 9px; letter-spacing: 0; color: #14110b; background: var(--ib-tabc, #86a6e0); }
.ib-tab.on .ib-tab-k i { color: #fff7e0; background: var(--ib-ink); }
.ib-tab-v { max-width: 100%; font-family: 'Lilita One', Fredoka, sans-serif; font-weight: 400; font-size: 16px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-tab.is-held .ib-tab-v { font-family: Nunito, system-ui, sans-serif; font-weight: 900; font-size: 12px; letter-spacing: .02em; color: #ffb3b3; padding-top: 2px; }
.ib-tab.on { color: var(--ib-ink); background: linear-gradient(180deg, #fbf6e8, #efe4c8); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ib-ink) 70%, #000), inset 0 -3px 0 var(--ib-ink); }
.ib-tab.on .ib-tab-v { color: var(--ib-ink); } .ib-tab.on.is-held .ib-tab-v { color: #a4161d; }
.ib-tab:focus-visible { outline: 3px solid #f2b705; outline-offset: 1px; }
.ib-stage { min-width: 0; }
.ib-stage > [hidden] { display: none !important; }

/* the brief */
.ib-card { --ib-ink: #1f3a68; --ib-tint: rgba(31, 58, 104, .07);
  position: relative; isolation: isolate; min-width: 0; padding: 12px 14px 12px; color: var(--ib-text, #1d1910); text-align: left;
  background: radial-gradient(120% 90% at 50% 0%, #fbf6e8 0%, #f7f0dd 55%, #efe4c8 100%);
  border: 1px solid color-mix(in srgb, var(--ib-ink) 70%, #000); border-radius: 0;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .2), 0 6px 14px rgba(0, 0, 0, .2); font-family: Nunito, system-ui, sans-serif; }
.ib-card.ib-jail { --ib-ink: #6b1d24; --ib-tint: rgba(107, 29, 36, .07); }
.ib-card.ib-util { --ib-ink: #0b5a52; --ib-tint: rgba(11, 90, 82, .07); }
.ib-card.ib-trans { --ib-ink: #1f3a68; --ib-tint: rgba(31, 58, 104, .07); }
/* guilloche frame: two ring fields from opposite corners interfere into the engraved moire of a banknote border, masked to a
   5 px band just inside the edge; a hairline rule runs inside it */
.ib-card::before { content: ''; position: absolute; inset: 3px; z-index: -1; padding: 5px; pointer-events: none; opacity: .5;
  background: repeating-radial-gradient(circle at 0 0, var(--ib-ink) 0 .7px, transparent .9px 3.1px),
              repeating-radial-gradient(circle at 100% 100%, var(--ib-ink) 0 .7px, transparent .9px 3.1px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.ib-card::after { content: ''; position: absolute; inset: 9px; z-index: -1; pointer-events: none; border: 1px solid color-mix(in srgb, var(--ib-ink) 40%, transparent); }

/* PROSPECTUS · SERIES band between double rules */
.ib-band { display: flex; align-items: center; gap: 8px; margin: 0 2px; font-size: 10px; font-weight: 900; letter-spacing: .24em; text-transform: uppercase; color: var(--ib-ink); line-height: 1; }
.ib-band::before, .ib-band::after { content: ''; flex: 1 1 0; height: 4px; border-top: 1px solid var(--ib-ink); border-bottom: 1px solid var(--ib-ink); opacity: .7; }
.ib-band span { white-space: nowrap; }
/* letterhead: seal, issuer, title */
.ib-lh { display: flex; align-items: center; gap: 9px; margin: 8px 2px 7px; }
.ib-seal { flex: 0 0 auto; width: 40px; height: 40px; color: var(--ib-ink); }
.ib-iss { display: flex; flex-direction: column; min-width: 0; line-height: 1.12; }
.ib-iss-name { font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: 12.5px; letter-spacing: .03em; color: var(--ib-ink); }
.ib-title { font-family: 'Lilita One', Fredoka, sans-serif; font-weight: 400; font-size: 20px; line-height: 1.08; letter-spacing: .01em; color: var(--ib-text, #1d1910); text-shadow: none; }

/* key terms: a ruled ledger table */
.ib-terms { width: calc(100% - 4px); margin: 0 2px; border-collapse: collapse; font-size: 12.5px; line-height: 1.28; table-layout: fixed; background: none; }
.ib-terms th, .ib-terms td { padding: 4px 0; vertical-align: top; border: 0; border-top: 1px solid var(--ib-rule); overflow-wrap: anywhere; background: none; }
.ib-terms tr:last-child th, .ib-terms tr:last-child td { border-bottom: 1px solid var(--ib-rule); }
.ib-terms th { width: 31%; padding: 6px 8px 4px 4px; text-align: left; font-size: 9.5px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--ib-mute, #4b4331); }
.ib-terms td { font-weight: 700; color: var(--ib-text, #1d1910); padding-right: 4px; }
.ib-terms tr:first-child td { font-family: 'Lilita One', Fredoka, sans-serif; font-weight: 400; font-size: 17px; line-height: 1.15; color: var(--ib-ink); letter-spacing: .02em; }
.ib-terms tr:nth-child(even) th, .ib-terms tr:nth-child(even) td { background: var(--ib-tint); }

.ib-risk { margin: 6px 2px 0; font-size: 11.5px; line-height: 1.3; color: var(--ib-mute, #4b4331); font-style: italic; }
.ib-risk b { font-style: normal; font-weight: 900; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ib-ink); margin-right: 3px; }

/* signature line + the plate / the stamp */
.ib-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 6px 2px 0; min-height: 46px; }
.ib-signblock { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; max-width: 150px; }
.ib-sig { width: 92px; height: 20px; color: var(--ib-ink); opacity: .85; margin-left: 2px; }
.ib-sigline { border-top: 1px solid var(--ib-text, #1d1910); padding-top: 2px; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ib-mute, #4b4331); white-space: nowrap; }

.ib-plate { --cut: 9px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 46px; min-width: 128px; padding: 0 16px;
  border: 0; border-radius: 0; cursor: pointer; font: inherit; font-weight: 900; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: #fff7e0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ib-ink, #1f3a68) 76%, #fff) 0%, var(--ib-ink, #1f3a68) 46%, color-mix(in srgb, var(--ib-ink, #1f3a68) 78%, #000) 100%);
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
  box-shadow: inset 0 0 0 2px rgba(255, 233, 170, .55); text-shadow: 0 1px 0 rgba(0, 0, 0, .45); transition: filter .12s, transform .12s; white-space: nowrap; }
.ib-plate b { font-family: 'Lilita One', Fredoka, sans-serif; font-weight: 400; font-size: 18px; letter-spacing: .03em; text-transform: none; }
.ib-plate:hover:not(:disabled) { filter: brightness(1.12); }
.ib-plate:active:not(:disabled) { transform: translateY(1px); }
.ib-plate:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
.ib-plate:disabled { cursor: not-allowed; color: #3d3628; text-shadow: none; background: repeating-linear-gradient(135deg, #e3d8bd 0 6px, #d9cdae 6px 12px); box-shadow: inset 0 0 0 2px rgba(61, 54, 40, .45); }

.ib-stamp { flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; padding: 3px 12px 4px; margin: 0 4px 2px 0; transform: rotate(-5deg);
  color: #a4161d; border: 3px double #a4161d; background: rgba(255, 255, 255, .25); line-height: 1.05; text-transform: uppercase; mix-blend-mode: multiply; }
.ib-stamp span { font-size: 9.5px; font-weight: 900; letter-spacing: .22em; }
.ib-stamp b { font-family: 'Lilita One', Fredoka, sans-serif; font-weight: 400; font-size: 18px; letter-spacing: .04em; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-card.is-mine .ib-stamp { color: #0b5a2e; border-color: #0b5a2e; }

/* all three + No thanks */
.ib-row { display: flex; gap: 8px; align-items: stretch; }
.ib-plate-all { --ib-ink: #5a4214; flex: 1 1 auto; min-width: 0; padding: 3px 12px; gap: 0; flex-direction: column; line-height: 1.05; }
.ib-plate-all .ib-all-k { font-size: 10.5px; letter-spacing: .08em; white-space: nowrap; }
.ib-plate-all .ib-all-save { letter-spacing: .02em; text-transform: none; font-weight: 800; color: #ffe39a; }
.ib-plate-all:disabled .ib-all-save { color: #3d3628; }
.ib-skip { --cut: 8px; flex: 0 0 auto; min-height: 46px; padding: 0 16px; border: 0; border-radius: 0; cursor: pointer; font: inherit; font-weight: 800; font-size: 14px; color: #f3ead2;
  background: rgba(20, 18, 12, .6); box-shadow: inset 0 0 0 1px rgba(243, 234, 210, .5);
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut)); }
.ib-skip:hover { background: rgba(20, 18, 12, .78); }
.ib-row > .ib-skip:only-child { flex: 1 1 auto; }

/* My Tycoon: held briefs, compact */
.ib-held { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ib-held-t { font-weight: 800; font-size: 13px; }
.ib-card.is-compact .ib-title { font-size: 18px; }

/* narrow columns (the desktop side column is ~300 px): tabs drop the series chip so every name fits whole */
@container (max-width: 330px) {
  .ib-tab { padding: 5px 6px 5px 9px; }
  .ib-tab-k { font-size: 9.5px; letter-spacing: .01em; }
  .ib-tab-k i { display: none; }
  .ib-tab-v { font-size: 15px; }
  .ib-skip { padding: 0 12px; }
}
/* phones: the turn card (max 46vh, style.css) grows to fit the briefs instead of scrolling them inside a small box */
@media (max-width: 900px) { .turn-card:has(.ib-desk) { max-height: none; } }
@media (max-width: 380px) {
  .ib-card { padding: 11px 12px; }
  .ib-tab { padding: 5px 7px 5px 9px; }
  .ib-tab-k { font-size: 9.5px; letter-spacing: .02em; gap: 3px; }
  .ib-band { letter-spacing: .18em; }
  .ib-plate { min-width: 116px; padding: 0 12px; }
  .ib-plate-all { padding: 0 10px; }
  .ib-sig { width: 80px; }
}
@media (prefers-reduced-motion: reduce) { .ib-plate { transition: none; } }
