*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:         #1c1c1c;
  --panel:      #252525;
  --bg-image:   url('images/bg1.png');
  --surface:    #2e2e2e;
  --surface-2:  #383838;
  --border:     #464646;
  --border-sub: #3a3a3a;
  --text:       #e2e2e2;
  --muted:      #7a7a7a;
  --accent:     #4a8fd4;
  --accent-bg:  rgba(74, 143, 212, 0.12);
  --amber:      #c97b3a;
  --amber-bg:   rgba(201, 123, 58, 0.12);
  --green:      #4a9e6a;
  --green-bg:   rgba(74, 158, 106, 0.12);
  --radius:     3px;
  --font:       -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --mono:       'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
}

html, body {
  min-height: 100dvh;
  background: var(--bg) var(--bg-image) center / cover no-repeat fixed;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

@supports (font-variation-settings: normal) {
  * {
    font-feature-settings: "cv10";
  }
}

@supports (-webkit-appearance: none) {
  *[style*="font-family: var(--mono)"],
  .arc-dim-input,
  .arc-custom-input,
  .arc-detected-fraction,
  .arc-detected-decimal,
  .arc-detect-fraction {
    -webkit-text-stroke: 0.3px transparent;
  }
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.arc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 18px;
  background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 50%, #d9d9d9 100%);
  border-bottom: 1px solid #b0b0b0;
  user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.arc-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #3a3a3a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.arc-title-cloud {
  position: relative;
  display: inline-block;
  margin-left: -2px;
  font-size: 1.4em;
  line-height: 1;
}

.arc-title-cmd {
  position: absolute;
  left: -1px;
  top: 0px;
  display: inline-block;
}

.arc-mark {
  opacity: 0.6;
  color: #666;
}

/* ── Main layout ─────────────────────────────────────────────────────────── */

.arc-main {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 43px);
}

/* ── Preview section ─────────────────────────────────────────────────────── */

.arc-preview-section {
  background: var(--panel) var(--bg-image) center / cover no-repeat fixed;
  border-bottom: 1px solid var(--border);
  padding: 18px 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  height: 38vh;
  min-height: 200px;
  max-height: 400px;
  justify-content: center;
}

.arc-preview-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.arc-preview-rect {
  /* Fixed at open gate aspect ratio — never changes */
  width: min(calc(100% - 32px), calc(240px * 1.3163));
  aspect-ratio: 4096 / 3112;
  background: #161616;
  border: 1px solid #3a3a3a;
  position: relative;
  overflow: hidden;
}

/* Crop box — centred, box-shadow masks the sensor area outside it */
.arc-crop-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(74, 143, 212, 0.7);
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.5);
  transition: width 0.25s ease, height 0.25s ease;
}

/* Crosshair guides — clipped to crop box */
.arc-crosshair-h {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: rgba(74, 143, 212, 0.15);
  pointer-events: none;
}

.arc-crosshair-v {
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 1px;
  background: rgba(74, 143, 212, 0.15);
  pointer-events: none;
}

/* Corner marks — clipped to crop box */
.arc-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: rgba(74, 143, 212, 0.5);
  border-style: solid;
  pointer-events: none;
}

.arc-corner--tl { top: 4px; left: 4px;  border-width: 1px 0 0 1px; }
.arc-corner--tr { top: 4px; right: 4px; border-width: 1px 1px 0 0; }
.arc-corner--bl { bottom: 4px; left: 4px;  border-width: 0 0 1px 1px; }
.arc-corner--br { bottom: 4px; right: 4px; border-width: 0 1px 1px 0; }

/* Open gate stage label */
.arc-stage-label {
  position: absolute;
  bottom: 5px;
  right: 7px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.2);
  pointer-events: none;
  user-select: none;
}

.arc-ratio-label {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  color: var(--accent);
  user-select: none;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 8px 14px;
  border-radius: 4px;
  display: inline-block;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  margin-top: -4px;
}

