/* Image Aspect Ratio & Crop Calculator — content styles. Prefix: --ar- */

:root {
  --ar-surface: #ffffff;
  --ar-panel:   #f7f7fa;
  --ar-line:    #e5e5eb;
  --ar-text:    #16161f;
  --ar-muted:   #606070;
  --ar-brand:   #5b4699;
  --ar-ok:      #1b7340;
  --ar-warn:    #b45309;
}

.ar-main {
  padding-block: 1.5rem 3rem;
}

.ar-wrap {
  max-width: 56rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.ar-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.25fr);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 48rem) {
  .ar-grid {
    grid-template-columns: 1fr;
  }
}

.ar-panel {
  background: var(--ar-panel);
  border: 1px solid var(--ar-line);
  border-radius: 2px;
  padding: 1.25rem;
}

.ar-section-title {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ar-muted);
  margin: 0 0 1rem 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--ar-line);
}

.ar-preset-row {
  margin-bottom: 1rem;
}

.ar-preset-label {
  display: block;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--ar-muted);
  margin-bottom: 0.35rem;
}

.ar-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ar-chip {
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--ar-surface);
  color: var(--ar-text);
  border: 1px solid var(--ar-line);
  border-radius: 2px;
  cursor: pointer;
}

.ar-chip:hover {
  background: var(--tf-accent-wash);
  border-color: var(--tf-accent);
  color: var(--tf-accent);
}

.ar-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

@media (max-width: 32rem) {
  .ar-row-2 {
    grid-template-columns: 1fr;
  }
}

.ar-field {
  margin-bottom: 0.85rem;
}

.ar-field label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--ar-text);
  margin-bottom: 0.35rem;
}

.ar-field select,
.ar-field input[type="number"] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  font-family: inherit;
  font-size: 0.925rem;
  color: var(--ar-text);
  background: var(--ar-surface);
  border: 1px solid var(--ar-line);
  border-radius: 2px;
  box-sizing: border-box;
}

.ar-field select:focus,
.ar-field input[type="number"]:focus {
  outline: none;
  border-color: var(--tf-accent);
}

.ar-action-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.ar-btn-primary {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--tf-accent);
  color: #ffffff;
  border: none;
  border-radius: 2px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.ar-btn-primary:hover {
  background: var(--tf-accent-hover);
}

.ar-btn-ghost {
  padding: 0.75rem 1rem;
  background: transparent;
  color: var(--ar-muted);
  border: 1px solid var(--ar-line);
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.ar-btn-ghost:hover {
  color: var(--ar-text);
  background: var(--ar-panel);
}

/* Results section */
.ar-results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ar-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 32rem) {
  .ar-hero-grid {
    grid-template-columns: 1fr;
  }
}

.ar-hero-card {
  background: var(--ar-surface);
  border: 1px solid var(--ar-line);
  border-radius: 2px;
  padding: 1.15rem;
}

.ar-hero-primary {
  border-top: 3px solid var(--tf-accent);
}

.ar-hero-secondary {
  border-top: 3px solid var(--ar-muted);
}

.ar-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.ar-hero-label {
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ar-muted);
}

.ar-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  background: color-mix(in srgb, var(--tf-accent) 15%, transparent);
  color: var(--tf-accent);
  border: 1px solid color-mix(in srgb, var(--tf-accent) 30%, transparent);
}

.ar-hero-val {
  font-size: 1.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--ar-text);
  margin-bottom: 0.35rem;
}

.ar-hero-sub {
  font-size: 0.75rem;
  color: var(--ar-muted);
  line-height: 1.35;
}

/* Visual map */
.ar-preview-card {
  background: var(--ar-surface);
  border: 1px solid var(--ar-line);
  border-radius: 2px;
  padding: 1rem;
}

.ar-preview-container {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ar-panel);
  border: 1px dashed var(--ar-line);
  border-radius: 2px;
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
}

.ar-canvas-box {
  background: #d8d8e4;
  border: 1px solid #b4b4c8;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.2s, height 0.2s;
}

.ar-crop-inner {
  background: color-mix(in srgb, var(--tf-accent) 35%, transparent);
  border: 2px solid var(--tf-accent);
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: width 0.2s, height 0.2s, top 0.2s, left 0.2s;
}

.ar-crop-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.75);
  padding: 2px 5px;
  border-radius: 2px;
  pointer-events: none;
  white-space: nowrap;
}

.ar-breakdown-card {
  background: var(--ar-panel);
  border: 1px solid var(--ar-line);
  border-radius: 2px;
  padding: 1rem;
}

.ar-card-title {
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ar-muted);
  margin: 0 0 0.65rem 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--ar-line);
}

.ar-spec-table {
  display: flex;
  flex-direction: column;
}

.ar-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.775rem;
  padding: 0.35rem 0;
  color: var(--ar-muted);
}

.ar-spec-row strong {
  font-weight: 600;
  color: var(--ar-text);
  font-variant-numeric: tabular-nums;
}

.ar-ad {
  overflow: hidden;
  min-height: 280px;
  margin: 2rem auto;
  text-align: center;
}

/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --ar-surface: var(--tf-surface);
  --ar-panel: var(--tf-surface);
  --ar-line: var(--tf-surface);
  --ar-text: var(--tf-ink);
  --ar-muted: var(--tf-ink-soft);
  --ar-brand: #9e8fcc;
  --ar-ok: #59cf8b;
  --ar-warn: #d9a57d;
}
