:root {
  color-scheme: light;
  --bg: #dce8f5;
  --bg-deep: #c8d9ea;
  --surface: rgba(250, 253, 255, 0.93);
  --surface-solid: #ffffff;
  --surface-soft: rgba(239, 247, 255, 0.86);
  --surface-strong: #05070c;
  --surface-ink: #111827;
  --text: #111827;
  --muted: #475467;
  --muted-soft: #667085;
  --line: rgba(18, 52, 86, 0.14);
  --line-strong: rgba(18, 52, 86, 0.22);
  --primary: #0a73ff;
  --primary-strong: #005bd6;
  --primary-soft: rgba(10, 115, 255, 0.12);
  --cyan: #13b5ff;
  --gold: #d7a84f;
  --navy: #071527;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #0a73ff;
  --blue: #0a73ff;
  --shadow-soft: 0 18px 48px rgba(15, 23, 42, 0.12);
  --shadow-hover: 0 22px 54px rgba(15, 23, 42, 0.16);
  --radius-card: 8px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 15% 12%, rgba(19, 181, 255, 0.18), transparent 30%),
    radial-gradient(circle at 84% 18%, rgba(215, 168, 79, 0.22), transparent 28%),
    linear-gradient(135deg, #ecf6ff 0%, var(--bg) 44%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.47;
  letter-spacing: 0;
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  position: fixed;
  z-index: -2;
  top: 0;
  right: 0;
  left: 0;
  height: 560px;
  background:
    linear-gradient(90deg, rgba(7, 21, 39, 0.2) 0%, rgba(220, 232, 245, 0.46) 58%, rgba(220, 232, 245, 0.72) 100%),
    linear-gradient(180deg, rgba(220, 232, 245, 0) 0%, var(--bg) 82%),
    url("/assets/angelic-raid-hero.png") center top / cover no-repeat;
  opacity: 0.38;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(10, 115, 255, 0.12), transparent 28%),
    radial-gradient(circle at 78% 22%, rgba(19, 181, 255, 0.1), transparent 26%);
  pointer-events: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.52;
}

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

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  min-height: 284px;
  padding: 28px 22px 68px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 7, 12, 0.9) 0%, rgba(5, 7, 12, 0.58) 40%, rgba(5, 7, 12, 0.12) 100%),
    linear-gradient(180deg, rgba(5, 7, 12, 0.16) 0%, rgba(5, 7, 12, 0.72) 100%),
    url("/assets/angelic-raid-hero.png") center 42% / cover no-repeat;
  color: #ffffff;
  box-shadow: 0 28px 72px rgba(7, 21, 39, 0.28);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 34%, rgba(19, 181, 255, 0.38), transparent 25%),
    linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.16) 44%, transparent 62%);
  mix-blend-mode: screen;
  transform: translateX(-26%);
  animation: heroSweep 8s var(--ease) infinite;
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(143, 214, 255, 0.95), rgba(215, 168, 79, 0.9), rgba(19, 181, 255, 0.95), transparent);
  transform: translateX(-45%);
  animation: headerRail 5.6s var(--ease) infinite;
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(1440px, 100%);
  min-width: 0;
  margin: 0 auto;
}

.brand img {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(143, 214, 255, 0.36);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 34px rgba(19, 181, 255, 0.34), 0 18px 42px rgba(0, 0, 0, 0.28);
}

.brand-copy {
  min-width: 0;
}

.brand-kicker {
  display: block;
  overflow: hidden;
  max-width: 100%;
  width: max-content;
  padding: 7px 12px;
  border: 1px solid rgba(143, 214, 255, 0.38);
  border-radius: var(--radius-pill);
  background: rgba(5, 7, 12, 0.34);
  color: #8fd6ff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h1 {
  margin-top: 12px;
  font-size: clamp(34px, 4.2vw, 56px);
  font-weight: 950;
  line-height: 0.98;
  text-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.brand p,
.workspace-header p,
.panel-header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.brand p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  color: #e5f4ff;
  font-size: 16px;
  font-weight: 750;
}

.brand-english {
  color: #ffe1a1;
  font-size: 18px;
  font-weight: 900;
}

.brand-english::after {
  content: " ·";
  color: rgba(255, 255, 255, 0.62);
}

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 404px;
  gap: 20px;
  width: min(1460px, calc(100% - 32px));
  margin: -36px auto 52px;
}