@media (max-width: 599px) {
  .arc-preview-section {
    height: auto;
    min-height: 255px;
    max-height: none;
  }

  .arc-ratio-label {
    margin-top: 4px;
  }
}

/* ── Controls ────────────────────────────────────────────────────────────── */

.arc-controls {
  width: 100%;
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: repeating-linear-gradient(
    to bottom,
    white 0px,
    white 3px,
    #F8F8F8 3px,
    #F8F8F8 6px
  ), var(--bg-image) center / cover no-repeat fixed;
  position: relative;
}

/* ── Ratio pills ─────────────────────────────────────────────────────────── */

.arc-pills-row {
  display: flex;
  gap: 6px;
  align-items: center;
}


.arc-pills {
  display: flex;
  gap: 6px;
  flex: 1;
}

.arc-pill {
  flex: 1;
  padding: 8px 6px;
  height: 37px;
  background: linear-gradient(180deg, rgba(225, 225, 225, 0.50) 0%, #ffffff 100%);
  box-shadow: 0px 3px 2px rgba(91, 102, 115, 0.19),
              0px 1px 1px rgba(193, 193, 193, 0.19),
              0px 3px 9px rgba(168, 168, 168, 0.33),
              0px 0px 12px rgba(255, 255, 255, 0.21) inset;
  border: none;
  outline: 1px solid #C0C3C7;
  outline-offset: -1px;
  border-radius: 100px;
  color: #3D3F44;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: 0px 1px 0px rgba(185, 224, 253, 0.40);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: opacity 0.12s;
}

.arc-pill::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 1px;
  right: 8px;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.50) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 100px;
  pointer-events: none;
}

.arc-pill:hover {
  opacity: 0.85;
}

.arc-pill.active {
  background: linear-gradient(180deg, rgba(104, 151, 211, 0.50) 0%, #BAE3F6 100%);
  box-shadow: 0px 3px 2px rgba(14, 97, 192, 0.19),
              0px 1px 1px rgba(14, 97, 192, 0.19),
              0px 3px 9px rgba(0, 128, 161, 0.33),
              0px 0px 12px rgba(255, 255, 255, 0.21) inset;
  border: none;
  outline: 1px solid #689DD3;
  outline-offset: -1px;
  border-radius: 100px;
  color: #213660;
  text-shadow: 0px 1px 0px rgba(185, 224, 253, 0.40);
  overflow: hidden;
  position: relative;
}

.arc-pill.active::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 1px;
  right: 8px;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.50) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 100px;
  pointer-events: none;
}

/* ── Custom ratio toggle ──────────────────────────────────────────────────── */

