.twcn-page {
  background: #f5f7fa;
  color: #273548;
  min-height: 100vh;
  padding: 2rem 0 4rem;
}

.twcn-container {
  max-width: 1180px;
}

.twcn-header {
  background: transparent;
  margin: 0 auto 1.4rem;
  max-width: 900px;
  text-align: center;
}

main .twcn-header h1 {
  color: #172335 !important;
  font-size: clamp(2rem, 5vw, 3.3rem);
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.twcn-header p {
  color: #596779;
  font-size: 1.08rem;
  line-height: 1.7;
  margin: 0;
}

.twcn-tool {
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(28, 47, 73, 0.12);
  margin: 0 auto;
  max-width: 1100px;
  padding: clamp(1rem, 3vw, 1.6rem);
}

.twcn-direction {
  background: #eef2f7;
  border-radius: 14px;
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 auto 1rem;
  max-width: 500px;
  padding: 0.35rem;
}

.twcn-direction__button {
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: #566579;
  font-weight: 800;
  min-height: 46px;
  padding: 0.65rem 1rem;
}

.twcn-direction__button.is-active {
  background: #1f67bf;
  box-shadow: 0 4px 12px rgba(31, 103, 191, 0.24);
  color: #fff;
}

.twcn-workspace {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.twcn-editor {
  min-width: 0;
}

.twcn-editor__heading {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.twcn-editor__heading label {
  color: #28384c;
  font-size: 1rem;
  font-weight: 800;
}

.twcn-editor__heading span {
  color: #718094;
  font-size: 0.84rem;
}

#twcn-input,
#twcn-output {
  border: 1px solid #cbd6e2;
  border-radius: 14px;
  font-size: 1.05rem;
  line-height: 1.7;
  min-height: 330px;
  padding: 1rem;
  resize: vertical;
}

#twcn-input:focus {
  border-color: #2b72d6;
  box-shadow: 0 0 0 0.22rem rgba(43, 114, 214, 0.15);
}

#twcn-output {
  background: #f7f9fc;
  color: #26374c;
}

.twcn-swap {
  align-items: center;
  align-self: center;
  background: #172a43;
  border: 0;
  border-radius: 999px;
  color: #fff;
  display: flex;
  flex-direction: column;
  font-weight: 800;
  height: 54px;
  justify-content: center;
  line-height: 1;
  margin-top: 1.6rem;
  width: 54px;
}

.twcn-swap span:first-child {
  font-size: 1.25rem;
}

.twcn-swap__label {
  font-size: 0.62rem;
  margin-top: 0.15rem;
}

.twcn-swap:hover,
.twcn-swap:focus-visible {
  background: #245b9e;
}

.twcn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1rem;
}

.twcn-actions .btn {
  border-radius: 10px;
  font-weight: 700;
}

.twcn-feedback {
  color: #2b669f;
  margin: 0.65rem 0 0;
  min-height: 1.4rem;
  text-align: center;
}

.twcn-ad {
  margin: 1.4rem auto;
  min-height: 100px;
  text-align: center;
}

.twcn-content {
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 16px;
  overflow: hidden;
}

.twcn-section {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.twcn-section + .twcn-section {
  border-top: 1px solid #e2e8ef;
}

.twcn-section h2 {
  color: #1d2b3d;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.twcn-section h3 {
  color: #30445a;
  font-size: 1.12rem;
  margin: 1.2rem 0 0.35rem;
}

.twcn-section p,
.twcn-section li,
.twcn-table {
  color: #4d5d70;
  line-height: 1.75;
}

.twcn-note {
  background: #f1f6fb;
  border-left: 0.3rem solid #2b72d6;
  margin-bottom: 0;
  padding: 0.85rem 1rem;
}

.twcn-table th,
.twcn-table td {
  border-color: #dce4ec;
  padding: 0.75rem;
  vertical-align: middle;
}

.twcn-use-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

.twcn-use-card {
  background: #f6f8fb;
  border: 1px solid #dce5ef;
  border-radius: 12px;
  padding: 1rem;
}

.twcn-use-card strong {
  color: #263a52;
  display: block;
  margin-bottom: 0.4rem;
}

.twcn-use-card p {
  margin: 0;
}

.twcn-faq h3:first-child {
  margin-top: 0;
}

.twcn-faq p:last-child {
  margin-bottom: 0;
}

.twcn-related {
  border-top: 1px solid #e2e8ef;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 1.2rem clamp(1.25rem, 3vw, 2rem);
}

.twcn-related a {
  background: #edf4fd;
  border-radius: 999px;
  color: #245b9e;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
}

.twcn-reference {
  border-top: 1px solid #e2e8ef;
  padding: 1rem clamp(1.25rem, 3vw, 2rem);
}

.twcn-reference p {
  color: #657286;
  font-size: 0.9rem;
  margin: 0;
}

.twcn-sidebar {
  position: sticky;
  top: 1rem;
}

@media (max-width: 991.98px) {
  .twcn-workspace {
    grid-template-columns: 1fr;
  }

  .twcn-swap {
    align-self: center;
    margin: 0 auto;
    transform: rotate(90deg);
  }

  .twcn-swap__label {
    display: none;
  }

  .twcn-sidebar {
    position: static;
  }
}

@media (max-width: 767.98px) {
  .twcn-page {
    padding-top: 1rem;
  }

  .twcn-tool {
    border-radius: 15px;
    padding: 0.9rem;
  }

  #twcn-input,
  #twcn-output {
    height: 230px;
    min-height: 230px;
  }

  .twcn-use-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .twcn-direction__button {
    font-size: 0.9rem;
    padding: 0.55rem 0.4rem;
  }

  .twcn-actions .btn {
    flex: 1 1 100%;
  }
}
