/* Partnerbereich — layout and components after brand/mockups/onepager/partner-portal.html.
   Tokens come from stille-welle.css; app.css is loaded first for the shared basics. */
html, body { overflow-x: clip; }
html { background: var(--mist); }
body { background: var(--mist); color: var(--ink); }
body:has(.p-tabs) { padding-bottom: 76px; }
.portal { --gutter: clamp(1rem, 3vw, 2.5rem); display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; font-size: 17px; line-height: 1.65; }
.portal a:focus-visible, .portal button:focus-visible { outline: 3px solid var(--mint-deep); outline-offset: 3px; }

/* Sidebar */
.p-side { display: none; }
.p-brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; }
.p-brand img { height: 40px; width: auto; }
.p-brand span { font-family: var(--display); font-weight: 700; font-size: .8rem; letter-spacing: -.01em; color: var(--ink); line-height: 1.1; }
.p-side nav { display: grid; gap: .15rem; }
.p-side nav > a, .p-side nav > span { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 12px; color: var(--slate); font-size: .95rem; font-weight: 500; text-decoration: none; }
.p-side nav > a::before, .p-side nav > span::before { content: ""; width: 9px; height: 9px; border: 2px solid var(--mint-deep); border-radius: 50%; flex: none; }
.p-side nav a:hover { background: var(--mist); }
.p-side nav a[aria-current="page"] { background: var(--mist); color: var(--teal-deep); font-weight: 600; }
.p-side nav a[aria-current="page"]::before { border-color: var(--teal); background: var(--teal); }
.p-side nav .count { margin-left: auto; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; background: var(--teal-deep); color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 700; line-height: 1; padding: 0 6px; margin-left: 6px; letter-spacing: 0; }

/* Contact card */
.p-contact { background: var(--mist); border-radius: 16px; padding: 1rem; font-size: .85rem; color: var(--slate); line-height: 1.6; }
.p-main .p-contact h2, .p-contact h2 { font-family: var(--display); font-weight: 700; font-size: .9rem; letter-spacing: -.01em; color: var(--ink); margin: 0 0 .2rem; }
.p-contact p { margin: 0; overflow-wrap: anywhere; }
.p-contact a { font-size: .85rem; color: var(--teal-deep); }
.p-contact-note { font-size: .78rem; margin-top: .2rem; }

/* Main column and top bar */
.p-body { min-width: 0; padding: .8rem var(--gutter) 2rem; }
.p-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .4rem 0 1rem; border-bottom: 1px solid var(--hairline); margin-bottom: 1.4rem; }
.p-who { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.p-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 700; flex: none; }
.p-who-text { min-width: 0; line-height: 1.35; }
.p-who-text strong { font-family: var(--display); font-weight: 700; display: block; letter-spacing: -.01em; color: var(--ink); }
.p-who-text small { color: var(--slate); font-size: .85rem; display: block; margin-top: .2rem; }
.p-head-links { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; font-size: .9rem; }
.p-head-links a, .p-head-links button { color: var(--slate); }
.p-head-links a:hover, .p-head-links button:hover { color: var(--teal-deep); }
.p-head-links form { margin: 0; }
.p-head-links button { background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.p-main { min-width: 0; }
.soon { color: var(--slate); }
.soon small { font-size: .75rem; margin-left: 4px; }

/* Page heading */
.p-eyebrow { margin-bottom: .5rem; }
.p-main h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); max-width: none; margin: 0 0 .3rem; hyphens: manual; overflow-wrap: normal; }
.p-main h1 em { letter-spacing: -.01em; }
.p-sub { color: var(--slate); max-width: 60ch; margin: 0; }
.p-main > .p-sub + .p-grid, .p-main > .p-sub + .p-card, .p-main > h1 + .p-grid, .p-main > h1 + .p-card { margin-top: 1.8rem; }