.arc-custom-toggle {
  width: 37px;
  height: 37px;
  padding: 0;
  padding-bottom: 4px;
  background: linear-gradient(180deg, rgba(225, 225, 225, 0.50) 0%, #ffffff 100%);
  box-shadow: 0px 3px 2px rgba(91, 102, 115, 0.19),
              0px 1px 1px rgba(193, 193, 193, 0.19),
              0px 3px 9px rgba(168, 168, 168, 0.33),
              0px 0px 12px rgba(255, 255, 255, 0.21) inset;
  border: none;
  outline: 1px solid #C0C3C7;
  outline-offset: -1px;
  border-radius: 100px;
  color: #3D3F44;
  font-family: var(--font);
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.arc-custom-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.50) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.arc-custom-toggle:hover {
  opacity: 0.85;
}

.arc-custom-toggle[aria-expanded="true"] {
  background: linear-gradient(180deg, rgba(104, 151, 211, 0.50) 0%, #BAE3F6 100%);
  box-shadow: 0px 3px 2px rgba(14, 97, 192, 0.19),
              0px 1px 1px rgba(14, 97, 192, 0.19),
              0px 3px 9px rgba(0, 128, 161, 0.33),
              0px 0px 12px rgba(255, 255, 255, 0.21) inset;
  outline: 1px solid #689DD3;
  color: #213660;
}

/* ── Custom ratio input ────────────────────────────────────────────────────── */

.arc-custom-ratio {
  display: none;
  flex-direction: column;
  gap: 10px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.arc-custom-ratio.visible {
  display: flex;
  max-height: 500px;
}

.arc-custom-ratio-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.arc-custom-input {
  width: 60px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #d0d0d0;
  border-radius: 2px;
  color: #333;
  font-family: var(--mono);
  font-size: 13px;
  text-align: center;
  -moz-appearance: textfield;
  transition: border-color 0.12s, background 0.12s;
}

.arc-custom-input::-webkit-inner-spin-button,
.arc-custom-input::-webkit-outer-spin-button { display: none; }

.arc-custom-input:focus {
  outline: none;
  border-color: #689DD3;
  background: #f9f9f9;
}

.arc-colon {
  color: var(--muted);
  font-size: 16px;
  font-weight: 200;
  line-height: 1;
}

.arc-custom-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-left: 2px;
}

.arc-custom-heading {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #666;
  margin-top: 20px;
  margin-bottom: 3px;
  user-select: none;
}

/* ── HD / UHD toggle ─────────────────────────────────────────────────────── */

.arc-hd-toggle {
  display: none;
  gap: 2px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75)),
    url('images/bg3.png');
  background-size: cover;
  background-position: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #d8d8d8;
  border-radius: 100px;
  padding: 3px;
}

.arc-hd-toggle.visible {
  display: flex;
}

.arc-hd-toggle.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.arc-hd-btn {
  flex: 1;
  padding: 4px 12px;
  height: 26px;
  background: transparent;
  box-shadow: none;
  border: none;
  outline: none;
  border-radius: 100px;
  color: #666;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
}

.arc-hd-btn:hover {
  color: #333;
}

.arc-hd-btn.active {
  background: white;
  color: #333;
  box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
}

/* ── Dimension inputs ────────────────────────────────────────────────────── */

.arc-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
  margin-top: 14px;
}

.arc-inputs-row {
  display: flex;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.arc-input-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.arc-input-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  flex: 1;
  min-width: 0;
}

.arc-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #666;
  min-width: 46px;
  user-select: none;
}

.arc-dim-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  padding-right: 36px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #d0d0d0;
  border-radius: 2px;
  color: #333;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 400;
  -moz-appearance: textfield;
  transition: border-color 0.12s, background 0.12s;
}

.arc-dim-input::-webkit-inner-spin-button,
.arc-dim-input::-webkit-outer-spin-button { display: none; }

.arc-dim-input:focus {
  outline: none;
  border-color: #689DD3;
  background: #f9f9f9;
}

.arc-dim-input.computed {
  color: var(--muted);
}

.arc-dim-input.copied {
  border-color: #4a9e6a;
  background: rgba(74, 158, 106, 0.08);
}

.arc-unit {
  display: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #888;
  flex-shrink: 0;
  user-select: none;
  position: absolute;
  right: 32px;
  pointer-events: none;
}

.arc-field-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  transition: color 0.12s;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  padding: 0;
  line-height: 1;
}

.arc-field-copy:hover {
  color: #689DD3;
}

.arc-field-copy.copied {
  color: #4a9e6a;
}

/* ── Detected ratio display ──────────────────────────────────────────────── */

