:root {
  --han: #00b968;
  --han-dark: #009653;
  --blue: #1677ff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f6f8fb;
  --user: #e9f3ff;
  --white: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--soft);
}

button, textarea { font: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px;
  background: #f0f3f8;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: white;
  border: 1px solid var(--line);
}

.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; }
.brand span { margin-top: 2px; font-size: 12px; color: var(--muted); }

.new-chat {
  width: 100%;
  border: 1px solid #d8dde6;
  background: white;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: #1357c7;
  font-weight: 600;
}

.sidebar-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #dde2ea;
  color: var(--muted);
  font-size: 12px;
}

.chat-panel {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background:
    radial-gradient(circle at 85% 12%, rgba(0,185,104,.06), transparent 25%),
    linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}

.chat-header {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-title img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: white;
}

.header-title h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.header-title p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.messages {
  overflow-y: auto;
  padding: 28px max(22px, calc((100vw - 260px - 960px) / 2));
}

.assistant-row, .user-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.user-row { justify-content: flex-end; }

.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--line);
}

.bubble {
  max-width: min(760px, 86%);
  padding: 12px 15px;
  border-radius: 16px;
  line-height: 1.55;
  font-size: 14px;
  word-break: break-word;
}

.bubble.assistant {
  background: white;
  border: 1px solid #edf0f4;
  border-top-left-radius: 6px;
  box-shadow: 0 3px 12px rgba(15,23,42,.04);
}

.bubble.user {
  background: var(--user);
  border-top-right-radius: 6px;
}

.bubble a {
  color: #0b63ce;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bubble p { margin: 0; }
.welcome { padding-bottom: 15px; }

.menu-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, max-content));
  gap: 8px;
}

.menu-grid button, .suggestion {
  border: 1px solid #d6dbe5;
  background: white;
  color: #064bd8;
  border-radius: 9px;
  padding: 9px 12px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 3px rgba(15,23,42,.05);
}

.menu-grid button:hover, .suggestion:hover {
  border-color: #9ab8eb;
  background: #f8fbff;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -8px 0 18px 44px;
  max-width: 760px;
}

.suggestion {
  font-size: 13px;
  color: #0a55b7;
  padding: 7px 10px;
}

.typing {
  margin: 0 max(22px, calc((100vw - 260px - 960px) / 2)) 8px;
  color: var(--muted);
  font-size: 12px;
}

.hidden { display: none !important; }

.composer {
  margin: 10px max(18px, calc((100vw - 260px - 960px) / 2)) 18px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  background: white;
  border: 1px solid #dfe4ec;
  border-radius: 14px;
  box-shadow: 0 5px 18px rgba(15,23,42,.06);
}

.composer textarea {
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;
  min-height: 38px;
  max-height: 130px;
  padding: 9px 0;
  color: var(--ink);
  background: transparent;
}

.composer button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  color: white;
  background: var(--blue);
  font-size: 21px;
}

.composer button:disabled { opacity: .5; cursor: default; }

@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .chat-header { padding: 11px 14px; }
  .messages { padding: 18px 12px; }
  .bubble { max-width: 91%; }
  .menu-grid { grid-template-columns: 1fr 1fr; }
  .typing { margin-left: 14px; margin-right: 14px; }
  .composer { margin: 8px 10px 10px; }
}

@media (max-width: 480px) {
  .header-title h1 { font-size: 14px; }
  .menu-grid { grid-template-columns: 1fr; }
  .menu-grid button { width: 100%; }
}


.local-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.local-menu-button {
  border: 1px solid #d6dbe5;
  background: #fff;
  color: #064bd8;
  border-radius: 9px;
  padding: 9px 11px;
  cursor: pointer;
  text-align: left;
}
.local-menu-button:hover { border-color: #9ab8eb; background: #f8fbff; }
.back-home-button {
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 0;
}
@media (max-width: 600px) { .local-menu-grid { grid-template-columns: 1fr; } }


.local-menu-bubble {
  max-width: min(860px, 92%);
}

.local-menu-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #111827;
}

.local-menu-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.local-menu-nav {
  display: flex;
  gap: 14px;
  margin-top: 12px;
}

@media (max-width: 720px) {
  .local-menu-grid {
    grid-template-columns: 1fr;
  }
}

/* v4 - Dify Human Input formlarını otomatik çizen ortak kart motoru */
.human-input-card {
  width: min(720px, 92%);
  max-width: 720px;
  padding: 16px;
}

.human-input-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
  color: #111827;
}

.human-input-content {
  line-height: 1.55;
  margin-bottom: 12px;
}

.human-input-form {
  display: grid;
  gap: 12px;
}

.human-input-field {
  display: grid;
  gap: 6px;
}

