.tcs-app {
  --tcs-blue: #1479d6;
  --tcs-blue-dark: #075ea9;
  --tcs-ink: #202124;
  --tcs-muted: #697078;
  --tcs-line: #e2e6e9;
  --tcs-soft: #f6f8f9;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  color: var(--tcs-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  line-height: 1.65;
}

.tcs-app *,
.tcs-app *::before,
.tcs-app *::after {
  box-sizing: border-box;
}

.tcs-app [hidden] {
  display: none !important;
}

.tcs-app button,
.tcs-app input {
  font: inherit;
}

.tcs-app button,
.tcs-app summary {
  cursor: pointer;
}

.tcs-app button:focus-visible,
.tcs-app input:focus-visible,
.tcs-app summary:focus-visible {
  outline: 3px solid rgba(20, 121, 214, .24);
  outline-offset: 2px;
}

.tcs-intro {
  padding: 15px 16px;
  border: 1px solid #dcebf7;
  border-radius: 10px;
  background: #f7fbff;
}

.tcs-intro p {
  margin: 0;
  color: #303941;
  font-size: 14px;
}

.tcs-trust {
  display: flex;
  margin-top: 9px;
  gap: 6px;
  flex-wrap: wrap;
}

.tcs-trust span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f4ff;
  color: var(--tcs-blue-dark);
  font-size: 11px;
  font-weight: 600;
}

.tcs-guide,
.tcs-advanced,
.tcs-rules {
  margin-top: 16px;
  border: 1px solid var(--tcs-line);
  border-radius: 12px;
  background: #fff;
}

.tcs-guide > summary,
.tcs-advanced > summary,
.tcs-rules > summary {
  position: relative;
  display: flex;
  min-height: 58px;
  padding: 12px 46px 12px 16px;
  flex-direction: column;
  justify-content: center;
  list-style: none;
  color: var(--tcs-ink);
  font-size: 14px;
  font-weight: 700;
}

.tcs-guide > summary::-webkit-details-marker,
.tcs-advanced > summary::-webkit-details-marker,
.tcs-rules > summary::-webkit-details-marker {
  display: none;
}

.tcs-guide > summary::after,
.tcs-advanced > summary::after,
.tcs-rules > summary::after {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 9px;
  height: 9px;
  border-right: 2px solid #727980;
  border-bottom: 2px solid #727980;
  content: "";
  transform: translateY(-65%) rotate(45deg);
}

.tcs-guide[open] > summary::after,
.tcs-advanced[open] > summary::after,
.tcs-rules[open] > summary::after {
  transform: translateY(-35%) rotate(225deg);
}

.tcs-guide > summary small {
  color: var(--tcs-muted);
  font-size: 11px;
  font-weight: 400;
}

.tcs-guide-body {
  display: grid;
  padding: 20px;
  border-top: 1px solid var(--tcs-line);
  grid-template-columns: .75fr 1.25fr;
  gap: 22px;
  align-items: start;
}

.tcs-guide figure {
  min-width: 0;
  margin: 0;
  text-align: center;
}

.tcs-guide figcaption {
  display: flex;
  min-height: 48px;
  margin-bottom: 12px;
  align-items: flex-start;
  gap: 9px;
  color: #3e444a;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}

.tcs-guide figcaption b {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--tcs-blue);
  color: #fff;
  font-size: 12px;
}

.tcs-guide img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--tcs-line);
  border-radius: 10px;
}

.tcs-guide figure:first-child img {
  max-width: 220px;
}

.tcs-form,
.tcs-result {
  margin-top: 16px;
  padding: 26px;
  border: 1px solid var(--tcs-line);
  border-radius: 14px;
  background: #fff;
}

.tcs-panel-title {
  margin: 0;
  color: var(--tcs-ink);
  font-size: 19px;
  font-weight: 750;
  line-height: 1.4;
}

.tcs-field {
  display: block;
  margin-top: 20px;
}

.tcs-field-head {
  display: flex;
  margin-bottom: 9px;
  align-items: center;
  gap: 10px;
  color: #30353a;
  font-size: 14px;
  font-weight: 700;
}

.tcs-field-head > b {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border-radius: 50%;
  background: var(--tcs-blue);
  color: #fff;
  font-size: 12px;
}

.tcs-field-head > span {
  min-width: 0;
}