/* Status chips */
.p-chips { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; padding: 0; margin: 1.2rem 0 0; }
.p-chips li { background: #fff; border: 1px solid var(--hairline); border-radius: 999px; padding: .45rem 1rem; font-size: .85rem; color: var(--slate); line-height: 1.4; }
.p-chips b { color: var(--ink); font-weight: 600; }
.p-chips li.ok::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin-right: .5rem; vertical-align: middle; }

/* Card grid and cards */
.p-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1.2rem; margin-top: 1.8rem; }
.p-card { background: #fff; border: 1px solid var(--hairline); border-radius: 22px; padding: 1.3rem 1.5rem; grid-column: span 12; min-width: 0; color: var(--ink); }
.p-card + .p-card { margin-top: 1.2rem; }
.p-grid > .p-card + .p-card { margin-top: 0; }
.p-card-hd { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .9rem; }
.p-main .p-card-hd h2, .p-main .p-card h2 { font-size: 1.15rem; margin: 0; max-width: none; letter-spacing: -.02em; line-height: 1.2; }
.p-card-hd a { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.p-card p { color: var(--slate); font-size: .92rem; max-width: none; margin: 0 0 .6rem; }
.p-card p:last-child { margin-bottom: 0; }
.p-card .p-strong { color: var(--ink); font-weight: 600; }
.p-note { margin-top: .9rem !important; }
.p-empty { color: var(--slate); font-size: .92rem; padding: .7rem 0; border-top: 1px solid var(--mist); }
.p-card-hd + .p-empty { border-top: 0; padding-top: 0; }
.p-card h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
@media (min-width: 701px) { .p-card.c4 { grid-column: span 6; } }
@media (min-width: 1201px) { .p-grid > .p-card { grid-column: span 6; } .p-grid > .p-card.c4 { grid-column: span 4; } .p-grid > .p-card.c12 { grid-column: span 12; } }

/* Rows */
.p-rows { list-style: none; padding: 0; margin: 0; }
.p-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem 1rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--mist); }
.p-row:first-child { border-top: 0; }
.p-kpis + .p-rows { margin-top: .8rem; }
.p-kpis + .p-rows > .p-row:first-child, .p-card > p + .p-rows > .p-row:first-child { border-top: 1px solid var(--mist); }
.p-row b { font-weight: 600; display: block; font-size: .95rem; line-height: 1.4; }
.p-row small { color: var(--slate); font-size: .82rem; display: block; line-height: 1.5; margin-top: .15rem; }
.p-row small em { font-size: .9rem; }
.p-row > form { margin: 0; }
.p-row > .p-row-full { grid-column: 1 / -1; }
.p-act, .p-actions button, .p-inline button { font-size: .85rem; font-weight: 600; white-space: nowrap; color: var(--teal); background: none; border: 0; border-bottom: 2px solid var(--teal); border-radius: 0; padding: 0; font-family: inherit; line-height: 1.5; cursor: pointer; text-decoration: none; }
.p-actions { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; justify-content: flex-end; margin: 0; }
.p-actions form { margin: 0; }
@media (max-width: 480px) { .p-row:has(> .p-actions) { grid-template-columns: minmax(0, 1fr); } .p-row > .p-actions { justify-content: flex-start; } }

/* Tags */
.p-tag, .chip { display: inline-block; font-family: var(--body); font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-deep); background: var(--mist); border-radius: 999px; padding: 3px 8px; margin-left: .4rem; vertical-align: middle; line-height: 1.4; white-space: nowrap; }
.p-tag.ok { background: var(--mint); color: var(--teal-deep); }
.p-tag.warn { background: #FBF1DC; color: var(--ink); }
.p-tag--lead { margin: 0 0 .2rem; }

/* KPIs */
.p-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: .4rem; }
.p-big { font-family: var(--display); font-weight: 800; letter-spacing: -.03em; font-size: 2rem; color: var(--teal); line-height: 1; display: block; }
.p-kpis small { color: var(--slate); font-size: .8rem; display: block; margin-top: .3rem; line-height: 1.4; }

