:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #637083;
  --line: #dde4ea;
  --navy: #101932;
  --gold: #caa64a;
  --green: #20b86b;
  --blue: #2f6fd6;
  --shadow: 0 18px 50px rgba(23, 33, 43, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic",
    "Yu Gothic UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(16, 25, 50, 0.06), rgba(202, 166, 74, 0.1)),
    var(--bg);
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 430px);
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.phone-frame {
  position: relative;
  width: 100%;
  height: min(880px, calc(100vh - 56px));
  min-height: 700px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid rgba(23, 33, 43, 0.08);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
  color: #ffffff;
  background:
    linear-gradient(rgba(16, 25, 50, 0.58), rgba(16, 25, 50, 0.8)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 420'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1' y1='0' y2='1'%3E%3Cstop stop-color='%232f6fd6'/%3E%3Cstop offset='1' stop-color='%23caa64a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='900' height='420' fill='%23101932'/%3E%3Cpath d='M0 300 C140 240 210 330 330 260 C470 178 570 250 690 160 C790 86 830 112 900 74 L900 420 L0 420 Z' fill='url(%23g)' opacity='.58'/%3E%3Cpath d='M94 332 L238 160 L355 332 Z M446 332 L546 130 L668 332 Z' fill='%23ffffff' opacity='.12'/%3E%3Cpath d='M0 350 H900' stroke='%23fff' stroke-width='8' opacity='.16'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.78;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.top-bar h1 {
  display: grid;
  gap: 2px;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
}

.service-title__main,
.service-title__sub {
  display: block;
}

.service-title__main {
  color: #ffffff;
}

.service-title__sub {
  color: rgba(229, 234, 240, 0.78);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  padding-left: 2px;
}

.service-disclaimer {
  margin-top: 7px;
  color: rgba(229, 234, 240, 0.64);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.header-actions {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}

.header-button-group {
  display: flex;
  gap: 8px;
}

.header-actions > .header-guide-button + .header-guide-button {
  margin-top: 0;
}

.header-guide-button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.header-guide-button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.account-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.account-button {
  position: relative;
  width: auto;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 12px 0 8px;
  border-color: rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.account-unread-badge {
  position: absolute;
  top: 3px;
  left: 36px;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  background: #e5484d;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(16, 25, 50, 0.24);
}

.account-button #accountIconInitial {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background:
    linear-gradient(135deg, #2f6fd6, #20b86b);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.42);
}

.account-button__label {
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.account-button span.is-empty::before,
.account-button span.is-empty::after {
  content: "";
  display: block;
  background: #ffffff;
}

.account-button span.is-empty::before {
  width: 10px;
  height: 10px;
  align-self: end;
  justify-self: center;
  border-radius: 50%;
}

.account-button span.is-empty::after {
  width: 18px;
  height: 9px;
  align-self: start;
  justify-self: center;
  border-radius: 999px 999px 4px 4px;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 15;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(16, 25, 50, 0.2);
}

.account-menu.is-hidden {
  display: none;
}

.account-menu__item {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--navy);
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: bold;
}

.account-menu__item:hover {
  background: #edf2f7;
}

.account-menu__notice {
  flex: 0 0 auto;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  color: #ffffff;
  background: #e5484d;
  font-size: 11px;
  font-weight: 900;
  line-height: 20px;
  white-space: nowrap;
}

.status-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-label__line {
  display: block;
}

.step-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 10px;
  gap: 8px;
  background: #f8fafb;
  border-bottom: 1px solid var(--line);
}

.step-tab {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.step-tab.is-active {
  color: #ffffff;
  background: #1f4fd1;
  border-color: #1f4fd1;
}

.view {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.view.is-active {
  display: block;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 22px;
  line-height: 1.2;
}

.section-head p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.chip.is-selected {
  color: #ffffff;
  border-color: var(--navy);
  background: var(--navy);
}

.destination-list,
.meeting-list {
  display: grid;
  gap: 12px;
}

.ad-slot {
  position: relative;
  aspect-ratio: 760 / 180;
  display: block;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  background: #ffffff;
}

.ad-slot__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.destination-card,
.meeting-card,
.ride-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.destination-card,
.meeting-card {
  padding: 16px;
  text-align: left;
}

article.destination-card,
article.meeting-card {
  padding: 0;
  overflow: hidden;
}

.destination-card__select {
  width: 100%;
  padding: 16px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.destination-card.is-selected,
.meeting-card.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 214, 0.12);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  display: block;
  font-size: 17px;
  line-height: 1.35;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.card-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f3f6f8;
}

.card-meta .usage-count {
  min-height: auto;
  padding: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}

.destination-toolbar {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
}

.destination-back-button {
  width: fit-content;
}

.destination-search {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.destination-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.destination-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f7f9fb;
  font-size: 14px;
  font-weight: 700;
}

.area-destination-button {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
}

.area-destination-button strong {
  font-size: 17px;
  line-height: 1.35;
}

.area-destination-button > span:last-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.area-destination-button.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 214, 0.12);
}

.destination-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.map-link {
  display: block;
  margin: 0 16px 16px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.map-link:hover {
  text-decoration: underline;
}

.departure-panel {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.departure-panel[hidden] {
  display: none;
}

.departure-panel__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.departure-panel__head strong {
  display: block;
  font-size: 17px;
}

.party-count {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.departure-panel .filter-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  overflow: visible;
  margin-bottom: 0;
}

.departure-panel .chip {
  min-width: 0;
  padding: 0 6px;
  font-size: 12px;
  white-space: nowrap;
}

.party-panel .members {
  margin-top: 0;
}

.party-members .member {
  appearance: none;
  cursor: pointer;
}

.party-members .member.is-self {
  color: var(--navy);
  border-style: solid;
  border-color: #87b89b;
  background: #dff1e7;
}

.party-members .member:disabled {
  cursor: default;
  opacity: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.is-waiting {
  background: var(--gold);
  color: #1f1a10;
}

.badge.is-paused {
  color: #5f4100;
  background: #f7df9c;
}

.badge.is-closed {
  color: #4b5563;
  background: #e5e7eb;
}

.venue-map {
  position: relative;
  aspect-ratio: 760 / 360;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf4f7;
}

.venue-map__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-point {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 2;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  color: transparent;
  background: transparent;
}

.map-point.is-selected {
  box-shadow: 0 0 0 4px rgba(47, 111, 214, 0.28);
}

.ride-list {
  display: grid;
  gap: 12px;
}

.ride-sample-list {
  display: grid;
  gap: 12px;
}

.join-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.join-toolbar .text-button {
  width: fit-content;
}

.ride-card {
  padding: 16px;
}

.ride-card--sample {
  background: #ffffff;
}

.ride-card-button {
  display: block;
  color: inherit;
  text-align: left;
}

.ride-card-button:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 214, 0.1);
}

.ride-card-button.has-unread-chat {
  border-color: rgba(229, 72, 77, 0.45);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.08);
}

.ride-card-button.has-unread-chat:hover {
  border-color: #d63f45;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.14);
}

.ride-card-button:disabled {
  cursor: not-allowed;
  color: #8f9ba8;
  background: #f2f5f8;
  box-shadow: none;
}

.ride-card-button:disabled:hover {
  border-color: var(--line);
}

.ride-card-button--new {
  border-style: dashed;
}

.list-section-title {
  margin: 4px 0 0;
  color: var(--navy);
  font-size: 15px;
}

.room-list-back-button {
  width: fit-content;
  margin-bottom: 12px;
}

.ride-header,
.ride-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ride-header h3 {
  font-size: 20px;
  line-height: 1.25;
}

.ride-title-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.ride-title-meta .status-label {
  margin-bottom: 0;
}

.unread-chat-badge {
  display: inline-grid;
  place-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  color: #ffffff;
  background: #e5484d;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.time-badge {
  display: inline-grid;
  place-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 4px;
  color: var(--navy);
  background: #edf2f7;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.ride-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.ride-select-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: var(--navy);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.ride-select-button:disabled {
  cursor: not-allowed;
  color: #8f9ba8;
  background: #e5eaf0;
}

.group-code-panel {
  margin-top: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 2px solid #87b89b;
  border-radius: 8px;
  color: var(--navy);
  background: #eaf5ef;
}

.group-code-panel__text {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.group-code-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.group-code-panel strong {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.group-code-chat-button {
  min-height: 42px;
  font-size: 13px;
}

.ride-route {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: #f7f9fb;
}

.ride-route span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.route-arrow {
  color: var(--muted);
  font-size: 22px;
}

.taxi-arrangement-note {
  margin: 14px 0 0;
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--navy);
  background: linear-gradient(transparent 18%, rgba(246, 214, 92, 0.92) 18%, rgba(246, 214, 92, 0.92) 88%, transparent 88%);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.5;
}

.taxi-arrangement-note--chat {
  margin: 12px 14px 0;
}

.members {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.member-slot {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
}

.secondary-button.close-room-button {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  color: var(--navy);
  background: var(--gold);
}

.secondary-button.close-room-button:hover {
  background: #d8b756;
}

.member {
  width: 100%;
  min-height: 58px;
  padding: 8px;
  display: grid;
  align-content: center;
  place-items: center;
  gap: 5px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.member__name {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.member-status-label {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 6em;
  min-height: 24px;
  border-radius: 999px;
  border: 1px solid #9bd3b3;
  padding: 0 5px;
  color: #064e3b;
  background: #ecfdf5;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  text-align: center;
  text-align-last: center;
  text-overflow: clip;
  white-space: nowrap;
  overflow: hidden;
}

.member-status-select {
  cursor: pointer;
}

.member.is-filled {
  color: var(--navy);
  border-style: solid;
  background: #eaf5ef;
}

.member.is-filled:empty::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.72);
}

.member__icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.member__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.member__text span {
  overflow-wrap: anywhere;
}

.settings-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.settings-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.settings-field input,
.settings-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f7f9fb;
  font-size: 14px;
  font-weight: 800;
}

.settings-consent {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.settings-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f7f9fb;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.settings-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
  accent-color: var(--navy);
}

.settings-check a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-link {
  min-height: auto;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.settings-terms-link {
  justify-self: start;
  font-size: 13px;
}

.settings-save-button {
  width: 100%;
  margin-top: 4px;
}

.terms-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

#guideView {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

#guideView.is-active {
  display: flex;
  flex-direction: column;
}

.guide-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}

.guide-panel {
  display: grid;
  gap: 12px;
}

.guide-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.guide-step__number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--green);
  font-size: 16px;
  font-weight: 900;
}

