.gctc {
  --gctc-gold: #b8860b;
  --gctc-gold-dark: #7a5600;
  --gctc-gold-soft: #fff8e8;
  --gctc-border: #ead9aa;
  --gctc-text: #1f2937;
  --gctc-muted: #6b7280;
  --gctc-green: #157347;
  --gctc-red: #b42318;
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
  color: var(--gctc-text);
  font-family: "Sarabun", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  box-sizing: border-box;
}

.gctc--full {
  position: relative;
  left: 50%;
  width: min(1000px, calc(100vw - 24px));
  max-width: 1000px;
  padding: 0;
  transform: translateX(-50%);
}

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

.gctc [hidden] {
  display: none !important;
}

.gctc button,
.gctc input,
.gctc select {
  font: inherit;
}

.gctc-product-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: -6px -6px 22px;
  padding: 6px;
  border: 1px solid #e8dec4;
  border-radius: 15px;
  background: #f7f3e9;
}

.gctc-product-tabs button {
  min-height: 46px;
  padding: 9px 14px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #6d6451;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.gctc-product-tabs button.is-active {
  background: #fff;
  color: var(--gctc-gold-dark);
  box-shadow: 0 3px 12px rgba(78, 61, 20, .11);
}

.gctc-card {
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--gctc-border);
  border-radius: 22px;
  background: linear-gradient(180deg, #fffdf8 0%, #fff 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
}

.gctc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.gctc-head h2 {
  margin: 0 0 6px;
  color: var(--gctc-gold-dark);
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.25;
}

.gctc-head p {
  margin: 0;
  color: var(--gctc-muted);
  font-size: 15px;
}

.gctc-mode {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid #e5dcc5;
  border-radius: 13px;
  background: #f7f3e9;
}

.gctc-mode-button {
  min-height: 38px;
  padding: 7px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #675d4a;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.gctc-mode-button.is-active {
  background: #fff;
  color: var(--gctc-gold-dark);
  box-shadow: 0 2px 8px rgba(67, 51, 16, .1);
}

.gctc-source-strip {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 18px;
}

.gctc-source-card {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #e6dfcf;
  border-radius: 13px;
  background: rgba(255, 255, 255, .82);
}

.gctc-source-card.is-fallback {
  border-color: #f2cb76;
  background: #fffbeb;
}

.gctc-source-card.is-stale,
.gctc-source-card.is-error {
  border-color: #f0a6a0;
  background: #fff5f4;
}

.gctc-source-label,
.gctc-source-card small,
.gctc-source-card strong {
  display: block;
}

.gctc-source-label {
  color: var(--gctc-muted);
  font-size: 12px;
  font-weight: 700;
}