/* Material tiles */
.p-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (max-width: 480px) { .p-tiles { grid-template-columns: minmax(0, 1fr); } }
.p-tiles a { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--hairline); border-radius: 12px; background: var(--paper); font-size: .88rem; font-weight: 500; color: var(--ink); line-height: 1.35; overflow-wrap: break-word; }
.p-tiles a::before { content: ""; width: 9px; height: 9px; border: 2px solid var(--teal); border-radius: 50%; flex: none; }
.p-tiles a:hover { border-color: var(--mint-deep); }

/* Quote and honesty */
.p-quote { font-family: var(--accent); font-style: italic; font-size: 1.05rem; line-height: 1.45; color: var(--ink); border-left: 3px solid var(--teal); padding-left: 1rem; margin: .6rem 0 0; }
.p-quote small { display: block; font-family: var(--body); font-style: normal; font-size: .8rem; color: var(--slate); margin-top: .4rem; }
.p-trust { border: 1.5px solid var(--teal); border-radius: 14px; padding: 14px 18px; background: #fff; font-size: .85rem; margin-top: 1.2rem; color: var(--ink); line-height: 1.6; }
.p-trust strong { color: var(--teal-deep); }
.p-copy { margin-top: .9rem !important; }

/* Footer */
.p-foot { margin-top: 2.5rem; font-size: .8rem; color: var(--slate); }
.p-foot p { margin: 0 0 .6rem; max-width: none; }
.p-foot-links { display: flex; flex-wrap: wrap; gap: .4rem 2rem; }
.p-foot a { color: inherit; border-bottom: 1px solid var(--hairline); }

/* Bottom tabs on phones */
.p-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--paper); border-top: 1px solid var(--hairline); padding-bottom: env(safe-area-inset-bottom); }
.p-tabs > a, .p-tabs > span { display: flex; align-items: center; justify-content: center; gap: 2px; text-align: center; padding: 16px 4px; color: var(--slate); text-decoration: none; font-size: .875rem; font-weight: 500; white-space: nowrap; min-width: 0; }
.p-tabs a[aria-current="page"] { color: var(--teal-deep); font-weight: 600; box-shadow: inset 0 3px 0 var(--teal); }
.p-tabs .count { margin-left: 4px; }