.group-code-badge {
  display: inline-grid;
  place-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  color: #ffffff;
  background: var(--navy);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.guide-step h3 {
  margin: 0;
  color: var(--navy);
  font-size: 16px;
  line-height: 1.35;
}

.guide-step p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.guide-actions {
  display: grid;
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 24px rgba(23, 33, 43, 0.08);
}

.admin-grid {
  display: grid;
  gap: 12px;
}

.admin-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 16px;
}

.admin-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.admin-card .primary-button,
.admin-card .secondary-button {
  width: 100%;
}

.terms-panel section {
  display: grid;
  gap: 6px;
}

.terms-panel h3 {
  margin: 0;
  color: var(--navy);
  font-size: 14px;
}

.terms-panel p,
.terms-panel li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.terms-panel ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.chat-panel {
  display: flex;
  height: clamp(520px, 68vh, 720px);
  min-height: 520px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.chat-context {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.chat-context > div {
  padding: 14px;
  background: #fbfcfd;
}

.chat-context strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.chat-notification-setting {
  padding: 10px 14px;
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-group-name {
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}

.chat-notification-setting label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 14px;
  background: #f7f9fb;
}

.chat-status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.chat-status-actions__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: bold;
}

.chat-status-button {
  min-height: 36px;
  padding: 0 12px;
  border-color: #9bd3b3;
  color: #064e3b;
  background: #ecfdf5;
  font-size: 13px;
}

.chat-status-button.is-selected {
  color: #ffffff;
  border-color: var(--green);
  background: var(--green);
}

.chat-message {
  max-width: 82%;
  align-self: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.chat-message.is-mine {
  align-self: flex-end;
  color: #ffffff;
  border-color: var(--navy);
  background: var(--navy);
}

.chat-message.is-system {
  max-width: 100%;
  align-self: center;
  color: var(--muted);
  border-style: dashed;
  background: #ffffff;
  text-align: center;
}

.chat-sender {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 900;
}

.chat-text {
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-message__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.chat-report-button {
  min-height: 28px;
  border: 0;
  padding: 0 2px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.chat-message.is-mine .chat-report-button,
.chat-message.is-system .chat-report-button {
  display: none;
}

.chat-form {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.chat-form textarea {
  min-width: 0;
  width: 100%;
  min-height: 78px;
  max-height: 150px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f7f9fb;
  line-height: 1.55;
}

.chat-action-row {
  display: flex;
  justify-content: flex-end;
}

.chat-send-button {
  justify-self: end;
  flex: 0 0 auto;
  align-self: flex-end;
  min-width: 72px;
  min-height: 44px;
  padding: 0 14px;
}

.view-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.primary-button,
.secondary-button {
  flex: 1;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
}

.primary-button {
  color: #ffffff;
  background: var(--navy);
}

.primary-button.is-leave {
  background: #c93535;
}

.secondary-button {
  color: #ffffff;
  background: var(--green);
}

.chat-contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.secondary-button.group-code-chat-button {
  width: fit-content;
  min-width: 0;
  min-height: 42px;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0 16px;
  white-space: nowrap;
}

.button-unread-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  color: #ffffff;
  background: #e5484d;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.group-code-panel .button-unread-badge {
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

.text-button {
  min-height: 38px;
  padding: 0 12px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.text-button.is-danger {
  color: #b91c1c;
}

.text-button.destination-back-button,
.text-button.room-list-back-button {
  color: #8f1d1d;
  border-color: #efb3b3;
  background: #fde8e8;
  box-shadow: 0 1px 0 rgba(143, 29, 29, 0.08);
}

.text-button.destination-back-button:hover,
.text-button.room-list-back-button:hover {
  color: #8f1d1d;
  border-color: #efb3b3;
  background: #fde8e8;
}

.text-button.return-button {
  color: #ffffff;
  border-color: #c93535;
  background: #c93535;
}

.text-button.return-button:hover {
  border-color: #a92d2d;
  background: #a92d2d;
}

.secondary-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  color: #8f9ba8;
  background: #e5eaf0;
}

.is-loading {
  cursor: wait;
  opacity: 0.78;
}

.action-row {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.action-row > button {
  width: 100%;
}

.group-leave-button {
  min-height: 46px;
}

.notice {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.profile-validation-notice {
  margin: 10px 0 16px;
}

.modal-notice {
  margin: 0 0 12px;
}

.notice.is-error {
  color: #dc2626;
}

.notice a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.profile-validation-notice a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 0 16px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--navy);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.profile-validation-notice a:hover {
  background: #243155;
}

.confirm-dialog {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 25, 50, 0.46);
}

.confirm-dialog.is-hidden {
  display: none;
}

.confirm-dialog__panel {
  width: min(100%, 340px);
  padding: 22px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(16, 25, 50, 0.24);
}

.confirm-dialog__panel h2 {
  font-size: 20px;
  line-height: 1.25;
}

.confirm-dialog__panel p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.report-message-preview {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.report-message-preview strong,
.report-reason-field span {
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.report-message-preview p {
  margin-top: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.report-reason-field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.report-reason-field textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f8fafc;
  line-height: 1.55;
  resize: vertical;
}

.confirm-dialog__actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.danger-button {
  background: #c93535;
}

.onboarding-modal,
.ban-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(16, 25, 50, 0.58);
}

.onboarding-modal__panel {
  width: min(100%, 380px);
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 58px rgba(16, 25, 50, 0.28);
}

.onboarding-modal__panel h2,
.ban-screen h2 {
  color: var(--navy);
  font-size: 21px;
  line-height: 1.3;
}

.modal-lead,
.ban-screen p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.safety-list {
  display: grid;
  gap: 10px;
}

.safety-list p {
  container-type: inline-size;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
}

.safety-list strong {
  color: var(--navy);
  font-size: 11px;
  font-size: clamp(8px, 3.5cqw, 12px);
  line-height: 1.35;
  white-space: nowrap;
}

.safety-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.modal-terms {
  max-height: 430px;
  grid-template-rows: minmax(0, 1fr) auto;
}

.modal-terms-content {
  display: grid;
  gap: 16px;
  overflow-y: auto;
}

.ban-screen {
  z-index: 40;
  background: #ffffff;
}

.ban-screen > div {
  display: grid;
  gap: 10px;
  max-width: 320px;
  text-align: center;
}

.admin-page {
  min-height: 100vh;
  background: #f4f6f8;
}

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

.admin-shell--wide {
  width: min(1440px, calc(100% - 48px));
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--navy);
}

.admin-header h1 {
  margin-top: 4px;
  font-size: 34px;
  line-height: 1.2;
}

.admin-header p:not(.eyebrow) {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1.6;
}

.admin-status-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
}

.admin-status-row p:not(.eyebrow) {
  margin-top: 0;
}

.admin-header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 16px;
  max-width: 520px;
}

.admin-nav-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 2px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.admin-nav-link:hover,
.admin-nav-link:focus {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.48);
  text-decoration: none;
}

.admin-nav-link.is-active,
.admin-nav-link[aria-current="page"] {
  color: #ffffff;
  border-bottom-color: var(--gold);
}

.admin-nav-logout {
  color: #fca5a5;
}

.admin-status-row .admin-nav-logout {
  min-height: auto;
  padding: 0;
  font-size: 14px;
}

.admin-auth-panel {
  margin-top: 18px;
}

.admin-login-form,
.admin-master-form,
.admin-settings-form,
.admin-ban-form {
  display: grid;
  gap: 12px;
}

.admin-login-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
}

.admin-master-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

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

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

.admin-login-form label,
.admin-master-form label,
.admin-settings-form label {
  display: grid;
  gap: 6px;
}

.admin-login-form span,
.admin-master-form span,
.admin-settings-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-login-form input,
.admin-master-form input,
.admin-master-form select,
.admin-settings-form input,
.admin-settings-form select,
.admin-settings-form textarea,
.admin-ban-form input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.admin-settings-form textarea {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}

.admin-form-wide {
  grid-column: span 2;
}

.admin-check-field {
  align-self: end;
  min-height: 42px;
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px !important;
}

.admin-check-field input {
  min-height: 0;
  width: auto;
}

.admin-notice {
  padding: 10px 12px;
  border-radius: 8px;
  color: #065f46;
  background: #d1fae5;
}

.admin-notice.is-error {
  color: #991b1b;
  background: #fee2e2;
}

.admin-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(32, 184, 107, 0.28);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(23, 33, 43, 0.94);
  box-shadow: 0 12px 30px rgba(23, 33, 43, 0.22);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.admin-stat,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(23, 33, 43, 0.08);
}

