.input-group {
	width: 100%
}

.input-group label {
	display: block;
	color: white;
	text-align: center;
	font-size: 1rem
}

.custom-input {
	width: 100%;
	font-family: 'Google Sans', sans-serif !important;
  	border: none;
  	border-radius: 4px;
  	padding: 0.25rem 0.5rem;
	margin-top: 0.5rem !important;
}

#iframe-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2; /* Higher than the iframe */
    display: none;  /* Hide by default */
	box-sizing: border-box;
	pointer-events: none;
}



/* Metabox Background */
#scratch_meta_box,
#image_slider_meta_box,
#quiz_meta_box,
#poll_meta_box,
#event_meta_box,
#feed_meta_box,
#nad_cost_metabox{
	display: block !important;
}







/* === Root Container & Theme Vars ========================================= */
#scratch-metabox-container {
  --scratch-primary: #ff9d1a;
  --scratch-primary-gradient-start: #ffc679;
  --scratch-primary-gradient-end: #ff9d1a;
  --scratch-brown: #8F612B;
  --scratch-brown-text: #855419;
  --scratch-brown-alt: #99703F;
  --scratch-dark: #725A42;
  --scratch-font: "Google Sans", sans-serif;
  font-family: var(--scratch-font);
  box-sizing: border-box;
}

/* Make sure everything inside the metabox uses border-box for saner layout. */
#scratch-metabox-container *,
#scratch-metabox-container *::before,
#scratch-metabox-container *::after {
  box-sizing: inherit;
}


/* === Fieldset Reset ====================================================== */
/* We build each "set" dynamically in JS. Kill WP admin default spacing. */
#scratch-metabox-container fieldset {
  display: block;
  margin: 0 !important;
  padding: 0;
  border: none;
}


/* === Header Row (Label + Delete [+ Add on first]) ======================== */
#scratch-metabox-container .scratch-set-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;          /* small gap between delete & add */
  margin-top: 10px;
  margin-bottom: 2.0rem; /* overall spacing below header */
  margin-top:2.5rem;
}

#scratch-metabox-container .scratch-set-label {
  flex-grow: 0;          /* don't push buttons away */
  margin: 0;
  color: black;
  font-size: 1rem;
  line-height: 1.2;
  /* Align header content over the select + media rows below.
     First row has Add button; others don't — so we bump margin-right later. */
  margin-right: 9rem;    /* see nth-child(n+2) override below */
}

/* Subsequent sets (no +Add button) need extra fake space so delete icons line up. */
#scratch-metabox-container .scratch-sets-container > fieldset:nth-child(n+2) 
  .scratch-set-label {
  margin-right: 16rem;
}

/* --- Add Image Button (outlined MDC) --- */
#scratch-metabox-container .scratch-set-header > button.scratch-add-image-btn {
  text-transform: none;
  font-size: 14px;
  height: 42px;
  line-height: 32px;
  padding: 0 12px;
  border: 2px solid var(--scratch-brown);
  border-radius: 24px;
  background: transparent;
  color: var(--scratch-brown-text);
  min-width: auto;
  box-sizing: border-box;
  cursor: pointer;
  font-family: var(--scratch-font);
}

/* --- Delete Icon Button --- */
#scratch-metabox-container .scratch-set-header > button.scratch-delete-btn {
  margin-left: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  --mdc-icon-button-size: 36px;
  padding: 0;
}

/* Glyph inside delete button */
#scratch-metabox-container .scratch-set-header > button.scratch-delete-btn 
  .mdc-icon-button__icon {
  color: var(--scratch-brown-text);
  font-size: 25px;
  line-height: 1;
  display: inline-block;
}


/* === Slide Select Row ==================================================== */
#scratch-metabox-container .scratch-slide-row {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: center;
  margin-bottom: 2.0rem;
}

/* Width of control + menu */
#scratch-metabox-container .scratch-slide-select {
  width: 450px;
  --mdc-theme-primary: black; /* override MDC blue highlights */
}

/* Selected text (both real & placeholder) always left-aligned */
#scratch-metabox-container .scratch-slide-select .mdc-select__selected-text {
  text-align: left;
}

/* Menu must match anchor width */
#scratch-metabox-container .scratch-slide-select .mdc-select__menu {
  min-width: 450px;
}

/* Anchor adjustments + room for faux arrow */
#scratch-metabox-container .scratch-slide-select .mdc-select__anchor {
  position: relative;
  padding-right: 2.5em;  /* space for ↓ */
  display: flex;
  align-items: center;   /* vertical centering */
  outline: none;
  box-shadow: none;
}

/* Fake dropdown arrow glyph (we piggyback MDC icon element) */
#scratch-metabox-container .scratch-slide-select .mdc-select__dropdown-icon::before {
  content: '▾';
  position: absolute;
  right: -1.9em;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 1.5em;
  color: inherit;
}

/* Nuke ripples */
#scratch-metabox-container .scratch-slide-select
  .mdc-select__anchor .mdc-select__ripple::before,
