
/* Gravity Watch V8.1 | Brand layer
   Appearance only: no business logic, server routes, permissions or translations. */
:root {
  color-scheme: dark;
  --background: #070d1c;
  --surface: #101d31;
  --field: #0b1729;
  --line: #26435e;
  --text: #eaf7ff;
  --muted: #a2b9cd;
  --accent: #49dcf9;
  --gw-blue: #13baf4;
  --gw-cyan: #49dcf9;
  --gw-violet: #8875ed;
  --gw-magenta: #e077b8;
  --gw-success: #69e0b3;
  --gw-warning: #f8bf70;
  --gw-danger: #ff7a9b;
  --gw-gradient: linear-gradient(115deg, #59e7fd, #4585ff 54%, #a578f6);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 38% at 80% -5%, #184b7d60, transparent 75%),
    radial-gradient(ellipse 50% 34% at 0% 50%, #31256840, transparent 80%),
    linear-gradient(160deg, #060b17 0%, #09162a 58%, #070b16 100%);
}
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: .18;
  background-image: linear-gradient(#65c8ee12 1px, transparent 1px), linear-gradient(90deg, #65c8ee12 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
  z-index: -1;
}
.page { max-width: 78rem; padding: clamp(1rem, 3.2vw, 2.75rem); }
.page-header, .gw-brand-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 154px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(.8rem, 2vw, 1.4rem);
  padding: clamp(1.15rem, 3vw, 2rem);
  margin-bottom: 1.2rem;
  border: 1px solid #387aaf80;
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 92% 36%, #184cbf5c, transparent 30%),
    linear-gradient(100deg, #0d1b32 15%, #102340 62%, #142245 100%);
  box-shadow: inset 0 1px #9fdcff20, 0 18px 70px #0004, 0 0 28px #167de111;
}
.page-header::before, .gw-brand-header::before {
  content: "";
  position: absolute;
  inset: -140px -110px auto auto;
  width: 450px;
  height: 450px;
  border: 1px solid #50d3f32a;
  border-radius: 50%;
  box-shadow: 0 0 0 32px #16c4ff06, 0 0 0 86px #8679e910, inset 0 0 60px #0b6dd018;
  background: repeating-radial-gradient(circle at 50% 50%, transparent 0 49px, #56d9ff12 50px 51px);
  transform: rotate(-16deg);
  z-index: -1;
}
.page-header::after, .gw-brand-header::after {
  content: "";
  position: absolute;
  right: 4%; bottom: -68px;
  width: min(48%, 400px); height: 145px;
  border-top: 1px solid #5af0ff75;
  border-radius: 50%;
  filter: drop-shadow(0 0 15px #13cafa);
  pointer-events: none;
  z-index: -1;
}
.gw-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: clamp(.8rem, 2vw, 1.35rem);
  flex: 1 1 290px;
}
.gw-brand-logo {
  width: clamp(76px, 12vw, 122px);
  height: clamp(76px, 12vw, 122px);
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 24px;
  background: #080f2080;
  border: 1px solid #4edcf444;
  filter: drop-shadow(0 0 24px #26d6ff45);
}
.gw-brand-copy { min-width: 0; }
.gw-eyebrow { font-size: .69rem; letter-spacing: .2em; text-transform: uppercase; color: #75bde4; font-weight: 750; }
.gw-brand h1, .page-header h1 { font-size: clamp(1.65rem, 4.3vw, 2.85rem); line-height: 1.12; font-weight: 850; color: #f3faff; letter-spacing: -.055em; }
.gw-brand h1 .gw-watch { color: var(--gw-cyan); }
.gw-tagline { margin-top: .45rem; color: #b6cadb; font-size: .86rem; letter-spacing: .035em; }
.page-header .version { color: #88bcdf; font-weight: 650; padding: .28rem .45rem; border: 1px solid #67b6ea38; border-radius: 999px; background: #08182c83; vertical-align: middle; }
.gw-header-tools { display: flex; align-items: center; flex-wrap: wrap; gap: .85rem; margin-inline-start: auto; }
.gw-header-tools > a { border: 1px solid #3b80a055; padding: .6rem .85rem; border-radius: .65rem; background: #0b2034aa; text-decoration: none; font-size: .85rem; font-weight: 650; }
.gw-header-tools > a:hover { border-color: var(--gw-cyan); background: #0d344a; }
.gw-header-tools .language-picker { margin: 0; min-width: 155px; }
.gw-header-tools .language-picker span { display: block; font-size: .71rem; }
.gw-header-tools .language-picker select { min-height: 2.5rem; }
.panel, .metric {
  border: 1px solid #34506bba;
  background: linear-gradient(150deg, #13233acf, #0e192cde);
  border-radius: 1rem;
  box-shadow: inset 0 1px #98dfff10, 0 12px 30px #01081228;
  backdrop-filter: blur(12px);
}
.panel { margin-bottom: 1rem; padding: clamp(1rem, 2.6vw, 1.5rem); }
.panel h2, .section-heading h2 { color: #f2f8ff; letter-spacing: -.018em; margin-bottom: .7rem; font-size: 1.1rem; }
.panel h2::before { content: ""; display: inline-block; background: var(--gw-gradient); height: .9em; width: 3px; border-radius: 3px; margin-inline-end: .65rem; vertical-align: -.06em; box-shadow: 0 0 9px #3dcdfa85; }
.metric { min-height: 100px; padding: 1rem 1.15rem; position: relative; overflow: hidden; }
.metric::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, #48e6fa90, #7282fa50, transparent); }
.metric dt { color: #aac3d8; font-size: .8rem; text-transform: uppercase; letter-spacing: .065em; font-weight: 650; }
.metric dd { color: #5cdef8; font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 780; }
input, select, button {
  border-color: #3a5774;
  background: #0b192e;
  border-radius: .65rem;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus { border-color: #46d7fa; box-shadow: 0 0 0 3px #3cccf825; outline: none; }
button {
  background: linear-gradient(110deg, #194c75, #153b68);
  border-color: #3d8eb4aa;
  color: #e7faff;
  font-weight: 650;
}
button:hover:not(:disabled) { background: linear-gradient(110deg, #1c638b, #24518b); border-color: #50d7f9; box-shadow: 0 0 16px #38bfff22; }
button:active:not(:disabled) { transform: translateY(1px); }
a { color: #6cdbfa; text-underline-offset: .2em; }
a:hover { color: #b6f2ff; }
.notice { border-color: #a97b42; background: #302317dd; }
.event, .role-item { border-color: #334d63; }
.event:hover, .role-item:hover { background: #32699813; }
.event-type, .role-name { color: #e9f7ff; }
.event-heading a { color: #67d9f6; }
details { border-radius: .7rem; }
details[open] > summary { color: var(--gw-cyan); }
#workspace { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 1rem; }
#workspace > nav { grid-column: 1 / -1; }
#workspace > section { grid-column: span 6; align-self: start; }
#workspace > section:nth-of-type(2), #workspace > section:nth-of-type(4), #workspace > section:nth-of-type(6), #workspace > section:nth-of-type(8) { grid-column: span 12; }
#workspace nav { justify-content: flex-end; }
#message:not(:empty) { margin: 0 0 1rem; border-inline-start: 3px solid #50dafa; padding: .7rem 1rem; background: #103149; border-radius: .45rem; }
#sign-in { max-width: 570px; margin: 1.3rem auto 3rem; padding: clamp(1.2rem, 4vw, 2rem); }
#sign-in h2 { font-size: clamp(1.15rem, 3vw, 1.55rem); }
#sign-in p { margin-bottom: 1rem; line-height: 1.75; color: #bdd0df; }
#sign-in code { color: #79effa; background: #071c2c; padding: .2rem .42rem; border: 1px solid #2f6681; border-radius: .3rem; }
#sign-in #login { display: grid; gap: .85rem; }
#sign-in #login label { display: grid; gap: .45rem; }
#sign-in #login input { min-height: 3rem; }
#sign-in #login button { min-height: 3.1rem; background: var(--gw-gradient); color: #041323; font-weight: 800; border: none; }
.supervision-page form { row-gap: .85rem; }
.supervision-page #case-detail, .supervision-page #analysis, .supervision-page #report { overflow-wrap: anywhere; }
.supervision-page .manage[hidden] { display: none; }
.gw-footer { text-align: center; color: #7799b2; font-size: .75rem; letter-spacing: .08em; padding: 1.25rem .5rem; }
[dir="rtl"] .page-header::before { right: auto; left: -110px; }
@media (max-width: 850px) { #workspace > section { grid-column: 1 / -1 !important; } .page-header, .gw-brand-header { min-height: 125px; } }
@media (max-width: 620px) {
  .page-header, .gw-brand-header { padding: 1rem; }
  .gw-brand { flex-basis: 100%; gap: .75rem; }
  .gw-brand-logo { width: 70px; height: 70px; border-radius: 16px; }
  .gw-brand h1 { font-size: 1.65rem; }
  .gw-header-tools { width: 100%; justify-content: space-between; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { min-height: 85px; }
  .panel { padding: .95rem; }
  #sign-in { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  input, select, button { transition: none; }
}
/* V8.1 visual polish: the cropped banner preserves the orbital artwork,
   without reprinting the wordmark or slogan behind accessible HTML. */
.page-header.gw-brand-header {
  background-image:
    linear-gradient(100deg, rgba(8,18,36,.96) 0%, rgba(8,22,41,.89) 46%, rgba(9,24,49,.49) 100%),
    url("gravity-watch-banner-ornament.webp");
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}
.gw-brand, .gw-header-tools {
  position: relative;
  z-index: 1;
}
.gw-brand-copy h1 { text-wrap: balance; }
.gw-brand-copy .gw-tagline { text-wrap: pretty; }
.gw-header-tools > a { display: inline-flex; justify-content: center; align-items: center; }

/* Accessible compact forms: keep 44px touch targets for action controls,
   but prevent checkboxes from inheriting the full-width input rules. */
.supervision-page input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 1.15rem;
  min-width: 1.15rem;
  flex: 0 0 1.15rem;
  padding: 0;
  margin: 0;
  accent-color: var(--gw-cyan);
}
.supervision-page form label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 2.5rem;
  margin: 0;
  line-height: 1.4;
  cursor: pointer;
}
.supervision-page form label:has(> input[type="checkbox"]) > span {
  margin: 0;
}
.supervision-page form :is(input, select, button) { min-width: 0; }
.supervision-page #workspace .panel > :is(button, select) { margin-block: .25rem; }
.supervision-page #workspace > section.panel { min-width: 0; }
.supervision-page #health {
  color: #cbddeb;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.supervision-page #case-list { margin-block: .4rem; }

/* Separate audit settings into readable groups without changing
   the three form IDs, their input names, or their submission handlers. */
.gw-form-title {
  font-size: .95rem;
  font-weight: 720;
  color: #dceffb;
  letter-spacing: .015em;
  margin: 0 0 .1rem;
}
.supervision-page :is(#sensitive-roles, #sequence, #operation) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: .85rem 1rem;
  width: 100%;
  margin: .85rem 0;
  padding: clamp(.85rem, 1.8vw, 1.2rem);
  border: 1px solid #294d6c;
  border-radius: .85rem;
  background: linear-gradient(135deg, #0c1b30b3, #10223a9e);
}
.supervision-page :is(#sensitive-roles, #sequence, #operation) > .gw-form-title {
  grid-column: 1 / -1;
}
.supervision-page :is(#sensitive-roles, #sequence, #operation) > label {
  width: 100%;
  min-width: 0;
  margin: 0;
}
.supervision-page :is(#sensitive-roles, #sequence, #operation) > button {
  width: fit-content;
  max-width: 100%;
  grid-column: 1 / -1;
  justify-self: start;
}
.supervision-page #sensitive-roles > label {
  grid-column: 1 / -1;
}
.supervision-page #sensitive-roles select[multiple] {
  display: block;
  min-height: 7.5rem;
  max-height: 11rem;
  padding: .5rem;
}
.supervision-page #sequence > label:has(input[name="enabled"]) {
  grid-column: 1 / -1;
  min-height: 2.75rem;
  padding-inline: .6rem;
  border: 1px solid #30506d;
  background: #0b1b30a6;
  border-radius: .65rem;
}
.supervision-page #operation input[type="datetime-local"] {
  width: 100%;
  min-width: 0;
  font-size: .92rem;
}
.supervision-page #operation label:has(input[name="note"]) {
  grid-column: 1 / -1;
}
.supervision-page #operation label:has(input[name="actor"]) {
  grid-column: 1 / -1;
}
.supervision-page .panel form :is(input,select):focus-visible {
  outline: 2px solid var(--gw-cyan);
  outline-offset: 2px;
}

@media (max-width: 620px) {
  .page { padding: .65rem; }
  .page-header.gw-brand-header {
    min-height: unset;
    padding: .85rem;
    gap: .65rem;
    margin-bottom: .75rem;
  }
  .gw-brand { gap: .7rem; }
  .gw-brand-logo { width: 59px; height: 59px; border-radius: 14px; }
  .gw-eyebrow { font-size: .58rem; letter-spacing: .1em; }
  .gw-brand h1 { font-size: clamp(1.28rem, 5vw, 1.65rem); }
  .gw-tagline { font-size: .77rem; margin-top: .22rem; }
  .gw-header-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: .55rem;
    width: 100%;
  }
  .gw-header-tools > a {
    min-height: 44px;
    text-align: center;
    padding: .5rem;
    font-size: .8rem;
    line-height: 1.2;
  }
  .gw-header-tools .language-picker { min-width: 0; width: 100%; }
  .gw-header-tools .language-picker span { font-size: .68rem; }
  .gw-header-tools .language-picker select { width: 100%; min-height: 44px; }
  #workspace { gap: 0 .6rem; }
  #workspace > nav { justify-content: center; gap: .45rem; margin: .5rem 0 .7rem; }
  #workspace > nav button { flex: 1 1 auto; min-height: 44px; padding: .48rem .55rem; }
  #workspace > section.panel {
    margin-bottom: .65rem;
    padding: .85rem;
    border-radius: .85rem;
  }
  .supervision-page .panel h2 { margin-bottom: .55rem; font-size: 1.04rem; }
  .supervision-page #health { font-size: .9rem; line-height: 1.5; }
  .supervision-page .panel form { gap: .65rem; }
  .supervision-page :is(#sensitive-roles, #sequence, #operation) {
    gap: .65rem;
    padding: .75rem;
  }
  .supervision-page #operation { grid-template-columns: minmax(0, 1fr); }
  .supervision-page #operation > label { grid-column: 1 / -1; }
  .supervision-page #operation input[type="datetime-local"] { font-size: 1rem; }
}
@media (max-width: 350px) {
  .gw-header-tools { grid-template-columns: minmax(0, 1fr); }
  .supervision-page #sequence { grid-template-columns: minmax(0, 1fr); }
}
