:root {
  --navy: #071b45;
  --navy-mid: #0d3473;
  --blue: #176fef;
  --cyan: #28bdd5;
  --violet: #715ce7;
  --bg: #f3f6fb;
  --surface: #fff;
  --ink: #0a1d3e;
  --muted: #58708e;
  --border: #dce5f0;
  --danger: #bf3b4b;
  --shadow: 0 18px 46px rgba(7, 27, 69, 0.09);
  font-family: Inter, "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(
      circle at 82% 0,
      rgba(40, 189, 213, 0.09),
      transparent 25rem
    ),
    var(--bg);
}
button,
input {
  font: inherit;
}
.skip {
  position: fixed;
  top: -4rem;
  left: 1rem;
  z-index: 99;
  background: white;
  padding: 0.7rem 1rem;
}
.skip:focus {
  top: 1rem;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px 1fr;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(165deg, var(--navy), #0b3475 70%, #164b93);
  color: white;
  padding: 1.6rem 1rem;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.2rem 0.55rem 2rem;
}
.brand b {
  font-size: 1.18rem;
  letter-spacing: 0.02em;
}
.brand small,
.account small {
  display: block;
  opacity: 0.7;
  margin-top: 0.12rem;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  display: grid;
  place-items: center;
  transform: rotate(45deg);
  box-shadow: inset 0 0 18px rgba(40, 189, 213, 0.18);
}
.brand-mark:before {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid var(--cyan);
  border-radius: 7px;
}
.brand-mark i {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--violet);
  border-radius: 50%;
}
nav {
  display: grid;
  gap: 0.35rem;
}
.nav-item,
.reset-link {
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  border-radius: 12px;
  padding: 0.76rem 0.9rem;
  cursor: pointer;
}
.nav-item {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  font-weight: 650;
}
.nav-item span {
  width: 1.3rem;
  text-align: center;
  color: #aeeef5;
}
.nav-item:hover,
.nav-item:focus-visible,
.nav-item.active {
  background: rgba(255, 255, 255, 0.13);
  outline: none;
}
.reset-link {
  margin-top: auto;
  font-size: 0.875rem;
  opacity: 0.75;
  text-decoration: underline;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 76px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.2rem;
  backdrop-filter: blur(12px);
}
.demo-chip {
  display: inline-block;
  margin-left: 0.65rem;
  padding: 0.23rem 0.55rem;
  border-radius: 99px;
  background: #e6f8fb;
  color: #126e78;
  font-size: 0.78rem;
  font-weight: 750;
}
.account {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: white;
}
.mobile-menu {
  display: none;
  border: 0;
  background: none;
  font-size: 1.5rem;
}
.demo-note {
  padding: 0.55rem 2.2rem;
  background: #fff8df;
  border-bottom: 1px solid #ecd68a;
  color: #6e5710;
  font-size: 0.83rem;
}
main {
  padding: 2.3rem clamp(1.2rem, 4vw, 3rem) 4rem;
  max-width: 1500px;
  margin: auto;
}
.view {
  display: none;
}
.view.active {
  display: block;
}
.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.page-title h1 {
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  margin: 0.12rem 0 0.4rem;
}
.page-title p {
  margin: 0;
  color: var(--muted);
}
.eyebrow {
  font-size: 0.73rem !important;
  letter-spacing: 0.16em;
  font-weight: 800;
  color: var(--blue) !important;
  margin: 0;
}
.primary,
.secondary,
.text-button,
.danger {
  border: 0;
  border-radius: 11px;
  padding: 0.72rem 1rem;
  cursor: pointer;
  font-weight: 750;
}
.primary {
  color: white;
  background: linear-gradient(100deg, var(--blue), #2462d8 60%, var(--violet));
  box-shadow: 0 8px 20px rgba(23, 111, 239, 0.22);
}
.primary:hover {
  filter: brightness(1.06);
}
.secondary {
  background: #edf2f8;
  color: var(--ink);
}
.text-button {
  color: var(--blue);
  background: transparent;
  padding: 0.4rem;
}
.danger {
  color: white;
  background: var(--danger);
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(40, 189, 213, 0.5);
  outline-offset: 2px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.metric,
.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.metric {
  padding: 1.35rem;
  min-height: 155px;
}
.metric p {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-weight: 650;
}
.metric strong {
  font-size: 2.1rem;
}
.metric strong small,
.metric > small {
  font-size: 0.9rem;
}
.metric > span {
  display: block;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.83rem;
}
.metric.spotlight {
  color: white;
  background: linear-gradient(140deg, var(--navy), var(--navy-mid));
  border: 0;
}
.metric.spotlight p,
.metric.spotlight > span {
  color: #c8dafa;
}
.progress {
  height: 7px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 99px;
  margin-top: 0.85rem;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #8eebf3);
  border-radius: inherit;
}
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(270px, 0.7fr);
  gap: 1rem;
}
.panel {
  padding: 1.35rem;
}
.panel-head,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.panel h2 {
  font-size: 1.15rem;
  margin: 0.22rem 0;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
th {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid #edf1f6;
  font-size: 0.89rem;
}
.person {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.person-badge {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  background: linear-gradient(140deg, var(--blue), var(--cyan));
}
.person span small {
  display: block;
  color: var(--muted);
  margin-top: 0.18rem;
}
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  padding: 0.24rem 0.58rem;
  font-size: 0.76rem;
  font-weight: 750;
  background: #e8f7f5;
  color: #176c65;
}
.status.none {
  background: #edf1f6;
  color: #627187;
}
.status.pending {
  background: #fff4d5;
  color: #83610a;
}
.activity ol {
  padding: 0;
  list-style: none;
  margin: 0;
}
.activity li {
  padding: 0.72rem 0;
  border-bottom: 1px solid #edf1f6;
  font-size: 0.87rem;
}
.activity time {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}
.toolbar {
  justify-content: flex-start;
}
.search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0.55rem 0.8rem;
  background: white;
  min-width: min(350px, 100%);
}
.search input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
}
.toolbar > span {
  color: var(--muted);
  font-size: 0.85rem;
}
.privacy-note {
  color: var(--muted);
  font-size: 0.83rem;
  margin: 1rem 0.3rem;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}