.gctc-source-card strong {
  overflow: hidden;
  margin-top: 1px;
  color: #3b3323;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gctc-source-card small {
  overflow: hidden;
  color: #8b8272;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gctc-refresh,
.gctc-primary,
.gctc-secondary,
.gctc-history-actions button,
.gctc-quick button {
  border: 0;
  cursor: pointer;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.gctc-refresh {
  min-width: 148px;
  padding: 0 14px;
  border: 1px solid #dcc98e;
  border-radius: 13px;
  background: #fff8e8;
  color: var(--gctc-gold-dark);
  font-size: 14px;
}

.gctc-refresh:disabled {
  cursor: wait;
  opacity: .65;
}

.gctc-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.gctc-field {
  min-width: 0;
}

.gctc-field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: #5b4b1f;
  font-size: 14px;
  font-weight: 700;
}

.gctc-field label span {
  color: #99907c;
  font-size: 11px;
  font-weight: 500;
}

.gctc-field input,
.gctc-field select {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid #d6d3d1;
  border-radius: 14px;
  outline: 0;
  background: #fff;
  color: #111827;
  font-size: 17px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.gctc-field input:focus,
.gctc-field select:focus,
.gctc button:focus-visible,
.gctc a:focus-visible {
  border-color: #c89b2d;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(200, 155, 45, .14);
}

.gctc-field-help {
  display: block;
  margin-top: 6px;
  color: #8b8069;
  font-size: 11px;
}

.gctc-quick {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}

.gctc-quick button {
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid #e4dac1;
  border-radius: 999px;
  background: #fff;
  color: #675d4a;
  font-size: 12px;
}

.gctc-quick button:hover,
.gctc-refresh:hover,
.gctc-secondary:hover,
.gctc-history-actions button:hover {
  background: #fff3cf;
}

.gctc-advanced {
  margin-top: 14px;
  border: 1px solid #eee4cd;
  border-radius: 13px;
  background: #fdfbf6;
}

.gctc-advanced summary {
  padding: 11px 14px;
  color: #665932;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.gctc-advanced-content {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) 1.3fr;
  gap: 18px;
  align-items: end;
  padding: 0 14px 14px;
}

.gctc-advanced-content .gctc-field input {
  height: 44px;
}

.gctc-advanced-content .gctc-field small {
  display: block;
  margin-top: 5px;
  color: var(--gctc-muted);
  font-size: 11px;
}

.gctc-formula-note {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  color: #6c6250;
  font-size: 12px;
}

.gctc-formula-note strong,
.gctc-formula-note span {
  display: block;
}

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

.gctc-result-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid #e8d18b;
  border-radius: 16px;
  background: var(--gctc-gold-soft);
}

.gctc-result-card--sell {
  background: linear-gradient(135deg, #fff9e8 0%, #fff2c7 100%);
}

.gctc-result-card span,
.gctc-result-card small,
.gctc-result-card output {
  display: block;
}

.gctc-result-card span {
  color: #695b32;
  font-size: 13px;
  font-weight: 700;
}

.gctc-result-card output {
  overflow: hidden;
  margin: 3px 0 1px;
  color: var(--gctc-gold-dark);
  font-size: clamp(27px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gctc-result-card small {
  color: #8a8068;
  font-size: 11px;
}

.gctc-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin-top: 10px;
  color: #776a4b;
  font-size: 12px;
}

.gctc-summary strong {
  color: var(--gctc-gold-dark);
}

.gctc-sensitivity {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 17px;
}

.gctc-sensitivity div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid #e8e3d8;
  border-radius: 12px;
  background: #faf9f6;
  font-size: 13px;
}

.gctc-sensitivity span {
  color: var(--gctc-muted);
}

.gctc-sensitivity strong {
  color: #5b4b1f;
  text-align: right;
}

.gctc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.gctc-primary,
.gctc-secondary {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 13px;
  font-size: 14px;
}

.gctc-primary {
  background: linear-gradient(135deg, #d4a62a 0%, #b8860b 100%);
  color: #fff;
  box-shadow: 0 7px 18px rgba(184, 134, 11, .2);
}

.gctc-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(184, 134, 11, .28);
}

.gctc-secondary {
  border: 1px solid #dfd3b2;
  background: #fff;
  color: #695b32;
}

.gctc-history-wrap {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #eee4c6;
}

.gctc-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.gctc-history-head h3 {
  margin: 0;
  color: #4b5563;
  font-size: 18px;
}

.gctc-history-head span,
.gctc-history-empty {
  color: #9ca3af;
  font-size: 12px;
}

.gctc-history-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed #ddd2b6;
  border-radius: 12px;
  text-align: center;
}

.gctc-history {
  display: grid;
  gap: 9px;
}

.gctc-history-row {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) 2fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #ece3cc;
  border-radius: 13px;
  background: #faf8f2;
}

.gctc-history-title strong,
.gctc-history-title small {
  display: block;
}

.gctc-history-title strong {
  color: #4e452f;
  font-size: 14px;
}

.gctc-history-title small {
  color: #918874;
  font-size: 11px;
}

.gctc-history-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.gctc-history-values span,
.gctc-history-values small,
.gctc-history-values strong {
  display: block;
  min-width: 0;
}

.gctc-history-values small {
  color: #89816f;
  font-size: 10px;
}

.gctc-history-values strong {
  overflow: hidden;
  color: #403929;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gctc-history-actions {
  display: flex;
  gap: 6px;
}

.gctc-history-actions button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #decf9f;
  border-radius: 9px;
  background: #fff;
  color: #6f5d2a;
  font-size: 11px;
  white-space: nowrap;
}

.gctc-history-actions button.is-delete {
  border-color: #f0c0bc;
  color: var(--gctc-red);
}

.gctc-notice {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--gctc-muted);
  font-size: 12px;
}

.gctc-notice.is-success { color: var(--gctc-green); }
.gctc-notice.is-warning { color: #9a6700; }
.gctc-notice.is-error,
.gctc-error { color: var(--gctc-red); }

.gctc-disclaimer {
  margin: 8px 0 0;
  color: #918a7c;
  font-size: 11px;
}

.gctc-full-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--gctc-gold-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.gctc-full-link:hover {
  text-decoration: underline;
}

.gctc-jewelry-head {
  margin-bottom: 20px;
}

.gctc-jewelry-base {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #ead79b;
  border-radius: 15px;
  background: #fffbef;
}

.gctc-jewelry-base > button {
  align-self: center;
  max-width: 230px;
}

.gctc-jewelry-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 17px;
}