.view-tabs {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-card);
  background: rgba(235, 246, 255, 0.9);
  box-shadow: var(--shadow-soft);
  backdrop-filter: saturate(170%) blur(18px);
  animation: panelIn 520ms var(--ease) both;
}

.view-tabs button,
.raid-tabs button {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.view-tabs button {
  position: relative;
  min-height: 46px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  text-align: left;
  transition: color 180ms var(--ease), background-color 180ms var(--ease), transform 180ms var(--ease);
}

.view-tabs button:hover:not(.is-active) {
  background: rgba(10, 115, 255, 0.08);
  transform: translateX(2px);
}

.view-tabs button.is-active {
  background: linear-gradient(135deg, #0a73ff, #13b5ff 72%, #57d3ff);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(10, 115, 255, 0.24);
}

.raid-tabs {
  display: inline-flex;
  justify-self: center;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.05);
  backdrop-filter: saturate(160%) blur(10px);
}

.raid-tabs button {
  flex: 0 0 auto;
  min-width: 78px;
  min-height: 38px;
  border-radius: var(--radius-pill);
  padding: 0 17px;
  font-size: 14px;
  white-space: nowrap;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.raid-tabs button:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.72);
}

.raid-tabs button.is-active {
  background: var(--surface-ink);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.18);
  animation: tabPop 240ms var(--ease) both;
}

.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  transition:
    transform 170ms var(--ease),
    background-color 170ms var(--ease),
    border-color 170ms var(--ease),
    color 170ms var(--ease),
    box-shadow 170ms var(--ease);
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: scale(0.96);
}

.button-primary {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(10, 115, 255, 0.26);
}

.button-primary:hover {
  box-shadow: 0 16px 34px rgba(10, 115, 255, 0.34);
}

.button-secondary {
  background: rgba(10, 115, 255, 0.08);
  border-color: rgba(10, 115, 255, 0.24);
  color: var(--primary-strong);
}

.button-secondary:hover {
  background: rgba(10, 115, 255, 0.13);
}

.button-ghost {
  background: rgba(255, 255, 255, 0.76);
  border-color: var(--line);
  color: var(--text);
}

.button-ghost:hover {
  border-color: rgba(10, 115, 255, 0.22);
  background: #ffffff;
}

.button-danger {
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(220, 38, 38, 0.26);
  color: var(--red);
}

.button-danger:hover {
  background: rgba(220, 38, 38, 0.07);
}

.button-icon {
  width: 40px;
  padding: 0;
  font-size: 17px;
}

.workspace,
.tool-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(143, 214, 255, 0.28);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(250, 253, 255, 0.96), rgba(239, 247, 255, 0.92));
  box-shadow: var(--shadow-soft);
  backdrop-filter: saturate(170%) blur(18px);
}

.workspace::before,
.tool-panel::before,
.force::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(19, 181, 255, 0.55), transparent);
}

.workspace {
  padding: 24px;
  animation: panelIn 560ms var(--ease) both;
}

.tool-panel {
  padding: 20px;
  animation: panelIn 620ms var(--ease) both;
}

.workspace-header,
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.workspace-header {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) auto minmax(118px, 1fr);
  align-items: center;
}

.workspace-header h2,
.panel-header h2 {
  color: var(--text);
  font-size: 26px;
  font-weight: 850;
  line-height: 1.12;
}

.header-actions,
.force-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.header-actions {
  justify-content: flex-end;
}

.side-panel {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 100px);
  overflow: auto;
  scrollbar-width: thin;
}

.settings-dialog,
.equipment-dialog {
  width: min(600px, calc(100% - 28px));
  border: 0;
  border-radius: var(--radius-card);
  padding: 0;
  background: transparent;
}

.equipment-dialog {
  width: min(760px, calc(100% - 28px));
}

.settings-dialog::backdrop,
.equipment-dialog::backdrop {
  background: rgba(5, 7, 12, 0.46);
  backdrop-filter: blur(10px);
}

.settings-card,
.equipment-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-hover);
}

.settings-header,
.equipment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.settings-header h2,
.equipment-header h2 {
  font-size: 24px;
  font-weight: 850;
  line-height: 1.16;
}

