body {
  margin: 0; min-height: 100vh; font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #0f172a; color: #e2e8f0;
}
a { color: #38bdf8; }
.td-hidden { display: none; }

.td-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.td-wrap { max-width: 480px; padding: 32px; box-sizing: border-box; }
.td-login-wrap { text-align: center; }
.td-eyebrow { color: #38bdf8; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
h1 { font-size: 1.7rem; margin: 0 0 4px; }
p { color: #94a3b8; line-height: 1.5; }

input {
  display: block; width: 100%; box-sizing: border-box; margin: 10px 0; padding: 10px 12px;
  border-radius: 6px; border: 1px solid #334155; background: #1e293b; color: #e2e8f0; font-size: 0.95rem;
}
button {
  padding: 10px 14px; border-radius: 6px; border: none; background: #38bdf8;
  color: #0f172a; font-weight: 600; cursor: pointer; font-size: 0.9rem;
}
#td-login-btn { width: 100%; }
.td-error { color: #f87171; font-size: 0.85rem; margin-top: 8px; }

.td-shell { max-width: 900px; margin: 0 auto; padding: 24px; box-sizing: border-box; }
.td-topbar { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.td-topbar h1 { margin-right: auto; }
.td-topbar-right { display: flex; align-items: center; gap: 14px; }
.td-badge {
  background: #1e293b; border: 1px solid #334155; border-radius: 999px; padding: 4px 12px;
  font-size: 0.8rem; color: #94a3b8;
}
.td-badge-level-guest { color: #94a3b8; }
.td-badge-level-employee { color: #4ade80; }
.td-badge-level-admin { color: #38bdf8; }
.td-badge-level-superuser { color: #facc15; }
.td-tiny-link { font-size: 0.85rem; }

.td-tabs { display: flex; gap: 4px; border-bottom: 1px solid #334155; margin-bottom: 20px; flex-wrap: wrap; }
.td-tab {
  background: none; border: none; color: #94a3b8; padding: 10px 16px; cursor: pointer;
  font-size: 0.9rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.td-tab:hover { color: #e2e8f0; }
.td-tab-active { color: #38bdf8; border-bottom-color: #38bdf8; font-weight: 600; }
.td-tab:disabled { color: #475569; cursor: not-allowed; }

.td-panel {
  background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 24px; min-height: 200px;
}
.td-loading { color: #64748b; }
.td-placeholder { color: #64748b; text-align: center; padding: 40px 20px; }
.td-placeholder-icon { font-size: 2rem; margin-bottom: 8px; }

.td-field-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #334155; }
.td-field-row:last-child { border-bottom: none; }
.td-field-label { color: #94a3b8; font-size: 0.85rem; }
.td-field-value { font-weight: 500; }

.td-profile-form { display: flex; flex-direction: column; gap: 12px; max-width: 480px; }
.td-form-label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: #94a3b8; }
.td-form-label input, .td-form-label textarea {
  font-family: inherit; font-size: 0.95rem; color: #e2e8f0; background: #0f172a;
  border: 1px solid #334155; border-radius: 6px; padding: 8px 10px; margin: 0; width: auto; resize: vertical;
}

.td-avail-section { margin-bottom: 28px; }
.td-avail-section:last-child { margin-bottom: 0; }
.td-avail-section h3 { font-size: 1rem; margin: 0 0 12px; color: #e2e8f0; }
.td-avail-day-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #334155;
}
.td-avail-day-label { width: 40px; flex: 0 0 40px; color: #94a3b8; font-size: 0.85rem; font-weight: 600; }
.td-avail-day-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.td-avail-empty { color: #64748b; font-size: 0.85rem; }
.td-avail-chip {
  display: inline-flex; align-items: center; gap: 6px; background: #0f172a; border: 1px solid #334155;
  border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 0.85rem; color: #cbd5e1;
}
.td-avail-chip em { color: #64748b; font-style: normal; }
.td-avail-chip-x {
  background: none; border: none; color: #64748b; cursor: pointer; padding: 2px 6px;
  font-size: 0.8rem; border-radius: 999px; line-height: 1;
}
.td-avail-chip-x:hover { color: #f87171; background: #1e293b; }
.td-avail-timeoff-row {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid #334155; font-size: 0.9rem;
}
.td-avail-timeoff-row em { color: #64748b; font-style: normal; }

.td-add-row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.td-add-row input, .td-add-row select {
  width: auto; flex: 1 1 140px; margin: 0; height: 38px; padding: 0 10px; box-sizing: border-box;
}
.td-add-row button { flex: 0 0 auto; align-self: center; }
.td-add-row input[type="color"] { flex: 0 0 44px; padding: 2px; }

.td-inline-label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: #94a3b8; flex: 1 1 160px; }
/* flex: none overrides .td-add-row input/select's own flex-basis (140px) -
   inside this column-direction flex container, an inherited flex-basis
   drives the item's HEIGHT (the main axis), not its width, which is what
   made these inputs render much taller than the rest of the row. */
.td-inline-label input, .td-inline-label select { margin: 0; height: 38px; padding: 0 10px; box-sizing: border-box; flex: none; }

.td-preset-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.td-preset-chip {
  display: inline-flex; align-items: center; gap: 8px; background: #0f172a; border: 1px solid #334155;
  border-radius: 999px; padding: 6px 8px 6px 6px; font-size: 0.82rem; color: #cbd5e1; cursor: pointer;
  user-select: none;
}
.td-preset-chip:hover { border-color: #475569; }
.td-preset-chip-active { border-color: #38bdf8; box-shadow: 0 0 0 1px #38bdf8; }
.td-preset-chip-eraser { color: #94a3b8; }
.td-preset-swatch { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 14px; border: 1px solid rgba(255,255,255,0.2); }
.td-preset-name { font-weight: 600; }
.td-preset-meta { color: #64748b; font-size: 0.75rem; }

.td-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.td-cal-nav button { background: #334155; color: #e2e8f0; font-size: 0.8rem; padding: 6px 10px; }
.td-cal-month-label { font-weight: 600; }
.td-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.td-cal-grid-head { margin-bottom: 4px; color: #64748b; font-size: 0.75rem; text-align: center; }
.td-cal-cell {
  min-height: 56px; border: 1px solid #334155; border-radius: 6px; padding: 4px 6px; background: #0f172a;
  cursor: pointer; display: flex; flex-direction: column; gap: 2px; user-select: none;
}
.td-cal-cell:hover { border-color: #475569; }
.td-cal-cell-empty { border: none; background: none; cursor: default; }
.td-cal-daynum { font-size: 0.75rem; color: #94a3b8; }
.td-cal-preset-name { font-size: 0.68rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.td-profile-form #td-profile-save { align-self: flex-start; margin-top: 6px; }
.td-tiny-status { font-size: 0.8rem; color: #64748b; margin-left: 10px; }

.td-avatar-row { display: flex; align-items: center; gap: 16px; }
.td-avatar {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid #334155;
  background: #0f172a; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #38bdf8; flex-shrink: 0;
}
.td-avatar-controls { display: flex; align-items: center; flex-wrap: wrap; }
.td-btn-secondary {
  background: #334155; color: #e2e8f0; padding: 8px 12px; border-radius: 6px; border: none;
  cursor: pointer; font-size: 0.85rem;
}

.td-help-text { color: #94a3b8; font-size: 0.85rem; margin: -6px 0 14px; }

.td-skill-list { margin-bottom: 16px; }
.td-skill-chip {
  display: inline-flex; align-items: center; gap: 8px; background: #0f172a; border: 1px solid #334155;
  border-radius: 999px; padding: 4px 6px 4px 12px; margin: 4px 4px 0 0; font-size: 0.85rem; color: #cbd5e1;
}
.td-skill-name { font-weight: 500; }
.td-skill-tier-badge {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 2px 8px; border-radius: 999px;
}
.td-skill-tier-proposed .td-skill-tier-badge { background: #334155; color: #cbd5e1; }
.td-skill-tier-certified .td-skill-tier-badge { background: #0c4a6e; color: #7dd3fc; }
.td-skill-tier-authenticated .td-skill-tier-badge { background: #713f12; color: #facc15; }
.td-skill-tier-authenticated { border-color: #facc15; }
.td-skill-tier-certified { border-color: #38bdf8; }
.td-skill-used { color: #64748b; font-size: 0.75rem; }
.td-skill-remove {
  background: none; border: none; color: #64748b; cursor: pointer; font-size: 1rem; line-height: 1;
  padding: 0 4px; border-radius: 50%;
}
.td-skill-remove:hover { color: #f87171; }

.td-offers-subhead { color: #94a3b8; font-size: 0.9rem; font-weight: 600; margin: 20px 0 8px; }

.td-offer-card {
  background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 16px; margin-bottom: 12px;
}
.td-offer-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.td-offer-title { font-weight: 600; font-size: 1.02rem; }
.td-offer-status {
  border-radius: 999px; padding: 3px 10px; font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}
.td-offer-status-pending { background: #422006; color: #facc15; }
.td-offer-status-accepted { background: #052e1a; color: #4ade80; }
.td-offer-status-denied { background: #450a0a; color: #f87171; }
.td-offer-meta { color: #94a3b8; font-size: 0.88rem; margin-top: 4px; }
.td-offer-skills { margin-top: 8px; }

.td-offer-confidence { margin-top: 14px; }
.td-offer-confidence label { display: block; color: #94a3b8; font-size: 0.82rem; margin-bottom: 6px; }
.td-offer-confidence-row { display: flex; align-items: center; gap: 10px; }
.td-offer-confidence-row input[type="range"] { flex: 1; margin: 0; width: auto; }
.td-confidence-value { color: #38bdf8; font-weight: 600; min-width: 1.2em; text-align: right; }

.td-offer-actions { display: flex; gap: 10px; margin-top: 14px; }
.td-btn-accept { background: #4ade80; }
.td-btn-deny { background: #1e293b; border: 1px solid #f87171; color: #f87171; }
.td-offer-hint {
  margin-top: 10px; padding: 8px 12px; border-radius: 6px; background: #422006; color: #facc15; font-size: 0.85rem;
}
