#tcc-unit-converter {
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #173354;
  position: fixed;
  right: 0;
  top: 40%;
  z-index: 1035;
  text-align: left;
  color-scheme: light;
}
#tcc-unit-converter *,
#tcc-unit-converter *::before,
#tcc-unit-converter *::after {
  box-sizing: border-box;
}
#tcc-unit-converter button {
  font: inherit;
  cursor: pointer;
  letter-spacing: normal;
  text-transform: none;
}
#tcc-unit-converter button:focus-visible,
#tcc-unit-converter input:focus-visible,
#tcc-unit-converter select:focus-visible {
  outline: 2px solid #1684ef;
  outline-offset: 3px;
}
#tcc-unit-converter .tcc-uc-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  writing-mode: vertical-rl;
  border: 0;
  border-radius: 9px 0 0 9px;
  background: #092d58;
  color: #fff;
  padding: 14px 9px;
  font-size: 12px;
  box-shadow: 0 3px 15px #092d5826;
}
#tcc-unit-converter .tcc-uc-trigger > span:first-child {
  font-size: 19px;
}
#tcc-unit-converter .tcc-uc-panel {
  position: fixed;
  right: 44px;
  top: clamp(12px, 25vh, max(12px, calc(100dvh - 370px)));
  width: 282px;
  max-width: calc(100vw - 56px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d9e3f0;
  border-radius: 12px;
  box-shadow: 0 15px 45px #06234530;
}
#tcc-unit-converter [hidden] {
  display: none !important;
}
#tcc-unit-converter .tcc-uc-heading {
  padding: 9px 14px;
  background: #092d58;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#tcc-unit-converter .tcc-uc-heading strong {
  font-size: 14px;
  font-weight: 600;
}
#tcc-unit-converter .tcc-uc-close {
  background: transparent;
  color: #fff;
  border: 0;
  padding: 0;
  width: 28px;
  height: 28px;
  font-size: 23px;
  line-height: 1;
}
#tcc-unit-converter .tcc-uc-content {
  padding: 12px;
}
#tcc-unit-converter .tcc-uc-types {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: #eef3fa;
  margin-bottom: 12px;
}
#tcc-unit-converter .tcc-uc-types button {
  flex: 1;
  border: 0;
  background: transparent;
  color: #52657b;
  padding: 6px;
  border-radius: 6px;
}
#tcc-unit-converter .tcc-uc-types button[aria-pressed="true"] {
  background: #fff;
  color: #145dc2;
  box-shadow: 0 1px 4px #16385818;
  font-weight: 600;
}
#tcc-unit-converter label {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #52657b;
  margin: 0 0 5px;
}
#tcc-unit-converter input,
#tcc-unit-converter select {
  font-family: inherit;
  border: 1px solid #d4dfed;
  border-radius: 7px;
  background: #fff;
  color: #183656;
  width: 100%;
  min-width: 0;
  box-shadow: none;
}
#tcc-unit-converter input {
  padding: 8px 10px;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 10px;
  height: 40px;
}
#tcc-unit-converter select {
  padding: 7px 4px;
  font-size: 13px;
  height: 35px;
}
#tcc-unit-converter .tcc-uc-units {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  gap: 3px;
  align-items: end;
}
#tcc-unit-converter .tcc-uc-swap {
  height: 35px;
  border: 0;
  background: transparent;
  color: #145dc2;
  padding: 0;
  font-size: 21px;
}
#tcc-unit-converter .tcc-uc-result {
  position: relative;
  margin-top: 12px;
  padding: 12px 43px 12px 12px;
  background: #edf5ff;
  border-radius: 9px;
  color: #07366b;
}
#tcc-unit-converter .tcc-uc-result small {
  display: block;
  font-size: 11px;
  color: #526c8b;
  margin-bottom: 4px;
}
#tcc-unit-converter output {
  display: block;
  padding: 0;
  margin: 0;
  font-size: 23px;
  line-height: 1.25;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  user-select: text;
}
#tcc-unit-converter .tcc-uc-result-unit {
  display: block;
  font-size: 12px;
  margin-top: 3px;
}
#tcc-unit-converter .tcc-uc-copy {
  position: absolute;
  right: 7px;
  top: 24px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #145dc2;
  padding: 4px;
  font-size: 20px;
}
#tcc-unit-converter .tcc-uc-copy:disabled {
  opacity: 0.4;
  cursor: default;
}
#tcc-unit-converter .tcc-uc-status {
  font-size: 12px;
  color: #52657b;
  margin: 8px 0 0;
}
#tcc-unit-converter .tcc-uc-status:empty {
  display: none;
}
@media (max-width: 575px) {
  #tcc-unit-converter {
    top: auto;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    right: 12px;
  }
  #tcc-unit-converter .tcc-uc-trigger {
    writing-mode: horizontal-tb;
    border-radius: 24px;
    padding: 10px 14px;
    min-height: 44px;
  }
  #tcc-unit-converter .tcc-uc-panel {
    top: auto;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    width: 282px;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 100px);
  }
  #tcc-unit-converter select {
    font-size: 16px;
    height: 44px;
  }
  #tcc-unit-converter .tcc-uc-units {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  }
  #tcc-unit-converter .tcc-uc-swap,
  #tcc-unit-converter .tcc-uc-close {
    min-height: 44px;
    min-width: 44px;
  }
  #tcc-unit-converter .tcc-uc-types button {
    min-height: 44px;
  }
  #tcc-unit-converter .tcc-uc-copy {
    width: 44px;
    height: 44px;
    right: 2px;
    top: 16px;
  }
  #tcc-unit-converter .tcc-uc-result {
    padding-right: 48px;
  }
}
@media print {
  #tcc-unit-converter {
    display: none !important;
  }
}

