/* Page logo (top-left) */
.icimod-logo-wrap {
  position: fixed;
  top: 0.85rem;
  left: 1.25rem;
  z-index: 60;
  pointer-events: none;
}

.icimod-logo {
  display: block;
  height: clamp(36px, 5vw, 48px);
  width: auto;
  max-width: min(160px, 28vw);
  object-fit: contain;
}

@media (max-width: 480px) {
  .icimod-logo-wrap {
    top: 0.5rem;
    left: 0.65rem;
  }

  .icimod-logo {
    max-width: 120px;
    height: 32px;
  }
}

/* Hide default Tethys chrome */
.app-header-wrapper,
#app-header-wrapper,
.app-header,
#app-header,
.app-navigation,
#app-navigation,
.app-navigation-wrapper,
#app-navigation-wrapper,
#footer.app-footer,
#app-footer,
#footer,
.site-footer,
.footer-wrapper,
body > footer,
#app-content-wrapper + footer,
.app-content-wrapper + footer,
.footer,
#app-action,
#app-actions,
.app-action,
.app-actions {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

#app-content-wrapper,
.app-content-wrapper,
.app-content {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* Landing: compact stack (no full-viewport stretch). Chat: full height for scroll. */
.icimod-main {
  background: #f8fafc;
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-sizing: border-box;
  padding: 0 clamp(0.75rem, 3vw, 1.25rem);
}

/* Inner app content description section */
.inner-app-content {
  max-width: 920px;
  margin: 2rem auto 0;
  padding: 0 clamp(0.75rem, 3vw, 1.25rem);
  box-sizing: border-box;
}

.inner-app-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #475569;
  margin: 0;
  text-align: center;
}

.icimod-main.has-results {
  min-height: 100vh;
  min-height: 100dvh;
}

.icimod-results {
  flex: 0 1 auto;
  overflow-y: auto;
  width: 100%;
  padding: 1rem 0 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.icimod-empty {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0 0;
  box-sizing: border-box;
}

.icimod-title {
  margin: 0;
  text-align: center;
  font-size: clamp(1.72rem, 2vw, 2.05rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #111827;
}

.icimod-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.9rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.icimod-question {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.9rem;
}

.icimod-question-text {
  margin: 0;
  max-width: min(70%, 620px);
  background: #e9eef5;
  color: #0f172a;
  border: 1px solid #dde4ee;
  border-radius: 16px;
  padding: 0.72rem 1rem;
  font-size: 0.98rem;
  line-height: 1.4;
}

.icimod-card-title {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 640;
}

.icimod-card-description {
  margin: 0.55rem 0 0.8rem;
  color: #1e293b;
  line-height: 1.6;
  white-space: pre-wrap;
}

.icimod-source-label {
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f172a;
  margin-top: 0.75rem;
  margin-bottom: 0.55rem;
  padding: 0.4rem 0.65rem;
  font-weight: 700;
  background: linear-gradient(180deg, #eff6ff 0%, #e0f2fe 100%);
  border: 1px solid #93c5fd;
  border-left: 4px solid #2563eb;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.icimod-source-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.icimod-source-list a {
  display: inline-block;
  text-decoration: none;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 0.38rem 0.5rem;
  transition: all 0.16s ease;
}

.icimod-source-list a:hover {
  color: #0b5ed7;
  border-color: #b7cff6;
  background: #f1f5f9;
  transform: translateY(-1px);
}

/* Composer: tight spacing to heading on landing */
.icimod-input-wrap {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto 1.25rem;
  flex-shrink: 0;
  min-height: 168px;
  background: #ffffff;
  border: 1px solid #cfd8e3;
  border-radius: 16px;
  padding: 0.75rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  z-index: 20;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.icimod-input-wrap:focus-within {
  border-color: #b7c5d6;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.16), 0 4px 14px rgba(15, 23, 42, 0.08);
}

.icimod-form {
  display: block;
}

.icimod-input {
  width: 100%;
  min-height: 120px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #ffffff;
  color: #0f172a;
  padding: 0.7rem 5.2rem 2.4rem 0.8rem;
  outline: none;
  font-size: 1rem;
  line-height: 1.45;
}

.icimod-input::placeholder {
  color: #94a3b8;
}

.icimod-input:focus {
  border-color: #ffffff;
}

/* Send button at bottom-right */
.icimod-submit {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  border: 0;
  border-radius: 999px;
  background: #94a3b8;
  color: #ffffff;
  padding: 0.58rem 0.95rem;
  min-width: 72px;
  font-weight: 620;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.icimod-submit:hover:not(:disabled) {
  filter: brightness(1.01);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(71, 85, 105, 0.2);
}

.icimod-submit:active:not(:disabled) {
  transform: translateY(0);
}

.icimod-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.icimod-loading {
  color: #64748b;
  font-size: 0.84rem;
  margin-top: 0.35rem;
  margin-left: 0.3rem;
  display: none;
}

/* After first result: move composer to bottom */
.icimod-main.has-results .icimod-empty {
  display: none;
}

.icimod-main.has-results .icimod-results {
  flex: 1 1 auto;
  padding: 2rem 0 10rem;
}

.icimod-main.has-results .icimod-input-wrap {
  position: sticky;
  bottom: 1.25rem;
  left: auto;
  transform: none;
  margin: 0 auto 1.25rem;
}

@media (max-width: 760px) {
  .icimod-main {
    max-width: 100%;
  }

  .icimod-results {
    padding: 0.75rem 0 0;
  }

  .icimod-main.has-results .icimod-results {
    padding: 1rem 0 9.5rem;
  }
}
