:root { --tremie-navy: #0b3d5c; --tremie-amber: #f2a900; --tremie-card: #ffffff; --tremie-line: rgba(0,0,0,.12); --tremie-hint: #5d6b78; }
:root[data-theme="dark"] { --tremie-card: #1d2733; --tremie-line: rgba(255,255,255,.14); --tremie-hint: #9fb0c0; }
html, body { height: 100%; margin: 0; }
.tremieBrand { color: var(--tremie-navy); font-weight: 700; letter-spacing: .02em; }
:root[data-theme="dark"] .tremieBrand { color: #fff; }
.tremieLoginPage { background: linear-gradient(160deg, rgba(11,61,92,.10), rgba(242,169,0,.10)); }
.tremieLoginBox { max-width: 24rem; margin: 3rem auto; padding: 1.5rem; background: var(--tremie-card); border-radius: .75rem; box-shadow: 0 2px 16px rgba(0,0,0,.12); box-sizing: border-box; width: calc(100% - 2rem); }
.tremieGrid { padding: .5rem; }
.tremiePanel { border-radius: .5rem; }
.tremieStrong { font-weight: 600; }
.tremieHint { color: var(--tremie-hint); font-size: .8rem; }
.tremieBigButton .sapMBtnInner { min-height: 3rem; font-size: 1.05rem; }
.tremieFilters { flex-wrap: wrap; height: auto; padding: .5rem; }
.tremieResult { border-left: 3px solid var(--tremie-amber); padding-left: .75rem; }
.tremieCage { color: var(--tremie-hint); margin: .5rem 0; }
.tremieTabs .sapMITBContent { padding: 0; }
.tremieUserName { font-weight: 600; }
@media (max-width: 600px) {
  .tremieGrid { padding: .25rem; }
  .tremieLoginBox { margin: 1rem auto; }
  .tremieUserName { display: none; }
}

/* ---- plan screen ---- */
.tremiePlan { width: 100%; }
.tremiePlanBox { display: flex; flex-direction: column; height: calc(100vh - 17rem); min-height: 22rem; }
.tremieLegend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; padding: .4rem .6rem; font-size: .85rem; }
.tremieDone { font-size: 1rem; }
.tremieChip i { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .3rem; border: 1px solid rgba(0,0,0,.4); }
.tremieViewport { position: relative; flex: 1; overflow: hidden; background: #fff; border: 1px solid var(--tremie-line); touch-action: none; user-select: none; -webkit-user-select: none; }
.tremieWorld { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.tremieWorld img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.tremieWorld svg { position: absolute; left: 0; top: 0; }
.tremieWorld svg circle { cursor: pointer; }
.tremieLbl { display: none; pointer-events: none; fill: #000; font-family: sans-serif; }
.tremieLabels .tremieLbl { display: block; }
.tremieMarquee { display: none; position: absolute; border: 2px dashed #f2a900; background: rgba(242,169,0,.15); pointer-events: none; }
@media (max-width: 600px) { .tremiePlanBox { height: calc(100vh - 21rem); } }

/* ---- page banners (one image per tab; text on the empty left side, drawing on the right) ---- */
.tremieHero { position: relative; box-sizing: border-box; height: clamp(5.5rem, 15vw, 9.5rem); margin: .5rem .5rem 0; padding: 0 clamp(1rem, 3vw, 2rem); justify-content: center; color: #fff;
  border-radius: .9rem; background: linear-gradient(90deg, #05265b, #073f8e); overflow: hidden; }
.tremieHero--entry { --hero-img: url("../img/banner/draw-entry.webp"); }
.tremieHero--piles { --hero-img: url("../img/banner/draw-piles.webp"); }
.tremieHero--plan { --hero-img: url("../img/banner/draw-plan.webp"); }
.tremieHero--anchor { --hero-img: url("../img/banner/draw-anchor.webp"); }
.tremieHero--table { --hero-img: url("../img/banner/draw-table.webp"); }
.tremieHero--setup { --hero-img: url("../img/banner/draw-setup.webp"); }
.tremieHero--tools { --hero-img: url("../img/banner/draw-tools.webp"); }
.tremieHero--login { --hero-img: url("../img/banner/draw-login.webp"); margin: 0; border-radius: 0; height: clamp(7rem, 20vw, 11rem); }
.tremieHero .tremieHeroTitle, .tremieHero .sapMTitle { color: #fff; font-size: clamp(1.3rem, 3.6vw, 2.1rem); font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.45); max-width: 60%; }
.tremieHero .tremieHeroSub { color: rgba(255,255,255,.88); font-size: clamp(.78rem, 1.8vw, 1rem); max-width: 55%; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
@media (max-width: 600px) { .tremieHero { margin: .25rem .25rem 0; } .tremieHero .sapMTitle, .tremieHero .tremieHeroSub { max-width: 62%; } }

/* login: banner on top, the form centred in the remaining height (also on phones) */
.tremieLoginPage > section { display: flex; flex-direction: column; min-height: 100%; }
.tremieLoginPage > section > .tremieLoginBox { margin-top: auto; margin-bottom: auto; flex: 0 0 auto; }
.tremieLoginPage > section > .tremieHero { flex: 0 0 auto; }
@media (max-width: 600px) { .tremieLoginPage > section > .tremieLoginBox { margin-top: auto; margin-bottom: auto; } }
@media (max-width: 600px) { .tremieReqBtn .sapMBtnText { display: none; } }

/* banner holds brand + buttons (glass buttons like RiskSavar) */
.tremieHero { height: auto; min-height: clamp(7rem, 17vw, 10.5rem); padding: .75rem clamp(.75rem, 2.5vw, 1.5rem) 1rem; justify-content: flex-start; margin-top: .5rem; }
.tremieHero .tremieHeroTop { width: 100%; gap: .5rem; }
.tremieHero .tremieHeroText { min-width: 0; flex: 1 1 auto; padding-top: .2rem; }
.tremieHero .tremieHeroText .sapMTitle { max-width: 100%; }
.tremieHero .tremieHeroText .tremieHeroSub { max-width: 100%; }
.tremieHero .tremieHeroBrand { color: #fff; font-weight: 700; letter-spacing: .04em; margin-left: .4rem; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.tremieHero .tremieHeroBrandRow { margin-bottom: .35rem; }
.tremieHero .tremieHeroActions { flex: 0 0 auto; gap: .35rem; flex-wrap: nowrap; position: relative; z-index: 2; }
.tremieHeroBtn.sapMBtn .sapMBtnInner { background: rgba(255,255,255,.12) !important; border: 1px solid rgba(255,255,255,.28) !important; backdrop-filter: blur(6px); min-width: 2.25rem; }
.tremieHeroBtn.sapMBtn .sapMBtnInner:hover { background: rgba(255,255,255,.22) !important; }
.tremieHeroBtn.sapMBtn .sapUiIcon, .tremieHeroBtn.sapMBtn .sapMBtnText { color: #fff !important; }
.tremieHero--login { padding: 0 clamp(1rem, 3vw, 2rem); justify-content: center; min-height: 0; height: clamp(7rem, 20vw, 11rem); margin-top: 0; }
.tremieSiteBar { background: transparent; border: 0; }
@media (max-width: 600px) { .tremieHero { padding-top: .5rem; } .tremieHero .tremieHeroTitle, .tremieHero .sapMTitle { font-size: 1.25rem; } .tremieHero .tremieHeroSub { display: none; } }
.tremieUserBtn .sapMBtnText { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .tremieUserBtn .sapMBtnText { display: none; } }
.tremieFirst { max-width: 30rem; margin: 1.5rem auto; padding: 1.25rem; background: var(--tremie-card); border-radius: .75rem; box-shadow: 0 2px 16px rgba(0,0,0,.12); box-sizing: border-box; width: calc(100% - 1.5rem); }

/* banner picture: always shown whole (full height, right aligned); its left edge fades into the gradient */
.tremieHero::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; aspect-ratio: 1200 / 330; background: var(--hero-img) no-repeat center / 100% 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%); mask-image: linear-gradient(90deg, transparent 0, #000 14%); pointer-events: none; }
.tremieHero > * { position: relative; z-index: 1; }
/* dialog footer: theme switch at the bottom left */
.sapMDialog .tremieDlgTheme { position: absolute; left: .5rem; }
/* taller banners so the picture fits (desktop and phone) */
.tremieHero { min-height: clamp(9rem, 21vw, 13rem); }
.tremieHero--login { height: clamp(9rem, 24vw, 13.5rem); min-height: 0; }
@media (max-width: 600px) { .tremieHero { min-height: 9.5rem; } .tremieHero--login { height: 10rem; } }
.tremieHeroActions .sapMBtn { flex: 0 0 auto; }
.tremieHeroActions { min-width: max-content; }
@media (max-width: 600px) { .tremieUserBtn.sapMBtn { width: 2.25rem; } .tremieUserBtn .sapMBtnInner { width: 2.25rem; padding: 0; } }
/* bigger logo in dialog headers */
/* dialog logo: as tall as the TR/EN switch, with a little margin around the picture */
.sapMDialog img.sapMDialogIcon, .sapMDialog .tremieDlgLogo { width: 2.6rem; height: 2.6rem; box-sizing: border-box; padding: .1rem; background: transparent; margin-right: .5rem; }
.tremieHeroBrandRow { gap: .5rem; }
.tremieHero .tremieHeroBrand { font-size: 1.1rem; }

/* coloured tab icons: each tab has its own colour; the selected one is filled (tab key comes from CustomData -> data-tab) */
[data-tab="entry"] { --tab-color: #1a73e8; }
[data-tab="piles"] { --tab-color: #8e44ad; }
[data-tab="plan"] { --tab-color: #f29900; }
[data-tab="table"] { --tab-color: #1e9e4a; }
[data-tab="setup"] { --tab-color: #d6336c; }
[data-tab="tools"] { --tab-color: #0f9fb5; }
.sapMITBItem[data-tab] .sapMITBFilterIcon { color: var(--tab-color) !important; border-color: var(--tab-color) !important; background: color-mix(in srgb, var(--tab-color) 12%, transparent) !important; }
.sapMITBItem[data-tab].sapMITBSelected .sapMITBFilterIcon { background: var(--tab-color) !important; color: #fff !important; }
.sapMITBItem[data-tab] .sapMITBText { color: var(--tab-color) !important; }
.sapMITBItem[data-tab].sapMITBSelected .sapMITBText { font-weight: 700; }
/* form label spacing in the location dialogs (a bit tighter than sapUiSmallMarginTop) */
.tremieFieldGap { margin-top: .7rem; }
/* example texts must not look like typed values: lighter */
.sapMInputBaseInner::placeholder { opacity: .55; }
/* account info rows */
.tremieInfoRow { margin-bottom: .6rem; }
.tremieInfoRow .sapMLabel { font-size: .78rem; opacity: .75; }
/* plan badge in the banner: amber = free (invites to upgrade), green = Pro */
.tremiePkgBtn[data-plan="free"].sapMBtn .sapMBtnInner { background: rgba(242,169,0,.25) !important; border-color: rgba(242,169,0,.75) !important; }
.tremiePkgBtn[data-plan="pro"].sapMBtn .sapMBtnInner { background: rgba(30,158,74,.3) !important; border-color: rgba(74,222,128,.75) !important; }
@media (max-width: 600px) { .tremiePkgBtn .sapMBtnText { display: none; } }

/* banner v2: empty banner as background, the transparent drawing sits bottom right BELOW the button row (never behind the buttons) */
.tremieHero { background: #05265b url("../img/banner/bg.webp") center / cover no-repeat; }
.tremieHero::before { top: 3.6rem; right: clamp(.5rem, 2vw, 1.5rem); bottom: .35rem; left: auto; width: 46%; aspect-ratio: auto; background: var(--hero-img) no-repeat right bottom / contain; -webkit-mask-image: none; mask-image: none; }
.tremieHero--login::before { top: .5rem; bottom: .5rem; }
.tremieHero .tremieHeroCompany { align-items: center; gap: .25rem; margin-top: .35rem; }
.tremieHero .tremieHeroCompany .sapMTitle { max-width: none; }
.tremieHero .tremieHeroAdd.sapMText { color: rgba(255,255,255,.75); font-style: italic; }

/* sticky banner + fixed tab strip. No layout change while scrolling (that made it stutter): the banner keeps its height and simply
   slides up under a negative sticky top (set from JS = its height minus the 3.5rem strip); logo and buttons stick inside it. */
.tremieMain .tremieHero { position: sticky; top: var(--hero-top, 0px); z-index: 30; }
.tremieMain .tremieHero .tremieHeroTop { flex: 1 1 auto; align-items: stretch; }
.tremieMain .tremieHero .tremieHeroBrandRow { position: sticky; top: .45rem; z-index: 2; }
.tremieMain .tremieHero .tremieHeroActions { position: sticky; top: .5rem; align-self: flex-start; }
.tremieMain .tremieHero::before { transition: opacity .2s ease; }
.tremieMain .tremieHero.tremieHero--small::before { opacity: 0; }
.tremieMain .tremieHero.tremieHero--small { box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.tremieMain .tremieTabs > .sapMITH, .tremieMain .tremieTabs .sapMITBHead { position: sticky; top: 4.25rem; z-index: 25; background: var(--sapBackgroundColor, #f5f6f7); }
.tremieMain .tremieHero { overflow: visible; }   /* overflow:hidden would stop the logo / buttons from sticking inside it */
.tremieMain .tremieHero .tremieHeroText { align-self: stretch; }
.tremieCompanyLogo { border-radius: .4rem; background: #fff; padding: .15rem; box-sizing: border-box; max-width: 8rem; object-fit: contain; }
.tremieMain .tremieHero .tremieHeroCompany { transition: opacity .15s ease; }
.tremieMain .tremieHero.tremieHero--small .tremieHeroCompany { opacity: 0; pointer-events: none; }
