* {
  box-sizing: border-box;
}

:root {
  --brand-orange: #ff6004;
  --brand-orange-soft: #fff1e8;
  --brand-orange-ring: #ff600440;
}

body {
  margin: 0;
  color: #22252b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mobile-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f8cf70 0, #fff2cd 220px, #f8fafc 220px);
}

.form-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 22px 16px 32px;
}

.form-header {
  padding: 8px 4px 18px;
}

.form-header h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: 0;
}

.form-header p {
  margin: 0;
  color: #5b4b27;
  font-size: 15px;
}

.profile-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #e6e8ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 45px #5942141f;
}

.profile-form label {
  display: grid;
  gap: 7px;
}

.profile-form label span {
  color: #3b414c;
  font-size: 15px;
  font-weight: 700;
}

.profile-form label.required span::after {
  content: " *";
  color: #d33a2c;
}

.form-divider {
  height: 1px;
  margin: 6px 0 2px;
  background: #e7ebf1;
}

.radio-field {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.radio-field legend {
  width: 100%;
  margin-bottom: 7px;
  color: #3b414c;
  font-size: 15px;
  font-weight: 700;
}

.radio-field label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #cdd3df;
  background: #fbfcff;
  color: #3b414c;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.radio-field label:first-of-type {
  border-radius: 6px 0 0 6px;
}

.radio-field label:last-of-type {
  border-radius: 0 6px 6px 0;
}

.radio-field label + label {
  margin-left: -1px;
}

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

.radio-field label:has(input:checked) {
  border-color: var(--brand-orange);
  background: var(--brand-orange-soft);
  color: #a83f02;
  z-index: 1;
}

.profile-form input,
.profile-form select,
.profile-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cdd3df;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fbfcff;
  color: inherit;
  font: inherit;
  font-size: 16px;
  outline: none;
}

.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px var(--brand-orange-ring);
}

.custom-input.is-hidden {
  display: none;
}

.profile-form button {
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  background: var(--brand-orange);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.profile-form button:active {
  transform: translateY(1px);
}

.notice,
.error {
  margin: 0;
  padding: 11px 12px;
  border-radius: 6px;
  font-weight: 700;
}

.notice {
  background: #d9f8e5;
  color: #146c35;
}

.error {
  background: #ffe1dc;
  color: #9f2f20;
}

.wall-page {
  min-height: 100vh;
  overflow: auto;
  background:
    radial-gradient(circle, #d9d9d9 1px, transparent 1px) 0 0 / 18px 18px,
    #f7f7f4;
}

.wall-login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.wall-login-shell {
  width: min(100%, 420px);
}

.wall-login-card {
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid #e6e8ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px #5942141f;
}

.wall-login-card h1,
.wall-login-card p {
  margin: 0;
}

.wall-login-card h1 {
  font-size: 30px;
}

.wall-login-card > p {
  color: #5b4b27;
}

.wall-login-card label {
  display: grid;
  gap: 7px;
}

.wall-login-card label span {
  color: #3b414c;
  font-size: 15px;
  font-weight: 700;
}

.wall-login-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cdd3df;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fbfcff;
  color: inherit;
  font: inherit;
  font-size: 16px;
  outline: none;
}

.wall-login-card input:focus {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px var(--brand-orange-ring);
}

.wall-login-card button {
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  background: var(--brand-orange);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.wall-login-error {
  padding: 11px 12px;
  border-radius: 6px;
  background: #ffe1dc;
  color: #9f2f20;
  font-weight: 700;
}

.wall {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, 272px);
  gap: 24px;
  align-items: start;
  min-width: 100vw;
  min-height: 100vh;
  padding: 74px 24px 24px;
}

.wall.is-presenting-profile::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 250;
  pointer-events: none;
  background: #14182138;
}

.wall.just-received-profile::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 260;
  pointer-events: none;
  background: #ffffff00;
  animation: receiveFlash 0.65s ease-out;
}

.wall-tools {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 460;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: #fff8e680;
}

.wall-summary {
  display: flex;
  gap: 0;
  color: #2f3642;
  font-size: 18px;
  font-weight: 900;
}

.wall-actions {
  display: flex;
  gap: 10px;
}

.wall-export {
  position: relative;
}

.wall-action-button {
  display: grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid #e4e7ec;
  border-radius: 5px;
  background: #ffffffb8;
  box-shadow: none;
  cursor: pointer;
}

.wall-action-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  opacity: 0.72;
}

.wall-action-button:hover {
  border-color: #d7dce4;
  background: #fff;
}

.wall-action-button:hover .wall-action-icon {
  opacity: 0.92;
}

.wall-export-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  display: grid;
  min-width: 112px;
  gap: 2px;
  padding: 4px;
  border: 1px solid #e4e7ec;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 10px 28px #1018281f;
}

.wall-export-menu[hidden] {
  display: none;
}

.wall-export-menu button {
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  padding: 7px 12px;
  background: transparent;
  color: #3b414c;
  font: inherit;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.wall-export-menu button:hover,
.wall-export-menu button:focus-visible {
  background: var(--brand-orange-soft);
  color: #a83f02;
  outline: none;
}

.activity-setup-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #14182180;
}

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

.activity-setup-card {
  width: min(100%, 460px);
  padding: 28px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 80px #0005;
}

.activity-setup-card form {
  display: grid;
  gap: 16px;
}

.activity-setup-card h1,
.activity-setup-card p {
  margin: 0;
}

