@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;800&display=swap");

:root {
  --bg: #f7f7f9;
  --surface: #ffffff;
  --text: #05070d;
  --muted: #2d2d2d;
  --border: #dce2eb;
  --blue: #0a5cff;
  --blue-soft: #e9f1ff;
  --green: #22c55e;
  --green-border: #1db152;
  --green-soft: #eff8f0;
  --green-hover: #bfebd0;
  --orange: #f59e0b;
  --orange-border: #fabd74;
  --orange-soft: #fef5ed;
  --orange-hover: #ffe4c4;
  --yellow: var(--orange);
  --yellow-border: var(--orange-border);
  --yellow-soft: var(--orange-soft);
  --red: #ef2428;
  --red-soft: #fff0f1;
  --gray-soft: #eef1f5;
  --no-strike: #475569;
  --no-strike-border: #64748b;
  --no-strike-soft: #e2e8f0;
  --sidebar: #0d1724;
  --sidebar-width: 82px;
  --header-height: 36px;
  --control-height: 30px;
  --control-inner-height: calc(var(--control-height) - 2px);
  --control-hover-bg: #eef4ff;
  --control-hover-border: #c8d8ff;
  --control-hover-shadow: 0 7px 14px rgba(7, 92, 239, 0.12);
  --control-focus-bg: #f6f9ff;
  --control-focus-shadow: 0 0 0 3px rgba(10, 92, 255, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  color: var(--text);
  background: var(--bg);
  font-family: "Roboto", Arial, sans-serif;
  letter-spacing: 0;
  caret-color: transparent;
}

button,
a {
  font: inherit;
}

button {
  appearance: none;
  -webkit-appearance: none;
}

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

:where(input, select, textarea, [contenteditable="true"], [contenteditable="plaintext-only"]) {
  caret-color: auto;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

:where(input, select, textarea):is(:disabled, [readonly]) {
  caret-color: transparent;
}

:where(input, select, textarea):hover {
  background: var(--control-hover-bg);
}

:where(input, select, textarea):focus {
  outline: none;
  border-color: var(--control-hover-border);
  background: var(--control-focus-bg);
  box-shadow: var(--control-focus-shadow);
}

:where(input, textarea)[readonly] {
  pointer-events: none;
  cursor: default;
}

:where(input, textarea)[readonly]:hover,
:where(input, textarea)[readonly]:focus {
  border-color: var(--border);
  background: #f8fafc;
  box-shadow: none;
}

.app-shell {
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 20px 9px 8px;
  background:
    radial-gradient(circle at 55% 10%, rgba(62, 81, 111, 0.32), transparent 36%),
    linear-gradient(180deg, #0d1724 0%, #101a28 44%, #0a111c 100%);
  color: #ffffff;
}

.logo {
  margin: 8px 0 25px;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav {
  display: grid;
  gap: 12px;
}

.nav-item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 60px;
  padding: 8px 4px;
  color: #ffffff;
  border-radius: 7px;
  opacity: 0.9;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  opacity: 1;
}

.nav-item--disabled,
.nav-item--disabled:hover,
.nav-item--disabled:active {
  background: transparent;
  box-shadow: none;
  color: rgba(255, 255, 255, 0.62);
  cursor: default;
  opacity: 0.48;
  pointer-events: none;
  transform: none;
}

.nav-item:active {
  transform: translateY(1px);
}

.nav-item.active {
  background: linear-gradient(180deg, #0b63ff 0%, #0751cf 100%);
  box-shadow:
    0 8px 18px rgba(7, 92, 239, 0.26),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav-item.active-shift {
  border: 1px solid rgba(35, 227, 139, 0.34);
  background:
    radial-gradient(circle at 50% 0%, rgba(35, 227, 139, 0.26), transparent 58%),
    linear-gradient(180deg, rgba(9, 98, 77, 0.92) 0%, rgba(6, 63, 61, 0.72) 100%);
  color: #ecfff6;
  box-shadow:
    0 8px 18px rgba(16, 185, 129, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.nav-item.active-shift::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.nav-item.active-shift.current {
  background:
    radial-gradient(circle at 50% 0%, rgba(35, 227, 139, 0.34), transparent 58%),
    linear-gradient(180deg, #0aa06f 0%, #087064 100%);
  box-shadow:
    0 10px 22px rgba(16, 185, 129, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
}

.nav svg,
.ui-btn svg,
.stat-icon svg,
.new-shift-link svg,
.logout-button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.nav-item span:last-child {
  max-width: 62px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.12;
}

.sidebar-bottom {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.logout-form {
  margin: 0;
}

.logout-button {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.new-shift-link {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 55px;
  padding: 8px 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: #f4f8ff;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.new-shift-link:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.new-shift-link:active {
  transform: translateY(1px);
}

.new-shift-link svg {
  width: 21px;
  height: 21px;
}

.new-shift-link span {
  max-width: 56px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.page {
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  padding: 12px 12px 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  height: var(--header-height);
  margin-bottom: 8px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: var(--header-height);
  margin-left: auto;
  min-width: 0;
}

.event-create-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.event-create-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 15;
  display: grid;
  gap: 4px;
  width: max-content;
  min-width: 170px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  visibility: hidden;
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 140ms ease;
}

.event-create-menu:hover .event-create-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.event-create-dropdown__item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--control-height);
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.event-create-dropdown__item:hover,
.event-create-dropdown__item:focus-visible {
  border-color: var(--control-hover-border);
  background: var(--control-hover-bg);
  box-shadow: var(--control-hover-shadow);
  outline: none;
}

.shift-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--header-height);
  min-width: 0;
}

h1 {
  display: flex;
  align-items: center;
  height: var(--header-height);
  margin: 0;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.08;
}

.shift-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--header-height);
  min-width: 0;
  flex-wrap: wrap;
}

.shift-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  color: #0b7a34;
  background: #e6f7ec;
  font-size: 12px;
  font-weight: 700;
}

.shift-status.finished {
  color: #334155;
  background: #edf1f5;
}

.shift-times {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
}

.topbar > .shift-meta .shift-times {
  border-color: rgba(34, 197, 94, 0.3);
  background: #ecfdf3;
}

.topbar > .shift-meta-finished .shift-times {
  border-color: var(--border);
  background: #ffffff;
}

.topbar > .shift-meta .time-item span {
  color: var(--green-border);
}

.topbar > .shift-meta-finished .time-item span {
  color: var(--muted);
}

.time-item {
  display: grid;
  gap: 2px;
}

.time-item span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.time-item strong {
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}

.time-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--control-height);
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition:
    background 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.ui-btn--small {
  min-width: 0;
  min-height: var(--control-height);
}

.ui-btn--large {
  min-width: 124px;
  min-height: 34px;
  padding: 0 10px;
}

.ui-btn--compact {
  min-width: 110px;
}

.ui-btn--wide {
  min-width: 145px;
}

.ui-btn--primary {
  border-color: var(--blue);
  background: linear-gradient(180deg, #075cff 0%, #054ed5 100%);
  color: #ffffff;
  box-shadow: 0 8px 15px rgba(7, 92, 239, 0.16);
}

.ui-btn--primary:hover {
  background: linear-gradient(180deg, #176aff 0%, #0758ed 100%);
  box-shadow: 0 10px 18px rgba(7, 92, 239, 0.22);
}

.ui-btn--secondary {
  border-color: var(--border);
  background: #ffffff;
  color: var(--text);
}

.ui-btn--secondary:hover,
.ui-btn--outline:hover {
  border-color: var(--control-hover-border);
  background: var(--control-hover-bg);
  box-shadow: var(--control-hover-shadow);
}

.ui-btn--outline {
  border-color: var(--blue);
  background: #ffffff;
  color: var(--blue);
  font-weight: 400;
}

.ui-btn--danger {
  border-color: #ff3b30;
  background: #ffffff;
  color: #ff3b30;
}

.ui-btn--danger:hover {
  border-color: #ff3b30;
  background: #fff1f0;
  box-shadow: 0 8px 15px rgba(255, 59, 48, 0.12);
}

.ui-btn:disabled,
.ui-btn:disabled:hover,
.ui-btn:disabled:active {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
  transform: none;
}

.ui-btn:active {
  transform: translateY(1px);
  box-shadow: 0 5px 10px rgba(7, 92, 239, 0.18);
}

.ui-btn--secondary:active,
.ui-btn--outline:active {
  box-shadow: none;
}

.ui-btn:focus-visible,
.nav-item:focus-visible,
.new-shift-link:focus-visible {
  outline: 3px solid rgba(10, 92, 255, 0.28);
  outline-offset: 3px;
}

.ui-btn svg {
  display: block;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  transition: none;
}

.pir-letter-icon text {
  fill: currentColor;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
}

.ui-btn--plus::before,
.ui-btn--plus::after,
.ui-btn--chevron::before,
.ui-btn--chevron::after {
  content: "";
  flex: 0 0 15px;
  background: currentColor;
}

.ui-btn--plus::before,
.ui-btn--plus::after {
  width: 15px;
  height: 15px;
  -webkit-mask:
    linear-gradient(#000 0 0) center / 15px 2px no-repeat,
    linear-gradient(#000 0 0) center / 2px 15px no-repeat;
  mask:
    linear-gradient(#000 0 0) center / 15px 2px no-repeat,
    linear-gradient(#000 0 0) center / 2px 15px no-repeat;
}

.ui-btn--icon-right.ui-btn--plus::before,
.ui-btn--icon-left.ui-btn--plus::after {
  display: none;
}

.ui-btn--chevron::before,
.ui-btn--chevron::after {
  width: 13px;
  height: 13px;
  -webkit-mask: linear-gradient(#000 0 0) center / 100% 100% no-repeat;
  mask: linear-gradient(#000 0 0) center / 100% 100% no-repeat;
  clip-path: polygon(35% 15%, 75% 50%, 35% 85%, 25% 73%, 52% 50%, 25% 27%);
}

.ui-btn--icon-right.ui-btn--chevron::before,
.ui-btn--icon-left.ui-btn--chevron::after {
  display: none;
}

.stats-panel {
  margin-bottom: 8px;
}

.stats-panel-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 5px;
}

.stats-toggle {
  min-width: 0;
}

.stats-toggle-icon {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-135deg) translateY(-1px);
}

.stats-panel.is-collapsed .stats-toggle-icon {
  transform: rotate(45deg) translateY(-2px);
}

.stats-grid {
  display: grid;
  grid-template-columns: max-content repeat(4, minmax(150px, 1fr)) max-content;
  gap: 6px;
  margin-bottom: 8px;
}

.stats-panel .stats-grid {
  margin-bottom: 0;
}

.stats-panel.is-collapsed .stats-grid,
[data-stats-grid][hidden] {
  display: none;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  border-radius: 999px;
}

.stat-icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 1;
}

.stat-icon.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.stat-icon.green {
  color: var(--green);
  background: var(--green-soft);
}

.stat-icon.red {
  color: var(--green);
  background: var(--red-soft);
}

.stat-icon.yellow {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.stat-icon.gray {
  color: #334155;
  background: var(--gray-soft);
}

.stat-card p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.stat-card strong {
  display: block;
  color: #05070d;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.ui-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.ui-panel-head {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
}

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

.base-panel {
  min-width: 0;
}

.base-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.base-form--position {
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.7fr) auto;
}

.base-list {
  display: grid;
  gap: 0;
}

.base-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

.base-row:last-child {
  border-bottom: 0;
}

.base-row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.base-row-main strong,
.base-row-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.base-row-main strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.base-row-main span,
.base-empty {
  color: var(--muted);
  font-size: 12px;
}

.base-empty {
  padding: 12px 8px;
}

.base-delete-button {
  padding: 0;
  color: var(--red);
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-height: 220px;
  padding: 38px 14px;
  text-align: center;
}

.empty-state--inset {
  min-height: 180px;
  border: 0;
  border-radius: 0;
}

.empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
}

.empty-state__icon svg {
  width: 34px;
  height: 34px;
}

.empty-state h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.empty-state p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.event-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.93fr) 28px;
  gap: 6px;
  padding: 7px;
}

.event-form-grid > .event-section:nth-child(2) {
  grid-column: 2 / 4;
}

.event-form-inline-panel {
  margin-top: 8px;
}

.event-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  align-items: start;
  gap: 5px 6px;
  min-width: 0;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
}

.event-section--inline {
  gap: 5px 6px;
}

.event-section--inline .ui-field--row {
  grid-template-columns: 96px minmax(0, 1fr);
}

.event-section--inline .ui-field--row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-fields-row-desktop .ui-field {
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.ui-fields-row-desktop .ui-field > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-section legend {
  padding: 0 4px;
  font-size: 14px;
  font-weight: 800;
  min-height: 18px;
}

.detection-section--split {
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
}

.detection-section--split legend {
  grid-column: 1 / -1;
}

.detection-main-fields,
.detection-side-fields {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.event-repeat-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  margin-bottom: 3px;
}

.event-repeat-row {
  align-items: end;
}

.event-repeat-add {
  width: 100%;
  justify-self: stretch;
}

.event-repeat-delete {
  align-self: end;
  padding: 0;
  color: var(--red);
  cursor: pointer;
}

.event-repeat-list.is-single-row .event-repeat-delete {
  display: none;
}

.detection-main-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 5px;
  row-gap: 8px;
}

.event-labeled-field {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

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

.event-labeled-field > span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-field-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 5px;
  min-width: 0;
}

.event-copy-detection-button {
  padding: 0;
  cursor: pointer;
}

.event-copy-detection-button:disabled,
.event-copy-detection-button:disabled:hover,
.event-copy-detection-button:disabled:active {
  border-color: var(--border);
  background: #f8fafc;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.detection-section legend {
  color: var(--blue);
}

.strike-section legend {
  color: var(--red);
}

.strike-section > legend {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.strike-section--multi {
  align-content: start;
}

.strike-entry-list {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
  min-width: 0;
}

.strike-entry {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--red-soft);
  border-radius: 6px;
  background: #fffafa;
}

.strike-entry legend {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  color: var(--red);
}

.strike-entry-delete {
  margin-left: auto;
}

.strike-section.is-single-strike .strike-entry-delete {
  display: none;
}

.strike-entry-grid {
  display: grid;
  gap: 5px 6px;
  min-width: 0;
}

.strike-entry-add-field {
  grid-column: 1 / -1;
}

.strike-section.is-disabled {
  position: relative;
}

.strike-section:not(.is-disabled) .no-strike-overlay {
  display: none;
}

.strike-section.is-disabled > label,
.strike-section.is-disabled > .event-input,
.strike-section.is-disabled > .event-inline-inputs,
.strike-section.is-disabled > .ui-tabs,
.strike-section.is-disabled > .event-zone-description-row,
.strike-section.is-disabled > .detection-main-fields,
.strike-section.is-disabled > .detection-side-fields,
.strike-section.is-disabled > .strike-entry-list,
.strike-section.is-disabled > .strike-entry-add-field {
  opacity: 0.15;
}

.no-strike-overlay {
  position: absolute;
  inset: 0 5px 6px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
}

.no-strike-overlay-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 6px;
  width: min(100%, 318px);
}

.no-strike-overlay-form--single {
  grid-template-columns: 1fr;
  width: min(100%, 420px);
}

.event-input,
.event-inline-inputs input {
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
  color: #020617;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: var(--control-inner-height);
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.event-input--textarea {
  height: auto;
  min-height: 72px;
  padding: 7px 8px;
  line-height: 1.35;
  overflow: auto;
  resize: vertical;
  white-space: normal;
}

.event-input::placeholder,
.event-inline-inputs input::placeholder {
  color: #64748b;
  opacity: 1;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value,
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-inline-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.event-inline-inputs--amount-type {
  grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
}

.event-inline-inputs--main-side {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.event-inline-inputs--crew-unit-zone {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detection-side-fields .event-inline-inputs--amount-type {
  grid-template-columns: minmax(54px, 58px) minmax(0, 1fr) 28px;
}

.detection-side-fields .event-repeat-list.is-single-row .event-inline-inputs--amount-type {
  grid-template-columns: minmax(54px, 58px) minmax(0, 1fr);
}

.detection-side-fields .event-repeat-row--detection-target.event-inline-inputs--amount-type {
  grid-template-columns: minmax(0, 1fr) minmax(54px, 58px) 28px;
}

.detection-side-fields .event-repeat-list.is-single-row .event-repeat-row--detection-target.event-inline-inputs--amount-type {
  grid-template-columns: minmax(0, 1fr) minmax(54px, 58px);
}

.detection-side-fields .event-repeat-row--strike-result.event-inline-inputs--amount-type,
.detection-side-fields .event-repeat-list.is-single-row .event-repeat-row--strike-result.event-inline-inputs--amount-type {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.event-zone-description-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  grid-column: 1 / -1;
  gap: 6px;
  min-width: 0;
}

.event-zone-description-row > .ui-field--wide {
  grid-column: auto;
}

.event-input:not(:disabled):not([readonly]):hover,
.event-inline-inputs input:not(:disabled):not([readonly]):hover {
  border-color: var(--control-hover-border);
  background: var(--control-hover-bg);
  box-shadow: var(--control-hover-shadow);
}

.event-input:not(:disabled):not([readonly]):focus,
.event-inline-inputs input:not(:disabled):not([readonly]):focus {
  border-color: var(--control-hover-border);
  background: var(--control-focus-bg);
  box-shadow: var(--control-focus-shadow);
}

.event-input:is(:disabled, [readonly]),
.event-inline-inputs input:is(:disabled, [readonly]) {
  border-color: var(--border);
  background: #f8fafc;
  color: #334155;
  box-shadow: none;
}

.event-input.is-error,
.event-labeled-field.is-error .event-input,
.event-inline-inputs.is-error input,
.event-inline-inputs input.is-error {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(239, 36, 40, 0.12);
}

.event-input.is-error:not(:disabled):not([readonly]):hover,
.event-input.is-error:not(:disabled):not([readonly]):focus,
.event-labeled-field.is-error .event-input:not(:disabled):not([readonly]):hover,
.event-labeled-field.is-error .event-input:not(:disabled):not([readonly]):focus,
.event-inline-inputs.is-error input:not(:disabled):not([readonly]):hover,
.event-inline-inputs.is-error input:not(:disabled):not([readonly]):focus,
.event-inline-inputs input.is-error:not(:disabled):not([readonly]):hover,
.event-inline-inputs input.is-error:not(:disabled):not([readonly]):focus {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(239, 36, 40, 0.12);
}

.event-labeled-field.is-error > span {
  color: var(--red);
}

.ui-custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.ui-custom-select-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  gap: 8px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
  color: #020617;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: var(--control-inner-height);
  outline: none;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.ui-custom-select-label {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-custom-select.has-value .ui-custom-select-label {
  color: #020617;
}

.ui-custom-select-chevron {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: #334155;
  transform: rotate(45deg) translateY(-2px);
}

.ui-custom-select-control:not(:disabled):hover,
.ui-custom-select.is-open .ui-custom-select-control {
  border-color: var(--control-hover-border);
  background: var(--control-hover-bg);
  box-shadow: var(--control-hover-shadow);
}

.ui-custom-select-control:not(:disabled):focus {
  border-color: var(--control-hover-border);
  background: var(--control-focus-bg);
  box-shadow: var(--control-focus-shadow);
}

.ui-custom-select.is-error .ui-custom-select-control,
.ui-custom-select.is-error .ui-custom-select-control:not(:disabled):hover,
.ui-custom-select.is-error .ui-custom-select-control:not(:disabled):focus {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(239, 36, 40, 0.16);
}

.ui-custom-select.is-disabled .ui-custom-select-control,
.ui-custom-select.is-readonly .ui-custom-select-control {
  border-color: var(--border);
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.ui-custom-select.is-disabled .ui-custom-select-label,
.ui-custom-select.is-readonly .ui-custom-select-label {
  color: #94a3b8;
}

.ui-custom-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  display: grid;
  width: max-content;
  min-width: 100%;
  max-width: min(360px, calc(100vw - 24px));
  max-height: 210px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  overflow-x: hidden;
  overflow-y: auto;
}

.ui-custom-select-menu[hidden] {
  display: none;
}

.ui-custom-select-option {
  display: block;
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 7px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.ui-custom-select-option:hover,
.ui-custom-select-option:focus {
  background: var(--control-hover-bg);
  color: var(--blue);
  outline: none;
}

.ui-custom-select-option.is-selected {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.ui-custom-select-option--check {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.ui-custom-select-option--check > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-custom-select-check {
  position: relative;
  width: 13px;
  height: 13px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #ffffff;
}

.ui-custom-select-option--check.is-selected {
  background: #ffffff;
  color: var(--text);
  font-weight: 400;
}

.ui-custom-select-option--check.is-selected:hover,
.ui-custom-select-option--check.is-selected:focus {
  background: var(--control-hover-bg);
  color: var(--blue);
}

.ui-custom-select-option--check.is-selected .ui-custom-select-check {
  border-color: var(--blue);
  background: var(--blue);
}

.ui-custom-select-option--check.is-selected .ui-custom-select-check::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 4px;
  height: 7px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg);
}

.ui-custom-number {
  width: 100%;
  min-width: 0;
}

.ui-custom-number-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
  color: #020617;
  overflow: hidden;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.ui-custom-number-input,
.event-inline-inputs .ui-custom-number-input {
  width: 100%;
  min-width: 0;
  height: calc(var(--control-height) - 2px);
  padding: 0 6px 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #020617;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: var(--control-inner-height);
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none;
}

.ui-custom-number-input::placeholder {
  color: #64748b;
  opacity: 1;
}

.event-inline-inputs .ui-custom-number-input:not(:disabled):not([readonly]):hover,
.event-inline-inputs .ui-custom-number-input:not(:disabled):not([readonly]):focus,
.event-inline-inputs .ui-custom-number-input:is(:disabled, [readonly]) {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ui-custom-number-stepper {
  display: grid;
  grid-template-rows: repeat(2, 1fr);
  width: 18px;
  height: 100%;
}

.ui-custom-number-step {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #334155;
  cursor: pointer;
}

.ui-custom-number-step::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
}

.ui-custom-number-step[data-step="up"]::before {
  transform: rotate(225deg) translate(-1px, -1px);
}

.ui-custom-number-step[data-step="down"]::before {
  transform: rotate(45deg) translate(-1px, -1px);
}

.ui-custom-number-control:hover,
.ui-custom-number:focus-within .ui-custom-number-control {
  border-color: var(--control-hover-border);
  background: var(--control-hover-bg);
  box-shadow: var(--control-hover-shadow);
}

.ui-custom-number-step:not(:disabled):hover {
  color: var(--blue);
}

.ui-custom-number.is-error .ui-custom-number-control,
.ui-custom-number.is-error .ui-custom-number-control:hover,
.ui-custom-number.is-error:focus-within .ui-custom-number-control {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(239, 36, 40, 0.16);
}

.ui-custom-number.is-disabled .ui-custom-number-control,
.ui-custom-number.is-readonly .ui-custom-number-control {
  border-color: var(--border);
  background: #f8fafc;
  color: #94a3b8;
  box-shadow: none;
}

.ui-custom-number.is-disabled .ui-custom-number-input,
.ui-custom-number.is-readonly .ui-custom-number-input {
  color: #94a3b8;
  cursor: not-allowed;
}

.ui-custom-number.is-disabled .ui-custom-number-step,
.ui-custom-number.is-readonly .ui-custom-number-step {
  color: #94a3b8;
  cursor: not-allowed;
}

.ui-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ui-field--strong {
  gap: 4px;
}

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

.ui-field--row {
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.ui-field span,
.ui-check span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ui-field input,
.ui-field select,
.ui-field textarea,
.ui-control {
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
  color: #020617;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: var(--control-inner-height);
}

.ui-field input,
.ui-field select,
.ui-control {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-field input:not(:disabled):not([readonly]):hover,
.ui-field select:not(:disabled):hover,
.ui-field textarea:not(:disabled):not([readonly]):hover,
.ui-control:not(:disabled):not([readonly]):hover {
  border-color: var(--control-hover-border);
  background: var(--control-hover-bg);
  box-shadow: var(--control-hover-shadow);
}

.ui-field input:not(:disabled):not([readonly]):focus,
.ui-field select:not(:disabled):focus,
.ui-field textarea:not(:disabled):not([readonly]):focus,
.ui-control:not(:disabled):not([readonly]):focus {
  border-color: var(--control-hover-border);
  background: var(--control-focus-bg);
  box-shadow: var(--control-focus-shadow);
}

.ui-field.is-error > span {
  color: var(--red);
}

.ui-field.is-error input,
.ui-field.is-error select,
.ui-field.is-error textarea,
.ui-control.is-error {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(239, 36, 40, 0.12);
}

.ui-field.is-error input:not(:disabled):not([readonly]):hover,
.ui-field.is-error select:not(:disabled):hover,
.ui-field.is-error textarea:not(:disabled):not([readonly]):hover,
.ui-control.is-error:not(:disabled):not([readonly]):hover,
.ui-field.is-error input:not(:disabled):not([readonly]):focus,
.ui-field.is-error select:not(:disabled):focus,
.ui-field.is-error textarea:not(:disabled):not([readonly]):focus,
.ui-control.is-error:not(:disabled):not([readonly]):focus {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(239, 36, 40, 0.16);
}

.ui-field-error {
  display: block;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.ui-field-error[hidden] {
  display: none;
}

.ui-field--row .ui-field-error {
  grid-column: 2;
}

.ui-field textarea {
  height: auto;
  min-height: 64px;
  padding: 8px 10px;
  line-height: 1.35;
  resize: vertical;
}

.ui-field select {
  cursor: pointer;
}

.ui-check {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: var(--control-height);
  grid-column: 1 / -1;
  cursor: pointer;
}

.ui-check input {
  width: 17px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.ui-check:has(input:disabled) {
  cursor: not-allowed;
}

.ui-check input:disabled {
  cursor: not-allowed;
}

.ui-check--legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  color: var(--red);
  font: inherit;
}

.ui-check--legend span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.ui-check--zone {
  grid-column: auto;
  justify-content: flex-start;
  min-width: 0;
  height: var(--control-height);
  min-height: var(--control-height);
  padding: 0;
  border: 0;
  background: transparent;
  color: #020617;
  font-size: 13px;
}

.ui-check--zone span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-check--zone input[type="hidden"] {
  display: none;
}

.ui-field :disabled,
.ui-inline-field :disabled {
  border-color: var(--border);
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.is-disabled .ui-field span {
  color: #94a3b8;
}

.event-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 8px 8px;
}

.event-details .event-form-actions {
  justify-content: space-between;
}

.event-actions-right {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.event-list-panel {
  margin-top: 8px;
}

.misc-event-form {
  margin-top: 8px;
}

.misc-event-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
}

.misc-event-list {
  margin-top: 8px;
}

.misc-event-table {
  display: grid;
  grid-template-columns: max-content max-content max-content max-content max-content minmax(180px, 1fr);
}

.misc-event-row {
  color: var(--text);
  font-size: 12px;
  display: contents;
}

.misc-event-row--editable {
  cursor: pointer;
}

.misc-event-row--editable:hover > *,
.misc-event-row--editable.is-open > *,
.misc-event-row--editable:focus-visible > * {
  background: #f9fbff;
}

.misc-event-row--editable:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.misc-event-row--head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.misc-event-row--head > * {
  min-height: 30px;
  background: #f8fafc;
}

.misc-event-row strong,
.misc-event-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.misc-event-row > * {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

.misc-event-row .misc-event-description {
  align-items: center;
  overflow: visible;
  text-overflow: clip;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.misc-event-edit {
  grid-column: 1 / -1;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.misc-event-edit .event-form-actions {
  justify-content: space-between;
  padding: 0;
}

.misc-event-edit[hidden] {
  display: none;
}

.misc-event-empty {
  grid-column: 1 / -1;
  padding: 14px 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.event-create-panel[hidden] {
  display: none;
}

.event-filter-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  min-height: 36px;
  margin-bottom: 8px;
  padding: 5px 8px;
}

.event-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.event-filter-group > strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.event-filter-checkbox {
  width: 17px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.event-filter-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.event-list {
  display: grid;
  gap: 5px;
  padding: 6px 8px 8px;
}

.event-row {
  display: grid;
  z-index: 6;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.93fr) 28px;
  gap: 5px;
  padding: 5px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.event-row:hover {
  background: #f1f6ff;
  box-shadow: var(--control-hover-shadow);
}

.event-row--readonly {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.93fr) 28px;
}

.event-row--own-zone {
  background: var(--green-soft);
  border-color: var(--green-border);
}

.event-row--not-own-zone {
  background: var(--orange-soft);
  border-color: var(--orange-border);
}

.event-row--own-zone:hover,
.event-row--own-zone.is-open {
  border-color: var(--green-border);
  background: var(--green-hover);
  box-shadow: var(--control-hover-shadow);
}

.event-row--not-own-zone:hover,
.event-row--not-own-zone.is-open {
  border-color: var(--orange-border);
  background: var(--orange-hover);
  box-shadow: var(--control-hover-shadow);
}

.event-row:hover .event-row-block--no-strike,
.event-row.is-open .event-row-block--no-strike {
  background:
    repeating-linear-gradient(
      135deg,
      #e2e8f0 0,
      #e2e8f0 9px,
      #f1f5f9 9px,
      #f1f5f9 18px
    );
}

.event-details {
  overflow: hidden;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  margin-top: -14px;
  padding-top: 14px;
}

.event-strike-stack {
  display: grid;
  grid-column: 2 / 4;
  gap: 6px;
  min-width: 0;
}

.event-details--edit {
  position: relative;
  overflow: visible;
}

.event-details--strike {
  border-color: #c8d8ff;
  background: #fbfdff;
}

.event-details--no-strike {
  border-color: #dfe5ee;
  background: #fbfcfe;
}

.event-details--view {
  background: #ffffff;
}

.event-details--own-zone {
  border-color: var(--green-border);
  background: #fbfffc;
}

.event-details--not-own-zone {
  border-color: var(--orange-border);
  background: var(--orange-soft);
}

.event-details--own-zone.is-open {
  background: var(--green-soft);
}

.event-details--not-own-zone.is-open {
  background: var(--orange-soft);
}

.event-read-section h3 {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.event-read-section.detection-section h3 {
  color: var(--blue);
}

.event-read-section.strike-section h3 {
  color: var(--red);
}

.event-read-section.no-strike-section h3 {
  color: #475569;
}

.event-read-field {
  display: grid;
  grid-template-columns: minmax(82px, 96px) minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}

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

.event-read-section--empty {
  align-content: center;
}

.no-strike-section--description-only {
  position: relative;
  align-content: center;
  min-height: 128px;
}

.no-strike-detail-overlay {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  min-height: 96px;
}

.no-strike-detail-summary {
  max-width: 86%;
  color: #334155;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.event-read-empty {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  min-height: 108px;
}

.event-read-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: #64748b;
  background: var(--gray-soft);
}

.event-read-empty-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.event-read-field > span {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.event-read-field strong,
.event-read-link {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-read-link {
  color: var(--blue);
}

.event-read-field--multiline strong {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.event-read-section--detection-layout {
  align-content: start;
}

.event-read-cell-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.event-read-cell-pair--amount-type {
  grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
}

.event-read-cell-pair--main-side {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.event-read-cell-group {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.event-read-cell-group--crew-unit-zone {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detection-side-fields .event-read-cell-pair--amount-type {
  grid-template-columns: minmax(0, 1fr) minmax(54px, 58px);
}

.detection-side-fields .event-read-cell-pair--strike-result {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.event-read-cell {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.event-read-cell--wide {
  grid-column: 1 / -1;
}

.event-read-cell > span:first-child {
  overflow: hidden;
  color: var(--muted);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-read-cell-value,
.event-read-cell .event-read-link {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-read-cell .event-read-link {
  color: var(--blue);
}

.event-read-cell--multiline .event-read-cell-value {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.event-read-zone {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
}

.event-read-zone-icon {
  display: inline-block;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  background: currentColor;
}

.event-read-zone-icon--detection-own {
  color: var(--green);
  -webkit-mask: url("/icons/detected-own-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/detected-own-zone.svg") center / 100% 100% no-repeat;
}

.event-read-zone-icon--detection-not-own {
  color: var(--yellow);
  -webkit-mask: url("/icons/detected-other-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/detected-other-zone.svg") center / 100% 100% no-repeat;
}

.event-read-zone-icon--strike-own {
  color: var(--green);
  -webkit-mask: url("/icons/strike-own-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/strike-own-zone.svg") center / 100% 100% no-repeat;
}

.event-read-zone-icon--strike-not-own {
  color: var(--yellow);
  -webkit-mask: url("/icons/strike-other-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/strike-other-zone.svg") center / 100% 100% no-repeat;
}

.event-read-actions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 0 8px 8px;
}

.no-strike-section legend {
  color: #475569;
}

.event-row-block {
  display: grid;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  gap: 6px;
  padding: 4px 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.event-row-block--detection {
  grid-template-columns: minmax(0, 1fr) 28px 28px;
}

.event-detection-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.event-detection-flow__item {
  min-width: 0;
}

.event-detection-flow__item--time {
  flex: 0 0 62px;
}

.event-detection-flow__item--landmark {
  flex: 0 1 126px;
}

.event-detection-flow__item--summary {
  flex: 1 1 210px;
}

.event-row-block--strike {
  position: relative;
  overflow: hidden;
  grid-template-columns: 30px minmax(0, 1fr) minmax(54px, max-content) 28px 28px;
  min-height: 34px;
  gap: 5px;
  padding-top: 3px;
  padding-right: 5px;
  padding-bottom: 3px;
  border: 2px solid var(--border);
  border-radius: 5px;
  background: #ffffff;
}

.event-strike-list {
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 4px;
  min-width: 0;
}

.event-row-block--strike-own-zone {
  border-color: var(--green-border);
  background: var(--green-soft);
}

.event-row-block--strike-not-own-zone {
  border-color: var(--orange-border);
  background: var(--orange-soft);
}

.strike-hit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  border-radius: 999px;
  color: var(--red);
  background: var(--gray-soft);
}

.strike-hit-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.strike-hit-icon--skull svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.75;
}

.strike-hit-icon--skull .skull-fill {
  fill: currentColor;
  stroke: none;
}

.strike-hit-icon--skull {
  color: #ffffff;
  background: var(--red);
}

.event-row-block--no-strike {
  display: grid;
  align-items: center;
  grid-template-columns: 30px minmax(0, 1fr) 28px;
  min-height: 34px;
  gap: 5px;
  padding-top: 3px;
  padding-right: 5px;
  padding-bottom: 3px;
  border: 2px solid var(--no-strike-border);
  border-radius: 5px;
  background:
    repeating-linear-gradient(
      135deg,
      #e2e8f0 0,
      #e2e8f0 9px,
      #f1f5f9 9px,
      #f1f5f9 18px
    );
}

.no-strike-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 999px;
  color: var(--no-strike);
  background: #f8fafc;
}

.no-strike-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.no-strike-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.no-strike-copy strong {
  min-width: 0;
  color: #334155;
  font-size: 15px;
  font-weight: 800;
  white-space: normal;
}

.no-strike-copy span {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.no-strike-results {
  width: auto;
  max-width: 100%;
  justify-content: flex-start;
  flex: 0 1 auto;
}

.no-strike-results .event-strike-result strong,
.no-strike-results .event-amount-prefix,
.no-strike-detail-targets .event-read-cell-value {
  color: #64748b;
}

.event-cell {
  display: grid;
  min-width: 0;
  gap: 2px;
  line-height: 1.15;
}

.event-cell strong,
.event-type {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-amount-prefix {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.event-amount-separator {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.event-row-block--strike .event-cell strong {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.event-row-block--strike .event-cell strong > span {
  min-width: 0;
  overflow: hidden;
  color: #53627a;
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-cell span:not(.status-pill):not(.event-zone-icon):not(.event-type):not(.event-strike-status):not(.event-strike-amount):not(.event-strike-result-separator):not(.event-unit-badge):not(.event-amount-separator) {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #53627a;
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-strike-status,
.event-strike-amount {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-strike-results {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.event-strike-result {
  display: grid;
  justify-items: center;
  align-content: center;
  flex: 0 1 auto;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  text-align: center;
}

.event-row-block--strike .event-strike-results .event-strike-result-separator {
  flex: 0 0 auto;
  align-self: center;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  font-family: Arial, sans-serif;
  line-height: 1;
  transform: translateY(2px);
}

.event-row-block--strike .event-strike-result strong,
.event-strike-result .event-strike-status {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-strike-result .event-strike-status {
  margin-top: 1px;
}

.coordinate-copy {
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: copy;
}

.copyable-text {
  text-decoration: none;
  cursor: copy;
}

.event-cell--zone {
  justify-items: start;
}

.event-zone-icon {
  display: block;
  width: 32px;
  height: 32px;
  background: currentColor;
}

.event-zone-icon--own {
  color: var(--green);
  -webkit-mask: url("/icons/detected-own-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/detected-own-zone.svg") center / 100% 100% no-repeat;
}

.event-zone-icon--not-own {
  color: var(--yellow);
  -webkit-mask: url("/icons/detected-other-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/detected-other-zone.svg") center / 100% 100% no-repeat;
}

.event-row-block--strike .event-zone-icon--own {
  -webkit-mask: url("/icons/strike-own-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/strike-own-zone.svg") center / 100% 100% no-repeat;
}

.event-row-block--strike .event-zone-icon--not-own {
  -webkit-mask: url("/icons/strike-other-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/strike-other-zone.svg") center / 100% 100% no-repeat;
}

.event-cell--status {
  justify-items: start;
}

.event-row-block--strike .event-cell--status {
  justify-items: end;
  width: 100%;
  min-width: 0;
  text-align: center;
}

.event-cell--strike-unit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  min-width: 0;
}

.event-row-block--detection .event-unit-badge {
  justify-self: start;
}

.event-unit-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  height: 22px;
  padding: 0 7px;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-unit-badge--own {
  color: var(--green-border);
  background: var(--green-soft);
}

.event-unit-badge--my-unit {
  border-width: 2px;
  color: var(--green-border);
  background: var(--green-hover);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.14);
}

.event-unit-badge--adjacent {
  color: var(--orange);
  background: var(--orange-soft);
}

.event-stream-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--blue);
  background: #ffffff;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.event-edit-button {
  align-self: center;
  justify-self: end;
  padding: 0;
  cursor: pointer;
}

.event-stream-link:hover {
  border-color: var(--control-hover-border);
  background: var(--control-hover-bg);
  box-shadow: var(--control-hover-shadow);
}

.event-stream-link--empty,
.event-stream-link--empty:hover,
.event-stream-link--empty:active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  cursor: default;
  transform: none;
}

.event-stream-link:active {
  transform: translateY(1px);
}

.event-edit-button--disabled,
.event-edit-button--disabled:hover,
.event-edit-button--disabled:active {
  color: var(--muted);
  border-color: var(--border);
  background: #f6f8fb;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.event-coordinate-button {
  padding: 0;
  cursor: copy;
}

.event-stream-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.ui-kit-section {
  margin-bottom: 8px;
}

.ui-kit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
}

.ui-kit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
}

.ui-kit-control-row {
  padding: 8px;
  margin-bottom: 0;
}

.icon-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 6px;
  padding: 8px;
}

.icon-sample {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 58px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
}

.icon-sample__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 999px;
}

.icon-sample__glyph svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.icon-sample--own .icon-sample__glyph {
  color: var(--green);
  background: var(--green-soft);
}

.icon-sample--other .icon-sample__glyph {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.icon-sample strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.icon-sample span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.journal-topbar {
  margin-bottom: 8px;
}

.ui-control-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 140px;
  gap: 6px;
  width: 100%;
  margin-bottom: 8px;
}

.ui-inline-field {
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--control-height);
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.ui-inline-field:hover {
  border-color: var(--control-hover-border);
  background: var(--control-hover-bg);
  box-shadow: var(--control-hover-shadow);
}

.ui-inline-field:focus-within {
  border-color: var(--control-hover-border);
  background: var(--control-focus-bg);
  box-shadow: var(--control-focus-shadow);
}

.ui-inline-field.is-error:not(.is-disabled):not(.is-readonly) {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(239, 36, 40, 0.12);
}

.ui-inline-field.is-error:not(.is-disabled):not(.is-readonly):hover,
.ui-inline-field.is-error:not(.is-disabled):not(.is-readonly):focus-within {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(239, 36, 40, 0.16);
}

.ui-inline-field.is-error > span {
  color: var(--red);
}

.ui-inline-field.is-disabled,
.ui-inline-field.is-readonly,
.ui-inline-field.is-disabled:hover,
.ui-inline-field.is-readonly:hover,
.ui-inline-field.is-disabled:focus-within,
.ui-inline-field.is-readonly:focus-within {
  border-color: var(--border);
  background: #f8fafc;
  box-shadow: none;
  cursor: default;
}

.ui-inline-field.is-disabled > span,
.ui-inline-field.is-disabled input {
  color: #94a3b8;
}

.ui-inline-field > span {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ui-inline-field > span::after {
  content: ":";
}

.ui-inline-field input {
  width: 100%;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #020617;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 28px;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.ui-inline-field--value-left input {
  text-align: left;
}

.ui-inline-field--value-right input {
  text-align: right;
  text-align-last: right;
}

.ui-inline-field--value-right input[type="date"]::-webkit-date-and-time-value,
.ui-inline-field--value-right input[type="time"]::-webkit-date-and-time-value {
  width: 100%;
  text-align: right;
}

.ui-inline-field--value-right input[type="date"]::-webkit-datetime-edit,
.ui-inline-field--value-right input[type="time"]::-webkit-datetime-edit {
  margin-left: auto;
}

.ui-inline-field input:focus {
  box-shadow: none;
}

.zone-map-field {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  color: var(--text);
  cursor: pointer;
}

.zone-map-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.zone-map-field__map {
  position: relative;
  width: 100%;
  height: var(--control-height);
  flex: 1 1 auto;
  border: 1px solid #d8e0ec;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(34, 197, 94, 0.12) 0 50%, rgba(245, 158, 11, 0.13) 50% 100%),
    repeating-linear-gradient(90deg, transparent 0 13px, rgba(148, 163, 184, 0.22) 13px 14px);
}

.zone-map-field__pin {
  position: absolute;
  top: 2px;
  left: 5%;
  width: 40%;
  height: 24px;
  border: 2px solid var(--green);
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.22);
  transition:
    background-color 160ms ease,
    left 160ms ease;
}

.zone-map-field__label {
  position: absolute;
  z-index: 1;
  color: #334155;
  font-weight: 500;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  width: 40%;
  top: 10px;
  font-size: 10px;
  text-align: center;
}


.zone-map-field__label--own {
  left: 5%;
  color: var(--green);
}

.zone-map-field__label--other {
  right: 5%;
  color: var(--orange-border);
}

.zone-map-field__state {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.zone-map-field__state--other,
.zone-map-field input:not(:checked) ~ .zone-map-field__state--own {
  display: none;
}

.zone-map-field input:not(:checked) ~ .zone-map-field__map .zone-map-field__pin {
  border: 2px solid var(--yellow);
  left: 55%;
}

.zone-map-field input:not(:checked) ~ .zone-map-field__state--other {
  display: inline;
}

.ui-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
}

.ui-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 6px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.ui-tab:last-child {
  border-right: 0;
}

.ui-tab:hover {
  background: var(--control-hover-bg);
  color: var(--blue);
}

.ui-tab.is-active {
  background: var(--blue-soft);
  color: var(--blue);
}

.ui-tab-icon {
  display: block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  background: currentColor;
  color: currentColor;
}

.ui-tab-icon--own {
  color: var(--green);
  -webkit-mask: url("/icons/detected-own-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/detected-own-zone.svg") center / 100% 100% no-repeat;
  width: 30px;
  height: 30px;
  min-width: 30px;
  max-width: 30px;
  min-height: 30px;
  max-height: 30px;
  flex: 0 0 30px;
}

.ui-tab-icon--not-own {
  color: var(--yellow);
  -webkit-mask: url("/icons/detected-other-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/detected-other-zone.svg") center / 100% 100% no-repeat;
  width: 30px;
  height: 30px;
  min-width: 30px;
  max-width: 30px;
  min-height: 30px;
  max-height: 30px;
  flex: 0 0 30px;
}

.ui-tab-icon--detection-own {
  color: var(--green);
  -webkit-mask: url("/icons/detected-own-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/detected-own-zone.svg") center / 100% 100% no-repeat;
  width: 30px;
  height: 30px;
  min-width: 30px;
  max-width: 30px;
  min-height: 30px;
  max-height: 30px;
  flex: 0 0 30px;
}

.ui-tab-icon--detection-not-own {
  color: var(--yellow);
  -webkit-mask: url("/icons/detected-other-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/detected-other-zone.svg") center / 100% 100% no-repeat;
  width: 30px;
  height: 30px;
  min-width: 30px;
  max-width: 30px;
  min-height: 30px;
  max-height: 30px;
  flex: 0 0 30px;
}

.ui-tab-icon--strike-own {
  color: var(--green);
  -webkit-mask: url("/icons/strike-own-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/strike-own-zone.svg") center / 100% 100% no-repeat;
  width: 30px;
  height: 30px;
  min-width: 30px;
  max-width: 30px;
  min-height: 30px;
  max-height: 30px;
  flex: 0 0 30px;
}

.ui-tab-icon--strike-not-own {
  color: var(--yellow);
  -webkit-mask: url("/icons/strike-other-zone.svg") center / 100% 100% no-repeat;
  mask: url("/icons/strike-other-zone.svg") center / 100% 100% no-repeat;
  width: 30px;
  height: 30px;
  min-width: 30px;
  max-width: 30px;
  min-height: 30px;
  max-height: 30px;
  flex: 0 0 30px;
}

.ui-tabs.is-disabled,
.ui-tabs:has(.ui-tab:disabled) {
  background: #f8fafc;
}

.ui-tab:disabled,
.ui-tab:disabled:hover,
.ui-tabs.is-disabled .ui-tab,
.ui-tabs.is-disabled .ui-tab:hover {
  background: transparent;
  color: #94a3b8;
  cursor: not-allowed;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(247, 249, 252, 0.76);
  backdrop-filter: blur(2px);
}

.modal-backdrop[hidden] {
  display: none;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 12px;
  background: var(--bg);
}

.modal-card {
  overflow: hidden;
  width: min(430px, 100%);
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.16);
}

.modal-card--confirm {
  width: min(360px, 100%);
}

.modal-card--quick-detection {
  width: min(430px, 100%);
}

.modal-content {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.modal-title {
  margin: 0 0 2px;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.modal-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.modal-info-list {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.modal-info-list strong {
  color: var(--text);
  font-weight: 800;
}

.quick-detection-datetime {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.quick-detection-stream-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: end;
  gap: 6px;
}

.quick-detection-zone-field {
  min-width: 116px;
}

.ui-field--strong span {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.ui-field--readonly {
  pointer-events: none;
}

.ui-control[readonly] {
  color: #334155;
  background: #f8fafc;
}

.save-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 7px 8px;
  border: 1px solid #cfe0ff;
  border-radius: 6px;
  background: #f8fbff;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 2px solid var(--blue);
  border-radius: 999px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.save-preview p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.save-preview strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.login-card {
  width: min(340px, 100%);
}

.login-error {
  margin: 0;
  padding: 7px 8px;
  border: 1px solid var(--red);
  border-radius: 5px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.modal-actions--center {
  justify-content: center;
}

.sync-toast-stack {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 70;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: min(320px, calc(100vw - 24px));
  pointer-events: none;
}

.sync-toast {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  color: var(--text);
  pointer-events: auto;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.sync-toast.is-removing {
  opacity: 0;
  transform: translateX(12px);
}

.sync-toast.is-success {
  border-color: var(--green-border);
  background: var(--green-soft);
}

.sync-toast.is-failed {
  border-color: #f2b4b6;
  background: var(--red-soft);
}

.sync-toast__marker {
  width: 18px;
  height: 18px;
  border: 2px solid var(--blue);
  border-top-color: transparent;
  border-radius: 999px;
  animation: sync-toast-spin 900ms linear infinite;
}

.sync-toast.is-success .sync-toast__marker,
.sync-toast.is-failed .sync-toast__marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  animation: none;
}

.sync-toast.is-success .sync-toast__marker::before {
  content: "";
  width: 11px;
  height: 6px;
  border: solid var(--green-border);
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

.sync-toast.is-failed .sync-toast__marker::before {
  content: "!";
  color: var(--red);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.sync-toast__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sync-toast__body strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-toast__body span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-toast__retry {
  height: 28px;
  padding: 0 9px;
  border: 1px solid #f2b4b6;
  border-radius: 5px;
  background: #ffffff;
  color: var(--red);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.sync-toast__retry:hover,
.sync-toast__retry:focus-visible {
  border-color: var(--red);
  background: #fff7f8;
  box-shadow: 0 7px 14px rgba(239, 36, 40, 0.1);
  outline: none;
}

@keyframes sync-toast-spin {
  to {
    transform: rotate(360deg);
  }
}

.journal-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.journal-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 32px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
}

h2 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.journal-list-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.journal-list-head .stats-toggle span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.journal-list-head-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.shift-list-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.shift-list-period {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.shift-list-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.shift-list-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 999px;
}

.shift-list-stat-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1;
}

.shift-list-stat-icon.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.shift-list-stat-icon.green {
  color: var(--green);
  background: var(--green-soft);
}

.shift-list-stat-icon.red {
  color: var(--green);
  background: var(--red-soft);
}

.shift-list-stat-icon.yellow {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.shift-list-stat-icon.gray {
  color: #334155;
  background: var(--gray-soft);
}

.shift-list-stat strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.journal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  transition: background-color 160ms ease;
}

.journal-row:last-child {
  border-bottom: 0;
}

.journal-row:hover {
  background: #f9fbff;
}

.shift-row[data-shift-url] {
  cursor: pointer;
}

.shift-row[data-shift-url]:focus-visible {
  background: #f9fbff;
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.row-main strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.row-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.shift-row .row-main strong {
  font-size: 15px;
}

.shift-period {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.shift-row-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.shift-row-stats .shift-list-stat {
  min-height: 22px;
}

.shift-row-stats .shift-list-stat-icon {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
}

.shift-row-stats .shift-list-stat-icon svg {
  width: 19px;
  height: 19px;
}

.shift-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.shift-delete-button {
  flex: 0 0 28px;
  padding: 0;
  color: var(--red);
  cursor: pointer;
}

.date-thin.date-thin,
.shift-period .date-thin {
  font-weight: 400;
}

.time-bold.time-bold,
.shift-period .time-bold {
  color: var(--text);
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.success {
  color: #0b7a34;
  background: #e3f6e8;
}

.status-pill.info {
  color: #0758ed;
  background: #e8f0ff;
}

.status-pill.pending {
  color: #b45309;
  background: #fff1dc;
}

.status-pill.neutral {
  color: #475569;
  background: #eef1f5;
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 56px;
  }

  .sidebar {
    padding: 14px 7px 7px;
  }

  .logo {
    margin-bottom: 20px;
    font-size: 15px;
  }

  .nav {
    gap: 10px;
  }

  .nav-item {
    min-height: 44px;
    padding: 8px 4px;
  }

  .nav-item span:last-child,
  .new-shift-link span,
  .logout-button span:last-child {
    display: none;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
  }

  .nav-item.active-shift::after {
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
  }
  
  .new-shift-link {
    min-height: 44px;
    padding: 8px 4px;
  }

  .new-shift-link svg {
    width: 22px;
    height: 22px;
  }

  .base-grid,
  .base-form,
  .base-form--position {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 10px;
  }

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

  .event-form-grid {
    grid-template-columns: 1fr;
  }

  .misc-event-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .misc-event-table {
    grid-template-columns: max-content max-content max-content max-content max-content minmax(160px, 1fr);
  }

  .event-form-grid > .event-section:nth-child(2) {
    grid-column: auto;
  }

  .event-strike-stack {
    grid-column: auto;
  }

  .event-row {
    grid-template-columns: minmax(0, 1fr) 28px;
  }

  .event-row--readonly {
    grid-template-columns: minmax(0, 1fr) 28px;
  }

  .event-row-block--detection {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) 28px 28px;
  }

  .event-row--readonly .event-row-block--detection {
    grid-column: 1 / -1;
  }

  .event-row-block--strike {
    grid-column: 1;
    grid-template-columns: 30px minmax(0, 1fr) minmax(54px, max-content) 28px 28px;
  }

  .event-strike-list {
    grid-column: 1;
  }

  .event-row-block--no-strike {
    grid-column: 1;
    grid-template-columns: 30px minmax(0, 1fr) 28px;
  }

  .event-edit-button {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: end;
  }

  .ui-kit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ui-control-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ui-control-row > .ui-btn {
    grid-column: 1 / -1;
  }

  .topbar {
    align-items: center;
    flex-wrap: wrap;
    height: auto;
  }

  .topbar-actions,
  .shift-meta,
  .shift-summary,
  .shift-title-row,
  h1 {
    height: auto;
  }

  .topbar-actions {
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
  }
  
  .ui-fields-row-desktop .ui-field {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 5px;
  }

  .ui-fields-row-desktop .ui-field > span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

}

@media (max-width: 640px) {
  :root {
    --sidebar-width: 56px;
  }

  .sidebar {
    padding: 14px 7px 7px;
  }

  .logo {
    margin-bottom: 20px;
    font-size: 15px;
  }

  .nav {
    gap: 10px;
  }

  .nav-item {
    min-height: 44px;
    padding: 8px 4px;
  }

  .nav-item span:last-child,
  .new-shift-link span {
    display: none;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
  }

  .nav-item.active-shift::after {
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
  }

  .new-shift-link {
    min-height: 44px;
    padding: 8px 4px;
  }

  .new-shift-link svg {
    width: 22px;
    height: 22px;
  }

  .ui-control-row,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions .ui-btn--plus {
    width: var(--control-height);
    min-width: var(--control-height);
    min-height: var(--control-height);
    padding: 0;
    gap: 0;
  }

  .topbar-actions .ui-btn--plus span {
    display: none;
  }

  .topbar-actions .topbar-report-btn {
    width: var(--control-height);
    min-width: var(--control-height);
    min-height: var(--control-height);
    padding: 0;
    gap: 0;
  }

  .topbar-actions .topbar-report-btn span {
    display: none;
  }

  .event-section {
    grid-template-columns: 1fr;
  }

  .misc-event-form-grid {
    grid-template-columns: 1fr;
  }

  .misc-event-table {
    min-width: 620px;
    overflow-x: auto;
  }

  .detection-section--split {
    grid-template-columns: 1fr;
  }

  .detection-main-grid {
    grid-template-columns: 1fr;
  }

  .event-zone-description-row {
    grid-template-columns: 1fr;
  }

  .event-inline-inputs--crew-unit-zone,
  .event-read-cell-group--crew-unit-zone {
    grid-template-columns: 1fr;
  }

  .event-row {
    padding: 5px 6px;
  }

  .event-row-block,
  .event-row-block--detection {
    gap: 5px 6px;
  }

  .event-row-block--detection {
    grid-template-columns: minmax(0, 1fr) 28px 28px;
    gap: 5px;
  }

  .event-detection-flow {
    gap: 5px;
  }

  .event-detection-flow__item--time {
    flex-basis: 42px;
  }

  .event-detection-flow__item--landmark {
    flex-basis: 86px;
  }

  .event-detection-flow__item--summary {
    flex-basis: 130px;
  }

  .event-row-block--strike {
    grid-template-columns: 30px minmax(0, 1fr) minmax(46px, max-content) 28px 28px;
    gap: 5px;
  }

  .event-row-block--no-strike {
    grid-template-columns: 30px minmax(0, 1fr) 28px;
  }

  .event-row-block--no-strike .event-cell {
    grid-column: 2;
  }

  .no-strike-overlay-form {
    grid-template-columns: 1fr;
  }

  .event-stream-link {
    justify-self: start;
  }

  .event-edit-button {
    justify-self: end;
  }

  .ui-fields-row-desktop .ui-field {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 5px;
  }

  .ui-fields-row-desktop .ui-field > span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .ui-kit-grid {
    grid-template-columns: 1fr;
  }

  .icon-gallery {
    grid-template-columns: 1fr;
  }

  .journal-list-head,
  .journal-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .journal-list-head {
    align-items: center;
    gap: 4px 6px;
    padding: 5px 8px;
  }

  .journal-list-head span {
    white-space: nowrap;
  }

  .journal-row {
    align-items: center;
    gap: 5px 6px;
    padding: 6px 8px;
  }

  .row-main {
    flex: 1 1 220px;
    min-width: 0;
  }

  .modal-backdrop {
    align-items: flex-start;
    padding: 10px;
  }

  .modal-content,
  .modal-actions {
    padding: 10px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .ui-btn {
    width: 100%;
  }
}