.admin-stat {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.admin-stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.admin-stat strong {
  color: var(--navy);
  font-size: 30px;
  line-height: 1;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  margin-top: 18px;
}

.admin-groups-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.admin-records-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.admin-side {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 18px;
}

.admin-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 14px;
  padding: 20px;
}

.admin-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-master-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-master-mode {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-master-mode .secondary-button {
  min-width: 96px;
  min-height: 40px;
  flex: 0 0 auto;
  padding: 0 14px;
  color: var(--muted);
  background: #e8eef5;
}

.admin-master-mode .secondary-button.is-active {
  color: #ffffff;
  background: var(--navy);
}

.admin-master-actions .secondary-button {
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
}

.admin-filter-bar {
  display: grid;
  grid-template-columns: minmax(130px, 170px) minmax(110px, 140px) minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-filter-bar label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.admin-filter-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-filter-bar input,
.admin-filter-bar select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.admin-filter-button {
  min-height: 42px;
  padding: 0 14px;
  line-height: 1;
}

.admin-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 14px;
  line-height: 1;
  text-align: center;
  text-decoration: none !important;
}

.admin-link-button:hover,
.admin-link-button:focus {
  text-decoration: none !important;
}

.admin-danger-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-action-button {
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  line-height: 1;
  text-align: center;
}

.admin-panel h2 {
  color: var(--navy);
  font-size: 20px;
  line-height: 1.25;
}

.admin-panel p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.admin-master-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.admin-master-tab {
  appearance: none;
  display: inline-grid;
  place-items: center;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.admin-master-tab.is-active {
  border-color: var(--navy);
  color: #ffffff;
  background: var(--navy);
}

.admin-table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.admin-table-wrap--compact {
  max-height: 260px;
}

.admin-table-wrap--compact .admin-table {
  min-width: 0;
  table-layout: fixed;
}

.admin-table-wrap--compact .admin-table th,
.admin-table-wrap--compact .admin-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table-wrap--sheet .admin-sheet-table {
  min-width: 1180px;
  table-layout: fixed;
}

.admin-sheet-col-area {
  width: 220px;
  min-width: 220px;
}

.admin-sheet-col-text {
  width: 160px;
  min-width: 160px;
}

.admin-sheet-col-wide {
  width: 220px;
  min-width: 220px;
}

.admin-master-sheet {
  display: grid;
  gap: 12px;
}

.admin-master-sheet__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-master-sheet__actions .secondary-button {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 0 14px;
}

.admin-master-sheet__meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.admin-sheet-table td {
  padding: 0;
  background: #ffffff;
}

.admin-sheet-table input[type="text"],
.admin-sheet-table input[type="number"],
.admin-sheet-table textarea.admin-sheet-textarea {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  padding: 10px 12px;
  color: var(--ink);
  background: transparent;
}

.admin-sheet-table textarea.admin-sheet-textarea {
  min-height: 64px;
  line-height: 1.4;
  resize: vertical;
  overflow-wrap: anywhere;
}

.admin-sheet-table select.admin-sheet-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  padding: 10px 32px 10px 12px;
  color: var(--ink);
  background: transparent;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.admin-sheet-table input[type="text"]:focus,
.admin-sheet-table input[type="number"]:focus,
.admin-sheet-table textarea.admin-sheet-textarea:focus,
.admin-sheet-table select.admin-sheet-select:focus {
  outline: 2px solid rgba(47, 111, 214, 0.18);
  outline-offset: -2px;
  background: #f8fbff;
}

.admin-sheet-check {
  min-height: 44px;
  display: grid;
  place-items: center;
}

.admin-sheet-check input {
  width: 18px;
  height: 18px;
}

.admin-sheet-add-row td {
  padding: 12px;
  background: #f8fafc;
}

.admin-sheet-add-row-button {
  min-height: 40px;
  width: 100%;
  padding: 0 14px;
}

.admin-clickable-row {
  cursor: pointer;
}

.admin-clickable-row.is-selected td {
  background: #f1f5f9;
}

.admin-subheading {
  color: var(--navy);
  font-size: 14px;
  line-height: 1.3;
}

.admin-detail-list {
  display: grid;
  gap: 8px;
}

.admin-detail-item {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-detail-item span,
.admin-chat-message span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.admin-detail-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.admin-detail-link {
  color: var(--navy);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.admin-detail-link:hover,
.admin-detail-link:focus {
  color: #2563eb;
}

.admin-detail-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.admin-chat-log {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.admin-chat-log--large {
  max-height: 520px;
}

.admin-chat-message {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-chat-message div {
  display: grid;
  gap: 2px;
}

.admin-chat-message strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.admin-chat-message p,
.admin-empty-text {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.admin-empty-text {
  color: var(--muted);
}

.admin-json-block {
  min-height: 120px;
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.admin-groups-table {
  min-width: 920px;
}

.admin-accounts-table {
  min-width: 980px;
}

.admin-logs-table {
  min-width: 900px;
}

.admin-chat-table {
  min-width: 940px;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.admin-inline-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 11px;
  font-weight: 900;
  vertical-align: middle;
}

.admin-status.is-active {
  color: #065f46;
  background: #d1fae5;
}

.admin-status.is-warning {
  color: #92400e;
  background: #fef3c7;
}

.admin-inline-code {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 24px;
  margin-right: 6px;
  border-radius: 4px;
  color: #ffffff;
  background: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.admin-action-cell {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-accordion-toggle,
.admin-detail-close {
  display: none;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .phone-frame {
    height: auto;
    min-height: 100vh;
    border-radius: 0;
    border: 0;
  }

  .phone-frame:has(#guideView.is-active) {
    height: 100dvh;
    min-height: 100dvh;
  }

  .admin-shell {
    width: min(100% - 28px, 760px);
    padding-top: 18px;
  }

  .admin-header,
  .admin-panel__head {
    display: grid;
  }

  .admin-login-form,
  .admin-master-form {
    grid-template-columns: 1fr;
  }

  .admin-master-actions,
  .admin-filter-bar {
    display: grid;
  }

  .admin-header-nav {
    justify-content: flex-start;
    max-width: none;
  }

  .admin-form-wide {
    grid-column: auto;
  }

  .admin-filter-bar {
    grid-template-columns: 1fr;
  }

  .admin-summary-grid,
  .admin-layout,
  .admin-groups-page,
  .admin-records-page {
    grid-template-columns: 1fr;
  }

  .admin-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .admin-stat {
    gap: 4px;
    min-width: 0;
    padding: 10px 6px;
    text-align: center;
  }

  .admin-stat span {
    font-size: 10px;
    line-height: 1.2;
  }

  .admin-stat strong {
    font-size: 20px;
  }

  .admin-accordion-toggle {
    appearance: none;
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    padding: 0;
    color: var(--navy);
    background: transparent;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.3;
    text-align: left;
  }

  .admin-accordion-toggle span:last-child {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 999px;
    color: var(--muted);
    background: #eef2f7;
    transition: transform 160ms ease;
  }

  .admin-accordion-panel.is-collapsed > :not(.admin-accordion-toggle) {
    display: none !important;
  }

  .admin-accordion-panel:not(.is-collapsed) > .admin-accordion-toggle span:last-child {
    transform: rotate(180deg);
  }

  .admin-accordion-panel > h2,
  .admin-accordion-panel > .admin-panel__head h2 {
    display: none;
  }

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

  .admin-table-wrap:not(.admin-table-wrap--sheet) {
    overflow-x: visible;
  }

  .admin-table-wrap:not(.admin-table-wrap--sheet) .admin-table,
  .admin-table-wrap:not(.admin-table-wrap--sheet) .admin-table tbody,
  .admin-table-wrap:not(.admin-table-wrap--sheet) .admin-table tr,
  .admin-table-wrap:not(.admin-table-wrap--sheet) .admin-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .admin-table-wrap:not(.admin-table-wrap--sheet) .admin-table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .admin-table-wrap:not(.admin-table-wrap--sheet) .admin-table thead {
    display: none;
  }

  .admin-table-wrap:not(.admin-table-wrap--sheet) .admin-table tr {
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(23, 33, 43, 0.06);
    overflow: hidden;
  }

  .admin-table-wrap:not(.admin-table-wrap--sheet) .admin-table tr:first-child {
    margin-top: 0;
  }

  .admin-table-wrap:not(.admin-table-wrap--sheet) .admin-table td {
    min-height: 36px;
    display: grid;
    grid-template-columns: minmax(86px, 34%) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid #edf1f5;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.45;
  }

  .admin-table-wrap:not(.admin-table-wrap--sheet) .admin-table td:last-child {
    border-bottom: 0;
  }

  .admin-table-wrap:not(.admin-table-wrap--sheet) .admin-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.5;
  }

  .admin-table-wrap:not(.admin-table-wrap--sheet) .admin-table td:not([data-label]) {
    display: block;
  }

  .admin-table-wrap:not(.admin-table-wrap--sheet) .admin-table td:not([data-label])::before {
    content: none;
  }

  .admin-action-cell {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-records-page > .admin-panel:nth-child(2),
  .admin-groups-page > .admin-panel:nth-child(2) {
    position: fixed;
    inset: 0;
    z-index: 1100;
    height: 100dvh;
    max-height: none;
    min-height: 0;
    border: 0;
    border-radius: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 180ms ease;
  }

  .admin-records-page > .admin-panel:nth-child(2).is-open,
  .admin-groups-page > .admin-panel:nth-child(2).is-open {
    transform: translateX(0);
  }

  .admin-detail-layer-open {
    overflow: hidden;
  }

  .admin-detail-close {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--navy);
    background: #f8fafc;
    font-size: 13px;
    font-weight: 900;
  }

  .admin-records-page > .admin-panel:nth-child(2) .admin-chat-log,
  .admin-groups-page > .admin-panel:nth-child(2) .admin-chat-log {
    max-height: none;
    overflow: visible;
  }

  .admin-danger-actions {
    grid-template-columns: 1fr;
  }

  .admin-shell--wide {
    width: min(100% - 28px, 760px);
  }

  .admin-toast {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 480px) {
  .onboarding-modal,
  .ban-screen {
    place-items: start center;
    padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  }

  .onboarding-modal__panel {
    max-height: none;
  }

  .top-bar {
    padding: 18px 16px 14px;
  }

  .top-bar h1 {
    font-size: 30px;
  }

  .service-title__sub {
    font-size: 16px;
  }

  .account-button {
    max-width: 188px;
    min-height: 50px;
    padding-right: 10px;
  }

  .header-actions {
    align-items: flex-end;
  }

  .header-guide-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .account-button__label {
    max-width: 112px;
    white-space: nowrap;
  }

  .view {
    padding: 16px;
  }

  .guide-scroll {
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .guide-actions {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .step-tab {
    font-size: 12px;
  }

  .action-row,
  .view-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .ride-card {
    padding: 14px;
  }

  .ride-list {
    gap: 10px;
  }

  .ride-sample-list {
    gap: 10px;
  }

  .ride-header {
    align-items: flex-start;
    gap: 10px;
  }

  .ride-header h3 {
    font-size: 18px;
    line-height: 1.2;
  }

  .time-badge {
    min-height: 20px;
    padding: 0 6px;
    font-size: 10px;
  }

  .group-code-badge {
    min-height: 20px;
    padding: 0 6px;
    font-size: 10px;
  }

  .ride-header .badge {
    flex: 0 0 auto;
  }

  .ride-card-actions {
    gap: 6px;
  }

  .ride-select-button {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  .ride-route {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding: 10px;
  }

  .ride-route span {
    margin-bottom: 3px;
    font-size: 11px;
  }

  .ride-route strong {
    font-size: 14px;
    line-height: 1.25;
  }

  .chat-context {
    grid-template-columns: 1fr;
  }

  .route-arrow {
    text-align: center;
    font-size: 18px;
  }

}

button,
button * {
  font-weight: 600;
}
