:root {
    color-scheme: light;
    --ink: #25324a;
    --heading: #17233a;
    --muted: #64748b;
    --line: #dbe3ef;
    --paper: #fff;
    --bg: #f7f9fb;
    --brand: #3498ff;
    --accent: #1976d2;
    --accent-hover: #125fae;
    --soft: #e7f3ff;
    --section: #d7e9fa;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 Arial, Helvetica, sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 24px; max-width: 1280px; margin: auto; padding: 16px 24px; flex-wrap: wrap; }
.brand-group { flex-shrink: 0; }
.brand { font-size: 25px; letter-spacing: -.7px; font-weight: 700; text-decoration: none; color: var(--heading); line-height: 1.1; }
.brand span { font-weight: 400; color: var(--accent); }
.environment { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; margin-top: 5px; }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.main-nav a { font-size: 13px; color: #485b78; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; text-decoration: none; white-space: nowrap; }
.main-nav a:hover { background: #f0f6fd; color: var(--accent); }
.main-nav a[aria-current="page"] { background: var(--soft); border-color: #b4d9ff; color: #1265b7; }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.logout { margin: 0; }
.logout button { min-height: 34px; padding: 6px 10px; background: white; border-color: var(--line); color: #485b78; font-size: 12px; }
.logout button:hover { background: #f1f6fc; border-color: #b9cbe2; color: var(--heading); }
main { max-width: 1280px; margin: auto; padding: 30px 24px 52px; }
footer { border-top: 1px solid var(--line); padding: 18px 24px; text-align: center; color: var(--muted); font-size: 12px; }
h1 { color: var(--heading); font-size: 25px; letter-spacing: -.5px; line-height: 1.25; margin: 6px 0 10px; font-weight: 600; }
h2 { color: #29344a; font-size: 16px; margin: 0 0 18px; font-weight: 600; }
h3 { font-size: 14px; margin: 0; font-weight: 600; }
.lead, .muted, .help { color: var(--muted); }
.lead { margin-top: 0; max-width: 780px; }
.help { font-size: 12px; line-height: 1.65; }
.section, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin: 22px 0; }
.panel > h2:first-child, .panel > .heading:first-child { background: var(--section); border-bottom: 1px solid #cbdff1; margin: -20px -20px 20px; padding: 12px 20px; border-radius: 11px 11px 0 0; }
.panel > .heading:first-child h2 { margin: 0; }
.panel > .section { background: #fbfcfe; border-radius: 8px; padding: 18px; }
.panel > .section:last-child { margin-bottom: 0; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid > .panel { margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 24px 0; }
.metric { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.metric::before { content: ''; display: block; width: 25px; height: 3px; background: #acd4ff; border-radius: 3px; margin-bottom: 12px; }
.metric strong { display: block; color: var(--heading); font-size: 29px; letter-spacing: -.6px; font-weight: 600; }
.metric span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: #455875; }
input, select, textarea { font: inherit; color: var(--ink); min-height: 36px; border: 1px solid #d4deec; border-radius: 8px; padding: 7px 10px; max-width: 100%; width: 100%; background: #fff; transition: border-color .12s; }
input:hover, select:hover, textarea:hover { border-color: #9abce2; }
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; vertical-align: -3px; margin: 0 7px 0 0; accent-color: var(--accent); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #7bbcff; outline-offset: 3px; }
.field { margin-bottom: 18px; }
.field > label + label { margin-top: 11px; }
.filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin: 24px 0; }
.filters .field { margin: 0; min-width: 175px; }
button, .button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 36px; font: 500 13px/1.4 Arial, Helvetica, sans-serif; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: #fff; padding: 7px 13px; cursor: pointer; text-decoration: none; transition: background-color .12s, border-color .12s; }
button:hover, .button:hover { background: var(--accent-hover); color: #fff; border-color: var(--accent-hover); }
.secondary { background: #fff; color: #2464a4; border-color: #b9cfe6; }
.secondary:hover { background: var(--soft); color: #125fae; border-color: #85b8ec; }
.danger { background: #fff; color: #a3333f; border-color: #e7bec4; }
.danger:hover { background: #fff1f2; color: #982b37; border-color: #cd7d87; }
.inline { display: inline; }
.notice { padding: 15px 18px; border-radius: 8px; background: #edf5ff; border: 1px solid #bdd8f5; margin: 16px 0; }
.notice.error { background: #fff3f3; border-color: #e9bfc4; color: #92323d; }
.notice.success { background: #f0faf5; border-color: #b8deca; color: #28533c; }
.notice.warning { background: #fff9eb; border-color: #ead5a8; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { font-size: 12px; font-weight: 600; color: #405477; background: #edf5fd; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; background: #edf1f7; color: #526581; border-radius: 5px; padding: 4px 7px; }
.badge.active, .badge.COMPLETED, .badge.SENT { background: #e8f6ee; color: #247449; }
.badge.inactive, .badge.DECLINED { background: #fff0f1; color: #a63843; }
.empty { padding: 32px; color: var(--muted); text-align: center; }
.mono, code { font-family: ui-monospace, monospace; font-size: 12px; overflow-wrap: anywhere; }
.token { display: block; padding: 16px; background: #f3f9f6; border: 1px solid #bdd9cd; border-radius: 8px; word-break: break-all; user-select: all; }
.auth, .auth-card { max-width: 510px; margin: 32px auto; padding: 30px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 18px #25324a05; }
.auth h1, .auth-card h1 { font-size: 25px; margin: 0 0 14px; }
.auth form, .auth-card form { display: grid; gap: 12px; }
.auth-card form + form { margin-top: 14px; }
.auth-card form label { margin-bottom: 0; }
.auth-card input, .auth-card button { min-height: 40px; }
.auth-card p { margin: 12px 0 20px; }
.auth-qr { display: block; max-width: 100%; height: auto; margin: 20px auto; image-rendering: pixelated; }
dl { display: grid; grid-template-columns: 170px 1fr; gap: 10px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.pagination { display: flex; justify-content: space-between; gap: 16px; margin: 20px 0; }
details summary { cursor: pointer; font-weight: 500; }
.stack > * + * { margin-top: 14px; }
@media (max-width: 1100px) {
    .topbar-inner { gap: 14px; }
    .main-nav { order: 3; width: 100%; }
}
@media (max-width: 700px) {
    .topbar-inner { padding: 14px 16px; gap: 12px; }
    .header-actions { gap: 8px; }
    .environment { display: none; }
    .brand { font-size: 23px; }
    .main-nav { gap: 4px; }
    .main-nav a { padding: 7px 9px; }
    main { padding: 24px 16px 36px; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .metric { padding: 16px; }
    .grid { grid-template-columns: 1fr; gap: 18px; }
    .panel, .section { padding: 16px; }
    .panel > h2:first-child, .panel > .heading:first-child { margin: -16px -16px 16px; padding: 12px 16px; }
    .panel > .section { padding: 14px; }
    h1 { font-size: 24px; }
    dl { grid-template-columns: 1fr; gap: 4px; }
    dd { margin-bottom: 12px; }
    .filters .field { min-width: 0; flex: 1 1 160px; }
    .filters button { flex-shrink: 0; }
    .auth, .auth-card { padding: 24px; margin: 20px auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.brand { display: inline-flex; align-items: center; gap: 5px; }
.account-menu { position: relative; }
.account-menu > summary { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 29px; height: 29px; border-radius: 50%; background: var(--accent); color: white; }
.account-dropdown { position: absolute; top: calc(100% + 9px); right: 0; width: 270px; max-width: calc(100vw - 32px); z-index: 20; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px #25324a20; }
.account-email { margin: 0 0 12px; overflow-wrap: anywhere; font-size: 12px; color: var(--muted); }
.account-link { display: block; padding: 8px 0; }
.account-dropdown .logout { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.account-dropdown .logout button { width: 100%; }
[hidden] { display: none !important; }
.actions { display:flex; flex-wrap:wrap; align-items:center; gap:.75rem; }
.actions form { margin:0; }
.table-wrap + .actions { margin-top:1rem; }

/* The supplied horizontal artwork includes whitespace; crop only its display box. */
.brand-art{display:block;position:relative;width:165px;height:42px;overflow:hidden;flex-shrink:0}.brand-art img{position:absolute;width:256px;height:auto;max-width:none;left:-47px;top:-31px}

/* Shared navigation actions: back controls, table drill-downs and pagination. */
.nav-button{max-width:100%;text-align:left;overflow-wrap:anywhere}
.back-button{margin-bottom:16px;min-height:36px;box-shadow:0 1px 2px #25324a08}
.back-button svg{flex-shrink:0}
.account-dropdown .account-link{display:flex;width:100%;justify-content:flex-start;padding:8px 12px;text-decoration:none}
.pagination{align-items:center;flex-wrap:wrap}

/* Ami Backup uses the supplied artwork unchanged; only its display box is cropped. */
.brand-art{width:190px;height:45px}.brand-art img{width:210px;left:-10px;top:-24px;height:auto}
.metric small{display:block;color:var(--muted);font-size:11px;margin-top:5px}
.badge.succeeded{background:#e8f6ee;color:#247449}.badge.failed{background:#fff0f1;color:#a63843}.badge.running{background:#e7f3ff;color:#1265b7}.badge.queued,.badge.neutral{background:#edf1f7;color:#526581}
td small{display:block;color:var(--muted);font-size:11px;margin-top:4px}.path{overflow-wrap:anywhere}.section-heading{display:flex;justify-content:space-between;gap:14px;align-items:baseline;flex-wrap:wrap}.source{display:flex;justify-content:space-between;gap:20px;padding:14px 0;border-bottom:1px solid var(--line)}.source:last-child{border:0}.source small{display:block;color:var(--muted);font-size:12px;margin-top:4px}.services{display:flex;flex-wrap:wrap;gap:28px}.services small{display:block;color:var(--muted);font-size:12px}.incident{display:flex;align-items:flex-start;gap:14px;padding:14px 0;border-bottom:1px solid var(--line)}.incident:last-child{border:0}.incident p{margin:4px 0}.incident small{color:var(--muted)}.errorlist{list-style:none;margin:6px 0 12px;padding:10px 12px;background:#fff3f3;color:#92323d;border-radius:6px;font-size:12px}.errorlist li+li{margin-top:6px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px}.form-grid .field.full{grid-column:1/-1}.form-grid .help{margin:6px 0}.settings-form{max-width:900px}.auth-card details{margin:16px 0}.auth-card code{user-select:all}.auth-card .auth-qr{width:280px;height:280px}.recovery-codes{list-style:none;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:10px}.recovery-codes li{background:var(--bg);padding:10px;border-radius:6px}.otp-input{font-size:21px;letter-spacing:.25em}.auth-card .secondary{width:100%}.updated{color:var(--muted);font-size:12px}.status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.status-grid .section{margin:0}button:disabled{opacity:.5;cursor:not-allowed}.page-heading{margin-bottom:24px}.page-heading p{margin:0}.form-actions{border-top:1px solid var(--line);padding-top:20px;margin-top:10px}.auth-card .field{margin-bottom:4px}.auth-card .field input{font-size:16px}.error{color:#92323d}.grid>.panel{min-width:0}.recovery-codes code{font-size:12px}a[href],button,summary{touch-action:manipulation}
@media(max-width:700px){.form-grid,.status-grid{grid-template-columns:1fr}.form-grid .field.full{grid-column:auto}.brand-art{width:170px;height:41px}.brand-art img{width:189px;left:-9px;top:-22px}.account-menu>summary{gap:6px}.source{gap:10px}.recovery-codes{grid-template-columns:1fr}.metric strong{font-size:26px}.heading .updated{width:100%}}
