:root {
  color-scheme: dark;
  --bg: #202224;
  --panel: #292c2f;
  --panel-2: #303337;
  --text: #e8eeee;
  --muted: #aebaba;
  --line: #6e7d7a;
  --line-soft: #3d4246;
  --accent: #ff8ab8;
  --accent-dark: #b8326f;
  --accent-soft: #331624;
  --warn: #ffb09c;
  --highlight: #472236;
}

* {
  box-sizing: border-box;
}

html,
body {
  touch-action: pan-x pan-y;
  overscroll-behavior: none;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

.app {
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 18px 12px 28px;
}

.app-header {
  position: relative;
  padding: 8px 0 16px;
  text-align: center;
}

.app-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0;
}

.app-title-link {
  color: inherit;
  text-decoration: none;
}

.app-title-link:active {
  color: var(--accent);
}

.app-subtitle {
  margin: 5px 0 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.header-menu-button {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: max(12px, calc((100vw - 520px) / 2 + 12px));
  display: grid;
  gap: 4px;
  place-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.header-menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.header-menu-button[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.header-menu {
  position: fixed;
  z-index: 999;
  top: 58px;
  left: max(12px, calc((100vw - 520px) / 2 + 12px));
  width: min(260px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  text-align: left;
}

.header-menu a {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.header-menu a:last-child {
  border-bottom: 0;
}

.header-menu a.is-current {
  background: var(--accent-soft);
  color: var(--accent);
}

.analysis-select {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.analysis-select span {
  color: var(--muted);
  font-size: 17px;
  font-weight: 500;
}

.analysis-select select {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 19px;
  outline: none;
}

.analysis-select select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(104, 214, 204, 0.16);
}

.panel {
  padding: 0;
}

.page-guide {
  display: grid;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.page-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.65;
}

.page-guide-title {
  color: var(--text) !important;
  font-weight: 900 !important;
}

.page-guide a {
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.page-guide a:active {
  color: var(--text);
}

.home-page {
  display: grid;
  gap: 14px;
}

.home-page .analysis-select {
  margin-bottom: 0;
}

.home-hero,
.home-section,
.home-note {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.home-hero {
  display: grid;
  gap: 12px;
  padding: 18px 14px;
}

.home-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.home-hero h2,
.home-section h2,
.home-note h2 {
  margin: 0;
  color: var(--text);
  font-weight: 900;
  letter-spacing: 0;
}

.home-hero h2 {
  font-size: 23px;
  line-height: 1.25;
  text-align: center;
}

.home-hero p,
.home-note p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.75;
}

.home-section,
.home-note {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.home-section h2,
.home-note h2 {
  font-size: 18px;
}

.home-app-links,
.home-feature-list,
.home-purpose-list,
.home-check-list {
  display: grid;
  gap: 8px;
}

.home-app-row {
  display: grid;
  gap: 8px;
}

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

.home-app-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-app-button,
.home-purpose-list a {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.home-app-button {
  display: grid;
  min-height: 104px;
  place-items: center;
  gap: 8px;
  padding: 14px 4px;
  text-align: center;
}

.home-app-button.is-setting-main {
  border-color: rgba(255, 138, 184, 0.45);
  background: rgba(255, 138, 184, 0.14);
}

.home-app-button.is-setting-sub {
  border-color: rgba(255, 138, 184, 0.34);
  background: rgba(255, 138, 184, 0.10);
}

.home-app-button.is-grape {
  border-color: rgba(172, 214, 74, 0.42);
  background: rgba(172, 214, 74, 0.13);
}

.home-app-button.is-diff {
  border-color: rgba(95, 171, 255, 0.42);
  background: rgba(95, 171, 255, 0.13);
}

.home-app-button.is-island {
  border-color: rgba(255, 202, 95, 0.42);
  background: rgba(255, 202, 95, 0.12);
}

.home-app-button.is-info {
  border-color: rgba(130, 167, 208, 0.38);
  background: rgba(130, 167, 208, 0.11);
}

.home-app-button span {
  font-size: 34px;
  line-height: 1;
}

.home-app-button strong,
.home-purpose-list strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.home-app-row-3 .home-app-button strong {
  font-size: 13px;
}

.home-app-button:active,
.home-purpose-list a:active,
.home-save-link:active {
  transform: translateY(1px);
}

.home-save-link {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid rgba(185, 125, 255, 0.40);
  border-radius: 8px;
  background: rgba(185, 125, 255, 0.10);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.home-save-link::after {
  content: " →";
  color: var(--accent);
}

.home-feature-list article {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
}

.home-feature-list h3 {
  margin: 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
}

.home-feature-list p,
.home-about p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.home-purpose-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
}

.home-purpose-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.home-purpose-list strong::after {
  content: " →";
  color: var(--accent);
}

.home-purpose-groups {
  display: grid;
  gap: 10px;
}

.home-purpose-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.home-purpose-group h3 {
  margin: 0;
  color: var(--accent);
  font-size: 15px;
  font-weight: 900;
}

.home-purpose-group p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.home-purpose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-purpose-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.home-purpose-actions a:active {
  transform: translateY(1px);
}

.home-check-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-check-list li {
  position: relative;
  min-height: 34px;
  padding: 8px 10px 8px 30px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.home-check-list li::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.home-note {
  background: rgba(255, 255, 255, 0.025);
}

.home-about {
  line-height: 1.65;
}

.home-about ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-about li {
  position: relative;
  padding-left: 16px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.home-about li::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  color: rgba(174, 186, 186, 0.58);
  font-size: 12px;
  font-weight: 700;
}

.site-footer a {
  color: rgba(174, 186, 186, 0.72);
  text-decoration: none;
}

.site-footer a:active {
  color: var(--accent);
}

.home-menu-page {
  gap: 14px;
  padding-inline: 0;
}

.home-menu-page .app-header {
  padding: 20px 56px 12px;
}

.home-menu-page .app-subtitle {
  color: var(--muted);
}

.home-menu-list {
  display: grid;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.home-menu-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  text-decoration: none;
}

.home-menu-item:last-child {
  border-bottom: 0;
}

.home-menu-item:active {
  background: rgba(255, 138, 184, 0.08);
}

.home-menu-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 20px;
}

.home-menu-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.home-menu-text strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.home-menu-text small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.home-menu-arrow {
  color: rgba(174, 186, 186, 0.6);
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
}

.home-extra {
  display: grid;
  gap: 8px;
  padding: 14px 18px 0;
}

.home-extra-details {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.home-extra-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.home-extra-details summary::-webkit-details-marker {
  display: none;
}

.home-extra-details summary::after {
  content: "⌄";
  color: var(--accent);
  font-size: 18px;
}

.home-extra-details[open] summary {
  border-bottom: 1px solid var(--line-soft);
}

.home-extra-details[open] summary::after {
  content: "⌃";
}

.home-extra-body {
  display: grid;
  gap: 16px;
  padding: 14px;
}

.home-extra-body section {
  display: grid;
  gap: 7px;
}

.home-extra-body h2,
.home-extra-body p,
.home-extra-body ul {
  margin: 0;
}

.home-extra-body h2 {
  color: var(--accent);
  font-size: 15px;
  font-weight: 900;
}

.home-extra-body p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
}

.home-extra-body ul {
  display: grid;
  gap: 4px;
  padding: 0;
  list-style: none;
}

.home-extra-body li {
  position: relative;
  padding-left: 16px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.home-extra-body li::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.home-contact-links {
  display: grid;
  gap: 8px;
}

.home-contact-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.home-contact-links a::after {
  content: "›";
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
}

.home-menu-page .site-footer {
  padding: 8px 18px 0;
}

.privacy-page {
  display: grid;
  gap: 14px;
}

.policy-panel {
  display: grid;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.policy-panel h2,
.policy-panel h3,
.policy-panel p,
.policy-panel ul {
  margin: 0;
}

.policy-panel h2 {
  color: var(--text);
  font-size: 21px;
  font-weight: 900;
}

.policy-panel section {
  display: grid;
  gap: 8px;
}

.policy-panel h3 {
  color: var(--accent);
  font-size: 15px;
  font-weight: 900;
}

.policy-panel p,
.policy-panel li {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.75;
}

.policy-panel ul {
  display: grid;
  gap: 4px;
  padding-left: 1.2em;
}

.policy-panel a {
  color: var(--accent);
  text-decoration: none;
}

.placeholder-panel {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.notice-message {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.tool-info-details {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.tool-info-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.tool-info-details summary::-webkit-details-marker {
  display: none;
}

.tool-info-details summary::after {
  content: "⌄";
  color: var(--accent);
  font-size: 18px;
}

.tool-info-details[open] summary {
  border-bottom: 1px solid var(--line-soft);
}

.tool-info-details[open] summary::after {
  content: "⌃";
}

.tool-info-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.tool-info-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.75;
}

.input-form {
  display: grid;
  gap: 12px;
}

.form-group-title {
  margin: 2px 0 -2px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
}

.form-block {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 138, 184, 0.10), transparent 34px), var(--panel);
}

.form-block::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent-dark);
}

.form-block.is-current::before {
  background: var(--accent);
}

.form-block.is-material::before {
  background: #8ec8bd;
}

.form-block.is-breakdown::before {
  background: #c995ff;
}

.form-block-body {
  display: grid;
  gap: 10px;
  padding: 0 10px 12px 14px;
}

.form-block .form-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  margin: 0 -10px 2px -14px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #8f8f8f;
  color: #ffffff;
  font-size: 15px;
}

.form-block.is-start .form-group-title::after {
  content: "前任者";
}

.form-block.is-current .form-group-title::after {
  content: "必須";
}

.form-block.is-material .form-group-title::after {
  content: "小役";
}

.form-block.is-breakdown .form-group-title::after {
  content: "入力時のみ";
}

.form-block .form-group-title::after {
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.14);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.form-block-details > summary {
  cursor: pointer;
  list-style: none;
}

.form-block-details > summary::-webkit-details-marker {
  display: none;
}

.form-block-details > summary::before {
  content: "⌄";
  margin-right: 8px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.form-block-details[open] > summary::before {
  content: "⌃";
}

.form-block-details:not([open]) > summary {
  margin-bottom: 0;
  border-bottom: 0;
}

.form-block-details > .form-block-body {
  padding-top: 10px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.form-row > span {
  color: var(--muted);
  font-size: 17px;
  font-weight: 500;
}

.input-form input,
.input-form select {
  width: 100%;
  min-height: 50px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 22px;
  text-align: center;
  outline: none;
}

.input-form select {
  appearance: auto;
  text-align: left;
  font-size: 19px;
}

.input-form input:focus,
.input-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(104, 214, 204, 0.16);
}

.bonus-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.bonus-inputs label {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.bonus-inputs span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.bonus-inputs .bonus-symbol-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 28px;
}

.bonus-symbol-label img {
  display: block;
  width: 42px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 4px rgb(0 0 0 / 28%));
}

.bonus-inputs input {
  min-width: 0;
  padding-inline: 8px;
}

.diff-control {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
}

.diff-control.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.sign-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  min-height: 50px;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: #09120f;
}

.sign-control[hidden] {
  display: none;
}

.sign-control input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.sign-control label {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.sign-control label span {
  font-size: 12px;
  line-height: 1;
}

.sign-control label strong {
  font-size: 18px;
  line-height: 1;
}

.sign-control input:checked + label {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.source-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  min-height: 50px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.source-control input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.source-control label {
  display: grid;
  place-items: center;
  padding-inline: 8px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.source-control input:checked + label {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.source-control.two-choice {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.breakdown-section {
  display: grid;
  gap: 12px;
}

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

.primary-button {
  width: 100%;
  min-height: 55px;
  margin-top: 2px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-dark);
  box-shadow: none;
  color: #e8fffb;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

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

.form-secondary-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.detail-reset-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.secondary-button {
  width: 100%;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

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

.danger-button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-dark);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

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

.error-message {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--warn);
  font-size: 13px;
  font-weight: 700;
}

.results-section {
  margin-top: 12px;
}

.result-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
}

.confirm-sheet {
  position: relative;
  width: min(100%, 360px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 20px 50px rgb(0 0 0 / 42%);
}

.confirm-sheet h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.confirm-sheet p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

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

.save-field {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

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

.save-field input {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.save-message {
  min-height: 18px;
  margin: 8px 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.58);
  cursor: pointer;
}

.modal-sheet {
  position: relative;
  width: min(100%, 620px);
  max-height: min(78vh, 640px);
  margin: 0 auto;
  overflow-y: auto;
  padding: 14px 12px 18px;
  border: 1px solid var(--line-soft);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: var(--bg);
  box-shadow: 0 -16px 34px rgba(0, 0, 0, 0.34);
}

.modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.modal-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.result-card {
  min-width: 0;
  padding: 9px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel-2);
  text-align: center;
}

.result-card.mode-cherry {
  border-color: var(--accent);
  background: var(--highlight);
}

.result-card.mode-cherry h3 {
  color: var(--accent);
  font-weight: 900;
}

.result-card h3 {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.result-main {
  display: grid;
  gap: 4px;
}

.probability {
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.nearest-setting {
  justify-self: center;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
}

.nearest-setting strong {
  font-size: 17px;
  line-height: 1;
}

.nearest-setting small {
  font-size: 10px;
}

.result-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.subheading {
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.result-notice {
  margin: 4px 0 12px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 122, 177, 0.42);
  border-radius: 8px;
  background: rgba(195, 48, 119, 0.14);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

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

.summary-card {
  min-width: 0;
  padding: 9px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel-2);
  text-align: center;
}

.summary-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.summary-card strong {
  display: block;
  color: var(--accent);
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
}

.observed-rates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.observed-rates div {
  min-width: 0;
  padding: 7px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel);
  text-align: center;
}

.observed-rates .metric-games {
  display: flex;
  min-height: 57px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-color: rgba(130, 167, 208, 0.3);
  background: rgba(130, 167, 208, 0.1);
}

.observed-rates .metric-grape {
  border-color: rgba(172, 214, 74, 0.38);
  background: rgba(172, 214, 74, 0.13);
}

.observed-rates .metric-cherry {
  border-color: rgba(255, 145, 185, 0.38);
  background: rgba(255, 145, 185, 0.13);
}

.observed-rates .metric-total {
  border-color: rgba(95, 171, 255, 0.42);
  background: rgba(95, 171, 255, 0.13);
}

.observed-rates .metric-big {
  border-color: rgba(255, 105, 105, 0.4);
  background: rgba(255, 105, 105, 0.13);
}

.observed-rates .metric-reg {
  border-color: rgba(178, 188, 201, 0.32);
  background: rgba(178, 188, 201, 0.1);
}

.observed-rates .metric-focus {
  border-color: rgba(95, 171, 255, 0.74);
  box-shadow: inset 0 0 0 1px rgba(95, 171, 255, 0.14);
}

.observed-rates span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.observed-rates strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.observed-rates .count-rate {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.15;
}

.observed-rates .count-rate-count {
  display: block;
  font-size: 14px;
}

.observed-rates .count-rate-rate {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-observed-rates {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.result-modal .summary-main-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin-bottom: 12px;
}

.result-modal .summary-sub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 12px;
}

.result-modal .summary-card,
.detail-observed-rates div {
  display: grid;
  grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
  text-align: left;
}

.detail-observed-rates div:last-child {
  border-bottom: 0;
}

.result-modal .summary-card {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel-2);
  text-align: center;
}

.result-modal .summary-card span,
.detail-observed-rates > div > span {
  display: flex;
  align-items: center;
  align-self: stretch;
  margin: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
}

.result-modal .summary-card strong,
.detail-observed-rates > div > strong {
  display: block;
  padding: 8px 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.result-modal .summary-card strong {
  color: var(--accent);
}

.result-modal .summary-main-grid .summary-card {
  grid-template-columns: minmax(0, 1fr);
  min-height: 84px;
  border-color: rgba(95, 171, 255, 0.55);
  background: linear-gradient(180deg, rgba(95, 171, 255, 0.18), rgba(95, 171, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(95, 171, 255, 0.12);
}

.result-modal .summary-main-grid .summary-card > span {
  justify-content: center;
  align-self: auto;
  padding: 12px 10px 4px;
  border-right: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.result-modal .summary-main-grid .summary-card > strong {
  padding: 0 10px 14px;
  color: var(--accent);
  font-size: 34px;
  line-height: 1;
  text-align: center;
}

.expectation-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid rgba(95, 171, 255, 0.25);
}

.expectation-card-metrics div {
  min-width: 0;
  padding: 9px 6px 10px;
}

.expectation-card-metrics div + div {
  border-left: 1px solid rgba(95, 171, 255, 0.25);
}

.expectation-card-metrics span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.expectation-card-metrics b {
  display: block;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.result-modal .summary-sub-grid .summary-card {
  grid-template-columns: minmax(0, 1fr);
  min-height: 66px;
}

.result-modal .summary-sub-grid .summary-card span {
  justify-content: center;
  align-self: auto;
  padding: 10px 6px 3px;
  border-right: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.result-modal .summary-sub-grid .summary-card strong {
  padding: 0 6px 10px;
  color: var(--text);
  font-size: 18px;
  text-align: center;
}

.detail-observed-rates .metric-games {
  display: grid;
  grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
  border-color: rgba(130, 167, 208, 0.3);
  background: rgba(130, 167, 208, 0.1);
}

.detail-observed-rates .metric-games strong {
  align-self: center;
}

.detail-observed-rates .metric-grape {
  background: rgba(172, 214, 74, 0.13);
}

.detail-observed-rates .metric-cherry {
  background: rgba(255, 145, 185, 0.13);
}

.detail-observed-rates .metric-total {
  background: rgba(95, 171, 255, 0.13);
}

.detail-observed-rates .metric-big {
  background: rgba(255, 105, 105, 0.13);
}

.detail-observed-rates .metric-reg {
  background: rgba(178, 188, 201, 0.1);
}

.detail-observed-rates .metric-focus {
  box-shadow: inset 0 0 0 1px rgba(95, 171, 255, 0.14);
}

.detail-observed-rates .count-rate {
  display: grid;
  grid-template-columns: minmax(58px, 0.8fr) 20px minmax(72px, 1fr);
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.detail-observed-rates .count-rate-count,
.detail-observed-rates .count-rate-crown,
.detail-observed-rates .count-rate-rate {
  display: block;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.detail-observed-rates .count-rate-count {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.detail-observed-rates .count-rate-crown {
  min-width: 20px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.detail-observed-rates .count-rate-rate {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.simple-input-data {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.simple-input-data div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  min-height: 92px;
  aspect-ratio: 1 / 1;
  padding: 8px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  text-align: center;
}

.simple-input-data div span {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.simple-input-data div strong {
  display: block;
  padding: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.simple-input-data .count-rate {
  display: grid;
  gap: 4px;
  line-height: 1.1;
}

.simple-input-data .count-rate-count,
.simple-input-data .count-rate-rate {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.simple-input-data .metric-big {
  background: rgba(255, 105, 105, 0.18);
}

.simple-input-data .metric-reg {
  background: rgba(178, 188, 201, 0.14);
}

.simple-input-data .metric-total {
  background: rgba(95, 171, 255, 0.16);
}

.simple-input-data .metric-games {
  background: rgba(130, 167, 208, 0.1);
}

.simple-input-data .metric-grape {
  background: rgba(172, 214, 74, 0.16);
}

.simple-result-data .count-rate {
  grid-template-columns: minmax(58px, 0.8fr) 20px minmax(72px, 1fr);
}

.simple-result-data .count-rate-count,
.simple-result-data .count-rate-crown,
.simple-result-data .count-rate-rate {
  display: block;
  text-align: right;
}

.simple-result-data .count-rate-crown {
  min-width: 20px;
  color: var(--accent);
  text-align: center;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.result-actions .primary-button {
  grid-column: 1 / -1;
  width: 100%;
}

.result-share-message {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}

.result-capture-brand {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.is-capturing-result .capture-hide {
  display: none !important;
}

.capture-clone {
  pointer-events: none;
  z-index: -1;
}

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

.saved-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.saved-note {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.saved-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.saved-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.saved-empty {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

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

.saved-card {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
}

.saved-card summary {
  display: grid;
  gap: 5px;
  padding: 12px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.saved-card summary::-webkit-details-marker {
  display: none;
}

.saved-card summary::before {
  content: "▶";
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.saved-card[open] summary::before {
  content: "▼";
}

.saved-title {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.saved-summary-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.saved-card-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.saved-meta {
  display: grid;
  gap: 0;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.saved-meta div {
  display: grid;
  grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
  border-bottom: 1px solid var(--line-soft);
}

.saved-meta div:last-child {
  border-bottom: 0;
}

.saved-meta dt,
.saved-meta dd {
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}

.saved-meta dt {
  border-right: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.saved-meta dd {
  color: var(--text);
  text-align: right;
}

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

.saved-summary-grid div {
  padding: 9px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel);
  text-align: center;
}

.saved-summary-grid span,
.saved-summary-grid strong {
  display: block;
}

.saved-summary-grid span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.saved-summary-grid strong {
  color: var(--accent);
  font-size: 16px;
  font-weight: 900;
}

.saved-subheading {
  margin: 2px 0 -4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

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

.delete-button.is-confirming {
  border-color: rgba(255, 92, 122, 0.72);
  background: rgba(255, 92, 122, 0.2);
}

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

.machine-info-panel h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

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

.machine-info-card {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
}

.machine-info-card summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 12px 0 34px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.machine-info-card summary::-webkit-details-marker {
  display: none;
}

.machine-info-card summary::before {
  content: "+";
  position: absolute;
  left: 12px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
}

.machine-info-card[open] summary::before {
  content: "-";
}

.machine-info-body {
  display: grid;
  gap: 12px;
  padding: 0 10px 12px;
}

.machine-info-section h3 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.machine-info-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel);
}

.machine-info-table th,
.machine-info-table td {
  padding: 8px 3px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
}

.machine-info-table th:last-child,
.machine-info-table td:last-child {
  border-right: 0;
}

.machine-info-table tbody tr:last-child th,
.machine-info-table tbody tr:last-child td {
  border-bottom: 0;
}

.machine-info-table thead th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 10px;
}

.machine-info-table tbody th {
  width: 42px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent);
}

.machine-info-table td.is-highlight {
  background: transparent;
  color: var(--text);
  font-weight: 800;
}

.machine-info-table :is(th, td) {
  --machine-cell-bg: transparent;
  --machine-cell-text: var(--text);
}

.machine-info-table thead th {
  --machine-cell-text: var(--muted);
}

.machine-info-table td:not(:first-child) {
  background: var(--machine-cell-bg);
  color: var(--machine-cell-text);
}

.machine-info-body > .machine-info-section:nth-of-type(1) .machine-info-table td:nth-child(2),
.machine-info-body > .machine-info-section:nth-of-type(4) .machine-info-table td:nth-child(2),
.machine-info-body > .machine-info-section:nth-of-type(4) .machine-info-table td:nth-child(4),
.machine-info-body > .machine-info-section:nth-of-type(4) .machine-info-table td:nth-child(6) {
  --machine-cell-bg: rgba(215, 68, 80, 0.14);
  --machine-cell-text: #ffd6dc;
}

.machine-info-body > .machine-info-section:nth-of-type(1) .machine-info-table td:nth-child(3),
.machine-info-body > .machine-info-section:nth-of-type(4) .machine-info-table td:nth-child(3),
.machine-info-body > .machine-info-section:nth-of-type(4) .machine-info-table td:nth-child(5) {
  --machine-cell-bg: rgba(80, 151, 224, 0.14);
  --machine-cell-text: #d8ecff;
}

.machine-info-body > .machine-info-section:nth-of-type(1) .machine-info-table td:nth-child(4) {
  --machine-cell-bg: rgba(226, 181, 71, 0.15);
  --machine-cell-text: #ffe8a8;
}

.machine-info-body > .machine-info-section:nth-of-type(3) .machine-info-table td:nth-child(2) {
  --machine-cell-bg: rgba(137, 196, 83, 0.15);
  --machine-cell-text: #dcffb8;
}

.machine-info-body > .machine-info-section:nth-of-type(3) .machine-info-table td:nth-child(3),
.machine-info-body > .machine-info-section:nth-of-type(3) .machine-info-table td:nth-child(4) {
  --machine-cell-bg: rgba(215, 68, 98, 0.14);
  --machine-cell-text: #ffd3df;
}

.machine-info-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.machine-info-message {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.island-panel,
.island-results {
  display: grid;
  gap: 12px;
}

.island-form {
  display: grid;
  gap: 14px;
}

.island-input-guide {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.island-input-block {
  display: grid;
  gap: 7px;
}

.island-input-block > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.island-input-block small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}

.island-input-block textarea {
  width: 100%;
  min-height: 210px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.55;
}

.island-help {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
}

.island-help summary {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.island-help p {
  margin: 0;
  padding: 0 12px 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
}

.prompt-copy-button {
  width: calc(100% - 24px);
  margin: 0 12px 10px;
}

.prompt-copy-message {
  min-height: 17px;
  margin: -4px 12px 8px;
  padding: 0;
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
}

.island-actions {
  display: grid;
  gap: 8px;
}

.island-results h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.island-summary {
  overflow: hidden;
  border: 1px solid #3a4248;
  border-radius: 8px;
  background: #252a2d;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.island-summary h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #3a4248;
  background: #32383d;
  color: #f3f6f7;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.island-summary-average {
  display: grid;
  gap: 4px;
  align-items: center;
  justify-items: center;
  margin: 8px;
  padding: 12px;
  border: 1px solid #3a4248;
  border-radius: 6px;
  background: #1f2326;
  text-align: center;
}

.island-summary-average span {
  color: #aeb8bd;
  font-size: 13px;
  font-weight: 800;
}

.island-summary-average strong {
  color: #ff7ab8;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.island-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 8px;
  overflow: hidden;
  border: 1px solid #3a4248;
  border-radius: 6px;
  background: #24292c;
}

.island-summary-grid div {
  display: flex;
  min-height: 58px;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 9px 5px;
  border-right: 1px solid #3a4248;
  border-bottom: 1px solid #3a4248;
  text-align: center;
}

.island-summary-grid div:nth-child(1) {
  border-color: rgba(95, 171, 255, 0.42);
  background: rgba(95, 171, 255, 0.13);
}

.island-summary-grid div:nth-child(2) {
  border-color: rgba(255, 105, 105, 0.4);
  background: rgba(255, 105, 105, 0.13);
}

.island-summary-grid div:nth-child(3) {
  border-color: rgba(172, 214, 74, 0.38);
  background: rgba(172, 214, 74, 0.13);
}

.island-summary-grid div:nth-child(4) {
  border-color: rgba(130, 167, 208, 0.3);
  background: rgba(130, 167, 208, 0.1);
}

.island-summary-grid div:nth-child(5) {
  border-color: rgba(255, 105, 105, 0.4);
  background: rgba(255, 105, 105, 0.13);
}

.island-summary-grid div:nth-child(6) {
  border-color: rgba(172, 214, 74, 0.38);
  background: rgba(172, 214, 74, 0.13);
}

.island-summary-grid div:nth-child(3n) {
  border-right: 0;
}

.island-summary-grid div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.island-summary-grid span,
.island-summary-grid strong {
  display: block;
  white-space: nowrap;
}

.island-summary-grid strong b,
.island-summary-grid strong small {
  display: block;
  font: inherit;
  line-height: 1.18;
}

.island-summary-grid strong small {
  margin-top: 3px;
  color: #cfd7dc;
  font-size: 12px;
}

.island-summary-grid span {
  margin-bottom: 5px;
  color: #aeb8bd;
  font-size: 11px;
  font-weight: 800;
}

.island-summary-grid strong {
  color: #f3f6f7;
  font-size: 13px;
  font-weight: 900;
}

.island-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.island-result-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.island-result-table th,
.island-result-table td {
  padding: 9px 8px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.island-result-table td strong,
.island-result-table td small {
  display: block;
  font: inherit;
  line-height: 1.15;
}

.island-result-table td small {
  margin-top: 3px;
  color: #cfd7dc;
  font-size: 12px;
}

.island-result-table th:first-child,
.island-result-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 54px;
  background: var(--panel-2);
  text-align: center;
}

.island-result-table th {
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.island-result-table td.is-high-setting {
  background: rgba(255, 122, 184, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 184, 0.22);
  color: #ffd7e9;
}

.island-result-table td.is-high-setting small {
  color: #ffd7e9;
}

.island-result-table td.is-diff-plus {
  background: rgba(255, 105, 105, 0.14);
  color: #ff9a9a;
}

.island-result-table td.is-diff-minus {
  background: rgba(95, 171, 255, 0.14);
  color: #9fc8ff;
}

.island-result-table tr.is-total td {
  background: rgba(95, 171, 255, 0.13);
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.island-result-table tr.is-total td:first-child {
  background: rgba(95, 171, 255, 0.22);
  color: var(--accent);
}

.judgement-box {
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.judgement-box strong {
  color: var(--accent);
}

.setting-bars {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.setting-bar-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
}

.setting-bar-label,
.setting-bar-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.setting-bar-value {
  text-align: right;
}

.setting-bar-track {
  overflow: hidden;
  height: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel);
}

.setting-bar-fill {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: var(--line);
}

.setting-bar-row.is-nearest .setting-bar-label,
.setting-bar-row.is-nearest .setting-bar-value {
  color: var(--accent);
}

.setting-bar-row.is-nearest .setting-bar-fill {
  background: var(--accent-dark);
}

.reference-analysis {
  margin-top: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.reference-analysis summary {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.reference-analysis-body {
  display: grid;
  gap: 12px;
  padding: 0 10px 12px;
}

.reference-analysis-message {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.reference-analysis-section h4 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.reference-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel);
}

.reference-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.reference-table th,
.reference-table td {
  padding: 7px 2px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
}

.reference-table tr:last-child th,
.reference-table tr:last-child td {
  border-bottom: 0;
}

.reference-table th:last-child,
.reference-table td:last-child {
  border-right: 0;
}

.reference-table thead th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 9px;
}

.reference-table tbody th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent);
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
}

.setting-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel);
}

.setting-table th,
.setting-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
  white-space: nowrap;
}

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

.setting-table td {
  font-size: 13px;
}

.setting-table tr:last-child td,
.setting-table tr:last-child th {
  border-bottom: 0;
}

.setting-table tr.is-nearest {
  background: var(--highlight);
}

.setting-table tr.is-nearest th,
.setting-table tr.is-nearest td {
  color: var(--text);
  font-weight: 900;
}

.diff-result-table th,
.diff-result-table td {
  padding-inline: 5px;
}

.diff-result-table .is-main-mode {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}

.diff-result-table td.is-main-mode {
  font-size: 15px;
}

.simple-setting-table .expectation-cell {
  color: var(--accent);
  font-size: 15px;
  font-weight: 900;
}

@media (max-width: 390px) {
  .app {
    padding-inline: 10px;
  }

  .app-header h1 {
    font-size: 22px;
  }

  .form-row {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 9px;
  }

  .analysis-select {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 9px;
  }

  .form-row > span,
  .analysis-select span {
    font-size: 15px;
  }

  .analysis-select select {
    font-size: 16px;
  }

  .input-form input,
  .input-form select {
    min-height: 46px;
    font-size: 19px;
  }

  .input-form select {
    font-size: 16px;
  }

  .bonus-inputs {
    gap: 6px;
  }

  .bonus-inputs label {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 4px;
  }

  .bonus-inputs span {
    font-size: 11px;
  }

  .bonus-inputs .bonus-symbol-label {
    width: 34px;
    height: 24px;
  }

  .bonus-symbol-label img {
    width: 34px;
  }

  .bonus-inputs input {
    padding-inline: 6px;
  }

  .diff-control {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 7px;
  }

  .diff-control.is-single {
    grid-template-columns: minmax(0, 1fr);
  }

  .sign-control {
    min-height: 46px;
  }

  .source-control {
    min-height: 46px;
  }

  .source-control label {
    font-size: 13px;
  }

  .notice-message,
  .judgement-box {
    font-size: 12px;
  }

  .probability {
    font-size: 16px;
  }

  .summary-card span {
    font-size: 10px;
  }

  .summary-card strong {
    font-size: 14px;
  }

  .observed-rates span {
    font-size: 10px;
  }

  .observed-rates strong {
    font-size: 12px;
  }

  .setting-bar-row {
    grid-template-columns: 42px minmax(0, 1fr) 34px;
    gap: 6px;
  }

  .setting-bar-label,
  .setting-bar-value {
    font-size: 11px;
  }

  .result-card h3,
  .result-meta,
  .nearest-setting small {
    font-size: 10px;
  }

  .nearest-setting strong {
    font-size: 15px;
  }

  .diff-result-table th,
  .diff-result-table td {
    padding-inline: 4px;
    font-size: 11px;
  }

  .diff-result-table td.is-main-mode {
    font-size: 12px;
  }

  .simple-setting-table th,
  .simple-setting-table td {
    padding-inline: 4px;
    font-size: 11px;
  }

  .simple-setting-table .expectation-cell {
    font-size: 12px;
  }
}