.settings-header p,
.equipment-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.equipment-member-summary {
  display: grid;
  grid-template-columns: 54px 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(248, 250, 252, 0.9);
}

.equipment-member-summary .member-avatar {
  width: 48px;
  height: 48px;
}

.equipment-member-summary .member-class-icon {
  width: 34px;
  height: 34px;
}

.equipment-member-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.equipment-member-text strong,
.equipment-member-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-member-text strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 850;
}

.equipment-member-text span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.equipment-tabs {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
}

.equipment-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 850;
  transition: background-color 170ms var(--ease), color 170ms var(--ease), box-shadow 170ms var(--ease);
}

.equipment-tabs button.is-active {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(10, 115, 255, 0.2);
}

.equipment-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-height: 120px;
}

.equipment-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.94);
}

.equipment-item[data-grade="Epic"] {
  border-color: rgba(215, 168, 79, 0.34);
}

.equipment-item[data-grade="Unique"] {
  border-color: rgba(10, 115, 255, 0.24);
}

.equipment-item[data-grade="Special"] {
  border-color: rgba(112, 75, 229, 0.24);
}

.equipment-item-icon {
  display: block;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-card);
  background: rgba(15, 23, 42, 0.06) center / contain no-repeat;
}

.equipment-item-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.equipment-item-name {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.3;
  white-space: nowrap;
}

.equipment-item-enchant,
.equipment-item-exceed {
  flex: 0 0 auto;
}

.equipment-item-exceed {
  color: var(--cyan);
}

.equipment-item-label {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.raid-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(248, 250, 252, 0.88);
}

.raid-order-actions {
  display: flex;
  gap: 6px;
}

.button-order {
  width: 40px;
  padding: 0;
}

.raid-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.forces {
  display: grid;
  gap: 18px;
}

.force {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-card);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(232, 243, 255, 0.84));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  animation: forceIn 440ms var(--ease) both;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.force:nth-child(2) {
  animation-delay: 70ms;
}

.force:nth-child(3) {
  animation-delay: 120ms;
}

.force:nth-child(4) {
  animation-delay: 170ms;
}

.force:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.force.is-active {
  border-color: rgba(10, 115, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(10, 115, 255, 0.13), var(--shadow-hover);
}

.force.is-capturing,
.force.is-capturing * {
  animation: none !important;
  transition: none !important;
}

.force.is-capturing {
  transform: none !important;
}

.force-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 0;
}

.force-title {
  display: grid;
  flex: 1 1 420px;
  gap: 12px;
  min-width: 0;
}

.force-title-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.force-title h3 {
  font-size: 21px;
  font-weight: 850;
  line-height: 1.19;
}

.force-title p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.force-schedule {
  display: inline-grid;
  grid-template-columns: auto 168px 136px;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.94);
}

.force-schedule-label {
  padding: 0 6px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.force-schedule input {
  height: 34px;
  min-height: 34px;
  border-color: transparent;
  border-radius: var(--radius-pill);
  padding: 0 10px;
  background: rgba(241, 245, 249, 0.96);
  font-size: 13px;
  font-weight: 650;
}

.force-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 8px;
  min-width: 0;
}

.force-metric {
  display: grid;
  grid-template-columns: max-content minmax(110px, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.95);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.force-metric > span {
  min-width: 0;
  white-space: nowrap;
}

.party-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.party {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.party-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.party h4 {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}

.party-tags {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 5px;
  min-width: 0;
}

.party-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}

.party-tag--required {
  border-color: rgba(220, 38, 38, 0.24);
  background: rgba(254, 226, 226, 0.88);
  color: #b91c1c;
}

.party-tag--advisory {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(254, 243, 199, 0.9);
  color: #a16207;
}

.slots {
  display: grid;
  gap: 8px;
}

.slot {
  min-width: 0;
  height: 150px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: #ffffff;
  text-align: left;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.slot:hover {
  transform: translateY(-1px);
  border-color: rgba(10, 115, 255, 0.28);
  background: #ffffff;
}

.slot.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.slot.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 115, 255, 0.12);
  animation: selectedBreath 2.8s var(--ease) infinite;
}

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

