/* ==================== Forms ==================== */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row {
  margin-bottom: 0.95rem;
}

label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
  color: var(--muted-soft);
  margin-bottom: 0.2rem;
}

label .primary {
  color: var(--text);
  font-weight: 500;
  font-size: 0.86rem;
  flex: 1;
}

label .unit {
  font-size: 0.78rem;
  opacity: 0.8;
  min-width: 70px;
  text-align: right;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-subtle);
  background: rgba(10, 13, 24, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  appearance: textfield;
  font-variant-numeric: tabular-nums;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

input[type="number"]:hover,
input[type="text"]:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

input[type="number"]:focus-visible,
input[type="text"]:focus-visible,
select:focus-visible {
  border-color: rgba(58, 228, 255, 0.7);
  background: rgba(11, 14, 26, 0.85);
  box-shadow: 0 0 0 2px rgba(58, 228, 255, 0.25);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.keystone-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.4rem;
}

.keystone-form {
  display: flex;
  flex-direction: column;
}

.keystone-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
}

.keystone-image {
  width: 100%;
  max-width: 220px;
  border-radius: 6px;
}

.keystone-legend {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.8rem;
  color: var(--muted-soft);
}

.keystone-legend strong {
  color: var(--accent);
}

.keystone-legend span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.keystone-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #f6724e;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.keystone-visual-result {
  margin-top: 0.9rem;
  padding: 0.8rem 0.9rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(58, 228, 255, 0.28);
  background:
    linear-gradient(160deg, rgba(58, 228, 255, 0.1), rgba(4, 8, 18, 0.9)),
    rgba(5, 9, 20, 0.9);
}

.keystone-visual-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.55rem;
}

.keystone-visual-head strong {
  color: var(--text);
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}

.keystone-visual-direction {
  color: var(--muted-soft);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
}

.keystone-visual-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 35% 22%, rgba(58, 228, 255, 0.18), rgba(4, 7, 16, 0.96)),
    rgba(4, 7, 16, 0.98);
  overflow: hidden;
}

.keystone-visual-caption {
  margin: 0.5rem 0 0;
  color: var(--muted-soft);
  font-size: 0.76rem;
  line-height: 1.4;
}

.keyviz-loss {
  fill: rgba(246, 114, 78, 0.22);
  stroke: rgba(246, 114, 78, 0.9);
  stroke-dasharray: 5 4;
  stroke-width: 1.2;
}

.keyviz-frame {
  fill: none;
  stroke: rgba(255, 255, 255, 0.34);
  stroke-width: 1.2;
}

.keyviz-center-line {
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.keyviz-usable {
  fill: rgba(58, 228, 255, 0.74);
  stroke: rgba(58, 228, 255, 0.95);
  stroke-width: 1.3;
}

.keyviz-projector {
  fill: rgba(245, 246, 251, 0.92);
  stroke: rgba(7, 12, 20, 0.95);
  stroke-width: 1;
}

.keyviz-arrow {
  stroke: rgba(245, 246, 251, 0.85);
  stroke-width: 1.3;
}

.keyviz-label {
  fill: rgba(245, 246, 251, 0.86);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.button-row {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
}

button {
  cursor: pointer;
  border-radius: 999px;
  border: 0;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition:
    background 0.16s ease,
    transform 0.08s ease,
    box-shadow 0.2s ease,
    opacity 0.16s ease;
  position: relative;
}

.lang-switch .lang-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.34rem 0.7rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  background: transparent;
  color: rgba(245, 246, 251, 0.9);
  min-width: 44px;
  text-transform: uppercase;
  line-height: 1;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.lang-switch .lang-btn[aria-pressed="true"] {
  color: #031018;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.lang-switch .lang-btn[aria-pressed="false"] {
  color: rgba(245, 246, 251, 0.94);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.inline-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: all 0.2s ease;
}

.inline-link:hover {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(58, 228, 255, 0.6);
  text-decoration-thickness: 2px;
}

/* ==================== Buttons ==================== */
.btn-primary {
  border: 1px solid transparent;
  background: linear-gradient(135deg, #3ae4ff, #4af2c5);
  color: #031018;
  box-shadow: none;

  /* verhindert Double-Tap-Zoom auf vielen Mobile-Browsern */
  touch-action: manipulation;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #45e8ff, #5cf6cd);
  box-shadow: 0 0 22px rgba(58, 228, 255, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
  background: linear-gradient(135deg, #35d9f2, #45ddb8);
  box-shadow: none;
}

.converter-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.78rem 1.05rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.converter-download-link.is-disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(0.4);
}

.converter-platform-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  line-height: 1;
}

.platform-separator {
  color: #031018;
  font-weight: 800;
  line-height: 1;
}

.platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.12rem;
  height: 1.12rem;
  color: #031018;
}

.platform-icon--apple {
  display: block;
  fill: currentColor;
}

.platform-icon--windows {
  display: block;
  fill: currentColor;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  touch-action: manipulation;
}

.btn-ghost:hover {
  background: rgba(58, 228, 255, 0.06);
  border-color: rgba(58, 228, 255, 0.4);
  color: var(--text);
}

button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ==================== Results & Feedback ==================== */
.result-box {
  margin-top: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: 11px;
  background: rgba(8, 10, 20, 0.6);
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.result-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  margin-bottom: 0.35rem;
}

.result-line:last-child {
  margin-bottom: 0;
}

.result-line .label {
  opacity: 0.85;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-line .value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  color: var(--text);
  font-weight: 500;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-line--highlight .value {
  font-size: 0.95rem;
  color: var(--accent-strong);
}

#vdrop-assess-out {
  display: block;
  margin-left: auto;
  text-align: right;
}

@media (max-width: 768px) {
  .result-line {
    flex-direction: column;
    gap: 0.15rem;
  }

  .result-line .value {
    width: 100%;
    text-align: left;
  }

  #vdrop-assess-out {
    margin-left: 0;
    text-align: left;
  }

}

#vdrop-phase-switch,
#power-phase-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
}