.arc-detected {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(200, 200, 200, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.arc-detected::before {
  display: none;
}

.arc-detected.visible {
  display: flex;
}

.arc-detected-fraction {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: #7a7a7a;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}

.arc-detected-decimal {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 9px;
  color: #5a5a5a;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 1;
  display: none;
}

.arc-detected-name {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(104, 157, 211, 0.15);
  color: #689DD3;
  border: none;
  outline: none;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.arc-detected-name.custom {
  background: transparent;
  color: #5a5a5a;
}

/* ── Copy button ─────────────────────────────────────────────────────────── */

.arc-copy-btn {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
  background: linear-gradient(180deg, rgba(225, 225, 225, 0.50) 0%, #ffffff 100%);
  box-shadow: 0px 3px 2px rgba(91, 102, 115, 0.19),
              0px 1px 1px rgba(193, 193, 193, 0.19),
              0px 3px 9px rgba(168, 168, 168, 0.33),
              0px 0px 12px rgba(255, 255, 255, 0.21) inset;
  border: none;
  outline: 1px solid #C0C3C7;
  outline-offset: -1px;
  border-radius: 100px;
  color: #3D3F44;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-shadow: 0px 1px 0px rgba(185, 224, 253, 0.40);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: opacity 0.12s;
}

.arc-copy-btn::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 1px;
  right: 8px;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.50) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 100px;
  pointer-events: none;
}

.arc-copy-btn:not(:disabled):hover {
  opacity: 0.85;
}

.arc-copy-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.arc-copy-btn.copied {
  background: linear-gradient(180deg, rgba(104, 151, 211, 0.50) 0%, #BAE3F6 100%);
  box-shadow: 0px 3px 2px rgba(14, 97, 192, 0.19),
              0px 1px 1px rgba(14, 97, 192, 0.19),
              0px 3px 9px rgba(0, 128, 161, 0.33),
              0px 0px 12px rgba(255, 255, 255, 0.21) inset;
  outline: 1px solid #689DD3;
  color: #213660;
}

/* ── Divider ─────────────────────────────────────────────────────────────── */

.arc-divider {
  height: 1px;
  background: var(--border-sub);
  margin: 2px 0;
}

/* ── Detect Ratio section ────────────────────────────────────────────────── */

.arc-detect-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arc-detect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.arc-detect-heading {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--muted);
  user-select: none;
  display: block;
  margin-bottom: 16px;
}

/* ── Sizes toggle button ──────────────────────────────────────────────────── */

.arc-sizes-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: linear-gradient(180deg, rgba(225, 225, 225, 0.50) 0%, #ffffff 100%);
  box-shadow: 0px 3px 2px rgba(91, 102, 115, 0.19),
              0px 1px 1px rgba(193, 193, 193, 0.19),
              0px 3px 9px rgba(168, 168, 168, 0.33),
              0px 0px 12px rgba(255, 255, 255, 0.21) inset;
  border: none;
  outline: 1px solid #C0C3C7;
  outline-offset: -1px;
  border-radius: 6px;
  color: #3D3F44;
  font-family: var(--font);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-shadow: 0px 1px 0px rgba(185, 224, 253, 0.40);
  cursor: pointer;
  transition: outline-color 0.12s, color 0.12s;
  position: relative;
  overflow: hidden;
}

.arc-sizes-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.50) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.arc-sizes-btn:hover,
.arc-sizes-btn[aria-expanded="true"] {
  outline: 1px solid #689DD3;
  color: #213660;
}

.arc-sizes-arrow {
  font-size: 8px;
  transition: transform 0.15s;
  display: inline-block;
}

.arc-sizes-btn[aria-expanded="true"] .arc-sizes-arrow {
  transform: rotate(180deg);
}

/* ── Sizes reference panel ───────────────────────────────────────────────── */

.arc-sizes-heading {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #666;
  margin-top: 24px;
  margin-bottom: 10px;
  user-select: none;
}

.arc-sizes-panel {
  display: none;
  flex-direction: column;
  max-height: 260px;
  overflow-y: auto;
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: var(--radius);
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

.arc-sizes-panel.open {
  display: flex;
}

.arc-sizes-group-header {
  position: sticky;
  top: 0;
  padding: 6px 12px 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #666;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  user-select: none;
  z-index: 1;
}

.arc-sizes-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  cursor: pointer;
  border-bottom: 1px solid #e8e8e8;
  transition: background 0.1s;
  gap: 10px;
}

.arc-sizes-item:hover {
  background: #f9f9f9;
}

.arc-sizes-item.selected {
  background: #e8f4fd;
  box-shadow: inset 0 0 0 1px #689DD3;
}

.arc-sizes-item:last-child {
  border-bottom: none;
}

.arc-sizes-item-label {
  font-family: var(--font);
  font-size: 11.5px;
  color: #333;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arc-sizes-item-dims {
  font-family: var(--mono);
  font-size: 10.5px;
  color: #999;
  white-space: nowrap;
  flex-shrink: 0;
}

.arc-detect-inputs {
  display: flex;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.arc-detect-inputs .arc-input-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.arc-detect-inputs .arc-input-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  flex: 1;
  min-width: 0;
}

.arc-detect-inputs .arc-dim-input {
  flex: 1;
  min-width: 0;
}

.arc-detect-result {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #d0d0d0;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.15s;
}

.arc-detect-result.visible {
  opacity: 1;
}

.arc-detect-fraction {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 400;
  padding: 4px 10px;
  border-radius: 2px;
  background: rgba(104, 157, 211, 0.15);
  color: #689DD3;
}

.arc-detect-decimal {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  flex: 1;
}

.arc-detect-badge {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  padding: 2px 8px;
  border-radius: 2px;
  white-space: nowrap;
}

.arc-detect-badge.known {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid rgba(74, 143, 212, 0.3);
}

.arc-detect-badge.custom {
  background: transparent;
  color: var(--muted);
  border: 1px solid #d0d0d0;
}

.arc-detect-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-left: auto;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  transition: color 0.12s;
  padding: 0;
  line-height: 1;
}

.arc-detect-copy:hover {
  color: #689DD3;
}

.arc-detect-copy.copied {
  color: #4a9e6a;
}

/* ── Tab interface (mobile) ──────────────────────────────────────────────────── */

.arc-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e0e0e0;
  padding: 0 18px;
  margin-bottom: 0;
}

