/* DomainData customer portal (/account/). Self-contained (main.css is not loaded): same components as the
   Maail portal (maail.co/account.css) in the DomainData look: Arial, ink on paper, blue accent, square corners. */

:root {
    --paper: #f3f3ef;
    --surface: #fff;
    --ink: #11120f;
    --muted: #66675f;
    --line: #c9cac2;
    --night: #11120f;
    --night-2: #1c1d19;
    --green: #1657ff;
    --blue: #1657ff;
    --mint: #d6ff3f;
    --mint-deep: #a9cc22;
    --violet: #6e56cf;
    --coral: #e5484d;
    --shadow: 0 26px 80px rgba(17, 18, 15, .12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: Arial, "Helvetica Neue", sans-serif;
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    color: inherit;
    font: inherit;
}

svg {
    display: block;
}

::selection {
    background: var(--mint);
    color: var(--ink);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.04em;
}

.logo b {
    color: var(--blue);
}

.logo-mark {
    width: 27px;
    height: 27px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
    border: 1px solid currentColor;
}

.logo-mark i {
    display: block;
    background: currentColor;
}

.logo-mark i:nth-child(2),
.logo-mark i:nth-child(4),
.logo-mark i:nth-child(9) {
    background: var(--blue);
}

.logo-light {
    color: #fff;
}

.logo-light b,
.logo-light .logo-mark i:nth-child(2),
.logo-light .logo-mark i:nth-child(4),
.logo-light .logo-mark i:nth-child(9) {
    color: var(--mint);
    background: var(--mint);
}

.logo-light b {
    background: none;
}

.button {
    min-height: 46px;
    padding: 0 1.15rem;
    border: 1px solid transparent;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    font-size: .92rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.button-small {
    min-height: 38px;
    padding-inline: .9rem;
    font-size: .84rem;
}

.button-primary {
    background: var(--blue);
    color: #fff;
}

.button-primary:hover {
    background: #0a42d8;
}

.button-dark {
    background: var(--ink);
    color: #fff;
}

.button-dark:hover {
    background: #2a2b26;
}

.button:focus-visible {
    outline: 3px solid rgba(22, 87, 255, .38);
    outline-offset: 2px;
}

.kicker {
    color: var(--blue);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.required-marker {
    color: var(--coral);
    font-style: normal;
}

.portal-body,
.portal-auth {
    min-height: 100vh;
    background: var(--paper);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 200;
    padding: .6rem 1rem;
    border-radius: 2px;
    background: var(--ink);
    color: #fff;
    font-weight: 700;
}

.skip-link:focus {
    top: 1rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.portal-body input:focus-visible,
.portal-body select:focus-visible,
.portal-body textarea:focus-visible,
.portal-auth input:focus-visible,
.portal-auth select:focus-visible,
.portal-auth textarea:focus-visible,
.quick-card:focus-visible,
.portal-body summary:focus-visible {
    outline: 3px solid rgba(22, 87, 255, .38);
    outline-offset: 2px;
}

.muted {
    color: var(--muted);
}

.mono,
.portal-body code,
.portal-auth code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .86em;
}

.mono {
    overflow-wrap: anywhere;
}

.button-outline {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
}

.button-outline:hover {
    border-color: var(--ink);
}

.button-danger {
    color: #b23a21;
}

.button-danger:hover {
    border-color: #b23a21;
}

.button-block {
    width: 100%;
}

.button[disabled],
.button[aria-busy="true"] {
    opacity: .65;
    cursor: progress;
    transform: none;
}

.auth-shell {
    width: min(40rem, calc(100% - 32px));
    margin: 0 auto;
    padding: 2rem 0 3rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.auth-back {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 650;
}

.auth-back:hover {
    color: var(--ink);
}

.auth-card {
    padding: 2.25rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-heading {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.auth-heading h1 {
    margin: .35rem 0 0;
    font-size: clamp(1.9rem, 5vw, 2.4rem);
    letter-spacing: -.045em;
    line-height: 1.05;
}

.auth-heading p {
    margin: .7rem 0 0;
    color: var(--muted);
    font-size: .92rem;
}

.auth-done h1 {
    color: var(--green);
}

.auth-switch {
    margin: 1.5rem 0 0;
    color: var(--muted);
    font-size: .88rem;
    text-align: center;
}

.auth-switch a,
.portal-form a,
.auth-heading a {
    color: var(--green);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .4rem 1.2rem;
    margin-top: 1.5rem;
    color: var(--muted);
    font-size: .75rem;
}

.auth-legal a:hover {
    color: var(--ink);
}

.portal-form {
    display: grid;
    gap: 1.1rem;
}

.field {
    display: grid;
    align-content: start;
    gap: .35rem;
    min-width: 0;
    font-size: .8rem;
    font-weight: 700;
}

.field-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.field-row a {
    font-weight: 650;
}

.field input,
.field select,
.field textarea,
.inline-edit input {
    width: 100%;
    min-height: 46px;
    padding: .7rem .8rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    font-size: .95rem;
    font-weight: 500;
}

.field textarea {
    min-height: 5.5rem;
    resize: vertical;
}

.field input:disabled {
    color: var(--muted);
    cursor: not-allowed;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--green);
    background: var(--surface);
}

.field-hint {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 500;
    line-height: 1.5;
}

.field-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.field-group legend,
.option-cards legend {
    width: 100%;
    margin-bottom: .55rem;
    font-size: .8rem;
    font-weight: 780;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
}

.field-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-wide {
    grid-column: 1 / -1;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    font-size: .82rem;
    line-height: 1.5;
}

.check input {
    margin-top: .2rem;
    accent-color: var(--green);
}

.form-footnote {
    margin: -.4rem 0 0;
    color: var(--muted);
    font-size: .74rem;
    text-align: center;
}

.option-cards {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.option-card {
    position: relative;
    display: grid;
    gap: .2rem;
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-card:has(input:checked) {
    border-color: var(--green);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--mint) 60%, transparent);
}

.option-card:has(input:focus-visible) {
    outline: 3px solid rgba(22, 87, 255, .38);
    outline-offset: 2px;
}

.option-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: .6rem;
}

.option-card span {
    display: grid;
    gap: .15rem;
}

.option-card strong {
    font-size: .9rem;
}

.option-card small {
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.45;
}

.option-card:has(input[type="checkbox"]) {
    padding-left: 2.6rem;
}

.option-card:has(input[type="checkbox"])::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 1rem;
    width: 1rem;
    height: 1rem;
    border: 1.5px solid var(--line);
    border-radius: 4px;
    background: var(--paper);
}

.option-card:has(input[type="checkbox"]:checked)::before {
    border-color: var(--green);
    background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 75% no-repeat;
}

.portal-notice {
    margin: 0 0 1.25rem;
    padding: .85rem 1rem;
    border-left: 3px solid var(--green);
    border-radius: 0 3px 3px 0;
    background: color-mix(in srgb, var(--mint) 18%, white);
    font-size: .86rem;
    font-weight: 650;
}

.portal-notice-error {
    border-left-color: var(--coral);
    background: color-mix(in srgb, var(--coral) 11%, white);
}

.captcha-error {
    margin: 0;
    color: #b23a21;
    font-size: .82rem;
    font-weight: 700;
}

.portal-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 2rem;
    padding: .75rem 1rem;
    border-radius: 4px;
    background: var(--night-2);
    color: #d9dad3;
    font-size: .84rem;
}

.portal-banner + .portal-banner {
    margin-top: .6rem;
}

.portal-banner p {
    margin: 0;
}

.portal-banner strong {
    color: #fff;
}

.portal-banner-warn {
    border: 1px solid #f0d28a;
    background: #fff7e0;
    color: #5c4300;
}

.portal-banner-warn strong {
    color: #3d2c00;
}

.portal-banner-preview {
    border: 1px dashed color-mix(in srgb, var(--violet) 55%, var(--line));
    background: color-mix(in srgb, var(--violet) 8%, var(--surface));
    color: var(--ink);
}

.portal-banner-preview strong {
    color: var(--ink);
}

.portal {
    display: grid;
    grid-template-columns: 16.5rem minmax(0, 1fr);
    min-height: 100vh;
    background: linear-gradient(90deg, var(--night) 16.5rem, transparent 16.5rem);
}

.portal-form > .button:not(.button-block) {
    justify-self: start;
}

.portal-topbar .button {
    white-space: nowrap;
}

.portal-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    height: 100vh;
    padding: 1.6rem 1rem 1.2rem;
    overflow-y: auto;
    background: var(--night);
    color: #d9dad3;
}

.portal-nav {
    display: grid;
    gap: .15rem;
}

.portal-nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .65rem;
    border-radius: 3px;
    color: #b9bab2;
    font-size: .88rem;
    font-weight: 650;
    transition: background-color 150ms ease, color 150ms ease;
}

