.sycb-tool {
  --sycb-primary: #4f46e5;
  --sycb-secondary: #7c3aed;
  --sycb-ink: #172033;
  --sycb-muted: #5d6678;
  --sycb-border: #cdd4e0;
  --sycb-surface: #ffffff;
  --sycb-soft: #f6f7ff;
  --sycb-danger: #b42318;
  --sycb-warning: #9a6700;
  --sycb-font-base: clamp(17px, calc(16px + .26vw), 18px);
  --sycb-font-small: 16px;
  --sycb-font-standard: 18px;
  --sycb-font-emphasis: 22px;
  --sycb-intro-size: 19px;
  --sycb-title-size: clamp(28px, 4vw, 42px);
  --sycb-result-value-size: clamp(28px, 5vw, 42px);
  --sycb-result-detail-size: clamp(18px, calc(17px + .26vw), 20px);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 960px;
  margin: 1.5rem auto;
  color: var(--sycb-ink);
  font-family: inherit;
  font-size: var(--sycb-font-base);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.sycb-tool *, .sycb-tool *::before, .sycb-tool *::after { box-sizing: inherit; }
.sycb-tool [hidden] { display: none !important; }

.sycb-tool__header {
  position: relative;
  min-width: 0;
  padding: clamp(1.35rem, 4vw, 2.5rem);
  border: 1px solid #c9c7f4;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(135deg, #f8f8ff 0%, #f4efff 100%);
}

.sycb-tool__title { margin: 0 0 .55rem; overflow-wrap: anywhere; color: #1d194a; font-size: var(--sycb-title-size); line-height: 1.16; }
.sycb-tool__header > p:not(.sycb-notice) { max-width: 760px; margin: 0; color: var(--sycb-muted); font-size: var(--sycb-intro-size); }

.sycb-notice {
  margin: 1rem 0 0;
  padding: .72rem .9rem;
  border-left: 4px solid var(--sycb-secondary);
  border-radius: 6px;
  background: #fff;
  color: #4b3f72;
  font-size: var(--sycb-font-standard);
}

.sycb-tool__panel {
  min-width: 0;
  padding: clamp(1rem, 3.5vw, 2rem);
  border: 1px solid var(--sycb-border);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  background: var(--sycb-surface);
  box-shadow: 0 14px 35px rgba(32, 35, 64, .11);
}

.sycb-form label { display: grid; gap: .4rem; color: #283145; font-size: var(--sycb-font-standard); font-weight: 700; }
.sycb-form small { color: var(--sycb-muted); font-size: var(--sycb-font-small); font-weight: 500; line-height: 1.4; }
.sycb-form input, .sycb-form select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 46px;
  padding: .65rem .75rem;
  border: 1px solid #bfc6d4;
  border-radius: 10px;
  background: #fff;
  color: var(--sycb-ink);
  font: inherit;
  font-weight: 500;
}

.sycb-form input:focus, .sycb-form select:focus, .sycb-button:focus-visible, .sycb-copy:focus-visible, .sycb-tabs button:focus-visible {
  outline: 3px solid rgba(79, 70, 229, .3);
  outline-offset: 2px;
  border-color: var(--sycb-primary);
}

.sycb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.sycb-grid > *, .sycb-form, .sycb-result, .sycb-result [data-sycb-output], .sycb-detail-stack, .sycb-card-grid, .sycb-wishes { min-width: 0; }
.sycb-form > label, .sycb-form > .sycb-grid, .sycb-form > .sycb-tabs, .sycb-form > [data-sycb-pane] { margin-bottom: 1rem; }

.sycb-tabs { display: flex; flex-wrap: wrap; gap: .45rem; padding: .3rem; border-radius: 12px; background: var(--sycb-soft); }
.sycb-tabs button {
  flex: 1 1 180px;
  min-height: 42px;
  padding: .55rem .8rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #494c67;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.sycb-tabs button.is-active { border-color: #cbc8ff; background: #fff; color: var(--sycb-primary); box-shadow: 0 2px 8px rgba(39, 35, 90, .08); }

.sycb-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; width: fit-content; }
.sycb-check input { width: 20px; min-height: 20px; margin: 0; }
.sycb-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .5rem; }
.sycb-button, .sycb-copy {
  max-width: 100%;
  min-height: 44px;
  padding: .68rem 1.05rem;
  border: 1px solid var(--sycb-primary);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sycb-primary), var(--sycb-secondary));
  color: #fff;
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  white-space: normal;
  cursor: pointer;
}
.sycb-button:hover, .sycb-copy:hover { filter: brightness(.95); }
.sycb-button--secondary { background: #fff; color: var(--sycb-primary); }
.sycb-button--small { min-height: 36px; padding: .48rem .72rem; font-size: var(--sycb-font-small); }

.sycb-result {
  margin-top: 1.35rem;
  padding: clamp(1rem, 3vw, 1.45rem);
  border: 1px solid #c8c5f2;
  border-radius: 16px;
  background: #fafaff;
  box-shadow: 0 8px 22px rgba(39, 35, 90, .07);
}
.sycb-result__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .8rem; }
.sycb-result__top h3 { margin: 0; font-size: var(--sycb-font-emphasis); }
.sycb-result [data-sycb-output] { font-size: var(--sycb-result-detail-size); line-height: 1.6; }
.sycb-copy { min-height: 34px; padding: .38rem .65rem; background: #fff; color: var(--sycb-primary); font-size: var(--sycb-font-small); }
.sycb-result__label { margin: 0; color: var(--sycb-muted); font-size: var(--sycb-result-detail-size); font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.sycb-result__value { margin: .25rem 0 1rem; color: #272063; font-size: var(--sycb-result-value-size); font-weight: 850; line-height: 1.2; }

.sycb-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: 0; }
.sycb-fact { min-width: 0; padding: .75rem; border: 1px solid #e2e4ec; border-radius: 10px; background: #fff; }
.sycb-fact dt { color: var(--sycb-muted); font-size: var(--sycb-result-detail-size); font-weight: 700; line-height: 1.5; }
.sycb-fact dd { margin: .18rem 0 0; font-size: calc(var(--sycb-result-detail-size) + 2px); font-weight: 750; line-height: 1.45; }
.sycb-result-note { margin: 1rem 0 0; padding: .72rem .85rem; border-radius: 9px; background: #f0f3f8; color: #444d60; font-size: var(--sycb-result-detail-size); line-height: 1.65; }
.sycb-result-note--info { border-left: 4px solid var(--sycb-primary); background: #f3f3ff; }
.sycb-result-note--warning { border-left: 4px solid #d6a100; background: #fff8df; color: #675000; }
.sycb-error { margin: 0; padding: .75rem .85rem; border-left: 4px solid var(--sycb-danger); border-radius: 7px; background: #fff0ef; color: var(--sycb-danger); font-weight: 700; }

.sycb-detail-stack { display: grid; gap: .8rem; margin-top: 1rem; }
.sycb-detail-stack > .sycb-result-note { margin-top: 0; }
.sycb-table-wrap { width: 100%; min-width: 0; max-width: 100%; margin-top: 1rem; overflow-x: auto; border: 1px solid var(--sycb-border); border-radius: 10px; background: #fff; -webkit-overflow-scrolling: touch; overscroll-behavior-inline: contain; }
.sycb-table-wrap table { width: 100%; min-width: 560px; border: 0; border-collapse: collapse; margin: 0; }
.sycb-table-wrap th, .sycb-table-wrap td { padding: .68rem .75rem; border: 0; border-bottom: 1px solid #e7e9ef; text-align: left; vertical-align: top; font-size: var(--sycb-result-detail-size); line-height: 1.5; }
.sycb-table-wrap th { background: #f1f2fb; color: #3c3b61; font-weight: 800; }
.sycb-table-wrap tr:last-child td { border-bottom: 0; }

.sycb-card-grid, .sycb-wishes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin-top: 1rem; }
.sycb-mini-card, .sycb-wish { min-width: 0; padding: 1rem; border: 1px solid #cecbea; border-radius: 13px; background: #fff; box-shadow: 0 6px 18px rgba(42, 40, 90, .08); }
.sycb-mini-card h4, .sycb-wish h4 { margin: .25rem 0 .5rem; font-size: calc(var(--sycb-result-detail-size) + 2px); line-height: 1.35; }
.sycb-mini-card p, .sycb-wish p { margin: .35rem 0; }
.sycb-mini-card__number { color: var(--sycb-primary); font-size: var(--sycb-result-detail-size); font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.sycb-small { color: var(--sycb-muted); font-size: var(--sycb-result-detail-size); line-height: 1.55; }
.sycb-moon-symbol { display: grid; place-items: center; width: 96px; height: 96px; margin: 1rem auto 0; border-radius: 50%; background: #17182f; color: #fff9cf; font-size: 4.6rem; line-height: 1; box-shadow: 0 0 0 7px #ececff, 0 8px 28px rgba(32, 31, 76, .25); }

.sycb-support { margin-top: 1.25rem; padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--sycb-border); border-radius: 16px; background: #fff; }
.sycb-support h3 { margin: 1.15rem 0 .35rem; color: #29275e; font-size: var(--sycb-font-emphasis); }
.sycb-support h3:first-child { margin-top: 0; }
.sycb-support p, .sycb-support ol { margin: .4rem 0; color: #4d5667; }
.sycb-support a { overflow-wrap: anywhere; }
.sycb-support li + li { margin-top: .35rem; }

.sycb-tool[data-sycb-show-details="no"] .sycb-facts,
.sycb-tool[data-sycb-show-details="no"] .sycb-result-note,
.sycb-tool[data-sycb-show-details="no"] .sycb-table-wrap {
  display: none;
}

.sycb-disabled {
  min-width: 0;
  padding: 1rem;
  overflow-wrap: anywhere;
  color: var(--sycb-muted);
  background: var(--sycb-soft);
  border: 1px solid var(--sycb-border);
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(32, 35, 64, .06);
}

.sycb-disabled p { margin: 0; }

@media (max-width: 767px) {
  .sycb-tool { margin: 1rem auto; }
  .sycb-tool__header { border-radius: 16px 16px 0 0; }
  .sycb-tool__panel { border-radius: 0 0 16px 16px; }
  .sycb-grid, .sycb-facts, .sycb-card-grid, .sycb-wishes { grid-template-columns: minmax(0, 1fr); }
  .sycb-actions { flex-direction: column; }
  .sycb-actions .sycb-button { width: 100%; }
  .sycb-result__top { align-items: flex-start; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .sycb-card-grid, .sycb-wishes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .sycb-tool__header, .sycb-tool__panel, .sycb-support { padding-left: .85rem; padding-right: .85rem; }
  .sycb-tabs button, .sycb-actions .sycb-button { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sycb-tool *, .sycb-tool *::before, .sycb-tool *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