.gctc-weight-presets,
.gctc-rate-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.gctc-weight-presets {
  margin-top: 9px;
}

.gctc-weight-presets > span {
  color: var(--gctc-muted);
  font-size: 12px;
}

.gctc-weight-presets button,
.gctc-rate-presets button {
  min-height: 31px;
  padding: 5px 11px;
  border: 1px solid #e4dac1;
  border-radius: 999px;
  background: #fff;
  color: #675d4a;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.gctc-weight-presets button:hover,
.gctc-rate-presets button:hover,
.gctc-rate-presets button.is-active {
  border-color: #d5b75d;
  background: #fff4d1;
  color: var(--gctc-gold-dark);
}

.gctc-jewelry-shop {
  margin-top: 22px;
}

.gctc-jewelry-shop h3 {
  margin: 0 0 9px;
  color: #4f452d;
  font-size: 16px;
}

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

.gctc-shop-options button {
  padding: 14px;
  border: 1px solid #e4dfd3;
  border-radius: 13px;
  background: #fff;
  color: #625947;
  cursor: pointer;
  text-align: left;
}

.gctc-shop-options button.is-active {
  border-color: #d5b75d;
  background: #fff8e2;
  box-shadow: inset 0 0 0 1px #ead28a;
}

.gctc-shop-options strong,
.gctc-shop-options span {
  display: block;
}

.gctc-shop-options strong {
  color: #4f452d;
  font-size: 14px;
}

.gctc-shop-options span {
  margin-top: 2px;
  color: #8a806d;
  font-size: 11px;
}

.gctc-jewelry-rule {
  margin-top: 11px;
  padding: 13px 14px;
  border-left: 4px solid #d3aa31;
  border-radius: 9px;
  background: #faf8f1;
  color: #6d624e;
  font-size: 12px;
}

.gctc-jewelry-rule > strong {
  color: #594c27;
}

.gctc-jewelry-rule p {
  margin: 3px 0 0;
}

.gctc-rule-link {
  display: inline-block;
  margin-top: 7px;
  color: #805b00;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gctc-deduction-field {
  display: grid;
  grid-template-columns: minmax(230px, .8fr) 1.2fr;
  gap: 14px;
  align-items: end;
  margin-bottom: 10px;
}

.gctc-deduction-field .gctc-field input {
  height: 44px;
}

.gctc-rate-presets {
  min-height: 44px;
}

.gctc-jewelry-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-top: 18px;
}

.gctc-jewelry-result {
  min-width: 0;
  padding: 15px;
  border: 1px solid #e5dfd0;
  border-radius: 14px;
  background: #faf9f6;
}