/* Final navy-to-blue compact design, icon-only launcher. */
#tcc-unit-converter .tcc-uc-trigger {
  writing-mode: horizontal-tb;
  width: 48px;
  height: 48px;
  padding: 10px;
  gap: 0;
  justify-content: center;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(125deg, #092d58, #186bdd);
}
#tcc-unit-converter .tcc-uc-trigger svg {
  display: block;
  width: 28px;
  height: 28px;
  flex: none;
}
#tcc-unit-converter .tcc-uc-panel {
  right: 56px;
}
#tcc-unit-converter .tcc-uc-heading {
  background: linear-gradient(125deg, #092d58, #186bdd);
  color: #fff;
}
#tcc-unit-converter .tcc-uc-types {
  background: #edf5ff;
}
#tcc-unit-converter .tcc-uc-types button {
  color: #52657b;
}
#tcc-unit-converter .tcc-uc-types button[aria-pressed="true"] {
  background: linear-gradient(125deg, #092d58, #186bdd);
  color: #fff;
  font-weight: 400;
}
#tcc-unit-converter label {
  color: #526c8b;
}
#tcc-unit-converter input {
  color: #07366b;
  font-weight: 400;
}
#tcc-unit-converter select {
  color: #183656;
}
#tcc-unit-converter .tcc-uc-result {
  background: #edf5ff;
}
#tcc-unit-converter output {
  color: #000;
  font-weight: 700;
}
#tcc-unit-converter .tcc-uc-result-unit,
#tcc-unit-converter .tcc-uc-copy,
#tcc-unit-converter .tcc-uc-swap {
  color: #005bd9;
}
@media (max-width: 575px) {
  #tcc-unit-converter .tcc-uc-trigger {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    padding: 10px;
  }
  #tcc-unit-converter .tcc-uc-panel {
    right: 12px;
  }
}

/* Bottom-right placement: 48px launcher, 12px panel gap, safe-area aware. */
#tcc-unit-converter {
  top: auto;
  right: calc(0px + env(safe-area-inset-right, 0px));
  bottom: calc(50px + env(safe-area-inset-bottom, 0px));
}
#tcc-unit-converter .tcc-uc-trigger {
  border-radius: 12px;
}
#tcc-unit-converter .tcc-uc-panel {
  top: auto;
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  max-width: calc(
    100vw - 40px - env(safe-area-inset-right, 0px) -
      env(safe-area-inset-left, 0px)
  );
  max-height: calc(100vh - 100px - env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 100px - env(safe-area-inset-bottom, 0px));
}
@media (max-width: 575px) {
  #tcc-unit-converter {
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  #tcc-unit-converter .tcc-uc-panel {
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    max-width: calc(
      100vw - 32px - env(safe-area-inset-right, 0px) -
        env(safe-area-inset-left, 0px)
    );
    max-height: calc(100vh - 92px - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 92px - env(safe-area-inset-bottom, 0px));
  }
}
