@font-face {
  font-family: AdjustedYuGothic;
  font-weight: 400;
  src: local("Yu Gothic Medium");
}

@font-face {
  font-family: AdjustedYuGothic;
  font-weight: 700;
  src: local("Yu Gothic Bold");
}

:root {
  --brand-navy: #0B2545;
  --product-navy: #1A4480;
  --link-navy: #0F3D75;
  --amber: #E09A1B;
  --amber-deep: #8A5A00;
  --warning: #F0C14B;
  --danger: #e01e5a;
  --text: #2A2622;
  --text-grey: #6E675F;
  --text-disabled: #C4BDB4;
  --wg-01: #F7F4F0;
  --wg-02: #EFEAE4;
  --wg-03: #A89F94;
  --wg-04: #4E4944;
  --white: #ffffff;
  --border: #D9D2C9;
  --over-bg: #F3EFEA;
  --action-bg: #D9D2C9;
  --shadow-1: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-2: 0 4px 8px rgba(0, 0, 0, 0.15);
  --xs: 4px;
  --s: 8px;
  --m: 16px;
  --l: 24px;
  --xl: 32px;
  --xxl: 40px;
  --font: AdjustedYuGothic, "Yu Gothic", YuGothic, "Hiragino Sans", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--text);
  background: var(--wg-01);
  overflow-wrap: break-word;
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s);
}

.nav-toggle {
  display: none;
  background: transparent;
  color: var(--product-navy);
  border: 1px solid var(--product-navy);
}

.mobile-only { display: none !important; }

.filter-search { min-width: 12rem; flex: 1; }

.member-profile {
  margin-top: var(--xxl);
  padding-top: var(--l);
  border-top: 1px solid var(--border);
}

.filter-more {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.filter-more summary {
  min-height: 44px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  color: var(--product-navy);
}

.filter-body {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s);
  align-items: flex-start;
  padding: 0 var(--m) var(--m);
}

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s);
}

.event-card {
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  padding: var(--m);
}

.event-card-title {
  display: block;
  margin: var(--s) 0;
  font-weight: 700;
  text-decoration: none;
}

.event-meta {
  margin: 0 0 var(--m);
}

.event-meta div {
  display: flex;
  justify-content: space-between;
  gap: var(--m);
  margin: 0 0 var(--xs);
}

.event-meta dt {
  color: var(--text-grey);
  font-size: 0.857rem;
}

.event-meta dd {
  margin: 0;
  text-align: right;
}

.event-url { margin: var(--s) 0 0; }

.event-card .copy-link { width: 100%; min-height: 44px; }

@media (min-width: 960px) {
  .filter-more {
    border: 0;
    background: transparent;
    width: auto;
    flex: 1 1 100%;
  }
  .filter-more summary { display: none; }
  .filter-body { padding: 0; }
}

.logo {
  display: block;
  color: var(--brand-navy);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.1rem;
  text-decoration: none;
}

.logo-sub {
  margin: var(--xs) 0 var(--l);
  color: var(--text-grey);
  font-size: 0.857rem;
}

nav {
  display: flex;
  flex-direction: column;
  gap: var(--xs);
}

nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: var(--s) var(--m);
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0.1rem;
  text-decoration: none;
}

nav a.is-active {
  background: var(--wg-02);
  color: var(--product-navy);
  font-weight: 700;
}

nav a.nav-feature {
  box-shadow: inset 4px 0 0 var(--amber);
}

main {
  flex: 1;
  min-width: 0;
  padding: var(--xl) var(--xxl) var(--xxl);
}

h1 {
  margin: 0 0 var(--m);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--m);
  margin: 0 0 var(--m);
}

.record-head h1 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.edit-link {
  flex: none;
  white-space: nowrap;
  line-height: 1.25;
  padding-top: 0.45rem;
}

h2 {
  margin: var(--xl) 0 var(--m);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

p { margin: 0 0 var(--m); }

a { color: var(--link-navy); }

.muted {
  color: var(--text-grey);
  font-size: 0.857rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--m);
  margin-bottom: var(--m);
}

.stats div,
.aoi-hero {
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  padding: var(--m);
}

.stats div { min-width: 8rem; }

.stats strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
}

.aoi-hero { margin-bottom: var(--l); }
.aoi-hero h1 { margin-bottom: var(--s); }

.filters,
.edit,
.ingest-actions,
.csv-actions form,
.status-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s);
  align-items: flex-start;
  margin: 0 0 var(--m);
}

.edit { align-items: flex-end; }

input,
select,
button,
.btn {
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
}

input,
select {
  min-height: 44px;
  padding: 8px 12px;
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
}

input:focus,
select:focus {
  outline: none;
  border: 2px solid var(--product-navy);
}

