/* Relation Labs (Bane, as on relationlabs.no and in Relation Voice) for brain's ops pages.
   Plum and northern light, lavender for the studio, Fraunces for headings, Inter for the interface.
   Gold is reserved for Relation OS, so here it only means "waiting on you" in a status. */

@font-face { font-family: "Fraunces"; font-weight: 500; font-display: swap; src: url("/ops/assets/fonts/fraunces-500.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 600; font-display: swap; src: url("/ops/assets/fonts/fraunces-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/ops/assets/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/ops/assets/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/ops/assets/fonts/inter-600.woff2") format("woff2"); }

:root, .natt {
  --bg0: #100d1a; --bg: #14101f; --raised: #1b1530; --card: #1d1830; --line: #2e2745; --line2: #3a3158;
  --ink: #efeae0; --ink-soft: #e1dacb; --text2: #a79fbc; --text3: #8982a0; --text3-dim: #6e6788;
  --lav: #8e86c8; --lav-strong: #b0a9e0; --lav-tint: #241e3e; --lav-line: #3d3663;
  --gold: #e4b14a; --gold-strong: #f0c878; --gold-tint: #2b2314; --gold-line: #4a3a1d; --gold-text: #e4b14a;
  --ok: #8fc9a3; --ok-tint: #1b2d21; --ok-line: rgba(143, 201, 163, .35);
  --err: #d98a8a; --err-tint: #351d1d; --err-line: #5a3030;
  --glass: rgba(29, 24, 48, .52); --glass-line: rgba(255, 255, 255, .07); --glass-hi: rgba(255, 255, 255, .06);
  --glass-shadow: 0 30px 60px -40px rgba(0, 0, 0, .75);
  --display-grad: linear-gradient(180deg, #f8f4ea 8%, #cfc8e6 66%, #a79fd0 88%);
  --fill: linear-gradient(90deg, #8e86c8, #b0a9e0);
  --ring: #b0a9e0; --field: rgba(16, 13, 26, .6);
  --topbar: rgba(16, 13, 26, .55);
  --sky: radial-gradient(120% 60% at 50% -10%, rgba(88, 76, 160, .28), transparent 60%),
         radial-gradient(90% 50% at 50% 110%, rgba(40, 30, 70, .6), transparent 70%);
  color-scheme: dark;
}
.papir {
  --bg0: #f5f0e6; --bg: #efe9dc; --raised: #fbf8f1; --card: #fbf8f1; --line: #e5decc; --line2: #d9d1bc;
  --ink: #251f38; --ink-soft: #3a3352; --text2: #5c5570; --text3: #706a83; --text3-dim: #8f89a0;
  --lav: #524b8b; --lav-strong: #524b8b; --lav-tint: #e6e4f1; --lav-line: #c5c1de;
  --gold-tint: #f5ecd6; --gold-line: #e0cf9e; --gold-text: #7a5a14;
  --ok: #2e6b47; --ok-tint: #ddeee4; --ok-line: #bcd8c6;
  --err: #9b403b; --err-tint: #f8e4e2; --err-line: #e6b7b3;
  --glass: rgba(251, 248, 241, .8); --glass-line: #e5decc; --glass-hi: rgba(255, 255, 255, .7);
  --glass-shadow: 0 1px 2px rgba(37, 31, 56, .06);
  --display-grad: linear-gradient(180deg, #251f38 20%, #524b8b 100%);
  --fill: linear-gradient(90deg, #6a61a8, #524b8b);
  --ring: #524b8b; --field: #ffffff;
  --topbar: rgba(245, 240, 230, .85);
  /* Paper keeps relationlabs.no's millimetre grid, quietly */
  --sky: linear-gradient(rgba(82, 75, 139, .045) 1px, transparent 1px) 0 0 / 56px 56px,
         linear-gradient(90deg, rgba(82, 75, 139, .045) 1px, transparent 1px) 0 0 / 56px 56px;
  color-scheme: light;
}

:root { --r-s: 8px; --r-m: 14px; --r-l: 18px; --ease: cubic-bezier(.16, 1, .3, 1);
  --fr: "Fraunces", "Inter", system-ui, sans-serif; --ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }

* { box-sizing: border-box; }
html { background: var(--bg0); }
body { margin: 0; min-height: 100vh; color: var(--text2); font: 400 14px/1.6 var(--ui); -webkit-font-smoothing: antialiased;
  background: var(--sky), var(--bg0); background-attachment: fixed; }
::selection { background: var(--lav); color: var(--bg0); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 4px; }
a { color: var(--lav-strong); text-decoration: none; } a:hover { text-decoration: underline; }
.tnum, td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Top bar: the mark and «Relation Brain», as «Relation Voice» */
.bar { position: sticky; top: 0; z-index: 10; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: var(--topbar); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--glass-line); }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.wordmark { font: 600 18.5px var(--fr); color: var(--ink); white-space: nowrap; display: flex; gap: .28em; align-items: baseline; }
.wordmark .sfx { color: var(--text2); }
.crumb { color: var(--text3); font-size: 13px; white-space: nowrap; }
.bar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--glass-line); background: var(--glass); border-radius: 999px; padding: 3px; }
.seg button { font: 500 12.5px/1 var(--ui); color: var(--text3); background: none; border: 0; border-radius: 999px; padding: 7px 13px; cursor: pointer; min-height: 30px; }
.seg button[aria-pressed="true"] { background: var(--lav-tint); color: var(--ink); box-shadow: inset 0 0 0 1px var(--lav-line); }
/* The same segmented control with links (the graph's views): the current one is aria-current */
.seg a { font: 500 12.5px/1 var(--ui); color: var(--text3); border-radius: 999px; padding: 8px 13px; white-space: nowrap; display: inline-flex; align-items: center; min-height: 30px; }
.seg a:hover { color: var(--ink); text-decoration: none; }
.seg a[aria-current="page"] { background: var(--lav-tint); color: var(--ink); box-shadow: inset 0 0 0 1px var(--lav-line); }
.bar .views { min-width: 0; overflow-x: auto; scrollbar-width: none; }
/* The tenant selector next to the breadcrumb (only with several tenants): the organization's name, the current marked */
.bar .tenants { min-width: 0; overflow-x: auto; scrollbar-width: none; flex: 0 1 auto; }
.bar .tenants a { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 14px; }
@media (max-width: 860px) { .bar .tenants a { max-width: 12ch; } }
/* The login in the bar: the name small (the e-mail on wide screens) and Logg ut, or a Logg inn link */
.bar .who { display: inline-flex; align-items: center; gap: 8px; font: 500 12px/1 var(--ui); color: var(--text3); white-space: nowrap; min-width: 0; }
.bar .who .who-name { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; max-width: 18ch; }
.bar .who .who-mail { color: var(--text3-dim); overflow: hidden; text-overflow: ellipsis; max-width: 26ch; }
.bar .who form { margin: 0; display: inline; }
.bar .who button { font: 500 12px/1 var(--ui); color: var(--text3); background: none; border: 1px solid var(--line2); border-radius: 999px; padding: 6px 11px; cursor: pointer; }
.bar .who button:hover, .bar a.who:hover { color: var(--ink); border-color: var(--lav-line); text-decoration: none; }
.bar a.who { border: 1px solid var(--line2); border-radius: 999px; padding: 7px 12px; }
@media (max-width: 1180px) { .bar .who .who-mail { display: none; } }
@media (max-width: 720px) { .bar .who .who-name { display: none; } }
@media (max-width: 720px) { .bar { gap: 8px; padding: 0 12px; } .bar:has(.views) .wordmark { display: none; } .seg a, .seg button { padding: 7px 9px; } }

/* Page tabs, lavender underline */
.tabs { display: flex; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--glass-line); }
.tabs a { position: relative; padding: 14px 0 12px; color: var(--text3); font-weight: 500; font-size: 14px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--lav-strong); border-radius: 2px; }

/* Type: Fraunces carries the headings, the display gradient goes from bone to lavender */
h1 { font: 500 34px/1.1 var(--fr); color: var(--ink); margin: 0; letter-spacing: -.015em; }
/* background-clip paints only the box: the padding keeps the descenders (g, j, p) in it, the negative margin keeps the layout. */
@supports (-webkit-background-clip: text) { h1 { background: var(--display-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; padding-bottom: .22em; margin-bottom: -.22em; } }
h2 { font: 600 17px/1.3 var(--fr); color: var(--ink); margin: 0 0 12px; }
.lead { color: var(--text3); font-size: 14px; margin: 8px 0 0; max-width: 64ch; }

/* Glass cards, KPI tiles, tables, notes, pills, progress */
.card { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r-l); box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding: 20px 22px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--glass-line); border-radius: var(--r-m); padding: 14px 16px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.kpi .l { font-size: 12.5px; font-weight: 500; color: var(--text3); }
.kpi .v { font: 500 28px/1.15 var(--fr); color: var(--ink); font-variant-numeric: tabular-nums lining-nums; margin-top: 4px; }
.kpi .s { font-size: 12.5px; color: var(--text3); margin-top: 2px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text3); padding: 0 12px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); color: var(--text2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; padding-right: 0; color: var(--ink); }
.empty { color: var(--text3); font-size: 13px; padding: 4px 0; margin: 0; }
.note { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--glass-line); border-radius: var(--r-m);
  background: var(--glass); color: var(--text2); font-size: 13.5px; }