.tcs-field .tcs-field-head small {
  display: block;
  margin: 1px 0 0;
  color: var(--tcs-muted);
  font-size: 10px;
  font-weight: 400;
}

.tcs-number-input {
  position: relative;
}

.tcs-number-input input {
  width: 100%;
  height: 58px;
  padding: 0 58px 0 14px;
  border: 1px solid #bcc4ca;
  outline: 0;
  border-radius: 9px;
  background: #fff;
  color: var(--tcs-ink);
  font-size: 18px;
  font-weight: 700;
}

.tcs-field.is-filled .tcs-number-input input {
  border-color: #8ebfe7;
  background: #fbfdff;
}

.tcs-number-input input::placeholder {
  color: #a1a8ae;
  font-weight: 400;
}

.tcs-number-input input:focus {
  border-color: var(--tcs-blue);
  box-shadow: 0 0 0 3px rgba(20, 121, 214, .12);
}

.tcs-number-input b {
  position: absolute;
  top: 50%;
  right: 15px;
  color: #666d74;
  font-size: 13px;
  transform: translateY(-50%);
}

.tcs-field small,
.tcs-result small {
  display: block;
  margin-top: 5px;
  color: var(--tcs-muted);
  font-size: 11px;
}

.tcs-quick {
  display: flex;
  margin-top: 8px;
  gap: 6px;
  flex-wrap: wrap;
}

.tcs-quick button {
  min-height: 33px;
  padding: 0 10px;
  border: 1px solid #ccd2d6;
  border-radius: 7px;
  background: #fff;
  color: #4e555b;
  font-size: 11px;
}

.tcs-quick button:hover {
  border-color: var(--tcs-blue);
  color: var(--tcs-blue-dark);
}

.tcs-quick button.is-selected {
  border-color: var(--tcs-blue);
  background: #eaf5ff;
  color: var(--tcs-blue-dark);
  font-weight: 700;
}

.tcs-advanced {
  background: var(--tcs-soft);
}

.tcs-advanced > summary {
  min-height: 48px;
  font-size: 12px;
  font-weight: 600;
}

.tcs-advanced-body {
  padding: 0 16px 18px;
  border-top: 1px solid var(--tcs-line);
}

