:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', sans-serif;
  color: #1b3040;
  background: #f1f5f7;
  font-size: 16px;
  line-height: 1.6;
  --blue: #174f7b;
  --green: #247458;
  --line: #d9e2e8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding-bottom: calc(85px + env(safe-area-inset-bottom));
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 16px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
button:hover,
.button:hover {
  background: #edf4f8;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.primary:hover {
  background: #103e62;
}
.danger {
  color: #a42835;
  border-color: #e9c4c9;
}
.danger.active {
  background: #a42835;
  color: white;
}
.small {
  min-height: 36px;
  padding: 4px 10px;
  font-size: 0.85rem;
}
.app-header {
  height: 62px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 max(16px, calc((100vw - 1220px) / 2));
  position: sticky;
  top: 0;
  z-index: 4;
}
.brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}
.event-home {
  max-width: 1220px;
  margin: 0 auto;
  padding: 12px 20px 0;
  font-size: 0.85rem;
}
.event-home a {
  color: var(--blue);
}
.portal {
  padding-bottom: 24px;
}
.portal-intro {
  margin: 36px 0 24px;
}
.portal-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}
.portal-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
}
.portal-card h2 {
  margin-top: 14px;
}
.portal-practice {
  margin-top: 36px;
}
#identity {
  margin-left: auto;
  font-size: 0.9rem;
}
#identity button {
  border: 0;
  padding: 4px 8px;
}
#connection {
  font-size: 0.75rem;
  white-space: nowrap;
  color: var(--green);
}
#connection.offline {
  color: #a64116;
}
.environment-warning,
.practice-warning {
  padding: 8px 16px;
  text-align: center;
  font-weight: 700;
  background: #feef9b;
  color: #694d00;
}
.practice-warning {
  background: #dcefe4;
  color: #275f3e;
}
main {
  max-width: 1220px;
  margin: 28px auto;
  padding: 0 20px;
}
h1 {
  font-size: 1.65rem;
  line-height: 1.4;
  margin: 0 0 8px;
}
h2 {
  font-size: 1.1rem;
  margin: 0 0 15px;
}
h3 {
  font-size: 1rem;
  margin: 8px 0;
}
p {
  margin: 8px 0 16px;
}
.lead {
  color: #617483;
}
.muted,
small {
  color: #6e7c86;
}
.eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--green);
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  margin: 0 0 20px;
  box-shadow: 0 2px 5px #15304704;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 20px;
}
.grid .card:last-child {
  margin-bottom: 20px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.9rem;
  font-weight: 650;
  margin: 12px 0;
}
label.check {
  flex-direction: row;
  align-items: center;
}
input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c6d2dc;
  border-radius: 7px;
  padding: 10px 11px;
  background: #fff;
  color: #1b3040;
}
input[type='checkbox'] {
  width: 20px;
  min-height: 20px;
}
textarea {
  resize: vertical;
  min-height: 90px;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #80badb;
  outline-offset: 2px;
}
.help {
  font-size: 0.8rem;
  color: #6e7c86;
}
.join {
  max-width: 460px;
  margin: 34px auto;
}
.join .brand-name {
  font-size: 1.9rem;
  color: var(--blue);
  font-weight: 800;
}
.join .event-name {
  color: var(--green);
  font-weight: 700;
}
.join input {
  font-size: 1rem;
}
.join .primary {
  width: 100%;
}
.pending {
  text-align: center;
  padding: 45px 24px;
}
.pending .symbol {
  font-size: 2.6rem;
  color: var(--green);
}
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 5px;
  background: #eaf1f7;
  color: #376179;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge.orange {
  background: #fff0dd;
  color: #975000;
}
.badge.red {
  background: #fce9e9;
  color: #aa293a;
}
.badge.green {
  background: #e1f2e9;
  color: #226c46;
}
#notice:empty {
  display: none;
}
#notice {
  padding: 10px 18px;
  background: #fff1d5;
  color: #724600;
  position: sticky;
  top: 62px;
  z-index: 3;
  overflow-wrap: anywhere;
}
#notice.error {
  background: #fce7e9;
  color: #982a38;
}
#navigation {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  background: #fff;
  border-top: 1px solid var(--line);
  z-index: 5;
  padding-bottom: env(safe-area-inset-bottom);
}
#navigation:empty {
  display: none;
}
#navigation a {
  color: #667a89;
  text-decoration: none;
  max-width: 180px;
  flex: 1;
  text-align: center;
  padding: 10px 4px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  position: relative;
}
#navigation a span.icon {
  display: block;
  font-size: 1.25rem;
  line-height: 1.4;
}
#navigation a[aria-current='page'] {
  color: var(--blue);
  background: #edf5fa;
}
#navigation .badge {
  position: absolute;
  top: 4px;
  right: 8px;
}
.staff-main {
  max-width: 640px;
  padding: 0;
  margin: 12px auto;
}
.staff-main h1 {
  font-size: 1.05rem;
}
.staff-main .inset {
  padding: 0 16px;
}
.staff-main .card {
  margin: 15px 12px;
  padding: 16px;
}
.camera {
  position: relative;
  background: #142a3b;
  aspect-ratio: 4/3;
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.camera video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.camera > .camera-start {
  position: absolute;
  inset: 0;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.15rem;
}
.camera > .camera-stop {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: #a42a36;
  color: white;
  border: 0;
}
.scan-result {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 15px;
  background: #123a36d9;
  border: 6px solid #61d799;
}
.scan-result:empty {
  display: none;
}
.scan-result.error {
  background: #672836e8;
  border-color: #f08a8a;
}
.scan-result strong {
  font-size: 2.2rem;
  display: block;
  line-height: 1.2;
}
.scan-result .kana {
  font-size: 1.65rem;
  font-weight: 750;
  line-height: 1.45;
}
.scan-result .sub {
  font-size: 0.9rem;
  margin-top: 8px;
}
.point-bar {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 8px 16px;
}
.point-bar select {
  flex: 1;
  min-width: 0;
}
.retire-mode {
  background: #fbe5e8;
  color: #9d2534;
  padding: 5px 15px;
  font-weight: 750;
}
.message {
  border-bottom: 1px solid #e4ebef;
  padding: 12px 0;
}
.message:last-child {
  border: 0;
}
.message .meta {
  font-size: 0.82rem;
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
}
.message .author {
  font-weight: 750;
}
.message .place {
  color: var(--green);
  font-weight: 700;
}
.message .dest {
  color: var(--blue);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message .body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 5px 0;
  line-height: 1.55;
}
.message .runner {
  font-weight: 750;
  color: #a42a36;
  font-size: 1.1rem;
}
.message .actions {
  font-size: 0.75rem;
  gap: 6px;
}
.message .actions button {
  padding: 3px 7px;
  min-height: 30px;
  font-size: 0.75rem;
}
.message .actions time {
  color: #7b8b97;
  margin-left: auto;
  font-size: 0.72rem;
}
.message.unread {
  border-left: 3px solid #f4a33f;
  padding-left: 8px;
}
.message.mine .author {
  color: var(--blue);
}
.pending-job {
  padding: 10px;
  border: 1px dashed #c8a562;
  background: #fff9e8;
  margin: 8px 0;
  font-size: 0.85rem;
}
.staff-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.staff-row strong {
  display: block;
}
.staff-row .details {
  font-size: 0.76rem;
  color: #697d8b;
}
.staff-row .controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.phrase {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--blue);
  overflow-wrap: anywhere;
}
.qr-image {
  max-width: 190px;
  display: block;
  margin: 15px auto;
}
.url-text {
  font-size: 0.8rem;
  word-break: break-all;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
th,
td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  background: #f4f7fa;
  font-size: 0.78rem;
}
td.cancelled {
  color: #8a969e;
  text-decoration: line-through;
}
.heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}
.heading-row select {
  max-width: 250px;
}
details > summary {
  cursor: pointer;
  font-weight: 700;
  padding: 5px 0;
}
.empty {
  padding: 28px 12px;
  text-align: center;
  color: #788d9c;
}
.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.link-grid a {
  justify-content: space-between;
  min-height: 65px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(92vw, 520px);
  max-height: 85vh;
  overflow: auto;
  padding: 24px;
}
dialog::backdrop {
  background: #10273980;
}
.loading {
  text-align: center;
  padding: 50px;
  color: #708493;
}
.stats {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin: 10px 0 20px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 20px;
  flex: 1;
  min-width: 130px;
}
.stat strong {
  display: block;
  font-size: 1.8rem;
  color: var(--blue);
}
.stat span {
  font-size: 0.8rem;
  color: #748492;
}
.file-label {
  border: 1px dashed #b8c9d7;
  padding: 15px;
  background: #f6f9fb;
}
.reply-preview {
  font-size: 0.8rem;
  padding: 6px 10px;
  background: #edf3f6;
  border-radius: 5px;
}
.online-info {
  font-size: 0.8rem;
  color: var(--green);
}
.button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.external-steps {
  padding-left: 22px;
}
.external-steps li {
  margin: 10px 0;
}
@media (max-width: 750px) {
  main {
    padding: 0 14px;
    margin-top: 20px;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .app-header {
    padding: 0 12px;
    gap: 8px;
    height: 56px;
  }
  .brand {
    font-size: 0.95rem;
  }
  #identity {
    font-size: 0.8rem;
  }
  #connection {
    font-size: 0.65rem;
  }
  #notice {
    top: 56px;
    font-size: 0.85rem;
  }
  h1 {
    font-size: 1.35rem;
  }
  .card {
    padding: 17px;
  }
  .heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .heading-row select {
    max-width: none;
  }
  .staff-main {
    margin-top: 6px;
    padding: 0;
  }
  .camera {
    aspect-ratio: 4/3;
    max-height: 44vh;
  }
  .staff-main .message .meta {
    font-size: 0.76rem;
  }
  .staff-row {
    gap: 7px;
  }
  .staff-row .controls {
    max-width: 160px;
  }
  .staff-row .controls button {
    font-size: 0.75rem;
    padding: 5px 8px;
    min-height: 36px;
  }
  .join {
    margin: 20px auto;
  }
  .stats {
    gap: 7px;
  }
  .stat {
    padding: 10px 13px;
    min-width: 90px;
  }
  .stat strong {
    font-size: 1.4rem;
  }
  .link-grid {
    grid-template-columns: 1fr;
  }
}
