/* Portal overrides follow unmodified Oat. Always dark, regardless of OS preference. */
:root {
  color-scheme: dark;
  --background: #0b101b;
  --foreground: #e3e9f3;
  --card: #111927;
  --card-foreground: #e3e9f3;
  --primary: #8cb4ff;
  --primary-foreground: #09152b;
  --secondary: #1b2639;
  --secondary-foreground: #d1dced;
  --muted: #172132;
  --muted-foreground: #9baac1;
  --faint: #101725;
  --faint-foreground: #8d9cb4;
  --accent: #1a2943;
  --border: #263247;
  --input: #34425b;
  --ring: #8cb4ff;
  --danger: #ff9b9b;
  --success: #8cd8bb;
  --warning: #ecc58a;
  --radius-medium: .4rem;
  --radius-large: .7rem;
  --text-regular: .875rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--background); color: var(--foreground); }
/* Leave button-link foregrounds to Oat; unlayered link styles override its layers. */
a:not(.button) { color: var(--primary); }
a, button, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 1.4rem + 1vw, 2.15rem); font-weight: 650; letter-spacing: -.045em; line-height: 1.2; }
h2 { font-size: 1rem; font-weight: 600; letter-spacing: -.015em; }
h3 { font-size: .95rem; font-weight: 600; }
button, .button { font-size: .84rem; font-weight: 550; white-space: nowrap; }
button.small { font-size: .76rem; padding: .4rem .65rem; min-height: 2rem; }
button:disabled { cursor: wait; }
button.danger-action { color: var(--danger); }
input, textarea { min-width: 0; }
textarea { resize: vertical; }
small { font-size: .76rem; }
code, pre { font-size: .76rem; }
.muted { color: var(--muted-foreground); }
.eyebrow { color: var(--primary); font-size: .65rem; font-weight: 650; letter-spacing: .15em; margin-bottom: .7rem; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 999; background: var(--primary); color: var(--primary-foreground); padding: .7rem 1rem; border-radius: .4rem; }
.skip-link:focus { top: 1rem; }
.site-header { min-height: 82px; padding: 1rem max(2rem, calc((100vw - 1240px) / 2)); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 3rem; background: #0d1421; }
.brand { display: inline-flex; align-items: center; gap: .75rem; flex-shrink: 0; color: var(--foreground); text-decoration: none; font-size: 1rem; font-weight: 650; letter-spacing: -.02em; }
.brand small { display: block; font-size: .55rem; letter-spacing: .15em; color: var(--muted-foreground); font-weight: 500; margin-top: .15rem; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid #3a5278; border-radius: .7rem; background: #182840; color: #a6c5ff; font-size: .95rem; letter-spacing: -.1em; }
.brand-mark span { color: #d9e7ff; }
.site-header nav { display: flex; gap: .3rem; align-self: stretch; align-items: center; flex: 1; }
.site-header nav a { color: var(--muted-foreground); text-decoration: none; padding: .55rem .85rem; border-radius: .4rem; font-size: .8rem; white-space: nowrap; }
.site-header nav a:hover { color: var(--foreground); background: var(--muted); }
.site-header nav a[aria-current] { background: #1b2c47; color: #b6cfff; }
.sign-out { color: var(--muted-foreground); font-size: .8rem; text-decoration: none; white-space: nowrap; }
.sign-out:hover { color: var(--foreground); }
.sign-out span { margin-left: .4rem; }
main { width: 100%; max-width: 1304px; padding: 2.8rem 2rem 4rem; margin: 0 auto; flex: 1; min-width: 0; }
main:focus { outline: none; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; max-width: 1304px; width: 100%; margin: auto auto 0; padding: 1.4rem 2rem; color: var(--muted-foreground); font-size: .7rem; border-top: 1px solid var(--border); }
.site-footer span:first-child { font-weight: 600; color: #acb9cd; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 2rem; margin-bottom: 2.4rem; }
.page-heading h1 + p { margin-top: .6rem; }
.identity { display: flex; align-items: center; gap: .7rem; max-width: 46%; }
.identity small { display: block; color: var(--muted-foreground); margin-bottom: .15rem; }
.identity-email { font-size: .8rem; overflow-wrap: anywhere; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; background: #24334d; color: #bbd1f7; font-size: .9rem; }
.section-heading, .panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.section-heading { margin-bottom: 1rem; }
.section-heading h2 { font-size: .85rem; }
.badge { font-size: .64rem; font-weight: 500; white-space: nowrap; }
.app-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.app-card { border: 1px solid var(--border); background: var(--card); padding: 1.4rem; border-radius: .7rem; text-decoration: none; color: var(--foreground); display: flex; flex-direction: column; align-items: flex-start; min-height: 220px; transition: border-color 150ms, background 150ms, transform 150ms; min-width: 0; }
.app-card:hover { border-color: #5475a6; background: #162237; transform: translateY(-2px); }
.app-symbol { width: 42px; height: 42px; border-radius: .65rem; background: #1e3150; color: #a8c9ff; border: 1px solid #2c466b; display: inline-flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 650; letter-spacing: -.04em; flex-shrink: 0; }
.app-card:nth-child(4n+2) .app-symbol { background: #203134; color: #9bd4cc; border-color: #2d4b4c; }
.app-card:nth-child(4n+3) .app-symbol { background: #2a2944; color: #c2b6f0; border-color: #424160; }
.app-card:nth-child(4n+4) .app-symbol { background: #2c303a; color: #c7ccd8; border-color: #434b5b; }
.app-card h3 { margin: 1rem 0 .5rem; overflow-wrap: anywhere; font-size: 1rem; }
.app-card p { color: var(--muted-foreground); font-size: .8rem; line-height: 1.65; overflow-wrap: anywhere; margin-bottom: 1.5rem; }
.app-launch { margin-top: auto; width: 100%; display: flex; justify-content: space-between; align-items: center; color: #adcaff; font-size: .74rem; font-weight: 550; }
.app-launch span { font-size: 1rem; }
.info-note { display: flex; align-items: flex-start; gap: .7rem; padding: 1rem 1.1rem; background: #101a2b; border: 1px solid #223550; border-radius: .6rem; color: #aabbd5; margin: 1.5rem 0; font-size: .78rem; line-height: 1.6; }
.info-note > span { color: #a6c5ff; }
.info-note p { min-width: 0; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 3rem 1.5rem; border: 1px dashed var(--border); border-radius: .7rem; color: var(--muted-foreground); }
.empty-state h3 { margin: .75rem 0 .4rem; color: var(--foreground); }
.empty-symbol { font-size: 2rem; color: var(--primary); }
ot-tabs { display: block; min-width: 0; }
ot-tabs > [role="tablist"] { margin-bottom: 1.3rem; gap: 1rem; }
ot-tabs > [role="tablist"] button { font-size: .84rem; padding: .8rem .15rem; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: .7rem; min-width: 0; overflow: clip; }
ot-tabs > [role="tabpanel"].panel { padding: 0; }
.panel-heading { padding: 1.4rem 1.5rem; }
.panel-heading p { color: var(--muted-foreground); font-size: .78rem; margin-top: .35rem; }
.panel-toolbar { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #101725; padding: 1.1rem 1.5rem; }
.inline-form { display: flex; gap: .8rem; align-items: end; flex-wrap: wrap; }
.inline-form label { flex: 1 1 240px; max-width: 340px; margin: 0; font-size: .76rem; }
.inline-form small { margin: 0 0 .55rem .3rem; flex: 1 1 220px; }
[data-field] { font-size: .8rem; }
[data-field] input, [data-field] textarea { font-size: .83rem; background: #0d1523; }
.table { width: 100%; min-width: 0; overflow-x: auto; margin: 0; }
table { margin: 0; font-size: .8rem; }
th { font-size: .66rem; letter-spacing: .03em; color: var(--muted-foreground); font-weight: 550; background: #111b2a; }
th, td { padding: .95rem 1.25rem; }
td { border-color: #222e40; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.grant-table { min-width: 740px; }
.grant-table th:not(:first-child), .grant-table td:not(:first-child) { text-align: center; }
.grant-table th:first-child { min-width: 230px; }
.grant-table th { max-width: 200px; overflow-wrap: anywhere; }
.grant-table td:first-child { max-width: 340px; }
.grant-table [role="switch"] { margin: 0; vertical-align: middle; }
.user-email { display: block; overflow-wrap: anywhere; font-weight: 500; }
.user-email + .badge { margin-top: .4rem; }
.panel-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.panel-footer small { line-height: 1.6; }
.catalog-row { display: flex; gap: 1rem; padding: 1.25rem 1.5rem; align-items: center; border-top: 1px solid var(--border); margin: 0; }
.small-symbol { width: 36px; height: 36px; font-size: .7rem; }
.catalog-info { min-width: 0; flex: 1; }
.catalog-title { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: .35rem; }
.catalog-title h3 { overflow-wrap: anywhere; }
.catalog-info code { background: transparent; color: var(--muted-foreground); padding: 0; overflow-wrap: anywhere; }
.catalog-info p { color: var(--muted-foreground); font-size: .76rem; margin-top: .4rem; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.audit-table { min-width: 680px; table-layout: fixed; }
.audit-table td, .audit-table th { overflow-wrap: anywhere; }
.audit-table th:last-child { width: 28%; }
.audit-table time { font-size: .72rem; }
.actor-id { display: block; color: var(--muted-foreground); font-size: .65rem; margin-top: .3rem; }
.audit-table summary { color: var(--primary); font-size: .74rem; cursor: pointer; }
.audit-table pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; padding: .6rem; }
.notice { padding: .85rem 1rem; margin: 1rem 0; border-radius: .5rem; background: #18312c; color: var(--success); border: 1px solid #35564c; font-size: .82rem; overflow-wrap: anywhere; }
.notice[data-variant="danger"] { background: #321f2a; border-color: #67404c; color: var(--danger); }
.notice[data-variant="warning"] { background: #322c21; border-color: #60513b; color: var(--warning); }
.loading { color: var(--muted-foreground); padding: 1.5rem; }
dialog { width: min(620px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; background: var(--card); border: 1px solid #3c4b64; border-radius: .8rem; box-shadow: 0 24px 80px #0009; }
dialog::backdrop { background: #050a14bb; backdrop-filter: blur(3px); }
dialog > form { margin: 0; display: flex; flex-direction: column; max-height: calc(100dvh - 2rem - 2px); }
dialog header, dialog footer { flex-shrink: 0; }
dialog header { padding: 1.5rem 1.5rem 1rem; }
dialog header h2 { font-size: 1.25rem; }
dialog header p.muted { font-size: .8rem; margin-top: .5rem; }
.dialog-body { padding: .5rem 1.5rem 1.5rem; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.dialog-body [data-field] { margin-bottom: 1rem; }
.dialog-status { margin-top: 0; }
dialog footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .6rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.switch-label { display: flex; align-items: center; gap: .65rem; font-size: .82rem; }
.narrow-panel { max-width: 900px; }
.account-form label { max-width: none; }
.account-form { margin-bottom: 1.5rem; }
.account-table { min-width: 480px; }
.account-table td:last-child, .account-table th:last-child { text-align: right; }
.account-table .row-actions { justify-content: flex-end; }
.trino-section { margin-top: 2rem; }
.trino-section .section-heading { flex-wrap: wrap; }
.connection-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.connection-list { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: .7rem 1rem; padding: 0 1.5rem 1.5rem; font-size: .78rem; margin: 0; }
.connection-list dt { color: var(--muted-foreground); }
.connection-list dd { margin: 0; overflow-wrap: anywhere; }
.public-page .site-header { background: transparent; border: 0; }
.public-page main { display: grid; place-items: center; }
.login-panel { text-align: center; max-width: 440px; padding: 2rem 1rem 4rem; }
.login-emblem { width: 74px; height: 74px; margin: 0 auto 2rem; display: grid; place-items: center; background: #192b47; border: 1px solid #33507b; border-radius: 1.3rem; color: #a9c9ff; font-size: 3rem; }
.login-panel h1 { font-size: clamp(2.6rem, 5vw, 3.3rem); line-height: 1.1; margin-bottom: 1.2rem; }
.login-panel > p.muted { line-height: 1.8; font-size: .9rem; }
.login-button { display: flex; justify-content: space-between; gap: 1rem; margin: 2rem 0 1rem; padding: .9rem 1.2rem; text-decoration: none; }
.google-mark { font-size: 1.05rem; font-weight: 700; }
@media (max-width: 1000px) {
  .site-header { gap: 1.5rem; }
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .site-header { padding: 1rem 1.2rem 0; gap: 1rem; flex-wrap: wrap; }
  .site-header .brand { flex: 1; }
  .site-header nav { order: 3; flex: 1 1 100%; overflow-x: auto; gap: .2rem; padding-bottom: .7rem; }
  .site-header nav a { padding: .5rem .65rem; font-size: .74rem; }
  main { padding: 2rem 1.2rem 3rem; }
  .site-footer { padding: 1.2rem; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 1rem; margin-bottom: 1.7rem; }
  .identity { max-width: 100%; }
  .app-card { padding: 1.15rem; }
  .panel-heading { flex-wrap: wrap; padding: 1.2rem; }
  .panel-toolbar, .panel-footer { padding: 1rem 1.2rem; }
  .inline-form label { max-width: none; }
  .inline-form small { margin: 0; }
  .catalog-row { padding: 1rem 1.2rem; flex-wrap: wrap; }
  .catalog-info { flex-basis: calc(100% - 60px); }
  .catalog-row .row-actions { margin-left: 52px; }
  .connection-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .public-page .site-header { padding-bottom: 1rem; }
}
@media (max-width: 440px) {
  .app-grid { grid-template-columns: 1fr; }
  .app-card { min-height: 200px; }
  .site-footer span:last-child { display: none; }
  ot-tabs > [role="tablist"] { gap: .6rem; }
  ot-tabs > [role="tablist"] button { font-size: .76rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