.human-input-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.human-input-field small {
  color: #6b7280;
  line-height: 1.4;
}

.human-input-control {
  width: 100%;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  background: #f7f8fa;
  color: #111827;
  padding: 11px 12px;
  outline: none;
}

textarea.human-input-control {
  min-height: 104px;
  resize: vertical;
}

.human-input-control:focus {
  border-color: #8fb6ef;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .08);
}

.human-input-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.human-input-action {
  border: 1px solid #d6dbe5;
  border-radius: 9px;
  background: #fff;
  color: #334155;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 600;
}

.human-input-action.primary {
  color: #fff;
  border-color: #1677ff;
  background: #1677ff;
}

.human-input-action.danger {
  color: #b42318;
  border-color: #f1b8b5;
  background: #fff7f6;
}

.human-input-action:disabled {
  opacity: .55;
  cursor: default;
}

.human-input-form.submitted .human-input-control {
  opacity: .75;
}

.human-input-expiry {
  font-size: 11px;
  color: #7c8798;
}

.human-input-file-note {
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
  padding: 10px;
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
}


/* ==================================================
   HAN ELEKTRONIK ARKA PLAN
   ================================================== */

/* Büyük masaüstü görünümü */
.chat-panel {
    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.76),
            rgba(255, 255, 255, 0.76)
        ),
        url("/static/han-bg-main.png");

    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}


/* Sağdaki dar / mobil / preview görünümü */
@media (max-width: 720px) {

    .chat-panel {
        background-image:
            linear-gradient(
                rgba(255, 255, 255, 0.72),
                rgba(255, 255, 255, 0.72)
            ),
            url("/static/han-bg-preview.png");

        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
    }

}


/* HAN_MOBILE_ACTIVATION_DIRECT_FORM_V3 */

.mobile-activation-bubble {
    width: min(560px, 100%);
}

.mobile-activation-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 7px;
}

.mobile-activation-info {
    margin-bottom: 14px;
}

.mobile-activation-form {
    display: grid;
    gap: 11px;
}

.mobile-activation-field {
    display: grid;
    gap: 5px;
}

.mobile-activation-field span {
    font-size: 13px;
    font-weight: 700;
}

.mobile-activation-field input {
    width: 100%;
    padding: 10px 11px;

    border:
        1px solid #cbd5e1;

    border-radius: 8px;

    font: inherit;
    background: #fff;
}

.mobile-activation-submit {
    margin-top: 3px;

    border: 0;
    border-radius: 8px;

    padding: 11px 15px;

    background: #2563eb;
    color: #fff;

    font-weight: 700;
    cursor: pointer;
}

.mobile-activation-submit:disabled {
    opacity: .6;
}

.mobile-activation-status {
    font-size: 13px;
    line-height: 1.5;
}

.mobile-activation-status.success {
    padding: 12px;

    border-radius: 8px;

    background: #ecfdf5;
    color: #166534;
}

.mobile-activation-status.error {
    padding: 12px;

    border-radius: 8px;

    background: #fef2f2;
    color: #b91c1c;
}



/* HAN_ACTIVATION_TRACK_BUTTON_V1 */

.mobile-activation-track-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-top: 4px;
    padding: 10px 14px;

    border-radius: 8px;

    background: #166534;
    color: #ffffff !important;

    text-decoration: none;
    font-weight: 700;
}

.mobile-activation-track-button:hover {
    opacity: .9;
}


/* =========================================================
   UNIWIZ RESET FORM
   ========================================================= */

.uniview-reset-card {
  max-width: 520px;
}

.uniview-reset-card h3 {
  margin: 0 0 10px;
}

.uniview-reset-card label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  font-weight: 600;
}

.uniview-reset-card input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
}

.uniview-reset-type {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.uniview-reset-type button {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.uniview-reset-type button.active {
  font-weight: 700;
  border-width: 2px;
}

.uniview-submit {
  width: 100%;
  margin-top: 16px;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.uniview-result {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  word-break: break-word;
}

.uniview-result.success {
  border: 1px solid #86efac;
}

.uniview-result.error {
  border: 1px solid #fca5a5;
}

.uniview-result-label {
  font-size: 13px;
  margin-bottom: 6px;
}

.uniview-result-code {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
}

.uniview-result-note {
  margin-top: 7px;
  font-size: 12px;
}

@media (max-width: 600px) {
  .uniview-reset-card {
    max-width: 100%;
  }

  .uniview-reset-type {
    flex-direction: column;
  }

  .uniview-result-code {
    font-size: 21px;
  }
}


.uniview-result-separator {
  height: 1px;
  margin: 14px 0;
  background: #d1d5db;
}

