/* =============================================================
   Office Color Editor — tool-specific styles  (BETA)
   Built on the shared design system (styles.css); uses its CSS
   variables so the tool follows the site's light/dark theme.
   ============================================================= */

/* ---- Beta marking ---- */
.oce .tool-hero h1 { flex-wrap: wrap; }
.oce .tool-hero h1 > span:not(.tool-icon):not(.oce-beta) { min-width: 0; }
.oce-beta { font-size: .62rem; align-self: center; }
.oce-beta-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: color-mix(in srgb, var(--brand-2) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-2) 55%, var(--border));
  border-radius: 12px; padding: 11px 15px; margin-bottom: 16px;
  font-size: 13px; color: var(--text); line-height: 1.5;
}
.oce-beta-note::before { content: "🎨"; font-size: 15px; line-height: 1.4; }

/* ---- Source bar ---- */
.oce-source {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 16px 18px; margin-bottom: 16px;
}
.oce-source .grow { flex: 1 1 auto; min-width: 180px; }
.filemeta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filemeta .fname { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 13px; color: var(--text); word-break: break-all; }
.filemeta .fsub { font-size: 12.5px; color: var(--text-soft); }
.filemeta.empty .fname { color: var(--text-soft); }
.oce-typebadge { font-size: .68rem; }
.oce .btn .ic { width: 16px; height: 16px; }
.oce .btn svg { display: block; }

/* ---- Cards ---- */
.oce-card { padding: 18px 20px; margin-bottom: 16px; }
.oce-card-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.oce-sec { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-soft); font-weight: 700; }
.oce-name { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12.5px; color: var(--text-soft); }
.oce-name-input {
  font: inherit; font-size: 13px; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; min-width: 160px;
}
.oce-name-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.oce-hint { margin: 0 0 14px; font-size: 13px; color: var(--text-soft); line-height: 1.5; }

/* ---- Colour-slot grid ---- */
.oce-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px 18px; }
.oce-slot { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; border: 1px solid transparent; }
.oce-slot.changed { background: color-mix(in srgb, var(--brand) 8%, transparent); border-color: color-mix(in srgb, var(--brand) 30%, var(--border)); }
.oce-slot-label { flex: 1 1 auto; font-size: 13px; color: var(--text); min-width: 0; }
.oce-ctl { display: flex; align-items: center; gap: 8px; }

/* native colour input styled as a swatch */
.oce-color {
  -webkit-appearance: none; appearance: none; width: 30px; height: 30px;
  border: 1px solid var(--border); border-radius: 8px; padding: 0; cursor: pointer; background: none;
}
.oce-color::-webkit-color-swatch-wrapper { padding: 2px; }
.oce-color::-webkit-color-swatch { border: none; border-radius: 6px; }
.oce-color::-moz-color-swatch { border: none; border-radius: 6px; }

.oce-hexwrap { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); overflow: hidden; }
.oce-hexwrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.oce-hash { padding: 0 2px 0 8px; color: var(--text-soft); font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.oce-hex {
  font-family: ui-monospace, Menlo, monospace; font-size: 13px; text-transform: uppercase;
  color: var(--text); background: none; border: none; padding: 7px 9px 7px 2px; width: 78px; letter-spacing: .04em;
}
.oce-hex:focus { outline: none; }

/* ---- Extra colours ---- */
.oce-actions { margin-top: 12px; }
.oce-extra-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.oce-extra-row:last-child { border-bottom: none; }
.oce-extra-name {
  flex: 1 1 160px; min-width: 120px; font: inherit; font-size: 13px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
}
.oce-extra-name:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.oce-remove {
  font-size: 18px; line-height: 1; color: var(--text-soft); background: transparent;
  border: 1px solid var(--border); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; flex: 0 0 auto;
  transition: background .14s, border-color .14s, color .14s;
}
.oce-remove:hover { background: color-mix(in srgb, var(--office-powerpoint) 12%, transparent); border-color: var(--office-powerpoint); color: var(--office-powerpoint); }
.oce-empty { color: var(--text-soft); font-size: 13px; font-style: italic; margin: 4px 0; }

/* ---- Last used colours ---- */
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; user-select: none; font-size: 13.5px; color: var(--text); }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }
.oce-mru { margin-top: 4px; }

.oce-empty-state { text-align: center; padding: 44px 24px; color: var(--text-soft); font-size: 1.05rem; }

/* ---- Sticky action bar ---- */
.oce-actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.oce-actionbar .inner { max-width: var(--maxw); margin: 0 auto; padding: 13px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.oce-actionbar .count { font-size: 13.5px; color: var(--text-soft); }
.oce-actionbar .count b { color: var(--brand); font-weight: 700; }
.oce-actionbar .spacer { flex: 1 1 auto; }

/* ---- Toast ---- */
.oce-toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-elev); color: var(--text); padding: 12px 18px; border-radius: 12px;
  border: 1px solid var(--border); font-size: 13.5px; opacity: 0; pointer-events: none;
  transition: all .25s ease; z-index: 70; box-shadow: var(--shadow-lg); max-width: 90vw;
}
.oce-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.oce-toast.err { border-color: color-mix(in srgb, var(--office-powerpoint) 60%, var(--border)); color: var(--office-powerpoint); }

/* drag & drop highlight */
.oce.droplit { outline: 2px dashed var(--brand); outline-offset: -10px; border-radius: 18px; }

/* legal note */
.oce-legal { margin-top: 36px; font-size: 11.5px; color: var(--text-soft); line-height: 1.55; }
.oce-legal p { margin: 0 0 8px; max-width: 84ch; }