.note b { color: var(--ink); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lav-strong); box-shadow: 0 0 0 3px var(--lav-tint), 0 0 10px rgba(176, 169, 224, .5); flex: none; }
.dot.err { background: var(--err); box-shadow: 0 0 0 3px var(--err-tint); }
.dot.live { animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent, 0 0 4px rgba(176, 169, 224, .2); } }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line2); color: var(--text3); white-space: nowrap; }
.pill.ok { color: var(--ok); background: var(--ok-tint); border-color: var(--ok-line); }
.pill.attention { color: var(--gold-text); background: var(--gold-tint); border-color: var(--gold-line); }
.pill.bad { color: var(--err); background: var(--err-tint); border-color: var(--err-line); }
.pill.info { color: var(--lav-strong); background: var(--lav-tint); border-color: var(--lav-line); }
.track { display: flex; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.track > i { display: block; height: 100%; }
.track .fill { background: var(--fill); box-shadow: 0 0 12px rgba(176, 169, 224, .35); }
.track .mid { background: var(--lav-line); } .track .bad { background: var(--err); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--text3); margin-top: 12px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.btn { font: 500 13px/1 var(--ui); color: var(--ink); background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r-s);
  padding: 9px 13px; min-height: 36px; cursor: pointer; transition: border-color .15s var(--ease); }