.tcs-oldest {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.tcs-oldest legend {
  margin-bottom: 7px;
  color: #30353a;
  font-size: 12px;
  font-weight: 700;
}

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

.tcs-segments input {
  position: absolute;
  opacity: 0;
}

.tcs-segments label span {
  display: grid;
  min-height: 40px;
  padding: 6px;
  place-items: center;
  border: 1px solid #cfd5d9;
  border-radius: 7px;
  background: #fff;
  color: #555d63;
  font-size: 11px;
  text-align: center;
}

.tcs-segments input:checked + span {
  border-color: var(--tcs-blue);
  background: #edf6ff;
  color: var(--tcs-blue-dark);
  font-weight: 700;
}

.tcs-submit {
  width: 100%;
  min-height: 56px;
  margin-top: 22px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  background: var(--tcs-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.tcs-submit:hover {
  background: var(--tcs-blue-dark);
}

.tcs-disclaimer {
  margin: 9px 0 0;
  color: var(--tcs-muted);
  font-size: 10px;
  text-align: center;
}

.tcs-result {
  scroll-margin-top: 18px;
  border-top: 4px solid var(--tcs-blue);
}

.tcs-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tcs-result-head button {
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: var(--tcs-blue-dark);
  font-size: 11px;
  text-decoration: underline;
}

.tcs-risk {
  display: inline-block;
  margin-bottom: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.tcs-risk.is-low {
  background: #eaf8f2;
  color: #137352;
}

.tcs-risk.is-mid {
  background: #fff4d7;
  color: #8a6300;
}

.tcs-risk.is-high {
  background: #ffebed;
  color: #b52335;
}

.tcs-result-main {
  display: grid;
  margin-top: 20px;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tcs-result-main > div {
  padding: 17px;
  border-radius: 10px;
  background: var(--tcs-soft);
}

.tcs-result-main span {
  color: #555c62;
  font-size: 11px;
  font-weight: 700;
}

.tcs-result-main p {
  display: flex;
  margin: 6px 0 0;
  align-items: baseline;
  gap: 8px;
}

.tcs-result-main p b {
  color: #737b82;
  font-size: 16px;
}

.tcs-result-main p i {
  color: #8d9499;
  font-style: normal;
}

.tcs-result-main p strong {
  color: var(--tcs-blue-dark);
  font-size: clamp(24px, 5vw, 31px);
  letter-spacing: -.04em;
}

.tcs-result-list {
  margin-top: 14px;
  padding: 4px 16px;
  border: 1px solid var(--tcs-line);
  border-radius: 10px;
}

.tcs-result-list p {
  display: flex;
  margin: 0;
  padding-top: 12px;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.tcs-result-list p:nth-of-type(2) {
  margin-top: 9px;
  border-top: 1px solid var(--tcs-line);
}

.tcs-result-list p strong {
  color: var(--tcs-ink);
  font-size: 15px;
}

.tcs-result-list p strong b {
  font-size: 20px;
}

.tcs-result-list small {
  margin: 1px 0 11px;
  text-align: right;
}

.tcs-restriction {
  margin-top: 12px;
  padding: 13px 15px;
  border-radius: 9px;
}

.tcs-restriction.is-low {
  background: #eaf8f2;
  color: #165f48;
}

.tcs-restriction.is-mid {
  background: #fff4d7;
  color: #765600;
}

.tcs-restriction.is-high {
  background: #ffebed;
  color: #a52534;
}

.tcs-restriction strong {
  font-size: 12px;
}

.tcs-restriction p {
  margin: 2px 0 0;
  font-size: 10px;
}

.tcs-actions {
  display: grid;
  margin-top: 14px;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tcs-actions button,
.tcs-share-tool button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--tcs-blue);
  border-radius: 8px;
  background: #fff;
  color: var(--tcs-blue-dark);
  font-size: 11px;
  font-weight: 700;
}

.tcs-x-button,
.tcs-actions .tcs-x-button,
.tcs-share-tool .tcs-x-button {
  border-color: #111 !important;
  background: #111 !important;
  color: #fff !important;
}

.tcs-x-button b {
  margin-right: 5px;
  font-size: 14px;
}

.tcs-related {
  margin: 15px 0 0;
  color: var(--tcs-muted);
  font-size: 11px;
  text-align: center;
}

.tcs-related a,
.tcs-official a {
  color: var(--tcs-blue-dark);
}

.tcs-rules > summary {
  min-height: 50px;
  font-size: 12px;
}

.tcs-rules > div {
  padding: 5px 16px 14px;
  border-top: 1px solid var(--tcs-line);
}

.tcs-rules p {
  margin: 10px 0 0;
  color: #52595f;
  font-size: 11px;
}

.tcs-rules .tcs-official {
  color: var(--tcs-muted);
  font-size: 10px;
}

.tcs-share-tool {
  display: flex;
  margin-top: 16px;
  padding: 14px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 10px;
  background: var(--tcs-soft);
}

.tcs-share-tool strong,
.tcs-share-tool span {
  display: block;
}

.tcs-share-tool strong {
  color: #30363b;
  font-size: 12px;
}

.tcs-share-tool span {
  margin-top: 2px;
  color: #50575d;
  font-size: 10px;
}

.tcs-share-tool button {
  min-width: 150px;
}

.tcs-toast {
  position: fixed;
  z-index: 99999;
  right: 18px;
  bottom: 18px;
  max-width: calc(100% - 36px);
  padding: 11px 15px;
  border-radius: 8px;
  background: #202124;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  color: #fff;
  font-size: 11px;
}

@media (max-width: 620px) {
  .tcs-guide-body,
  .tcs-result-main {
    grid-template-columns: 1fr;
  }

  .tcs-guide-body {
    padding: 18px 14px;
    gap: 26px;
  }

  .tcs-guide figure:first-child img {
    max-width: 260px;
  }

  .tcs-guide figcaption {
    min-height: 0;
  }

  .tcs-form,
  .tcs-result {
    padding: 21px 16px;
  }

  .tcs-result-main p strong {
    font-size: 28px;
  }

  .tcs-share-tool {
    display: block;
    text-align: center;
  }

  .tcs-share-tool button {
    width: 100%;
    margin-top: 10px;
  }
}

@media (max-width: 420px) {
  .tcs-segments {
    grid-template-columns: 1fr;
  }

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

  .tcs-result-list p {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tcs-app * {
    scroll-behavior: auto !important;
  }
}