.placeholder-view {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
}
.placeholder-view p {
  color: var(--muted);
}
dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  max-width: 470px;
  width: calc(100% - 2rem);
  box-shadow: 0 30px 90px rgba(7, 27, 69, 0.25);
}
dialog::backdrop {
  background: rgba(4, 15, 37, 0.58);
  backdrop-filter: blur(3px);
}
dialog form {
  padding: 1.8rem;
  position: relative;
}
dialog h2 {
  margin: 0.35rem 0;
}
dialog p:not(.eyebrow) {
  color: var(--muted);
}
dialog label {
  display: grid;
  gap: 0.45rem;
  margin-top: 1.4rem;
  font-weight: 700;
}
dialog input {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0.75rem;
}
.dialog-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  border: 0;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.5rem;
}
.form-error {
  color: var(--danger);
  min-height: 1.35rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}
.toast {
  position: fixed;
  right: 1.3rem;
  bottom: 1.3rem;
  background: var(--navy);
  color: white;
  border-radius: 12px;
  padding: 0.8rem 1.1rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1050px) {
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
  .activity {
    display: none;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: -260px;
    width: 244px;
    transition: left 0.2s;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.2);
  }
  .topbar {
    height: 66px;
    padding: 0 1rem;
  }
  .topbar > div:first-of-type {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .account span:last-child {
    display: none;
  }
  .mobile-menu {
    display: block;
  }
  .demo-note {
    padding: 0.55rem 1rem;
  }
  main {
    padding: 1.5rem 1rem 3rem;
  }
  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metric {
    min-height: 140px;
    padding: 1rem;
  }
  .metric strong {
    font-size: 1.65rem;
  }
  .panel {
    padding: 1rem;
    border-radius: 15px;
  }
}
@media (max-width: 470px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .page-title .primary {
    width: 100%;
  }
  .demo-chip {
    display: none;
  }
}
.contract-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}
.contract-card h2 {
  font-size: 1.5rem;
  margin: 0.8rem 0 0.2rem;
}
.price-note {
  color: var(--muted);
}
dl {
  margin: 1.5rem 0;
}
dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid #edf1f6;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
}
.seat-editor > p:not(.eyebrow) {
  color: var(--muted);
}
.seat-editor label {
  display: grid;
  gap: 0.55rem;
  margin: 1.4rem 0;
  font-weight: 700;
}
.stepper {
  display: flex;
  align-items: center;
  width: max-content;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.stepper button {
  border: 0;
  background: #edf2f8;
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 1.2rem;
}
.stepper output {
  min-width: 62px;
  text-align: center;
  font-weight: 800;
}
.period {
  color: var(--muted);
  font-weight: 700;
}
.date-value {
  font-size: 1.55rem !important;
}
.usage-bars {
  display: grid;
  gap: 1rem;
}
.usage-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 3fr 70px;
  align-items: center;
  gap: 1rem;
}
.usage-track {
  height: 9px;
  background: #edf1f6;
  border-radius: 99px;
  overflow: hidden;
}
.usage-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: inherit;
}
.audit-list ol {
  padding: 0;
  margin: 0;
  list-style: none;
}
.audit-list li {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 1rem 0.2rem;
  border-bottom: 1px solid #edf1f6;
}
.audit-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #e8f1ff;
  color: var(--blue);
  font-weight: 800;
}
.audit-list time {
  color: var(--muted);
  font-size: 0.82rem;
}
.inline-actions {
  display: flex;
  gap: 0.35rem;
}
.member-summary {
  margin: 1.2rem 0;
  padding: 1rem;
  background: #f5f8fc;
  border-radius: 13px;
}
.member-summary p {
  margin: 0.35rem 0 !important;
}
.warning {
  color: #8a6400;
  background: #fff7da;
  border: 1px solid #eed98f;
  border-radius: 11px;
  padding: 0.7rem;
  font-size: 0.84rem;
}
@media (max-width: 760px) {
  .contract-grid {
    grid-template-columns: 1fr;
  }
  .usage-row {
    grid-template-columns: 1fr 60px;
  }
  .usage-row .usage-track {
    grid-column: 1/3;
  }
  .audit-list li {
    grid-template-columns: 38px 1fr;
  }
  .audit-list time {
    grid-column: 2;
  }
}
.member-actions {
  flex-wrap: wrap;
}
.member-actions [data-member-close] {
  margin-right: auto;
}
.workspace,
main,
.view,
.panel,
.content-grid,
.content-grid > *,
.table-wrap {
  min-width: 0;
  max-width: 100%;
}
.table-wrap {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.topbar > div:first-of-type {
  min-width: 0;
}
table {
  width: 100%;
}
#view-members .panel {
  width: 100%;
  contain: inline-size;
}
.table-wrap {
  display: block;
  width: 100%;
}
@media (max-width: 760px) {
  #view-members .toolbar {
    flex-wrap: wrap;
  }
  .search {
    min-width: 0;
    width: 100%;
  }
}
.sr-only {
  left: 0;
  top: 0;
  clip-path: inset(50%);
}
.error-note {
  background: #fff0f1;
  border-color: #efb8bf;
  color: var(--danger);
}
button[hidden] {
  display: none;
}
.primary:disabled,
.secondary:disabled,
.danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
#organization-select {
  margin-left: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.4rem;
  background: white;
  color: var(--ink);
}

[hidden] { display: none !important; }
.invitation-entry { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.invitation-card { width: min(100%, 560px); padding: 36px; border: 1px solid var(--border); border-radius: 22px; background: white; box-shadow: 0 14px 40px #071b4510; }
.invitation-card h1 { margin: 8px 0 20px; }
.invitation-card p { line-height: 1.7; }
.invitation-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.invitation-actions button { flex: 1 1 190px; }
.invitation-card .form-error { margin-top: 16px; }
@media (max-width: 640px) { .invitation-card { padding: 26px 22px; } }
.support-form { max-width: 760px; display: grid; gap: 12px; }
.support-form p { margin: 0 0 8px; line-height: 1.7; color: var(--muted); }
.support-form label { margin-top: 8px; font-weight: 700; }
.support-form input, .support-form select, .support-form textarea { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid var(--border); border-radius: 10px; padding: 12px; font: inherit; background: white; color: var(--ink); }
.support-form textarea { resize: vertical; min-height: 160px; }
.support-form button { justify-self: start; }
.support-result { color: #126747; line-height: 1.7; }
.support-form :disabled { opacity: .6; }
@media (max-width: 640px) { .support-form button { width: 100%; } }
