:root {
  --ink: #1a1612;
  --ink-soft: #4a3f35;
  --ink-muted: #8a7d6f;
  --paper: #faf6ef;
  --paper-warm: #f3ece0;
  --line: #d9cfbd;
  --line-soft: #e8dfcf;
  --gold: #a37a2c;
  --gold-deep: #7a5719;
  --gold-soft: #f0e3c5;
}
body { background: var(--paper); color: var(--ink); font-family: 'Inter', system-ui, sans-serif; }
.umma-hub-page { min-height: 100vh; display: flex; flex-direction: column; }
#view-form,
#view-dir { flex: 1 0 auto; }
.serif { font-family: Georgia, 'Times New Roman', serif; }

/* NAVBAR */
.umma-nav { background: rgba(250,246,239,0.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.brand-icon { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--gold); background: var(--gold-soft); color: var(--gold-deep); display: grid; place-items: center; }
.brand-name { font-family: Georgia, serif; font-size: 1.5rem; font-weight: 600; letter-spacing: .15em; color: var(--ink); line-height: 1; }
.brand-tag { font-size: .65rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-muted); }
.nav-pills .nav-link { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); border-radius: 2px; padding: .5rem 1.1rem; }
.nav-pills .nav-link.active { background: var(--ink); color: var(--paper); }
.nav-pills .nav-link:not(.active):hover { color: var(--ink); }
.hub-nav-auth-btn {
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .45rem 1rem;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
}
.hub-nav-auth-btn:hover {
  background: var(--paper-warm);
  border-color: var(--gold);
  color: var(--ink);
}
.hub-nav-logout-btn {
  border-color: var(--ink-soft);
}
.hub-nav-member-label {
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--ink-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 575.98px) {
  .hub-nav-member-label { max-width: 100px; }
}

/* HERO */
.hero-eyebrow { font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-deep); }
.hero-title { font-family: Georgia, serif; font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.05; }
.hero-title em { font-style: italic; color: var(--gold-deep); }

/* WHY SECTION */
.why-section { border: 1px solid var(--line); background: var(--paper); position: relative; }
.why-section::before, .why-section::after { content: ''; position: absolute; width: 12px; height: 12px; border: 1px solid var(--gold); }
.why-section::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.why-section::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.why-num { font-family: Georgia, serif; font-size: 1.8rem; font-style: italic; color: var(--gold-deep); }
.why-card { border-top: 1px solid var(--gold); }
.why-card h3 { font-family: Georgia, serif; font-size: 1.2rem; font-weight: 500; }

/* FORM */
.form-shell { border: 1px solid var(--line); background: var(--paper); }
.section-num { font-family: Georgia, serif; font-size: 2rem; color: var(--gold); font-style: italic; line-height: 1; min-width: 48px; }
.section-title { font-family: Georgia, serif; font-size: 1.4rem; font-weight: 500; }
.section-sub { font-size: .8rem; color: var(--ink-muted); }
.field-label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; margin-bottom: .35rem; }
.form-control, .form-select { background: #fffdf8; border-color: var(--line); color: var(--ink); font-size: .9rem; border-radius: 2px; }
.form-control:focus, .form-select:focus { border-color: var(--gold-deep); box-shadow: 0 0 0 3px var(--gold-soft); background: #fffdf8; }

/* Chosen searchable selects */
.hub-field .chosen-container { width: 100% !important; font-size: .9rem; }
.hub-field .chosen-container-single .chosen-single {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: none;
  height: auto;
  line-height: 1.5;
  padding: .5rem .75rem;
  color: var(--ink);
}
.hub-field .chosen-container-active.chosen-with-drop .chosen-single,
.hub-field .chosen-container-single .chosen-single:hover {
  border-color: var(--gold-deep);
}
.hub-field .chosen-container .chosen-drop {
  border-color: var(--line);
  border-radius: 0 0 2px 2px;
  box-shadow: 0 4px 12px rgba(26, 22, 18, .08);
}
.hub-field .chosen-container .chosen-results li.highlighted {
  background: var(--ink);
  color: var(--paper);
}

/* Inline validation */
.field-hint { font-size: .72rem; color: var(--ink-muted); display: block; margin-top: .3rem; }
.hub-image-spec { line-height: 1.45; }
.field-error-msg { font-size: .8rem; line-height: 1.4; margin-top: .35rem; display: block; }
.hub-field.hub-invalid .form-control,
.hub-field.hub-invalid .upload-zone,
.hub-field.hub-invalid #f-willing-wrap {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, .12);
}
.hub-field.hub-invalid .chosen-container-single .chosen-single {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, .12);
}