.power-phase-switch-row {
  margin: 0.35rem 0 0.9rem;
}

.vdrop-phase-btn {
  border: 0;
  border-radius: 999px;
  min-width: 48px;
  padding: 0.32rem 0.58rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(245, 246, 251, 0.88);
  background: transparent;
  transition: background 0.18s ease, color 0.18s ease;
}

.vdrop-phase-btn[aria-pressed="true"] {
  color: #031018;
  background: linear-gradient(135deg, #3ae4ff, #4af2c5);
}

.vdrop-phase-btn[aria-pressed="false"] {
  color: rgba(245, 246, 251, 0.88);
}

.size-unit-switch-row {
  margin-bottom: 0.75rem;
}

.size-unit-switch-wrap {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.size-unit-switch-wrap::before {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: calc(50% - 0.3rem);
  height: calc(100% - 0.4rem);
  border-radius: 999px;
  background: linear-gradient(135deg, #3ae4ff, #4af2c5);
  box-shadow: 0 0 14px rgba(58, 228, 255, 0.45);
  transform: translateX(0);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}

.size-unit-switch-wrap[data-unit="px"]::before {
  transform: translateX(calc(100% + 0.2rem));
}

.size-unit-option {
  border: 1px solid transparent;
  border-radius: 999px;
  min-width: 70px;
  padding: 0.32rem 0.58rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(245, 246, 251, 0.88);
  background: transparent;
  transition: color 180ms ease;
  position: relative;
  z-index: 1;
}

.size-unit-option[aria-pressed="true"] {
  color: #031018;
}

.size-unit-option[aria-pressed="false"] {
  color: rgba(245, 246, 251, 0.9);
}

#vdrop-green-length-row {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.55rem;
  margin-top: 0.4rem;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted-soft);
  margin-top: 0.35rem;
}

.media-inspector-grid {
  align-items: start;
}

#media-file-input {
  width: 100%;
  padding: 0.56rem 0.64rem;
  border-radius: 10px;
  border: 1px solid rgba(58, 228, 255, 0.28);
  background: radial-gradient(circle at top, rgba(58, 228, 255, 0.1), rgba(8, 9, 18, 0.96));
  color: var(--muted);
  font-size: 0.86rem;
}

#media-file-input::file-selector-button {
  margin-right: 0.65rem;
  border: 1px solid rgba(58, 228, 255, 0.5);
  background: rgba(58, 228, 255, 0.14);
  color: var(--text);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
}

.media-button-row {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
}

.media-button-row--single {
  justify-content: flex-end;
}

.media-button-row button {
  flex: 0 0 auto;
}

.media-inspector-note {
  margin-top: 0.1rem;
  padding: 0.52rem 0.62rem;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: rgba(7, 9, 17, 0.9);
  color: var(--muted);
  font-size: 0.82rem;
}

.media-inspector-note[data-state="loading"] {
  border-color: rgba(58, 228, 255, 0.6);
  color: var(--accent);
}

.media-inspector-note[data-state="success"] {
  border-color: rgba(74, 242, 197, 0.7);
  color: #4af2c5;
}

.media-inspector-note[data-state="warning"] {
  border-color: rgba(255, 179, 66, 0.7);
  color: #ffc266;
}

.media-inspector-note[data-state="error"] {
  border-color: rgba(255, 75, 110, 0.7);
  color: #ff7c96;
}