.arc-tab {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #888;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
  text-align: center;
}

.arc-tab:hover {
  color: #666;
}

.arc-tab.active {
  color: #333;
  border-bottom-color: #689DD3;
}

.arc-presets-panel,
.arc-detect-panel {
  display: none;
  padding: 18px;
  gap: 14px;
  flex-direction: column;
}

.arc-presets-panel.active,
.arc-detect-panel.active {
  display: flex;
}

/* ── Desktop two-column ≥ 600px ──────────────────────────────────────────── */

@media (min-width: 600px) {
  .arc-tabs {
    display: none;
  }

  .arc-presets-panel,
  .arc-detect-panel {
    display: block !important;
  }

  .arc-main {
    flex-direction: row-reverse;
    align-items: stretch;
    min-height: calc(100dvh - 43px);
  }

  .arc-preview-section {
    flex: 1;
    height: auto;
    max-height: none;
    border-right: none;
    border-left: 1px solid var(--border);
    border-bottom: none;
    padding: 48px 40px;
  }

  .arc-preview-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
  }

  .arc-preview-rect {
    width: min(calc(100% - 96px), calc(600px * 1.3163));
    max-width: 100%;
  }

  .arc-controls {
    width: 35% !important;
    flex: none !important;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
  }

  .arc-pills-row {
    margin-bottom: 20px;
  }

  .arc-custom-ratio {
    margin-bottom: 20px;
  }

  .arc-hd-toggle {
    margin-bottom: 20px;
  }

  .arc-inputs {
    margin-bottom: 20px;
  }

  .arc-detected {
    margin-bottom: 20px;
  }

  .arc-copy-btn {
    margin-bottom: 20px;
  }

  .arc-detect-section {
    margin-top: 40px;
  }

  .arc-detect-heading {
    margin-bottom: 28px;
    font-size: 11px;
    margin-top: 0;
  }

  .arc-detect-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
}