.portal-nav a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.portal-nav a.active {
    background: rgba(214, 255, 63, .12);
    color: var(--mint);
}

.portal-nav svg {
    width: 1.05rem;
    height: 1.05rem;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-nav-heading {
    margin: .9rem 0 .2rem;
    padding-left: .65rem;
    color: #7c7d75;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.portal-sidebar-foot {
    display: grid;
    gap: .35rem;
    margin-top: auto;
    padding: 0 .65rem;
    font-size: .78rem;
}

.portal-sidebar-foot a {
    color: #9a9b93;
}

.portal-sidebar-foot a:hover {
    color: #fff;
}

.portal-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.portal-topbar {
    position: sticky;
    z-index: 40;
    top: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 2rem;
    border-bottom: 1px solid rgba(17, 18, 15, .08);
    background: color-mix(in srgb, var(--paper) 90%, transparent);
    backdrop-filter: blur(16px);
    margin-bottom: 1.25rem;
}

.portal-menu {
    display: none;
    min-height: 40px;
    padding: 0 .9rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--surface);
    font-size: .82rem;
    font-weight: 750;
    cursor: pointer;
}

.portal-account {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
    margin-left: auto;
}

.portal-account > span:last-child {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.portal-account strong {
    overflow: hidden;
    font-size: .88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-account small {
    overflow: hidden;
    color: var(--muted);
    font-size: .74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-avatar {
    display: grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    flex: none;
    border-radius: 50%;
    background: var(--ink);
    color: var(--mint);
    font-size: .8rem;
    font-weight: 850;
}

.portal-content {
    width: min(1120px, 100%);
    padding: 1.25rem 2rem 3rem;
}

.portal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.2rem;
    margin-top: auto;
    padding: 1.2rem 2rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .74rem;
}

.portal-footer a:hover {
    color: var(--ink);
}

.portal-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.portal-heading h1 {
    margin: .35rem 0 0;
    font-size: clamp(2rem, 4vw, 2.75rem);
    letter-spacing: -.05em;
    line-height: 1.04;
    overflow-wrap: anywhere;
}

.portal-heading p {
    max-width: 46rem;
    margin: .7rem 0 0;
    color: var(--muted);
    font-size: .93rem;
}

.portal-section {
    margin-top: 2.25rem;
}

.section-head,
.card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin-bottom: .9rem;
}

.section-head h2,
.card-head h2,
.card-title,
.portal-card > h2,
.portal-card > h3,
.portal-section > h2 {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: -.02em;
}

.portal-card > h2,
.portal-card > h3 {
    margin-bottom: .8rem;
}

.card-head h3 {
    margin: 0;
    font-size: 1rem;
}

.portal-card {
    min-width: 0;
    margin-bottom: 1rem;
    padding: 1.4rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
}

.portal-card p {
    margin: 0 0 .8rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
    padding: 0 .6rem;
    border-radius: 2px;
    background: #ecece6;
    color: var(--ink);
    font-size: .72rem;
    font-weight: 780;
    white-space: nowrap;
}

.badge-good {
    background: color-mix(in srgb, var(--mint) 45%, white);
    color: #0b3fb8;
}

.badge-warn {
    background: #fff0c2;
    color: #6b4b00;
}

.badge-bad {
    background: color-mix(in srgb, var(--coral) 20%, white);
    color: #8f2a14;
}

.badge-neutral {
    background: color-mix(in srgb, var(--violet) 14%, white);
    color: #4b2f8f;
}

.empty-state {
    padding: 1.6rem;
    border: 1px dashed var(--line);
    border-radius: 4px;
    color: var(--muted);
    font-size: .9rem;
    text-align: center;
}

.empty-state p {
    margin: 0 0 .5rem;
}

.empty-state p:last-child {
    margin-bottom: 0;
}

.empty-state .button {
    margin-top: .6rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    display: grid;
    align-content: start;
    gap: .6rem;
    padding: 1.3rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
}

.stat-label {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 780;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.stat-value {
    font-size: 2rem;
    letter-spacing: -.05em;
    line-height: 1.05;
}

.stat-value small {
    color: var(--muted);
    font-size: .95rem;
    font-weight: 650;
    letter-spacing: -.01em;
}

.stat-note {
    margin: 0;
    color: var(--muted);
    font-size: .8rem;
}

.stat-note .text-link {
    color: var(--green);
    font-size: .8rem;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .8rem;
}

.quick-card {
    display: grid;
    align-content: start;
    gap: .35rem;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.quick-card:hover {
    transform: translateY(-2px);
    border-color: var(--green);
    box-shadow: 0 14px 34px rgba(17, 18, 15, .08);
}

.quick-card strong {
    font-size: 1rem;
}

.quick-card > span:last-child {
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.5;
}

.developer-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 1rem 2rem;
    padding: 1.6rem;
    border-radius: 4px;
    background: var(--night);
    color: #d9dad3;
}

.developer-card h2 {
    margin: 0 0 .5rem;
    color: #fff;
    font-size: 1.25rem;
}

.developer-card p {
    margin: 0;
    font-size: .88rem;
}

.developer-card code {
    color: var(--mint);
}

.developer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.developer-links .button-dark {
    background: var(--mint);
    color: var(--night);
}

.developer-links .text-link {
    color: #fff;
}

.code-block {
    grid-row: span 2;
    margin: 0;
    padding: 1.1rem 1.2rem;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 4px;
    background: #0a0b09;
    color: #d9dad3;
    font-size: .8rem;
    line-height: 1.6;
}

.fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: .6rem;
    margin: 0 0 1rem;
}

.fact-grid div {
    padding: .7rem .8rem;
    border: 1px solid var(--line);
    border-radius: 3px;
}

.fact-grid dt {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 780;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.fact-grid dd {
    margin: .2rem 0 0;
    font-size: .92rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.raw-json summary {
    cursor: pointer;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 750;
}

.raw-json pre {
    max-height: 26rem;
    margin: .7rem 0 0;
    padding: 1rem;
    overflow: auto;
    border-radius: 3px;
    background: var(--night);
    color: #d9dad3;
    font-size: .76rem;
    line-height: 1.55;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.data-table th,
.data-table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.data-table thead th {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.data-table tfoot th,
.data-table tfoot td {
    border-bottom: 0;
    font-weight: 650;
}

.data-table tfoot tr:first-child th,
.data-table tfoot tr:first-child td {
    border-top: 1px solid var(--line);
}

.data-table.compact th,
.data-table.compact td {
    padding: .55rem .4rem;
}

.data-table .actions {
    text-align: right;
}

.data-table .actions form {
    margin: 0;
}

.table-link {
    color: var(--green);
    font-weight: 750;
    overflow-wrap: anywhere;
}

.row-muted td {
    color: var(--muted);
}

.inline-edit summary {
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.inline-edit summary::-webkit-details-marker {
    display: none;
}

.inline-edit summary::after {
    content: " ✎";
    color: var(--muted);
    font-size: .8em;
}

.inline-edit form {
    display: flex;
    gap: .4rem;
    margin-top: .5rem;
}

.inline-edit input {
    min-height: 36px;
    padding: .35rem .6rem;
    font-size: .85rem;
}

.key-reveal {
    margin-bottom: 1.25rem;
    padding: 1.4rem;
    border-radius: 4px;
    background: var(--night);
    color: #d9dad3;
}

.key-reveal h2 {
    margin: 0 0 .35rem;
    color: #fff;
    font-size: 1.15rem;
}

.key-reveal p {
    margin: 0 0 .9rem;
    font-size: .86rem;
}

.key-value {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .55rem .55rem 1rem;
    border: 1px solid rgba(214, 255, 63, .35);
    border-radius: 4px;
    background: #0a0b09;
}

.key-value code {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--mint);
    font-size: .92rem;
}

.key-value .button-dark {
    background: var(--mint);
    color: var(--night);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.summary-grid .portal-card {
    margin: 0;
}

.summary-grid + .portal-card,
.summary-grid + .portal-section,
.portal-card + .summary-grid {
    margin-top: 1rem;
}

.day-chart {
    display: grid;
    grid-template-columns: repeat(31, minmax(0, 1fr));
    align-items: end;
    gap: 3px;
    height: 9rem;
}

.day {
    display: grid;
    grid-template-rows: 1fr auto;
    align-items: end;
    height: 100%;
}

.day-bar {
    display: flex;
    align-items: flex-end;
    min-height: 2px;
    overflow: hidden;
    border-radius: 3px 3px 0 0;
    background: color-mix(in srgb, var(--mint) 60%, white);
}

.day-bar > span {
    display: block;
    width: 100%;
    background: var(--green);
}

.day small {
    margin-top: .3rem;
    color: var(--muted);
    font-size: .6rem;
    text-align: center;
}

.day-future .day-bar {
    background: #ecece6;
}

@media print {
.portal-sidebar,
.portal-topbar,
.portal-banner,
.portal-footer,
.skip-link {
        display: none !important;
    }

.portal {
        display: block;
    }

.portal-content {
        width: auto;
        padding: 0;
    }

.portal-body {
        background: #fff;
    }
}

@media (max-width: 1100px) {
.quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

.developer-card {
        grid-template-columns: 1fr;
    }

.code-block {
        grid-row: auto;
    }
}

@media (max-width: 920px) {
.portal {
        grid-template-columns: 1fr;
        background: none;
    }

.portal-sidebar {
        position: fixed;
        z-index: 90;
        left: 0;
        width: min(17rem, 85vw);
        transform: translateX(-100%);
        transition: transform 200ms ease;
        box-shadow: var(--shadow);
    }

.portal-sidebar[data-open] {
        transform: none;
    }

.portal-menu {
        display: inline-flex;
        align-items: center;
    }

.portal-topbar,
.portal-content,
.portal-footer {
        padding-inline: 1.1rem;
    }

.portal-banner {
        margin-inline: 1.1rem;
    }

.stat-grid {
        grid-template-columns: 1fr;
    }

.summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
.auth-card {
        padding: 1.4rem;
    }

.field-grid,
.field-grid-3,
.quick-grid {
        grid-template-columns: 1fr;
    }

.portal-heading {
        flex-direction: column;
        align-items: flex-start;
    }

.portal-account small {
        display: none;
    }
}

/* ---- DomainData additions: research, timeline, usage ---------------------------------------------------- */

@media (min-width: 901px) {
    .stat-grid-2 {
        grid-template-columns: 2fr 1fr;
    }
}

.search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: .6rem;
}

.search-row input,
.search-row select {
    min-height: 46px;
}

.search-row > input,
.field-grow {
    flex: 1 1 16rem;
}

.field-match {
    flex: 0 0 auto;
}

.field-grow input {
    width: 100%;
}

.timeline-search .search-row input {
    flex: 1 1 16rem;
}

.filter-panel {
    margin-top: 1rem;
    border-top: 1px solid var(--line);
    padding-top: .8rem;
}

.filter-panel > summary {
    cursor: pointer;
    font-weight: 700;
}

.filter-panel[open] > summary {
    margin-bottom: 1rem;
}

.tld-picker {
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.tld-picker legend {
    margin-bottom: .5rem;
    font-size: .85rem;
    font-weight: 700;
}

.chip input {
    position: absolute;
    opacity: 0;
}

.chip span {
    display: inline-block;
    padding: .35rem .7rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--surface);
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
}

.chip input:checked + span {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.chip input:focus-visible + span {
    outline: 3px solid rgba(22, 87, 255, .38);
    outline-offset: 2px;
}

.field-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.range-row {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.range-row input {
    min-width: 0;
    width: 100%;
}

.check-inline {
    align-self: end;
    min-height: 46px;
    align-items: center;
}

.month-picker select {
    min-width: 12rem;
}

.fact-grid {
    margin: 0 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    background: var(--surface);
}

.fact-grid > div {
    padding: 1rem 1.1rem;
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.fact-grid > div + div {
    border-left: 1px solid var(--line);
}

.fact-grid span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.fact-grid strong {
    overflow-wrap: anywhere;
}

.fact-grid small {
    color: var(--muted);
}

.timeline {
    --label: 8.5rem;
    position: relative;
    padding-top: 1.6rem;
}

.timeline-axis {
    position: absolute;
    top: 0;
    left: var(--label);
    right: 0;
    height: 100%;
    pointer-events: none;
}

.timeline-axis span {
    position: absolute;
    top: 0;
    height: 100%;
    padding-left: .3rem;
    border-left: 1px dashed var(--line);
    color: var(--muted);
    font-size: .75rem;
}

.timeline-row {
    position: relative;
    display: grid;
    grid-template-columns: var(--label) 1fr;
    align-items: center;
    min-height: 2.4rem;
    border-top: 1px solid var(--line);
}

.timeline-label {
    padding-right: .8rem;
    font-size: .85rem;
    font-weight: 700;
}

.timeline-lane {
    position: relative;
    height: 1.7rem;
}

.timeline-none {
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.7rem;
}

.timeline-bar {
    position: absolute;
    top: 0;
    height: 100%;
    min-width: 4px;
    overflow: hidden;
    border-right: 2px solid var(--surface);
    background: var(--tone);
    color: #fff;
    font-size: .74rem;
    font-weight: 700;
    line-height: 1.7rem;
    white-space: nowrap;
    cursor: default;
}

.timeline-bar span {
    display: block;
    padding-inline: .4rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-bar:hover,
.timeline-bar:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
    z-index: 2;
}

.tone-0 { --tone: #1657ff; }
.tone-1 { --tone: #11120f; }
.tone-2 { --tone: #6e56cf; }
.tone-3 { --tone: #0f8a6a; }
.tone-4 { --tone: #c2410c; }
.tone-5 { --tone: #66675f; }

.timeline-marker {
    position: absolute;
    top: 50%;
    width: .8rem;
    height: .8rem;
    margin: -.4rem 0 0 -.4rem;
    background: var(--mint);
    border: 2px solid var(--ink);
    transform: rotate(45deg);
}

.change-list {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.change-list li {
    padding: .65rem 0;
    display: grid;
    grid-template-columns: 11rem 7.5rem 1fr;
    gap: .8rem;
    align-items: baseline;
    border-top: 1px solid var(--line);
}

.change-list time {
    color: var(--muted);
    font-size: .88rem;
}

.raw-json > summary {
    cursor: pointer;
    font-weight: 700;
}

.raw-json pre {
    max-height: 32rem;
    margin-top: 1rem;
    overflow: auto;
}

@media (max-width: 900px) {
    .field-grid-4,
    .fact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fact-grid > div + div {
        border-left: 0;
    }
}

@media (max-width: 640px) {
    .field-grid-4,
    .fact-grid {
        grid-template-columns: 1fr;
    }

    .timeline {
        --label: 5.5rem;
    }

    .change-list li {
        grid-template-columns: 1fr;
        gap: .2rem;
    }
}


/* ---- Credits, receipts and admin (from the Maail portal) ---------------------------------------------- */

.inline-form {
    display: flex;
    align-items: end;
    gap: .8rem;
}

.inline-form .field {
    flex: 1;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 650;
}

.breadcrumbs a {
    color: var(--green);
}

.empty-state-large {
    margin-top: 3rem;
    padding: 3rem 1.5rem;
    background: var(--surface);
}

.empty-state-large h1 {
    margin: 0 0 .6rem;
    color: var(--ink);
    font-size: 1.8rem;
    letter-spacing: -.04em;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .7rem;
    margin-top: 1rem;
}

.action-row form {
    margin: 0;
}

.data-table tfoot .total th,
.data-table tfoot .total td {
    font-size: 1rem;
    font-weight: 850;
}

.invoice-sheet {
    margin-top: 1rem;
    padding: 2.5rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--surface);
    font-size: .9rem;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2.25rem;
}

.invoice-seller {
    margin: .9rem 0 0;
    color: var(--muted);
    font-size: .8rem;
}

.invoice-title h1 {
    margin: 0 0 .6rem;
    font-size: 2rem;
    letter-spacing: -.04em;
    text-align: right;
}

.invoice-title dl {
    display: grid;
    gap: .2rem;
    margin: 0;
    font-size: .82rem;
}

.invoice-title dl div {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.invoice-title dt {
    color: var(--muted);
}

.invoice-title dd {
    min-width: 8.5rem;
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.invoice-recipient {
    margin-bottom: 2rem;
    font-style: normal;
    line-height: 1.55;
}

.invoice-lines {
    margin-bottom: 1.25rem;
}

.invoice-lines th,
.invoice-lines td {
    padding-inline: .5rem;
}

.invoice-note {
    padding: .7rem .9rem;
    border-radius: 3px;
    background: var(--paper);
    font-size: .82rem;
}

.invoice-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .76rem;
}

.invoice-footer p {
    margin: 0 0 .3rem;
}

@media print {
.no-print {
        display: none !important;
    }
.invoice-sheet {
        margin: 0;
        padding: 0;
        border: 0;
    }
}

@media (max-width: 640px) {
.inline-form {
        flex-direction: column;
        align-items: stretch;
    }
.invoice-sheet {
        padding: 1.25rem;
    }
.invoice-header {
        flex-direction: column;
    }
.invoice-title h1 {
        text-align: left;
    }
.invoice-title dl div {
        justify-content: flex-start;
    }
.invoice-title dd {
        text-align: left;
    }
}

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: 0 0 1.25rem;
}

.tab-nav a {
    padding: .5rem .95rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--surface);
    font-size: .88rem;
    font-weight: 700;
}

.tab-nav a[aria-current="page"] {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}