.activity-setup-card h1 {
  color: #22252b;
  font-size: 28px;
}

.activity-setup-card p {
  color: #5b4b27;
}

.activity-name-field,
.activity-type-field {
  display: grid;
  gap: 8px;
}

.activity-name-field span,
.activity-type-field legend {
  color: #3b414c;
  font-size: 15px;
  font-weight: 700;
}

.activity-name-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cdd3df;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fbfcff;
  color: inherit;
  font: inherit;
  font-size: 16px;
  outline: none;
}

.activity-name-field input:focus {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px var(--brand-orange-ring);
}

.activity-type-field {
  grid-template-columns: repeat(3, 1fr);
  row-gap: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.activity-type-field legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
}

.activity-type-field label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid #cdd3df;
  background: #fbfcff;
  color: #3b414c;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.activity-type-field label:first-of-type {
  border-radius: 6px 0 0 6px;
}

.activity-type-field label:last-of-type {
  border-radius: 0 6px 6px 0;
}

.activity-type-field label + label {
  margin-left: -1px;
}

.activity-type-field label:has(input:checked) {
  position: relative;
  z-index: 1;
  border-color: var(--brand-orange);
  background: var(--brand-orange-soft);
  color: #a83f02;
}

.activity-type-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.activity-setup-card button {
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  background: var(--brand-orange);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.qrcode-modal {
  position: fixed;
  top: 66px;
  right: 16px;
  z-index: 450;
  touch-action: none;
}

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

.qrcode-card {
  box-sizing: border-box;
  padding: 16px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 80px #0005;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.qrcode-card.qrcode-dragging {
  cursor: grabbing;
}

.qrcode-loading {
  box-sizing: border-box;
  width: min(240px, calc(100vw - 64px));
  height: min(240px, calc(100vh - 64px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #89909d;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.qrcode-loading[hidden] {
  display: none;
}

.qrcode-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #edf0f4;
  border-top-color: var(--brand-orange);
  border-radius: 50%;
  animation: qrcodeSpin 0.8s linear infinite;
}

@keyframes qrcodeSpin {
  to {
    transform: rotate(360deg);
  }
}

.qrcode-image {
  display: block;
  width: 240px;
  height: 240px;
  aspect-ratio: 1;
  object-fit: contain;
  max-width: calc(100vw - 64px);
  max-height: calc(100vh - 64px);
  border: 0;
  cursor: pointer;
  -webkit-user-drag: none;
}

.qrcode-image[hidden] {
  display: none;
}

.qrcode-image.size-small {
  width: 160px;
  height: 160px;
}

.qrcode-image.size-medium {
  width: 240px;
  height: 240px;
}

.qrcode-image.size-large {
  width: 320px;
  height: 320px;
}

.note {
  width: 272px;
  min-height: 268px;
  padding: 18px 20px;
  border: 1px solid #0000000d;
  border-radius: 6px;
  box-shadow: 0 8px 18px #0000001f;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition:
    filter 0.45s ease,
    transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.wall.is-presenting-profile .note {
  filter: blur(9px);
}

.note.dragging {
  cursor: grabbing;
  z-index: 20;
  opacity: 0.94;
  transition: none;
}

.wall.settling .note {
  transition: none;
}

.note-placeholder {
  width: 272px;
  min-height: 268px;
  border: 2px dashed var(--brand-orange);
  border-radius: 6px;
  background: #ff600440;
}

.note-incoming-placeholder {
  border-color: transparent;
  background: transparent;
}

.note-new-overlay {
  position: fixed;
  z-index: 300;
  width: 340px;
  min-height: 330px;
  opacity: 0;
  transform: scale(0.94);
  transform-origin: center;
  box-shadow: 0 24px 80px #0006;
  transition:
    opacity 0.45s ease,
    left 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
    top 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
    width 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.note-new-overlay.is-visible {
  opacity: 1;
  transform: scale(1.18);
}

.note p {
  margin: 0 0 7px;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.45;
}

.note-value {
  display: inline-block;
  min-width: 1.5em;
  min-height: 1.45em;
  border-radius: 3px;
  cursor: text;
  user-select: text;
  touch-action: auto;
}

.note-value:hover {
  background: #ffffff66;
}

.note-value:focus {
  outline: 2px solid var(--brand-orange);
  outline-offset: 1px;
  background: #fff8f2;
}

.note-value.save-error {
  background: #ffc7c7;
}

.note-0 { background: #ffd2a6; }
.note-1 { background: #ffffff; }
.note-2 { background: #e5e5e5; }
.note-3 { background: #ffa49d; }
.note-4 { background: #ffe59a; }
.note-5 { background: #b4eee8; }
.note-6 { background: #cdb7ff; }

@keyframes receiveFlash {
  0% { background: #ffffff00; }
  18% { background: var(--receive-flash, #ffffff00); }
  100% { background: #ffffff00; }
}

.table-page {
  background: #eef1f5;
}

.table-shell {
  padding: 24px;
  overflow: auto;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 10px 30px #10182814;
}

th,
td {
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid #dcdfe5;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  font-weight: 800;
}

.focus-col {
  box-sizing: border-box;
  width: 142px;
  max-width: 142px;
  white-space: nowrap;
}

.focus-stars {
  display: flex;
  gap: 1px;
  white-space: nowrap;
}

.focus-stars button {
  width: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b8bec8;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
}

.focus-stars button.is-active {
  color: var(--brand-orange);
}