@media (min-width: 900px) {
  body:has(.p-tabs) { padding-bottom: 0; }
  .portal { grid-template-columns: 260px minmax(0, 1fr); background: linear-gradient(90deg, var(--paper) 259px, var(--hairline) 259px 260px, transparent 260px); }
  .p-side { padding: 1.4rem 1.2rem; display: flex; flex-direction: column; gap: 1.6rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .p-side .p-contact { margin-top: auto; }
  .p-body { padding: 1.2rem var(--gutter) 3rem; }
  .p-head { padding: .6rem 0 1.4rem; margin-bottom: 1.8rem; }
  .p-tabs { display: none; }
}
@media (max-width: 600px) {
  .p-head-links { font-size: .85rem; width: 100%; padding-left: calc(44px + .9rem); }
  .p-card { padding: 1.1rem 1.1rem; border-radius: 18px; }
  .p-big { font-size: 1.7rem; }
  .p-card-hd { flex-wrap: wrap; gap: .2rem 1rem; }
}

/* stille-welle.css underlines every link; navigation in the portal shell carries no bar. */
.p-brand, .p-head-links a, .p-side nav a, .p-tabs a, .p-more a { border-bottom: 0; }
.p-contact a, .p-legal a { border-bottom: 0; color: var(--teal-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.p-tabs a[aria-current="page"] { border-bottom: 0; }
.p-contact--mehr { margin-top: 1.2rem; background: #fff; border: 1px solid var(--hairline); border-radius: 22px; padding: 1.1rem 1.3rem; }
@media (max-width: 899.98px) { .p-contact--shell { display: none; } }
@media (min-width: 900px) { .p-contact--mehr { display: none; } }

/* Notices inside the main column */
.p-main .notice { margin: 0 0 1.2rem; }
.p-error { color: var(--ink); font-weight: 600; margin: 4px 0; font-size: .88rem; }

/* Inline forms in rows (Mitgeben, Verlängern) */
.p-inline { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .6rem 1rem; align-items: end; margin-top: .4rem; padding: .9rem 1rem; background: var(--mist); border-radius: 14px; }
.p-inline p { margin: 0 !important; display: grid; gap: .2rem; font-size: .85rem; }
.p-inline label { font-weight: 600; color: var(--slate); font-size: .8rem; }
.p-inline input { font: inherit; font-size: .92rem; padding: .5rem .7rem; border: 1px solid var(--hairline); border-radius: 10px; background: #fff; width: 100%; }
.p-inline-actions { display: flex; gap: 1.2rem; align-items: center; }
.p-inline-actions a { font-size: .85rem; color: var(--slate); border-bottom-color: var(--hairline); }

/* Mehr */
.p-more { list-style: none; padding: 0; margin: 0; }
.p-more li { border-top: 1px solid var(--mist); }
.p-more li:first-child { border-top: 0; }
.p-more a, .p-more .soon { display: flex; align-items: center; gap: .7rem; padding: .8rem 0; color: var(--ink); font-weight: 500; }
.p-more a::before { content: ""; width: 9px; height: 9px; border: 2px solid var(--mint-deep); border-radius: 50%; flex: none; }

/* Billing table: app.css table.list stacks rows below 700px; the month is a row header here. */
.p-table { margin: 0; border-radius: 14px; }
.p-table thead th, .p-table tbody th { white-space: nowrap; }
.p-table tbody th { text-align: left; padding: .6rem .8rem; border-top: 1px solid var(--mist); font-weight: 600; color: var(--ink); background: #fff; font-size: .88rem; letter-spacing: 0; text-transform: none; }
@media (max-width: 700px) {
  .p-table tbody th { white-space: normal; display: block; border: 0; padding: .25rem 0 .35rem; font-size: 1rem; background: none; }
  .p-table tr { border-color: var(--hairline); }
  .p-main table.p-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .15rem 0; }
  .p-main table.p-table td::before { display: inline; flex: none; }
}

/* Profile form and preview */
.p-profile-grid { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .p-profile-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } .p-profile-grid .p-card + .p-card { margin-top: 0; } }
.p-profile-grid > .p-card { grid-column: auto; }
.p-main > .p-sub + .p-profile-wrap { margin-top: 1.8rem; }
.p-profile { display: grid; gap: .9rem; }
.p-profile p { margin: 0 !important; }
.p-profile label { font-weight: 600; font-size: .85rem; color: var(--ink); }
.p-profile fieldset { border: 1px solid var(--hairline); border-radius: 12px; padding: .5rem 1rem .8rem; margin: 0; }
.p-profile fieldset label { font-weight: 400; display: inline-flex; align-items: center; gap: 6px; margin: 4px 16px 4px 0; }
.p-profile legend { font-weight: 600; font-size: .85rem; padding: 0 4px; }
.p-profile input[type="text"], .p-profile input:not([type]), .p-profile textarea { font: inherit; font-size: .95rem; padding: .55rem .75rem; width: 100%; max-width: 100%; border: 1px solid var(--hairline); border-radius: 10px; background: #fff; margin-top: 4px; }
.p-profile .p-hint { color: var(--slate); font-size: .82rem; }
.p-buttons { display: flex; flex-wrap: wrap; gap: .6rem; }
.p-main .btn, .auth .btn { font-size: .95rem; padding: .7em 1.4em; cursor: pointer; }
.p-preview { border: 1px solid var(--hairline); border-radius: 16px; padding: 1rem 1.1rem; background: var(--paper); }
.p-main .p-preview h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.p-preview p { margin: .3rem 0 0 !important; }
.p-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.p-tags .chip { margin: 0; }
.p-status { margin-bottom: 1rem !important; }

/* Privacy page */
.p-legal h2 { margin: 1.4rem 0 .4rem !important; font-size: 1.05rem !important; }
.p-legal h2:first-of-type { margin-top: .4rem !important; }
.p-legal p { font-size: .92rem; }
.nobr { white-space: nowrap; }

/* Sign-in pages: a white card on mist, like the portal cards */
.auth { max-width: 30rem; margin: 3rem auto; padding: 2rem 1.8rem; background: #fff; border: 1px solid var(--hairline); border-radius: 22px; font-size: 17px; line-height: 1.6; }
@media (max-width: 520px) { .auth { margin: 1rem; padding: 1.4rem 1.2rem; } }
.auth--wide { max-width: 46rem; }
.auth-logo { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.6rem; }
.auth-logo img { height: 40px; width: auto; }
.auth-logo span { font-family: var(--display); font-weight: 700; font-size: .8rem; letter-spacing: -.01em; color: var(--ink); line-height: 1.1; }
.auth h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); max-width: none; margin: 0 0 .4rem; }
.auth h2 { font-size: 1.05rem; max-width: none; margin: 1.4rem 0 .4rem; }
.auth p { margin: 0 0 .8rem; }
.auth-lead { color: var(--slate); }
.auth-form { display: grid; gap: 12px; margin: 16px 0 8px; }
.auth-field { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; color: var(--ink); }
.auth-field input { font: inherit; font-weight: 400; font-size: 1rem; padding: .65rem .8rem; border: 1px solid var(--hairline); border-radius: 10px; background: #fff; width: 100%; }
.auth-field input:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.auth-form .btn { justify-self: start; }
.auth-form .small { margin: 0; }
.auth .small { color: var(--slate); font-size: .85rem; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--slate); font-size: .875rem; margin: 24px 0 0; max-width: none; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--hairline); }
.auth-note { margin-top: 24px; }
.auth .notice { margin: 12px 0; }
.auth button:not(.btn) { background: none; border: 0; border-bottom: 2px solid var(--teal); color: var(--teal); font-weight: 600; cursor: pointer; padding: 0; }
.p-inline-actions button { background: var(--teal); color: #fff; border: 0; border-radius: 999px; padding: .55em 1.2em; font-family: var(--display); font-weight: 700; font-size: .88rem; }

/* Display type: Inter Tight 800 with negative tracking fuses words; open the word gaps. */
.p-main h1, .p-main h2, .p-main h3, .p-card h2, .p-who-text strong, .p-preview h3, .p-contact h2,
.p-brand span, .auth-logo span, .auth h1, .auth h2, .p-main .btn, .auth .btn, .p-inline-actions button, .p-avatar { word-spacing: .12em; }
.p-main h1, .auth h1 { letter-spacing: -.025em; }
.p-main h2, .p-card h2, .auth h2, .p-preview h3 { letter-spacing: -.012em; }
.p-who-text strong, .p-main .btn, .auth .btn { letter-spacing: -.005em; }

/* Bottom tabs: small badges and room between the tabs */
.p-tabs { grid-template-columns: repeat(4, auto); justify-content: space-evenly; gap: 4px; padding-left: 4px; padding-right: 4px; }
.p-tabs .count { min-width: 18px; height: 18px; font-size: .65rem; padding: 0 5px; margin-left: 5px; }
.p-tabs > a, .p-tabs > span { padding: 16px 6px; font-size: .84rem; }

/* Short date in the eyebrow on phones */
.p-date-short { display: none; }
@media (max-width: 480px) { .p-date-long { display: none; } .p-date-short { display: inline; } }

/* Notices: success calm, errors in the warn tokens */
.notice--success { background: var(--mist); border-color: var(--mint-deep); }
.notice--error { background: var(--warn-bg); border-color: var(--warn-edge); }

/* Profile form rows */
.p-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.p-field-row--zip { grid-template-columns: 8rem minmax(0, 1fr); }
.p-profile .p-field-row input { width: 100%; max-width: 100%; }
.p-submit { display: grid; gap: .8rem; padding: 1rem 1.1rem; background: var(--mist); border-radius: 14px; }
.p-profile .p-consent { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
.p-consent input { margin-top: .35rem; flex: none; }