#scratch-metabox-container .scratch-slide-select
  .mdc-select__anchor .mdc-select__ripple::after {
  background-color: transparent;
}

/* Remove hover/focus backgrounds */
#scratch-metabox-container .scratch-slide-select .mdc-select__anchor:hover,
#scratch-metabox-container .scratch-slide-select .mdc-select__anchor.mdc-select--focused,
#scratch-metabox-container .scratch-slide-select .mdc-select__menu .mdc-list-item:hover,
#scratch-metabox-container .scratch-slide-select .mdc-select__menu .mdc-list-item--selected {
  background-color: transparent;
}

/* Floating label color when floated */
#scratch-metabox-container .scratch-slide-select
  .mdc-floating-label--float-above {
  color: black;
}

/* When focused, kill path stroke (MDC outlines) */
#scratch-metabox-container .scratch-slide-select.mdc-select--focused
  .mdc-notched-outline__path {
  stroke: transparent;
}

/* Transparent list-item ripples */
#scratch-metabox-container .scratch-slide-select
  .mdc-select__menu .mdc-list-item {
  --mdc-ripple-color: transparent;
}

/* Hide "Select" placeholder from menu list but keep it in DOM so value="0" works. */
#scratch-metabox-container .scratch-slide-select .mdc-select__menu [data-value="0"] {
  display: none;
}


/* === Media Preview Row (Icon & Image columns) ============================ */
#scratch-metabox-container .scratch-preview-row {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: center;
  margin-bottom: 2.0rem;
  margin-top: 2.0rem;
  padding-left:22px;
}

/* Each column is a 2x2 grid: label spans row, preview left, button right. */
#scratch-metabox-container .scratch-preview-row > .scratch-icon-column,
#scratch-metabox-container .scratch-preview-row > .scratch-image-column {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "label  label"
    "preview button";
  gap: 0.5rem;
  align-items: center;
}

/* Column label (above preview) */
#scratch-metabox-container .scratch-column-label {
  grid-area: label;
  color: black;
  font-weight: bold;
  margin: 0;
  padding-left: 0.1rem;
  margin-bottom: 10px;
  line-height: 1.2;
}

/* Image preview (actual IMG element) */
#scratch-metabox-container .scratch-icon-column img,
#scratch-metabox-container .scratch-image-column img {
  grid-area: preview;
  width: 100px;
  height: 100px;
  object-fit: contain;
  display: block;
}

/* Select buttons */
#scratch-metabox-container button.select-icon-btn,
#scratch-metabox-container button.select-image-btn {
  grid-area: button;
  text-transform: none;
  color: var(--scratch-brown-alt);
  font-family: var(--scratch-font);
  cursor: pointer;
  background: none;
  border-radius: 4px;
  padding: 0.25rem 0.75rem;
  line-height: 1.2;
  font-size: 14px;
}


/* === Scratch Size Label & Circles ======================================= */
#scratch-metabox-container .scratch-size-label-row,
#scratch-metabox-container .scratch-circles-row {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: flex-start; /* left align to match select start edge */
  margin-bottom: 2.0rem;
  margin-top:2.0rem;
  padding-left: 226px;         /* aligns under the 450px select above */
}

/* Text label */
#scratch-metabox-container .scratch-size-label-row {
  color: black;
  font-size: 1rem;
  line-height: 1.2;
}



/* Individual circle+radio */
#scratch-metabox-container .scratch-circle-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

/* Circle preview disk (purely visual) */
#scratch-metabox-container .scratch-circle-preview {
  border-radius: 50%;
  background: var(--scratch-dark);
  width: 40px;   /* default; JS supplies inline width/height for actual scale */
  height: 40px;
}

/* Radio hit zone */
#scratch-metabox-container .scratch-circle-radio {
  cursor: pointer;
  margin: 0;
}

/* ==========================================================================
   Custom radios (Scratch): default black border, checked orange border + dot
   ========================================================================== */
#scratch-metabox-container .scratch-circle-radio {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid black;      /* default black ring */
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  background: transparent;
}

/* checked = orange ring */
#scratch-metabox-container .scratch-circle-radio:checked {
  border-color: #FF9B15;
}

/* inner orange dot */
#scratch-metabox-container .scratch-circle-radio:checked::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #FF9B15;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* focus state = orange border, no native outline */
#scratch-metabox-container .scratch-circle-radio:focus {
  outline: none;
  border-color: #FF9B15;
}




/* === Footer Buttons (Cancel / Apply Scratch) ============================ */
#scratch-metabox-container .scratch-metabox-footer {
  display: flex;
  justify-content: center;
  gap: 3.25rem;              /* tighten but leave breathing room */
  margin-top: 5.0rem;
  margin-bottom: 2.0rem;
  flex-wrap: wrap;           /* just in case nano screens */
}

/* Normalize MDC button base */
#scratch-metabox-container .scratch-metabox-footer .mdc-button {
  display: inline-flex;
  margin: 0;
  align-items: center;
  text-transform: none;
  font-family: var(--scratch-font);
  cursor: pointer;
}

