:root {
  color-scheme: light;
  --ink: #07143a;
  --muted: #66718f;
  --line: #dce5f4;
  --soft: #f6f9ff;
  --blue: #0869df;
  --blue-dark: #004fb8;
  --green: #21bf52;
  --orange: #f59d18;
  --violet: #7756ef;
  --shadow: 0 16px 36px rgba(21, 44, 88, 0.08);
  font-family:
    "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% -12%, rgba(8, 105, 223, 0.12), transparent 28rem),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 22px auto 32px;
}

.hero {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(300px, 380px);
  gap: 22px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 132px;
}

.brand-mark img {
  width: 100%;
  max-width: 150px;
  max-height: 132px;
  object-fit: contain;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2.35rem, 4vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero h1 span {
  color: var(--blue);
}

.event-date {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 10px;
  padding: 5px 12px;
  border: 1px solid #b8d7ff;
  border-radius: 999px;
  background: #eef7ff;
  color: var(--blue);
  font-size: 0.95rem;
  font-weight: 900;
}

.hero p {
  margin: 0;
  max-width: 760px;
  font-size: clamp(1rem, 1.45vw, 1.3rem);
  font-weight: 700;
  line-height: 1.75;
}

.hero p::first-letter {
  color: inherit;
}

.hero-actions {
  display: grid;
  gap: 20px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid #cfd9ea;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 2px rgba(18, 34, 64, 0.04);
}

.search-box svg,
button svg,
.notice svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.search-box input::placeholder {
  color: #7d89a7;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.primary-button,
.secondary-button,
.status-tab,
.companion-filter,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-weight: 900;
  letter-spacing: 0;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.primary-button {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 12px 22px rgba(8, 105, 223, 0.18);
}

.primary-button:hover,
.secondary-button:hover,
.status-tab:hover,
.companion-filter:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-button {
  background: #fff;
  border-color: var(--blue);
  color: var(--blue);
}

main {
  display: grid;
  gap: 12px;
}

.controls-grid {
  display: grid;
  grid-template-columns: minmax(640px, 1.35fr) minmax(420px, 0.9fr);
}

.control-panel {
  min-width: 0;
  padding: 26px 22px 24px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.control-panel:first-child {
  border-radius: 14px 0 0 14px;
}

.control-panel:last-child {
  border-radius: 0 14px 14px 0;
  border-left: 0;
}

.control-panel h2 {
  margin: 0 0 14px;
  font-size: 1.12rem;
  line-height: 1.35;
}

.status-tabs {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  gap: 10px;
  align-items: center;
}

.status-tab,
.companion-filter {
  min-height: 48px;
  padding: 0 18px;
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.status-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.status-tab .dot,
.status-pill .dot {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.8rem;
}

.companion-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 22px;
  row-gap: 14px;
  align-items: center;
}

.companion-panel h2 {
  grid-column: 1 / -1;
}

.companion-filter {
  color: #10a843;
  background: #fff;
}

.companion-filter.active {
  background: #eafff0;
  border-color: #b8efc8;
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  color: #2b3658;
  font-weight: 800;
  white-space: nowrap;
}

.switch-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: #b8c0d2;
  transition: background 160ms ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(16, 26, 49, 0.2);
  transition: transform 160ms ease;
}

.switch-label input:checked + .switch {
  background: var(--blue);
}

.switch-label input:checked + .switch::after {
  transform: translateX(24px);
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 2px 0 0;
}

.kpi-strip article {
  min-height: 82px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.kpi-strip span {
  display: block;
  color: var(--blue);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.kpi-strip p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 12px;
}

.post-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-width: 0;
  min-height: 342px;
  padding: 24px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.post-head {
  display: grid;
  grid-template-columns: 108px 1fr 34px;
  gap: 16px;
  align-items: start;
}

.avatar {
  overflow: hidden;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.88), transparent 15px),
    linear-gradient(135deg, var(--avatar-a), var(--avatar-b));
  color: #fff;
  border: 5px solid #eef5ff;
  font-size: 2.65rem;
  font-weight: 900;
  box-shadow: inset 0 -10px 22px rgba(7, 20, 58, 0.12);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person h3 {
  margin: 2px 0 2px;
  font-size: 1.2rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.account-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 9px;
}

.account-links a,
.account-links span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f6ff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.account-links span span,
.account-links a span {
  min-width: 0;
}

.account-logo {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.x-logo {
  width: 14px;
  height: 14px;
}

.vrchat-logo {
  width: 42px;
  height: 28px;
}

.account-links a:hover {
  color: var(--blue);
  background: #e6f1ff;
}

.bookmark {
  width: 34px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #263255;
  padding: 3px;
}

.bookmark.saved {
  color: var(--blue);
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.status-pill,
.looking-pill,
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1;
}

.status-pill.going {
  color: #06973a;
  background: #e9fff0;
  border: 1px solid #bdf0ca;
}

.status-pill.maybe {
  color: #f08300;
  background: #fff7e6;
  border: 1px solid #f8d790;
}

.status-pill.interested {
  color: var(--violet);
  background: #f0ebff;
  border: 1px solid #d8cfff;
}

.looking-pill {
  color: #0fa544;
  background: #eafff0;
  border: 1px solid #b8efc8;
  margin: 10px 0 14px 124px;
  width: fit-content;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 12px;
}

.tag-pill {
  min-height: 34px;
  border-radius: 999px;
  background: #e9f4ff;
  color: var(--blue);
}

.message {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.65;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-weight: 800;
}

.status-change {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 900;
}

.empty-state,
.notice {
  border: 1px solid #96c6ff;
  border-radius: 10px;
  background: #f5fbff;
  color: #2c3b62;
  font-weight: 800;
}

.empty-state {
  margin: 0;
  padding: 22px;
  text-align: center;
}

.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
}

.notice svg {
  color: var(--blue);
}

.modal {
  width: min(650px, calc(100% - 28px));
  border: 0;
  border-radius: 14px;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(5, 15, 39, 0.42);
  backdrop-filter: blur(2px);
}

.modal-card {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 72px rgba(4, 17, 48, 0.24);
}

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

.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.icon-button {
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  color: #1b294d;
  font-weight: 900;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

legend {
  padding: 0 6px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #ccd8eb;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline-color: var(--blue);
}

.avatar-upload {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
}

.avatar-preview {
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 4px solid #eef5ff;
  border-radius: 50%;
  background: linear-gradient(135deg, #77d8ff, #0869df);
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

.tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-options label,
.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tag-options input,
.checkbox-line input {
  width: auto;
}

.checkbox-line {
  justify-content: flex-start;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.modal-actions button {
  min-width: 140px;
}

.howto-list {
  margin: 0;
  padding-left: 1.35rem;
  color: #263255;
  font-weight: 800;
  line-height: 1.8;
}

@media (max-width: 1080px) {
  .app-shell {
    width: min(100% - 32px, 920px);
  }

  .hero {
    grid-template-columns: 128px 1fr;
  }

  .hero-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

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

  .controls-grid {
    grid-template-columns: 1fr;
  }

  .kpi-strip {
    grid-template-columns: 1fr 1fr;
  }

  .status-tabs {
    grid-template-columns: repeat(2, max-content);
  }

  .control-panel:first-child,
  .control-panel:last-child {
    border-radius: 12px;
    border: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 560px);
    margin-top: 14px;
  }

  .hero,
  .hero-actions,
  .action-row,
  .controls-grid,
  .companion-panel,
  .board-grid,
  .kpi-strip,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    height: 96px;
    width: 150px;
  }

  .brand-mark img {
    max-width: 150px;
    max-height: 96px;
  }

  .hero {
    gap: 14px;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .control-panel {
    padding: 20px 16px;
  }

  .status-tab,
  .companion-filter,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .status-tabs {
    grid-template-columns: 1fr;
  }

  .switch-label {
    justify-content: space-between;
    width: 100%;
  }

  .post-card {
    min-height: auto;
    padding: 20px 18px 16px;
  }

  .post-head {
    grid-template-columns: 84px 1fr 34px;
  }

  .avatar {
    width: 84px;
    height: 84px;
    font-size: 2rem;
  }

  .looking-pill {
    margin-left: 100px;
  }

  .modal-card {
    padding: 18px;
  }

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

  .modal-actions button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .app-shell {
    width: min(100% - 16px, 560px);
  }

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

  .post-head {
    grid-template-columns: 68px 1fr 32px;
    gap: 10px;
  }

  .avatar {
    width: 68px;
    height: 68px;
    border-width: 4px;
    font-size: 1.6rem;
  }

  .person h3 {
    font-size: 1.06rem;
  }

  .status-pill,
  .looking-pill,
  .tag-pill {
    font-size: 0.8rem;
  }

  .looking-pill {
    margin-left: 0;
  }
}
