* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: Arial, sans-serif; }
button { cursor: pointer; border: none; }
button:hover { opacity: 0.9; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
input[type="text"], input[type="date"], input[type="password"] { outline: none; }
input:focus { border-color: #3b82f6; }
a { text-decoration: none; }
a:hover { opacity: 0.8; }
#apiKeySection { margin-bottom: 1.5rem; padding: 1rem; background-color: #fef3c7; border-radius: 0.5rem; }
#currentTimeBar { letter-spacing: 0.05em;}
.h-screen { height: 100vh; }
.min-h-screen { min-height: 100vh; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }
.max-h-96 { max-height: 600px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.inline-flex { display: inline-flex; }
.block { display: block; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 1rem; }
.gap-2 { gap: 0.5rem; }
.gap-1 { gap: 0.25rem; }
.grid { display: grid; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.space-y-2 > * + * { margin-top: 0.5rem; }
.overflow-auto { overflow: auto; }
.bg-black { background-color: #000000; }
.bg-blue-900 { background-color: #1e3a8a; }
.bg-blue-800 { background-color: #1e40af; }
.bg-blue-700 { background-color: #1d4ed8; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-white { background-color: #ffffff; }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-700 { background-color: #374151; }
.bg-gray-600 { background-color: #4b5563; }
.bg-gray-500 { background-color: #6b7280; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-green-600 { background-color: #16a34a; }
.bg-green-500 { background-color: #22c55e; }
.bg-red-600 { background-color: #dc2626; }
.bg-red-500 { background-color: #ef4444; }
.bg-yellow-500 { background-color: #eab308; }
.text-white { color: #ffffff; }
.text-black { color: #000000; }
.text-gray-800 { color: #1f2937; }
.text-gray-700 { color: #374151; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-400 { color: #9ca3af; }
.text-red-500 { color: #ef4444; }
.text-blue-300 { color: #93c5fd; }
.text-blue-900 { color: #1e3a8a; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.75rem; }
.text-5xl { font-size: 3.5rem; line-height: 4rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.p-6 { padding: 1.5rem; }
.p-4 { padding: 1rem; }
.p-3 { padding: 0.75rem; }
.p-2 { padding: 0.5rem; }
.p-1 { padding: 0.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.w-full { width: 100%; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); }
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-l-4 { border-left-width: 4px; }
.border-gray-300 { border-color: #d1d5db; }
.border-gray-200 { border-color: #e5e7eb; }
.border-blue-500 { border-color: #3b82f6; }
.h-full { height: 100%; }
.fixed { position: fixed; }
.top-4 { top: 1rem; }
.right-4 { right: 1rem; }
.hidden { display: none; }
.current-hour .font-semibold {
    color: #1e40af;
}
#scheduleGrid {
    height: 100%;
    min-height: 100%;
}
.schedule-table {
    display: grid;
    min-height: 100%;
    background: white;
    border-radius: 0.5rem;
    overflow: visible;
    font-size: clamp(16px, 2vw, 64px); /* Dynamically adjust font size based on viewport */
}
.schedule-header {
    background: #374151;
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 1rem;
    border-right: 1px solid #4b5563;
    font-size: clamp(18px, 2vw, 64px); /* Dynamically adjust font size */
}
.tech-divider {
    border-right: 2px solid #000000;
}
.time-cell {
    background: #f9fafb;
    font-weight: bold;
    color: #374151;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
    font-size: clamp(16px, 2vw, 36px); /* Dynamically adjust font size */
    border-right: 2px solid #000000;
}
.event-cell {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: stretch;
}
.event-box {
    background-color: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 0.75rem;
    border-radius: 0.25rem;
    font-size: clamp(16px, 2vw, 64px); /* Dynamically adjust font size */
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Highlight entire row for current hour */
.current-hour-row {
    background-color: #bfdbfe !important;
}
/* Editable regions must establish a positioning context */
.editable {
  position: relative;
}
.editable.active-edit {
  outline: 2px dashed #2563eb;
  outline-offset: 4px;
}
/* Pencil icon */
.edit-pencil {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #2563eb; /* blue */
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 6px;
  border-radius: 9999px;
  cursor: pointer;
  z-index: 50;

  /* Hidden by default */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Show pencil on hover only when edit display is enabled */
body.edit-display-enabled .editable:hover .edit-pencil {
  opacity: 1;
  pointer-events: auto;
}
.apply.dirty {
  background-color: #dc2626; /* red */
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.7; }
  100% { opacity: 1; }
}
button.apply.dirty {
  background-color: #dc2626; /* red */
  animation: pulse 1.2s infinite;
}

/* Ensure editable images have a hover area even when src is empty */
img.editable {
  min-width: 48px;
  min-height: 48px;
  background: rgba(255,255,255,0.15);
  border: 1px dashed rgba(255,255,255,0.4);
}

/* Optional helper icon */
img.editable::before {
  content: "ðŸ–¼";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  pointer-events: none;
}
footer .editable .edit-pencil {
  top: -6px;
  right: -6px;
}
footer .editable {
  min-height: 1em;
}
.inspector {
  position: fixed;
  z-index: 1000;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 260px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  font-size: 14px;
}

.inspector.hidden {
  display: none;
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f3f3f3;
  padding: 6px 10px;
  font-weight: bold;
  border-bottom: 1px solid #ddd;
}

.inspector-header button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
}

.inspector-body {
  padding: 10px;
}

.inspector-body label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.inspector-body input {
  width: 100%;
  padding: 4px;
  margin-bottom: 10px;
}
.inspector-body input[type="color"] {
  height: 36px;
}

.apply-bar {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: #111;
  color: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  z-index: 900;
}

.apply-bar.hidden {
  display: none;
}

.apply-bar .apply {
  background: #2563eb;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  color: white;
  cursor: pointer;
}

.apply-bar .apply.dirty {
  background: #dc2626;
}
.inspector-open {
  animation: inspectorPulse 0.3s ease-out;
}
/* Header image safety constraints - responsive to 10vh parent */
.header-img {
    max-height: 8vh;        /* 80% of 10vh header */
    height: 8vh;            /* Fill to max height */
    max-width: 100%;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Center image slightly smaller - responsive to 10vh parent */
.header-img-center {
    max-height: 5vh;        /* 50% of 10vh header */
    height: 5vh;            /* Fill to max height */
    max-width: 100%;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Header Grid Layout - Three Equal Columns */
.header-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-section-left,
.header-section-center,
.header-section-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-section-left {
    justify-content: flex-start;
}

.header-section-center {
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.header-section-right {
    justify-content: flex-end;
}
.tech-header {
  height: 48px;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 10;
}

.tech-header-input {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  text-align: center;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 4px;
}

.tech-header-input:focus {
  background: white;
  color: black;
  outline: none;
}

.tech-delete-btn {
  background: transparent;
  color: white;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.tech-delete-btn:hover {
  color: #fecaca;
}
#system-info, #system-info * {
color: #fff;
}

#system-info a:hover {
opacity: 0.8;
}

@keyframes inspectorPulse {
  from { transform: scale(0.96); opacity: 0.8; }
  to   { transform: scale(1); opacity: 1; }
}