.btn:hover { border-color: var(--lav-line); }
.field { width: 100%; font: 400 14px/1.3 var(--ui); color: var(--ink); background: var(--field); border: 1px solid var(--line2); border-radius: var(--r-s); padding: 10px 12px; }
.field::placeholder { color: var(--text3); }
select.field { padding: 8px 10px; width: auto; }

@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .crumb { display: none; } h1 { font-size: 28px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }

/* ---- Voice's atmosphere: northern-light ribbons behind a veil, hairline gridlines with dots that drift up ---- */
body { background: var(--bg0); }
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--sky); }
.ribbon { position: absolute; left: -40%; top: 26%; width: 180%; height: 26vmax; filter: blur(28px); transform: rotate(-32deg);
  background: linear-gradient(180deg, transparent, rgba(126, 112, 214, .2) 45%, rgba(160, 148, 236, .3) 50%, rgba(126, 112, 214, .2) 55%, transparent);
  animation: drift 26s var(--ease) infinite alternate; }
.ribbon.two { top: 62%; height: 16vmax; opacity: .55; animation-duration: 34s; animation-direction: alternate-reverse; }
@keyframes drift { from { transform: rotate(-32deg) translateY(-4vmax); } to { transform: rotate(-28deg) translateY(4vmax); } }
.gridlines { position: fixed; inset: 0 38px; display: flex; justify-content: space-between; z-index: 0; pointer-events: none; }
.gl { position: relative; width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .055) 12%, rgba(255, 255, 255, .055) 88%, transparent); }
.gd { position: absolute; left: 50%; top: 100%; width: 5px; height: 5px; border-radius: 50%; transform: translate(-50%, -50%);
  background: rgba(176, 169, 224, .5); box-shadow: 0 0 8px rgba(142, 134, 200, .55); animation: rise 22s linear infinite; }
.gl:nth-child(1) .gd:nth-child(1) { animation-delay: -3s; } .gl:nth-child(1) .gd:nth-child(2) { animation-delay: -14s; animation-duration: 28s; }
.gl:nth-child(2) .gd:nth-child(1) { animation-delay: -9s; animation-duration: 26s; } .gl:nth-child(2) .gd:nth-child(2) { animation-delay: -20s; }
.gl:nth-child(3) .gd:nth-child(1) { animation-delay: -6s; animation-duration: 31s; } .gl:nth-child(3) .gd:nth-child(2) { animation-delay: -17s; animation-duration: 24s; }
.gl:nth-child(4) .gd:nth-child(1) { animation-delay: -1s; animation-duration: 27s; } .gl:nth-child(4) .gd:nth-child(2) { animation-delay: -12s; }
.gl:nth-child(5) .gd:nth-child(1) { animation-delay: -8s; animation-duration: 25s; } .gl:nth-child(5) .gd:nth-child(2) { animation-delay: -19s; animation-duration: 30s; }
@keyframes rise { 0% { top: 102%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: -2%; opacity: 0; } }
.papir .ribbon, .papir .gridlines { display: none; }
.page { position: relative; z-index: 1; }

/* The top bar and tabs sit on the sky, no hard edges */
.bar { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; height: 64px; }
.tabs { border-bottom: 0; justify-content: center; gap: 6px; padding: 0 24px 4px; }
.tabs a { padding: 7px 16px; border-radius: 999px; border: 1px solid transparent; font-size: 13.5px; }
.tabs a[aria-current="page"] { border-color: var(--lav-line); background: rgba(36, 30, 62, .55); }
.papir .tabs a[aria-current="page"] { background: var(--lav-tint); }
.tabs a[aria-current="page"]::after { display: none; }