button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--brand-navy);
  outline-offset: 2px;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  background: var(--product-navy);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.btn-secondary {
  background: transparent;
  color: var(--product-navy);
  border: 1px solid var(--product-navy);
}

.copy-link {
  min-height: 36px;
  padding: 4px 12px;
  font-size: 0.857rem;
}

.filter-checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s) var(--m);
  align-items: center;
  margin: 0;
  padding: var(--s) var(--m);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
}

.filter-checks legend {
  padding: 0 var(--xs);
  color: var(--text-grey);
  font-size: 0.857rem;
}

.filter-checks label {
  display: inline-flex;
  align-items: center;
  gap: var(--s);
  min-height: 44px;
  cursor: pointer;
}

.filter-checks input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  min-height: 0;
  margin: 0;
  accent-color: var(--product-navy);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border: 0;
}

.edit label {
  display: flex;
  flex-direction: column;
  gap: var(--s);
  min-width: 16rem;
  font-size: 0.857rem;
  color: var(--text-grey);
}

.edit input,
.edit select { width: 100%; }

select[multiple] { min-height: 16rem; }

.table-scroll { overflow-x: auto; }

.grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

.grid th,
.grid td {
  border: 1px solid var(--border);
  padding: var(--s) var(--m);
  text-align: left;
  vertical-align: top;
}

.grid th {
  background: var(--wg-02);
  color: var(--text-grey);
  font-size: 0.857rem;
  font-weight: 700;
}

.grid tbody tr:nth-child(odd) { background: var(--white); }
.grid tbody tr:nth-child(even) { background: var(--wg-01); }

.roster .member-col {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--white);
  white-space: nowrap;
}

.roster thead .member-col {
  z-index: 2;
  background: var(--wg-02);
}

.roster tbody tr:nth-child(even) .member-col { background: var(--wg-01); }

.roster .mark {
  text-align: center;
  white-space: nowrap;
}

.member-checks {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s) var(--m);
  margin: 0;
  padding: var(--s) var(--m) var(--m);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
}

.member-checks legend {
  padding: 0 var(--xs);
  color: var(--text-grey);
  font-size: 0.857rem;
}

.member-checks label {
  display: flex;
  align-items: center;
  gap: var(--xs);
  min-height: 0;
}

.member-checks input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  min-height: 0;
  padding: 0;
}

.event-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: var(--m);
}

.member-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  align-items: start;
  gap: var(--m);
}

.event-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s);
  margin: 0;
  min-width: 0;
  padding: var(--s) var(--m) var(--m);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--wg-01);
}

.event-group legend {
  padding: 0 var(--xs);
  color: var(--text);
  font-weight: 700;
}

.event-groups .group-all {
  width: 100%;
  padding-bottom: var(--xs);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.event-group label {
  align-items: flex-start;
}

.event-group input[type="checkbox"] {
  flex: 0 0 auto;
  margin-top: 0.25rem;
}

.call-sheet + .call-sheet {
  margin-top: var(--l);
}

td:has(.csv-actions) { background: var(--action-bg); }

.csv-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s);
  min-width: 12rem;
}

.nowrap { white-space: nowrap; }

.tag {
  display: inline-block;
  padding: var(--xs) var(--s);
  background: var(--wg-02);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: nowrap;
}

.notice {
  background: var(--over-bg);
  border: 1px solid var(--border);
  padding: var(--m);
  margin: 0 0 var(--m);
}

.notice-danger {
  border-color: var(--danger);
}

.notice-warning {
  background: var(--warning);
  border-color: var(--warning);
  color: var(--text);
}

code {
  background: var(--wg-02);
  padding: var(--xs) var(--s);
  font-family: inherit;
  font-size: 0.857rem;
  line-height: 1.75;
}

.notes {
  color: var(--text-grey);
  font-size: 0.857rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

ul { margin: 0 0 var(--m); padding-left: var(--l); }
li { margin: 0 0 var(--xs); }

@media (max-width: 959px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-basis: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: var(--m);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .logo-sub { display: none; }
  .nav-toggle { display: inline-flex; }
  nav { display: none; flex-direction: column; }
  nav.is-open { display: flex; }
  nav a.nav-feature { box-shadow: inset 4px 0 0 var(--amber); }
  main { padding: var(--l) var(--m) var(--xl); }
  h1 { font-size: 1.5rem; }
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
  ul.card-list.mobile-only { display: flex !important; }
  .filters { flex-direction: column; align-items: stretch; }
  .event-groups { grid-template-columns: 1fr; }
  .member-groups { grid-template-columns: 1fr 1fr; }
  .filter-search,
  .filters select,
  .filters button { width: 100%; }
  .filter-checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .edit label { min-width: 0; width: 100%; }
  .copy-link { min-height: 44px; }
}