/* Cancel = text style */
#scratch-metabox-container .scratch-cancel-btn {
  background: none;
  border: none;
  padding: 0.5em 1em;
  color: var(--scratch-brown-alt);
  width: auto;
  font-size: 1rem;
}

/* Apply Scratch = primary gradient block button */
#scratch-metabox-container .scratch-apply-btn {
  background: linear-gradient(
    135deg,
    var(--scratch-primary-gradient-start),
    var(--scratch-primary-gradient-end)
  );
  color: black;
  border: none;
  border-radius: 16px;
  padding: 0.5em 1em;
  font-size: 1rem !important;
  width: 300px; /* requested fixed width */
}


/* === Placeholder Preview Box ============================================ */
/* Shown when no icon/image selected yet. */
#scratch-metabox-container .placeholder-preview {
  width: 100px;
  height: 100px;
  background: #fff;
  border: 1px solid #ddd;
  box-sizing: border-box;
  grid-area: preview;
  display: block;
}


/* === Utility ============================================================= */
/* Hide previews */
#scratch-metabox-container img[src=""] {
  display: none !important;
}
/* --- Set-to-set divider (450px MDC line) ------------------------------- */
#scratch-metabox-container .scratch-set-divider {
  width: 450px;                /* match your select width */
  height: 1px;                 /* hairline */
  background: rgba(0,0,0,0.12);/* MDC divider color */
  margin: 2.5rem auto;         /* same vertical rhythm as headers */
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */
body.dark #scratch-metabox-container {
  --scratch-primary: #5FCCD0;
  --scratch-primary-gradient-start: #5FCCD0;
  --scratch-primary-gradient-end: #157184;
  --scratch-brown: #157184;
  --scratch-brown-text: #5FCCD0;
  --scratch-brown-alt: #5FCCD0;
  --scratch-dark: #0a1c21;
  --mdc-theme-on-surface: #f3ebe3;
}

body.dark #scratch-metabox-container .scratch-set-label,
body.dark #scratch-metabox-container .scratch-column-label,
body.dark #scratch-metabox-container .scratch-size-label-row {
  color: #f3ebe3;
}

body.dark #scratch-metabox-container .scratch-circle-preview {
  background: #5FCCD0;
}

body.dark #scratch-metabox-container .scratch-circle-radio {
  border-color: #c4b6aa;
}

body.dark #scratch-metabox-container .scratch-circle-radio:checked {
  border-color: #5FCCD0;
}

body.dark #scratch-metabox-container .scratch-circle-radio:checked::before {
  background: #5FCCD0;
}

body.dark #scratch-metabox-container .scratch-circle-radio:focus {
  border-color: #5FCCD0;
}

body.dark #scratch-metabox-container .scratch-apply-btn {
  background: linear-gradient(135deg, #5FCCD0, #157184);
  color: #000;
}

body.dark #scratch-metabox-container .scratch-cancel-btn {
  color: #5FCCD0;
}

body.dark #scratch-metabox-container .placeholder-preview {
  background: #0a1c21;
  border-color: #157184;
}

body.dark #scratch-metabox-container .scratch-set-divider {
  background: #157184;
}

body.dark #scratch-metabox-container .scratch-slide-select .mdc-floating-label--float-above {
  color: #f3ebe3;
}

body.dark #scratch-metabox-container .scratch-slide-select {
  --mdc-theme-primary: #5FCCD0;
}

body.dark #scratch-metabox-container .mdc-select__selected-text,
body.dark #scratch-metabox-container .mdc-select__dropdown-icon,
body.dark #scratch-metabox-container .mdc-floating-label,
body.dark #scratch-metabox-container .mdc-list-item__primary-text,
body.dark #scratch-metabox-container .mdc-icon-button__icon,
body.dark #scratch-metabox-container .material-symbols-rounded {
  color: #f3ebe3 !important;
}

body.dark #scratch-metabox-container .mdc-notched-outline__leading,
body.dark #scratch-metabox-container .mdc-notched-outline__notch,
body.dark #scratch-metabox-container .mdc-notched-outline__trailing {
  border-color: #f3ebe3 !important;
}

/* Dropdown menu surface - dark background with white text */
body.dark #scratch-metabox-container .mdc-select__menu.mdc-menu-surface,
body.dark #scratch-metabox-container .mdc-menu-surface {
  background: #0a1c21 !important;
  border: 1px solid #157184;
}

body.dark #scratch-metabox-container .mdc-select__menu .mdc-list-item,
body.dark #scratch-metabox-container .mdc-select__menu .mdc-list-item__text {
  color: var(--mdc-theme-on-surface, #f3ebe3) !important;
}

body.dark #scratch-metabox-container .mdc-select__menu .mdc-list-item:hover,
body.dark #scratch-metabox-container .mdc-select__menu .mdc-list-item--selected {
  background-color: #11272D !important;
}

body.dark #scratch-metabox-container .mdc-select__menu .mdc-list-item .mdc-list-item__ripple::before,
body.dark #scratch-metabox-container .mdc-select__menu .mdc-list-item .mdc-list-item__ripple::after {
  background-color: transparent;
}
