:root {
  --ink: #1b1f3b;
  --muted: #62687a;
  --line: #e4e6ee;
  --mist: #f7f8fa;
  --flame: #ff6a13;
  --ember: #aa3700;
  --tint: #fff1e8;
  --rail: 244px;
  color: var(--ink);
  font: 14px/1.5
    -apple-system,BlinkMacSystemFont,"PingFang TC","Microsoft JhengHei",sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--mist);
}
#frame[hidden], #auth[hidden], .field[hidden] { display: none; }
#identity-check { display: none; }
.identity-pending #frame, .identity-pending #dialog, .identity-pending #toast { visibility: hidden; }
.identity-pending #identity-check { display: block; position: fixed; inset: 45% 0 auto; text-align: center; }
#auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.auth-form { width: min(100%, 390px); padding: 34px; display: grid; gap: 17px; background: white; border: 1px solid var(--line); border-radius: 8px; }
.auth-form img { height: auto; }
.auth-form h1 { margin: 7px 0 3px; font-size: 24px; }
#auth .field input, .auth-form button { min-height: 43px; }
.auth-form [role=alert], .access-form [role=alert] { color: #962e14; margin: 0; }
.auth-form [role=alert]:empty { display: none; }
.account-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin: 0 0 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.account-summary span { color: var(--muted); }
.security-section { padding: 18px; margin-bottom: 14px; }
.security-section h2 { font-size: 16px; margin: 0 0 12px; }
.audit-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 15px 0; }
.access-form .field { margin-bottom: 14px; }
.access-error { color: #962e14; }
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  min-height: 32px;
  padding: 4px 14px;
}
button:hover:not(:disabled) {
  border-color: var(--flame);
  color: var(--ember);
}
button:disabled {
  cursor: not-allowed;
  color: #737887;
  background: #f5f5f7;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}
button.primary {
  background: var(--flame);
  border-color: var(--flame);
  color: var(--ink);
  font-weight: 600;
}
.linkbtn {
  color: var(--ember);
  background: transparent;
  border: 0;
}
.icon {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  display: inline-grid;
  place-items: center;
  padding: 8px;
}
.icon img,
.group img,
.navicon {
  width: 17px;
  height: 17px;
}
.spacer {
  flex: 1;
}
#frame {
  display: grid;
  grid-template-columns: var(--rail) minmax(0,1fr);
  min-height: 100vh;
}
#rail {
  background: white;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  z-index: 4;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 76px;
  padding: 0 22px;
}
.brand .fullbrand {
  width: 118px;
  height: 41px;
  object-fit: contain;
}
.brand span {
  font-size: 19px;
  font-weight: 450;
}
.brand .mark {
  display: none;
}
.group {
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 0;
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 0 20px;
  min-height: 46px;
}
.group .arrow {
  margin-left: auto;
  width: 11px;
}
.group.active {
  color: var(--ember);
}
.group[aria-expanded=true] .arrow {
  transform: rotate(180deg);
}
nav a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  padding: 9px 15px 9px 51px;
  border-right: 3px solid transparent;
}
nav a:hover {
  background: var(--mist);
}
nav a[aria-current=page] {
  background: var(--tint);
  border-color: var(--flame);
  color: var(--ember);
  font-weight: 600;
}
header {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 3;
}
h1 {
  font-size: 19px;
  line-height: 1.2;
  margin: 0;
  font-weight: 550;
}
.org {
  padding-right: 14px;
  border-right: 1px solid var(--line);
}
.account-initial {
  background: var(--ink);
  color: white;
  border: 0;
  width: 29px;
  min-height: 29px;
  border-radius: 50%;
  padding: 0;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.avatar { display: flex; gap: 6px; align-items: center; background: transparent; border: 0; padding: 2px; }
.account-user { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width:800px) { .account-user { display: none; } }
main {
  padding: 18px 22px 45px;
  min-width: 0;
}
.surface {
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.filters {
  padding: 15px 18px 12px;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px 24px;
}
.field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 5px;
  font-size: 13px;
}
.field input,
.field select,
.field textarea,
.jumpinput,
.datepick {
  border: 1px solid #cfd2dc;
  border-radius: 4px;
  padding: 5px 9px;
  background: white;
  width: 100%;
  min-height: 33px;
}
.range {
  display: flex;
  gap: 5px;
}
.range input {
  min-width: 0;
}
.filter-actions,
.footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  grid-column: 1/-1;
}
.toolbar,
.sourcebar,
.pager,
.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.toolbar {
  margin: 13px 0;
  min-height: 34px;
}
.sourcebar {
  color: var(--muted);
  font-size: 12px;
  margin: 12px 0 9px;
  gap: 6px;
}
.sourcebar img {
  width: 14px;
}
.sourcebar .counter {
  margin-left: auto;
}
.tablewrap {
  max-width: 100%;
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 13px;
}
th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
  white-space: nowrap;
  max-width: 290px;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 46px;
}
th {
  background: #f2f3f7;
  font-weight: 550;
  color: #50556b;
}
th button {
  all: unset;
  cursor: pointer;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: #fffaf7;
}
.sticky {
  position: sticky;
  right: 0;
  background: white;
  box-shadow: -2px 0 4px #1b1f3b0c;
  text-align: center;
}
.sticky.th {
  background: #f2f3f7;
}
.name-action {
  white-space: nowrap;
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: transparent;
  font-size: inherit;
  color: var(--ember);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pill:before {
  content: "";
  width: 6px;
  height: 6px;
  background: #779185;
  border-radius: 50%;
}
.pager {
  justify-content: center;
  margin: 16px 0;
  color: var(--muted);
  font-size: 13px;
}
.pager button,
.pager select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
}
.pager b {
  border: 1px solid var(--flame);
  padding: 4px 11px;
  border-radius: 4px;
  color: var(--ember);
}
.empty {
  text-align: center;
  padding: 45px 12px;
  color: var(--muted);
}
.empty img {
  display: block;
  width: 35px;
  margin: 0 auto 8px;
  opacity: .35;
}
.tabs {
  border-bottom: 1px solid var(--line);
  margin: 0 0 14px;
  gap: 18px;
}
.tabs button {
  border: 0;
  background: transparent;
  padding: 9px 3px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.tabs button[aria-selected=true] {
  color: var(--ember);
  border-color: var(--flame);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  width: min(640px,calc(100vw - 30px));
  max-height: 85dvh;
  color: var(--ink);
  box-shadow: 0 15px 65px #16182d30;
}
dialog::backdrop {
  background: #16182d50;
}
dialog:has(.tablewrap) {
  width: min(920px,calc(100vw - 30px));
}
.dialoghead {
  position: sticky;
  top: 0;
  background: white;
  display: flex;
  align-items: center;
  padding: 13px 19px;
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
.dialoghead h2 {
  font-size: 18px;
  margin: 0;
  flex: 1;
}
.dialoghead + .body,
#dialog-body {
  padding: 18px;
}
.formgrid,
.details {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px 18px;
}
.details {
  margin: 0;
}
.details dt {
  font-size: 12px;
  color: var(--muted);
}
.details dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}
.footer {
  margin-top: 16px;
}
.notification-actions {
  flex-wrap: wrap;
}
.activity-receipt {
  overflow-wrap: anywhere;
}
.hint {
  color: var(--muted);
  font-size: 13px;
}
.listrow {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  text-align: left;
  width: 100%;
  padding: 10px 3px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.checks {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 8px;
}
#toast:not(:empty) {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 9px 18px;
  border-radius: 5px;
  z-index: 12;
}
.calendar {
  display: grid;
  grid-template-columns: repeat(7,minmax(0,1fr));
  background: white;
}
.calendar > div {
  min-height: 80px;
  border-top: 1px solid var(--line);
  padding: 7px;
  overflow-wrap: anywhere;
}
.calendar .weekday {
  min-height: 32px;
  background: #f2f3f7;
}
.calendar button {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 1px 2px;
  font-size: 11px;
}
.calendar .today {
  color: var(--ember);
  font-weight: bold;
}
.yeargrid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
}
.collapsed {
  --rail: 68px;
}
.collapsed .brand {
  justify-content: center;
  padding: 0;
}
.collapsed .brand .fullbrand,
.collapsed .brand span,
.collapsed .group span,
.collapsed .group .arrow,
.collapsed nav a {
  display: none;
}
.collapsed .brand .mark {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.collapsed .group {
  justify-content: center;
  padding: 0;
}
.local-note {
  padding: 15px;
  background: #fff8f2;
  border-left: 3px solid var(--flame);
}
@media (max-width:800px) {
  #frame {
    display: block;
  }
  #rail {
    display: none;
    position: fixed;
    top: 59px;
    bottom: 0;
    width: 244px;
    height: calc(100dvh - 59px);
    box-shadow: 8px 0 22px #1b1f3b24;
  }
  #frame.drawer #rail {
    display: block;
  }
  header {
    height: 59px;
    padding: 0 10px;
    gap: 7px;
  }
  .org {
    display: none;
  }
  main {
    padding: 12px;
  }
  .filters {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px;
  }
  .calendar > div {
    min-height: 55px;
  }
  .brand {
    height: 64px;
  }
}
@media (max-width:530px) {
  .filters {
    grid-template-columns: 1fr;
  }
  .formgrid {
    grid-template-columns: 1fr;
  }
  .filter-actions {
    flex-wrap: wrap;
  }
  .toolbar {
    gap: 5px;
  }
  .toolbar button {
    padding: 4px 8px;
  }
  .details {
    grid-template-columns: 1fr;
  }
  .tabs {
    gap: 7px;
  }
  .sourcebar .counter {
    margin-left: 0;
  }
  th,
  td {
    padding: 8px 10px;
  }
  .calendar {
    font-size: 12px;
  }
}

@media (min-width:1000px) {
  .filters.four {
    grid-template-columns: repeat(4,minmax(0,1fr));
  }
}
#month {
  width: 155px;
}
.toolbar {
  margin: 8px 0;
}
table {
  font-size: 14px;
}
th {
  height: 40px;
  padding: 6px 14px;
}
td {
  height: 48px;
  padding: 6px 14px;
}
.pagejump input {
  width: 48px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px;
}
.published-body, .activity-list p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mobile-fields {
  display: grid;
  grid-template-columns: minmax(5em, auto) minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
}
.mobile-fields dt { color: var(--muted); }
.mobile-fields dd { margin: 0; overflow-wrap: anywhere; }
.op-error, #import-error, #cleanup-error {
  color: #a33025;
}
.sticky {
  padding: 5px 8px;
}
.pill {
  padding: 1px 6px;
  border-radius: 4px;
  background: #edf5ef;
  color: #2c5c40;
}