/* Rails instead of boxes (Voice: «sideskinner, uten bokser») */
.rail { display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.rail-head h2 { margin: 0; font: 600 1.15rem var(--fr); color: var(--ink); letter-spacing: -.01em; }
.rail-count { font-size: .78rem; color: var(--text3); }
.rail table td, .rail table th { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.rail table th { border-bottom: 0; padding-top: 2px; }
.chip { display: inline-flex; align-items: center; gap: .55rem; padding: .32rem .9rem .32rem .72rem; font: 600 12.5px var(--ui); letter-spacing: .02em;
  color: var(--ink-soft); border: 1px solid var(--lav-line); border-radius: 999px; background: rgba(36, 30, 62, .55); }
.papir .chip { background: var(--lav-tint); color: var(--ink); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lav-strong); box-shadow: 0 0 10px var(--lav-strong); }
.chip.err .dot { background: var(--err); box-shadow: 0 0 10px var(--err); }
.arrive { animation: arrive .6s var(--ease) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }

/* ---- Phones (and a phone on its side): the bar is one row with the mark, the current view and Meny; the menu holds the
   organisation, the login, the theme and the page tabs (shell.py's script opens and closes it). On a wide screen the
   button is not shown and nothing below applies. ---- */
.menubtn { display: none; }
@media (max-width: 640px), (max-height: 480px) and (pointer: coarse) {
  .bar { height: auto; min-height: 56px; flex-wrap: nowrap; gap: 8px; row-gap: 10px; padding: 6px 8px 6px 12px; }
  .bar .crumb, .bar .tenants, .bar .who, .bar > .seg[aria-label="Tema"] { display: none; }
  .bar .views { flex: 1 1 0; min-width: 0; overflow: visible; justify-content: center; }
  .bar:not(.open) .views a:not([aria-current="page"]) { display: none; }
  .bar .menubtn { margin-left: auto; }
  .bar.open .views { order: 8; flex-basis: 100%; flex-wrap: wrap; border-radius: 16px; }
  .bar .views a, .bar .tenants a { flex: none; }
  .bar:has(.views) .spacer { display: none; }
  .bar.open { flex-wrap: wrap; }
  .bar.open::after { content: ""; order: 9; flex-basis: 100%; height: 0; }
  .seg a, .seg button { min-height: 38px; }
  .menubtn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; padding: 0;
    color: var(--ink); background: var(--glass); border: 1px solid var(--glass-line); border-radius: 12px; cursor: pointer; }
  .menubtn span, .menubtn span::before, .menubtn span::after { display: block; width: 18px; height: 2px; border-radius: 1px; background: currentColor;
    transition: transform .2s var(--ease), background .2s var(--ease); }
  .menubtn span { position: relative; }
  .menubtn span::before, .menubtn span::after { content: ""; position: absolute; left: 0; }
  .menubtn span::before { top: -6px; } .menubtn span::after { top: 6px; }
  .bar.open .menubtn span { background: transparent; }
  .bar.open .menubtn span::before { transform: translateY(6px) rotate(45deg); }
  .bar.open .menubtn span::after { transform: translateY(-6px) rotate(-45deg); }
  /* The open menu: its rows under the bar, on a solid panel */
  .bar.open { background: var(--raised); box-shadow: 0 24px 40px -28px rgba(0, 0, 0, .7); pointer-events: auto; }
  .bar.open:has(.tenants)::before { content: ""; order: 11; flex-basis: 100%; height: 0; }
  .bar.open .tenants { display: inline-flex; order: 10; flex: 1 1 100%; max-width: 100%; flex-wrap: wrap; overflow: visible; border-radius: 16px; }
  .bar.open .tenants a { max-width: 100%; }
  .bar.open .who { display: inline-flex; order: 12; flex: 1 1 auto; }
  .bar.open .who .who-name { display: inline-block; }
  .bar.open > .seg[aria-label="Tema"] { display: inline-flex; order: 13; }
  .bar.open .who button, .bar.open a.who { min-height: 38px; }
  /* The page tabs: in the menu on the graph's views (the bar floats on the canvas there), a plain row elsewhere */
  .tabs { gap: 4px; padding: 4px 12px 8px; }
  .tabs a { padding: 9px 14px; }
  .skypage .tabs, .graphpage .tabs { display: none; }
  .bar.open + .tabs { background: var(--raised); border-radius: 0 0 18px 18px; box-shadow: 0 24px 40px -28px rgba(0, 0, 0, .7); }
  .skypage .bar.open + .tabs, .graphpage .bar.open + .tabs { display: flex; justify-content: flex-start; padding: 2px 12px 12px; }
}