.member-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: #ffffff;
  animation: itemIn 260ms var(--ease) both;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.member-row:hover {
  transform: translateY(-1px);
  border-color: rgba(10, 115, 255, 0.22);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.slot .member-row {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 10px 11px;
}

.slot .member-row:hover {
  transform: none;
}

.member-profile {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

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

.member-avatar {
  display: block;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-card);
  background: #eef2f7;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.14);
}

.member-class-badge {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 100%;
  min-width: 0;
}

.member-class-icon {
  display: block;
  width: 42px;
  height: 42px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 6px 8px rgba(15, 23, 42, 0.18));
}

.member-class-badge.is-icon-missing {
  padding-top: 2px;
}

.member-class-label {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-profile-text {
  min-width: 0;
}

.member-name-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.member-name {
  overflow: hidden;
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-name strong {
  color: var(--primary);
}

.member-inline-info {
  flex: 0 1 auto;
  overflow: hidden;
  min-width: 74px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-details {
  display: grid;
  gap: 3px;
  margin-top: 8px;
}

.member-detail-line {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.member-detail-label {
  color: var(--muted);
  font-weight: 800;
}

.member-detail-value {
  overflow: hidden;
  min-width: 0;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-power .member-detail-value {
  color: var(--primary-strong);
}

.member-power.is-compared .member-detail-value {
  color: var(--power-color);
}

.member-status {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  min-width: 0;
}

.member-status-row,
.member-control-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.member-status-label,
.member-control-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.member-status-value {
  display: grid;
  grid-template-columns: auto minmax(70px, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.proficiency-value {
  min-width: 18px;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.proficiency-meter {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
}

.proficiency-meter--compact {
  min-width: 96px;
}

.proficiency-segment {
  height: 8px;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.1);
}

.proficiency-segment.is-filled {
  background: var(--level-color);
  animation: meterFill 360ms var(--ease) both;
}

.clear-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.clear-dot,
.clear-person {
  display: inline-block;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
}

.clear-dot {
  width: 10px;
  height: 10px;
}

.clear-status.is-cleared .clear-dot,
.clear-person.is-cleared {
  background: #16a34a;
}

.clear-status.is-uncleared .clear-dot,
.clear-person.is-uncleared {
  background: #dc2626;
}

.clear-person.is-empty {
  background: rgba(15, 23, 42, 0.16);
}

.clear-meter {
  display: grid;
  grid-template-columns: repeat(8, 10px);
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.clear-person {
  width: 10px;
  height: 10px;
  animation: dotIn 260ms var(--ease) both;
}

.member-controls {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.proficiency-control {
  display: grid;
  grid-template-columns: repeat(10, minmax(12px, 1fr));
  gap: 3px;
  width: min(260px, 100%);
  min-width: 0;
}

.proficiency-button {
  height: 18px;
  min-height: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.1);
  padding: 0;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), border-color 160ms var(--ease);
}

.proficiency-button:hover {
  transform: translateY(-1px) scaleY(1.08);
}

.proficiency-button.is-filled {
  background: var(--level-color);
}

.proficiency-button.is-current {
  border-color: var(--surface-ink);
  box-shadow: 0 0 0 1px #ffffff inset;
}

.clear-toggle {
  justify-self: start;
  min-height: 34px;
  border: 1px solid rgba(220, 38, 38, 0.32);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.78);
  color: var(--red);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease);
}

.clear-toggle:hover {
  transform: translateY(-1px);
}

.clear-toggle.is-cleared {
  border-color: rgba(22, 163, 74, 0.42);
  color: var(--green);
}

.member-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  min-height: 100%;
}

.member-actions .button {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.member-actions .equipment-button,
.member-actions .official-button {
  width: 34px;
  flex: 0 0 34px;
  padding: 0;
  border-radius: var(--radius-pill);
  font-weight: 850;
  line-height: 1;
}

.member-quick-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: auto;
}

.member-actions .equipment-button {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-style: italic;
}

.member-actions .official-button {
  font-size: 16px;
}

.remove-member {
  width: 34px;
  min-height: 34px;
  padding: 0;
}

.side-panel .member-row,
.slot .member-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.side-panel .member-profile,
.slot .member-profile {
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 10px;
}

.side-panel .member-avatar,
.slot .member-avatar {
  width: 46px;
  height: 46px;
}

.side-panel .member-class-icon,
.slot .member-class-icon {
  width: 36px;
  height: 36px;
}

.side-panel .member-name-line,
.slot .member-name-line {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
}

.side-panel .member-detail-line,
.slot .member-detail-line {
  grid-template-columns: 48px minmax(0, 1fr);
}

.side-panel .member-status,
.slot .member-status {
  gap: 4px;
  margin-top: 6px;
}

.slot .member-media {
  gap: 3px;
}

.slot .member-details {
  gap: 2px;
  margin-top: 5px;
}

.slot .member-status {
  gap: 3px;
  margin-top: 5px;
}

.side-panel .member-status-row,
.slot .member-status-row {
  grid-template-columns: 48px minmax(0, 1fr);
}

.side-panel .member-status-value,
.slot .member-status-value {
  grid-template-columns: auto minmax(58px, 1fr);
  gap: 5px;
}

.side-panel .proficiency-segment,
.slot .proficiency-segment {
  height: 7px;
}

.side-panel .clear-status,
.slot .clear-status {
  font-size: 11px;
}

.search-form,
.roster-filter-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.roster-filter-form {
  margin-bottom: 14px;
}

.roster-manager-controls {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(248, 250, 252, 0.94);
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

input,
select {
  width: 100%;
  height: 44px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--text);
  padding: 0 14px;
  font-size: 15px;
  font-weight: 600;
  transition: border-color 170ms var(--ease), background-color 170ms var(--ease), box-shadow 170ms var(--ease);
}

input::placeholder {
  color: var(--muted-soft);
}

input:hover,
select:hover {
  border-color: rgba(10, 115, 255, 0.22);
  background: #ffffff;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(19, 181, 255, 0.86);
  outline-offset: 2px;
}

input:focus,
select:focus {
  border-color: rgba(10, 115, 255, 0.38);
  box-shadow: 0 0 0 4px rgba(10, 115, 255, 0.1);
}

.search-results {
  margin-top: 14px;
}

.more-button {
  width: 100%;
  margin-top: 12px;
}

.roster-list {
  grid-template-columns: 1fr;
}

.roster-preview-toggle {
  display: none;
}

button:hover:not(:disabled),
button:active:not(:disabled),
.view-tabs button:hover:not(.is-active),
.force:hover,
.slot:hover,
.member-row:hover,
.proficiency-button:hover,
.clear-toggle:hover {
  transform: none !important;
}

.empty-state,
.error-state {
  padding: 24px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.error-state {
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--red);
}

[data-view="roster"] .planner-only {
  display: none;
}

@keyframes headerRail {
  0% {
    transform: translateX(-55%);
    opacity: 0.35;
  }
  45% {
    opacity: 1;
  }
  100% {
    transform: translateX(55%);
    opacity: 0.35;
  }
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes heroSweep {
  0% {
    transform: translateX(-38%);
    opacity: 0.22;
  }
  42% {
    opacity: 0.48;
  }
  100% {
    transform: translateX(38%);
    opacity: 0.18;
  }
}

@keyframes panelIn {
  from {
    transform: translateY(12px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes forceIn {
  from {
    transform: translateY(14px) scale(0.985);
  }
  to {
    transform: translateY(0) scale(1);
  }
}

@keyframes itemIn {
  from {
    transform: translateY(7px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes tabPop {
  0% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes selectedBreath {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(10, 115, 255, 0.12);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(19, 181, 255, 0.16);
  }
}

@keyframes meterFill {
  from {
    transform: scaleX(0.18);
    opacity: 0.55;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes dotIn {
  from {
    transform: scale(0.55);
    opacity: 0.3;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 118px minmax(0, 1fr) 368px;
  }

  .workspace {
    padding: 20px;
  }

  .tool-panel {
    padding: 18px;
  }
}

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

  .view-tabs,
  .side-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

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

  .view-tabs button {
    text-align: center;
  }

  .view-tabs button:hover:not(.is-active) {
    transform: translateY(-1px);
  }
}

@media (max-width: 860px) {
  .party-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 240px;
    padding: 22px 16px 58px;
    background-position: 58% center;
  }

  .brand img {
    width: 46px;
    height: 46px;
  }

  h1 {
    font-size: clamp(30px, 8vw, 38px);
  }

  .app-shell {
    width: calc(100% - 20px);
    margin-top: -34px;
  }

  [data-view="planner"].app-shell {
    padding-bottom: 74px;
  }

  [data-view="planner"].app-shell.is-roster-preview-open {
    padding-bottom: calc(min(64dvh, 520px) + 18px);
  }

  .workspace,
  .tool-panel {
    padding: 14px;
  }

  [data-view="planner"] .roster-preview-panel {
    position: fixed;
    z-index: 40;
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: grid;
    grid-template-rows: auto;
    gap: 0;
    height: 56px;
    max-height: none;
    overflow: hidden;
    padding: 0;
    border-color: rgba(10, 115, 255, 0.38);
    background: rgba(250, 253, 255, 0.98);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.24);
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  [data-view="planner"] .roster-preview-panel.is-open {
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 10px;
    height: min(64dvh, 520px);
    max-height: calc(100dvh - 20px);
    padding: 10px;
  }

  [data-view="planner"] .roster-preview-panel.is-collapsed .panel-header,
  [data-view="planner"] .roster-preview-panel.is-collapsed .roster-filter-form,
  [data-view="planner"] .roster-preview-panel.is-collapsed .roster-preview {
    display: none;
  }

  [data-view="planner"] .roster-preview-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: var(--radius-card);
    background: linear-gradient(135deg, var(--surface-ink), #0a73ff);
    color: #ffffff;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.2;
    text-align: center;
  }

  [data-view="planner"] .roster-preview-panel.is-open .roster-preview-toggle {
    min-height: 42px;
  }

  [data-view="planner"] .roster-preview-panel .panel-header {
    margin-bottom: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }

  [data-view="planner"] .roster-preview-panel .roster-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: rgba(248, 250, 252, 0.96);
  }

  [data-view="planner"] .roster-preview-panel .field span {
    display: none;
  }

  [data-view="planner"] .roster-preview-panel .field-wide {
    grid-column: 1 / -1;
  }

  [data-view="planner"] .roster-preview-panel input,
  [data-view="planner"] .roster-preview-panel select {
    height: 38px;
    padding: 0 12px;
    font-size: 14px;
  }

  [data-view="planner"] .roster-preview {
    min-height: 0;
    align-content: start;
    gap: 8px;
    grid-auto-rows: max-content;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
    scrollbar-width: thin;
  }

  [data-view="planner"] .roster-preview .member-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 72px;
    gap: 8px;
    padding: 9px;
  }

  [data-view="planner"] .roster-preview .member-profile {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  [data-view="planner"] .roster-preview .member-media {
    gap: 0;
  }

  [data-view="planner"] .roster-preview .member-avatar {
    display: none;
  }

  [data-view="planner"] .roster-preview .member-class-icon {
    width: 34px;
    height: 34px;
  }

  [data-view="planner"] .roster-preview .member-class-label {
    font-size: 10px;
    line-height: 1.12;
  }

  [data-view="planner"] .roster-preview .member-name-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }

  [data-view="planner"] .roster-preview .member-name {
    font-size: 14px;
  }

  [data-view="planner"] .roster-preview .member-inline-info {
    min-width: 0;
    font-size: 11px;
  }

  [data-view="planner"] .roster-preview .member-details {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 4px;
    margin-top: 4px;
  }

  [data-view="planner"] .roster-preview .member-detail-line {
    display: block;
    min-width: 0;
    font-size: 11px;
  }

  [data-view="planner"] .roster-preview .member-detail-label {
    display: none;
  }

  [data-view="planner"] .roster-preview .member-status {
    display: none;
  }

  [data-view="planner"] .roster-preview .member-actions {
    align-items: stretch;
    justify-content: center;
    min-height: 0;
  }

  [data-view="planner"] .roster-preview .member-actions .button {
    width: 62px;
    min-height: 38px;
    padding: 0 8px;
  }

  .workspace-header {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .workspace-header h2,
  .panel-header h2,
  .settings-header h2 {
    font-size: 22px;
  }

  .raid-tabs,
  .header-actions {
    width: 100%;
  }

  .raid-tabs {
    justify-self: stretch;
  }

  .raid-tabs button {
    flex: 1 0 auto;
  }

  .raid-settings-row,
  .raid-add-row {
    grid-template-columns: 1fr;
  }

  .raid-order-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button-order {
    width: auto;
  }

  .header-actions,
  .force-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .force-header {
    align-items: stretch;
    flex-direction: column;
  }

  .force-title {
    width: 100%;
    flex-basis: auto;
  }

  .force-schedule {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    border-radius: var(--radius-card);
  }

  .force-schedule-label {
    grid-column: auto;
  }

  .force-schedule input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .force-metrics {
    grid-template-columns: 1fr;
  }

  .force-metric {
    grid-template-columns: max-content minmax(110px, 1fr);
    overflow-x: auto;
  }

  .search-form,
  .roster-filter-form {
    grid-template-columns: 1fr;
  }

  .slot {
    height: 158px;
  }

  .party-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .party-tags {
    justify-content: flex-start;
  }

  .member-profile,
  .side-panel .member-profile,
  .slot .member-profile {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .member-avatar,
  .side-panel .member-avatar,
  .slot .member-avatar {
    width: 44px;
    height: 44px;
  }

  .member-class-icon,
  .side-panel .member-class-icon,
  .slot .member-class-icon {
    width: 34px;
    height: 34px;
  }

  .equipment-card {
    padding: 14px;
  }

  .equipment-header {
    align-items: stretch;
    flex-direction: column;
  }

  .equipment-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  body {
    font-size: 15px;
  }

  .app-shell {
    width: calc(100% - 14px);
    margin-top: -28px;
  }

  [data-view="planner"].app-shell {
    padding-bottom: 70px;
  }

  [data-view="planner"].app-shell.is-roster-preview-open {
    padding-bottom: calc(min(66dvh, 480px) + 14px);
  }

  .topbar {
    min-height: 226px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand img {
    width: 42px;
    height: 42px;
  }

  .brand-kicker {
    font-size: 11px;
  }

  h1 {
    font-size: 30px;
  }

  .workspace,
  .tool-panel,
  .settings-card {
    padding: 12px;
  }

  [data-view="planner"] .roster-preview-panel {
    right: 7px;
    bottom: 7px;
    left: 7px;
    height: 54px;
    max-height: none;
    padding: 0;
  }

  [data-view="planner"] .roster-preview-panel.is-open {
    height: min(66dvh, 480px);
    max-height: calc(100dvh - 14px);
    padding: 8px;
  }

  [data-view="planner"] .roster-preview-toggle {
    min-height: 52px;
    font-size: 13px;
  }

  [data-view="planner"] .roster-preview-panel.is-open .roster-preview-toggle {
    min-height: 40px;
  }

  [data-view="planner"] .roster-preview-panel .panel-header h2 {
    font-size: 19px;
  }

  [data-view="planner"] .roster-preview-panel .panel-header p {
    font-size: 11px;
  }

  [data-view="planner"] .roster-preview-panel input,
  [data-view="planner"] .roster-preview-panel select {
    height: 36px;
    font-size: 13px;
  }

  [data-view="planner"] .roster-preview .member-row {
    grid-template-columns: minmax(0, 1fr) 58px;
    min-height: 66px;
    padding: 8px;
  }

  [data-view="planner"] .roster-preview .member-profile {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  [data-view="planner"] .roster-preview .member-details {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }

  [data-view="planner"] .roster-preview .member-class-icon {
    width: 30px;
    height: 30px;
  }

  [data-view="planner"] .roster-preview .member-class-label,
  [data-view="planner"] .roster-preview .member-inline-info,
  [data-view="planner"] .roster-preview .member-detail-line {
    font-size: 10px;
  }

  [data-view="planner"] .roster-preview .member-actions,
  [data-view="planner"] .roster-preview .member-actions .button {
    width: 58px;
  }

  .force-header,
  .party-grid {
    padding: 12px;
  }

  .member-row {
    grid-template-columns: 1fr;
  }

  .member-actions {
    align-items: stretch;
    justify-content: stretch;
  }

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

  .member-quick-actions {
    align-self: flex-end;
  }

  .member-actions .equipment-button,
  .member-actions .official-button {
    width: 34px;
    flex-basis: 34px;
  }

  .slot .member-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .slot .member-actions .button {
    width: auto;
  }

  .equipment-member-summary {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .equipment-member-summary .member-class-badge {
    display: none;
  }
}
