/* ---------------------------------------------------------------- tokens */
:root {
  --navy: #002D72;
  --navy-deep: #001B45;
  --gold: #F2A900;
  --ink: #1B1F27;
  --muted: #5C6573;
  --line: #DDE1E8;
  --surface: #FFFFFF;
  --canvas: #F4F6F9;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,25,70,.07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------- masthead */
.masthead {
  background: var(--navy);
  color: #fff;
  border-bottom: 4px solid var(--gold);
}
.masthead-inner {
  display: flex; align-items: center; gap: 16px;
  padding-top: 22px; padding-bottom: 22px;
}
/* Official NYIT mark, dark-background variant — it carries its own gold rule
   and white type, so it sits on the navy masthead unmodified. */
.logo { flex: none; display: block; width: auto; height: 36px; }

.masthead-divider {
  flex: none; width: 1px; height: 30px;
  background: rgba(255, 255, 255, .28);
}

@media (max-width: 560px) {
  .masthead-inner { gap: 12px; }
  .logo { height: 28px; }
  .masthead-divider { display: none; }
}
.masthead h1 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.tagline { margin: 2px 0 0; font-size: 14px; color: rgba(255,255,255,.72); }

/* --------------------------------------------------------------- layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
  padding-top: 28px;
  padding-bottom: 28px;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

/* ----------------------------------------------------------------- tabs */
.tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--canvas); border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 18px;
}
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--muted);
  padding: 6px 16px; border-radius: 6px;
}
.tab.is-active { background: var(--surface); color: var(--navy); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tab:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

/* --------------------------------------------------------------- fields */
.field { display: block; margin-bottom: 0; }
.label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ink); margin-bottom: 6px;
}
input[type=url], textarea, select {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px;
}
textarea { resize: vertical; line-height: 1.55; font-size: 14px; }
input[type=url]:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(0,45,114,.14);
}
input[aria-invalid="true"] { border-color: #C0392B; }
select { appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%235C6573' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 11px;
}

/* ---------------------------------------------------- advanced settings */
/* Collapsed by default: most people only need to paste a URL. */
.advanced { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }

.advanced-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  cursor: pointer; list-style: none;
  transition: background-color .15s ease, color .15s ease;
}
.advanced-summary::-webkit-details-marker { display: none; }
.advanced-summary:hover { background: var(--canvas); color: var(--navy); }
.advanced[open] > .advanced-summary { color: var(--navy); background: var(--canvas); }
.advanced-summary:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

/* Chevron, pointing down when closed and up when open. */
.advanced-summary::after {
  content: ''; flex: none;
  width: 7px; height: 7px; margin-right: 2px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  border-radius: 1px;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .18s ease;
}
.advanced[open] > .advanced-summary::after {
  transform: translateY(2px) rotate(225deg);
}

.advanced > .grid { margin-top: 14px; }

.grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
@media (max-width: 520px) { .grid { grid-template-columns: minmax(0, 1fr); } }

.check { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--navy); }

/* Label plus its help toggle. */
.label-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.label-row .label { margin-bottom: 0; }

/* A real button, not a `title` attribute: tooltips never appear on touch
   devices and are invisible to keyboard users. */
.hint {
  flex: none; appearance: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--line); color: var(--muted);
  font: 700 10px/1 var(--font);
  transition: background-color .15s ease, color .15s ease;
}
.hint:hover,
.hint[aria-expanded="true"] { background: var(--navy); color: #fff; }
.hint:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.tip {
  margin: 8px 0 0; padding: 9px 11px;
  font-size: 12.5px; line-height: 1.5; color: var(--muted);
  background: var(--canvas);
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 6px;
}
.tip strong { color: var(--ink); font-weight: 600; }

.note { margin: 8px 0 0; font-size: 13px; color: var(--muted); min-height: 19px; }
.note.is-error { color: #C0392B; }

/* -------------------------------------------------------------- preview */
.preview-panel { position: sticky; top: 24px; }
@media (max-width: 860px) { .preview-panel { position: static; } }

.stage {
  display: flex; align-items: center; justify-content: center;
  background: var(--canvas); border: 1px solid var(--line); border-radius: 8px;
  padding: 22px; min-height: 300px;
}
.preview { width: 100%; max-width: 256px; }
.preview svg { display: block; width: 100%; height: auto; border-radius: 4px; }
.preview.is-empty { color: var(--muted); font-size: 14px; text-align: center; max-width: none; }

.meta {
  margin: 12px 0 0; font-size: 12.5px; color: var(--muted);
  text-align: center; min-height: 19px;
}

/* -------------------------------------------------------------- actions */
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn {
  flex: 1 1 auto; appearance: none; cursor: pointer; font: inherit;
  font-size: 14px; font-weight: 500;
  padding: 9px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.btn:hover:not(:disabled) { background: var(--canvas); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-deep); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.status { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-align: center; min-height: 19px; }
.status.is-error { color: #C0392B; }

/* ----------------------------------------------------------------- foot */
.foot { padding-bottom: 36px; }
.foot p { margin: 0; font-size: 13px; color: var(--muted); }