/* UPLOAD */
.upload-zone { border: 1px dashed var(--line); background: #fffdf8; aspect-ratio: 1; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; color: var(--ink-muted); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; border-radius: 2px; overflow: hidden; transition: border-color .15s, background .15s; position: relative; }
.upload-zone:hover { border-color: var(--gold-deep); color: var(--ink); }
.upload-zone.is-dragover { border-color: var(--gold-deep); background: var(--paper-warm); color: var(--ink); border-style: solid; }
.upload-zone img { width: 100%; height: 100%; object-fit: cover; }
.upload-zone-hint { display: block; font-size: .62rem; letter-spacing: .06em; text-transform: none; color: var(--ink-muted); margin-top: .15rem; font-style: italic; }
.photo-remove { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(26,22,18,.8); color: #fff; border: none; font-size: .85rem; cursor: pointer; display: grid; place-items: center; line-height: 1; z-index: 2; }
.upload-zone-spinner { position: absolute; inset: 0; background: rgba(255,253,248,.75); display: flex; align-items: center; justify-content: center; z-index: 3; pointer-events: none; }
.upload-zone-spinner::after { content: ''; width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--gold-deep); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* CHIPS */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: .4rem .8rem; background: #fffdf8; border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; cursor: pointer; color: var(--ink-soft); transition: all .15s; user-select: none; }
.chip:hover { border-color: var(--gold); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* PRODUCT GRID */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.product-tile { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; background: var(--paper-warm); }
.product-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-remove { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; background: rgba(26,22,18,.85); color: #fff; border: none; font-size: .7rem; cursor: pointer; display: grid; place-items: center; line-height: 1; }
.product-add { aspect-ratio: 1; border: 1px dashed var(--line); background: #fffdf8; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ink-muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; border-radius: 2px; transition: all .15s; }
.product-add:hover { border-color: var(--gold-deep); color: var(--ink); }

/* SUBMIT */
.submit-area { background: var(--paper-warm); border-top: 1px solid var(--line-soft); }
.btn-umma { background: var(--ink); color: var(--paper); border: none; padding: .75rem 2rem; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; border-radius: 2px; transition: background .15s; }
.btn-umma:hover { background: var(--gold-deep); color: var(--paper); }
.btn-umma:disabled { opacity: .6; }
.btn-umma-outline { background: #fffdf8; color: var(--ink); border: 1px solid var(--line); padding: .75rem 1.5rem; font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; border-radius: 2px; transition: background .15s, border-color .15s; }
.btn-umma-outline:hover { background: var(--paper-warm); border-color: var(--gold); color: var(--ink); }
.btn-umma-outline:disabled { opacity: .6; }
.hub-forgot-link { display: inline-block; margin-top: .35rem; font-size: .78rem; color: var(--gold-deep); text-decoration: none; letter-spacing: .02em; }
.hub-forgot-link:hover { color: var(--ink); text-decoration: underline; }

/* SUCCESS */
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-deep); display: grid; place-items: center; margin: 0 auto 1.5rem; font-size: 1.8rem; }

/* DIRECTORY */
.search-box { display: flex; align-items: center; gap: .5rem; padding: 0 1rem; border: 1px solid var(--line); background: #fffdf8; border-radius: 2px; }
.search-box input { border: none; background: transparent; outline: none; padding: .7rem 0; font-size: .9rem; width: 100%; color: var(--ink); }
.dir-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.dir-search-clear:hover,
.dir-search-clear:focus-visible {
  color: var(--ink);
  background: rgba(0, 0, 0, .06);
  outline: none;
}
.dir-results-wrap { min-height: 0; }
.dir-search-status {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: -.5rem 0 1rem;
  padding: .45rem .75rem;
  font-size: .8rem;
  color: var(--ink-muted);
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
}
.dir-search-btn-spinner {
  display: inline-block;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--gold-deep);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
#dir-search-form button[type="submit"]:disabled {
  opacity: .85;
  cursor: wait;
}
.dir-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper);
}
.dir-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--line-soft);
}
.dir-row:last-child { border-bottom: none; }
.dir-row-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background .15s;
}
.dir-row-link:hover {
  background: var(--paper-warm);
  color: inherit;
}
.dir-row-link:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: -2px;
}
.dir-row-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--gold-soft);
  flex-shrink: 0;
}
.dir-row-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  color: var(--gold-deep);
  font-size: 1.1rem;
  text-align: center;
  padding: .2rem;
}
.dir-row-photo-unavailable {
  font-size: .5rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  line-height: 1.1;
  max-width: 100%;
}
.dir-row-content {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.5rem;
}
.dir-row-chevron {
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--ink-muted);
}
.dir-row-link:hover .dir-row-chevron { color: var(--gold-deep); }
.dir-row-main { flex: 1 1 180px; min-width: 0; }
.dir-row-name {
  font-family: Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.25;
  word-break: break-word;
}
.dir-row-biz {
  font-size: .85rem;
  color: var(--ink-muted);
  margin-top: .2rem;
  word-break: break-word;
}
.dir-row-location {
  font-size: .78rem;
  color: var(--ink-muted);
  margin-top: .35rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .15rem;
  word-break: break-word;
}
.dir-row-location .bi { color: var(--gold-deep); flex-shrink: 0; }
.dir-row-roles {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: flex-end;
  flex: 1 1 auto;
  max-width: 100%;
}
.role-tag {
  font-size: .65rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 9px;
  background: var(--gold-soft);
  color: var(--gold-deep);
  border-radius: 999px;
  white-space: nowrap;
}
@media (max-width: 575.98px) {
  .dir-row { padding: .75rem 1rem; flex-wrap: nowrap !important; gap: .65rem; align-items: center; }
  .dir-row-photo { width: 42px; height: 42px; }
  .dir-row-content { flex-direction: column; align-items: flex-start; gap: .25rem; justify-content: center; }
  .dir-row-main { flex: 1 1 0; min-width: 0; }
  .dir-row-roles { justify-content: flex-start; }
  .dir-row-name { font-size: .95rem; }
  .dir-row-biz { font-size: .78rem; margin-top: .1rem; }
  .dir-row-location { margin-top: .15rem; }
  .dir-row-chevron { font-size: .9rem; }
}

.dir-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  margin-top: 1.5rem;
}
.dir-page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 .6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  color: var(--ink-soft);
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.dir-page-btn:hover:not(:disabled):not(.is-active) {
  background: var(--paper-warm);
  border-color: var(--gold);
  color: var(--ink);
}
.dir-page-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  cursor: default;
}
.dir-page-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.dir-page-btn:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}
.dir-page-ellipsis {
  min-width: 26px;
  text-align: center;
  color: var(--ink-muted);
  user-select: none;
}
@media (max-width: 575.98px) {
  .dir-page-btn { min-width: 34px; height: 34px; font-size: .8rem; }
}

.umma-footer { border-top: 1px solid var(--line); font-size: .65rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-muted); }
.empty-state { font-family: Georgia, serif; font-size: 1.2rem; font-style: italic; color: var(--ink-muted); }