.gctc-jewelry-result--net {
  border-color: #e2c76f;
  background: linear-gradient(135deg, #fff9e7 0%, #fff0bd 100%);
}

.gctc-jewelry-result > span,
.gctc-jewelry-result output,
.gctc-jewelry-result small {
  display: block;
}

.gctc-jewelry-result > span {
  color: #72684f;
  font-size: 12px;
  font-weight: 700;
}

.gctc-jewelry-result > span b {
  color: var(--gctc-gold-dark);
}

.gctc-jewelry-result output {
  overflow: hidden;
  margin: 4px 0 1px;
  color: #5f512d;
  font-size: clamp(23px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gctc-jewelry-result--net output {
  color: var(--gctc-gold-dark);
}

.gctc-jewelry-result small {
  color: #958b75;
  font-size: 10px;
}

.gctc-jewelry-range {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 13px;
  border: 1px dashed #d9c481;
  border-radius: 11px;
  background: #fffdf7;
  color: #766948;
  font-size: 12px;
}

.gctc-jewelry-range strong {
  color: var(--gctc-gold-dark);
  font-size: 14px;
  text-align: right;
}

.gctc-seo-content {
  max-width: 900px;
  margin: 34px auto 0;
  color: #3f4650;
  font-size: 15px;
  line-height: 1.8;
}

.gctc-seo-content h2 {
  margin: 30px 0 9px;
  color: #2f3540;
  font-size: clamp(21px, 2.4vw, 26px);
  line-height: 1.35;
}

.gctc-seo-content p {
  margin: 0 0 13px;
}

.gctc-seo-content a {
  color: #8a6100;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gctc-seo-lead {
  padding: 18px 20px;
  border-left: 4px solid #d4a62a;
  border-radius: 10px;
  background: #fffaf0;
  color: #554b36;
  font-size: 16px;
}

.gctc-seo-formula {
  display: grid;
  gap: 3px;
  margin: 16px 0;
  padding: 15px 17px;
  border: 1px solid #ead79b;
  border-radius: 12px;
  background: #fffbef;
}

.gctc-seo-formula strong {
  color: #765400;
}

.gctc-faq {
  display: grid;
  gap: 9px;
}

.gctc-faq details {
  border: 1px solid #e6e0d4;
  border-radius: 12px;
  background: #fff;
}

.gctc-faq summary {
  padding: 13px 15px;
  color: #514832;
  cursor: pointer;
  font-weight: 700;
}

.gctc-faq p {
  padding: 0 15px 14px;
  color: #666d77;
}

.gctc--compact {
  max-width: 100%;
  margin: 14px auto;
  padding: 0;
  position: static;
  left: auto;
  width: auto;
  transform: none;
}

.gctc--compact .gctc-card {
  padding: 18px;
  border-radius: 17px;
}

.gctc--compact .gctc-head {
  margin-bottom: 12px;
}

.gctc--compact .gctc-head h2 {
  font-size: 22px;
}

.gctc--compact .gctc-head p {
  font-size: 13px;
}

.gctc--compact .gctc-source-strip {
  margin-bottom: 13px;
}

.gctc--compact .gctc-source-card {
  padding: 8px 10px;
}

.gctc--compact .gctc-source-card strong {
  font-size: 14px;
}

.gctc--compact .gctc-source-card small {
  font-size: 9px;
}

.gctc--compact .gctc-field input {
  height: 46px;
  font-size: 15px;
}

.gctc--compact .gctc-results {
  gap: 10px;
  margin-top: 13px;
}

.gctc--compact .gctc-result-card {
  padding: 13px;
  border-radius: 13px;
}

.gctc--compact .gctc-result-card output {
  font-size: clamp(23px, 4vw, 30px);
}

@media (max-width: 820px) {
  .gctc-source-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gctc-refresh {
    grid-column: 1 / -1;
    min-height: 42px;
  }

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

  .gctc-history-actions {
    justify-content: flex-end;
  }

  .gctc-jewelry-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gctc-jewelry-result--net {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .gctc {
    margin: 16px auto;
    padding: 0 10px;
  }

  .gctc-card {
    padding: 17px;
    border-radius: 17px;
  }

  .gctc-head {
    display: block;
  }

  .gctc-mode {
    display: flex;
    width: 100%;
    margin-top: 13px;
  }

  .gctc-mode-button {
    flex: 1;
  }

  .gctc-source-strip,
  .gctc-fields,
  .gctc-results,
  .gctc-sensitivity,
  .gctc-advanced-content,
  .gctc-jewelry-fields,
  .gctc-shop-options,
  .gctc-jewelry-results,
  .gctc-deduction-field {
    grid-template-columns: 1fr;
  }

  .gctc-product-tabs {
    margin-bottom: 18px;
  }

  .gctc-product-tabs button {
    min-height: 43px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .gctc-jewelry-base {
    grid-template-columns: 1fr;
  }

  .gctc-jewelry-base > button {
    width: 100%;
    max-width: none;
  }

  .gctc-jewelry-result--net {
    grid-column: auto;
  }

  .gctc-jewelry-range {
    align-items: flex-start;
    flex-direction: column;
  }

  .gctc-jewelry-range strong {
    text-align: left;
  }

  .gctc-seo-content {
    margin-top: 26px;
    font-size: 14px;
  }

  .gctc-seo-lead {
    padding: 15px;
    font-size: 15px;
  }

  .gctc-source-strip {
    gap: 7px;
  }

  .gctc-refresh {
    grid-column: auto;
  }

  .gctc-result-card output {
    font-size: 31px;
  }

  .gctc-sensitivity div {
    align-items: flex-start;
  }

  .gctc-actions > button {
    width: 100%;
  }

  .gctc-history-head {
    display: block;
  }

  .gctc-history-head span {
    display: block;
    margin-top: 2px;
  }

  .gctc-history-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gctc-history-actions button {
    flex: 1;
  }

  .gctc--compact {
    padding: 0;
  }
}

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