:root {
  color-scheme: light;
  --bg: #f5f7fc;
  --panel: #ffffff;
  --ink: #0d2035;
  --muted: #4f5362;
  --line: #dfe7f2;
  --user: #174a63;
  --bot: #f6f8fa;
  --blue: #123fa8;
  --green: #05734f;
  --accent: #0f8f8c;
  --accent-dark: #0a6565;
  --warn: #9a5a00;
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(21, 35, 45, 0.16);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 1720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 58px 80px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.chat-panel {
  width: 100%;
  display: grid;
  grid-template-rows: auto auto;
}

.topbar {
  padding: 0 0 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  margin: 0;
  font-size: clamp(58px, 6.4vw, 92px);
  line-height: 0.9;
  letter-spacing: 0;
  font-weight: 900;
}

.topbar-subtitle {
  display: none;
  margin: 14px 0 0;
  color: #676d7d;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
}

.ghost-button,
.composer button,
.send-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.ghost-button {
  display: none;
  padding: 0 14px;
}

.mode-picker {
  width: min(100%, 1570px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 46px;
  padding: 0 4px;
}

.mode-picker.is-hidden {
  display: none;
}

.mode-card {
  position: relative;
  min-height: 502px;
  padding: 60px;
  overflow: hidden;
  text-align: left;
  background: #ffffff;
  border: 1px solid rgba(223, 231, 242, 0.74);
  border-radius: 58px;
  box-shadow: 0 34px 82px rgba(18, 40, 75, 0.06);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.mode-card:hover {
  border-color: rgba(18, 63, 168, 0.18);
  transform: translateY(-3px);
  box-shadow: 0 42px 92px rgba(18, 40, 75, 0.1);
}

.mode-card:nth-child(2) {
  background: #eef4ff;
}

.mode-icon {
  width: 90px;
  height: 90px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 29px;
  color: #ffffff;
  box-shadow: 0 22px 45px rgba(18, 40, 75, 0.08);
}

.mode-icon svg {
  width: 42px;
  height: 42px;
}

.mode-icon-petition {
  background: var(--blue);
}

.mode-icon-info {
  background: var(--green);
}

.mode-watermark {
  position: absolute;
  pointer-events: none;
  color: #d7dce5;
}

.mode-watermark-document {
  top: 56px;
  right: 68px;
  width: 128px;
  height: 128px;
}

.mode-watermark-document svg {
  display: block;
  width: 100%;
  height: 100%;
}

.mode-watermark-question {
  top: 44px;
  right: 90px;
  font-size: 198px;
  line-height: 0.9;
  font-weight: 600;
}

.mode-title {
  display: block;
  margin: 50px 0 18px;
  color: var(--ink);
  font-size: clamp(32px, 2.2vw, 40px);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0;
}

.mode-card small {
  display: block;
  max-width: 600px;
  color: var(--muted);
  font-size: clamp(22px, 1.55vw, 29px);
  line-height: 1.5;
  font-weight: 500;
}

.mode-action {
  position: absolute;
  left: 60px;
  bottom: 66px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: #0b2d85;
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.mode-card:nth-child(2) .mode-action {
  color: var(--green);
}

.petition-method {
  display: none;
}

.petition-method-kicker {
  margin: 0 0 14px;
  color: #5f74b5;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.petition-method h2 {
  max-width: 650px;
  margin: 0;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
}

.petition-method-copy {
  max-width: 580px;
  margin: 20px 0 52px;
  color: #3e4454;
  font-size: 20px;
  line-height: 1.45;
  font-weight: 500;
}

.petition-method-options {
  display: grid;
  gap: 26px;
}

.petition-method-option {
  width: 100%;
  min-height: 137px;
  padding: 26px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  text-align: left;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid rgba(223, 231, 242, 0.58);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(18, 40, 75, 0.03);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.petition-method-option:hover {
  border-color: rgba(18, 63, 168, 0.18);
  box-shadow: 0 22px 54px rgba(18, 40, 75, 0.08);
  transform: translateY(-1px);
}

.petition-method-option-featured {
  color: #ffffff;
  background: linear-gradient(90deg, #15398c, #214fb5);
  border-color: transparent;
}

.petition-option-icon {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.petition-option-icon svg {
  width: 34px;
  height: 34px;
}

.petition-option-icon-standard {
  color: #123fa8;
  background: #dce7ff;
}

.petition-option-icon-ai {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.petition-option-body {
  min-width: 0;
}

.petition-option-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 23px;
  line-height: 1.18;
  font-weight: 900;
}

.petition-option-copy {
  display: block;
  max-width: 430px;
  margin-top: 8px;
  color: #394050;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 500;
}

.petition-method-option-featured .petition-option-copy {
  color: rgba(255, 255, 255, 0.92);
}

.petition-option-badge {
  padding: 4px 9px;
  color: #126243;
  background: #77e7b5;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.petition-option-arrow {
  color: #b5bdcc;
  font-size: 42px;
  line-height: 1;
  font-weight: 300;
}

.petition-method-option-featured .petition-option-arrow {
  color: rgba(255, 255, 255, 0.56);
}

.messages {
  display: none;
  overflow-y: auto;
  padding: 22px;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(238, 242, 245, 0.8), rgba(255, 255, 255, 0) 130px),
    #fff;
}

.message {
  width: fit-content;
  max-width: min(74ch, 84%);
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.bot {
  align-self: flex-start;
  background: var(--bot);
  border: 1px solid var(--line);
}

.message.user {
  align-self: flex-end;
  background: var(--user);
  color: #fff;
}

.message.error {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.24);
  background: #fff4f2;
}

.message.system {
  align-self: center;
  max-width: 92%;
  color: var(--warn);
  background: #fff9eb;
  border: 1px solid #f2d99a;
}

.message pre {
  margin: 0;
  font: inherit;
  white-space: pre-wrap;
}

.choice-row,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.choice-row button,
.result-actions button,
.result-actions a {
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.choice-row button:hover,
.result-actions button:hover,
.result-actions a:hover,
.ghost-button:hover {
  border-color: var(--accent);
}

.quick-prompts {
  display: none;
}

.composer {
  display: none;
  padding: 14px;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.api-key-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.api-key-row[hidden] {
  display: none;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

textarea {
  min-height: 48px;
  max-height: 160px;
  padding: 13px 14px;
  resize: none;
}

input {
  min-height: 42px;
  padding: 0 12px;
}

textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 143, 140, 0.14);
}

textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.send-button {
  padding: 0 18px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

body.is-chatting .app-shell {
  width: min(100%, 960px);
  padding: 56px 32px;
  display: grid;
  place-items: center;
}

body.is-petition-method .app-shell {
  width: min(100%, 660px);
  padding: 58px 24px;
  display: block;
}

body.is-petition-method .chat-panel {
  display: block;
}

body.is-petition-method .topbar {
  display: none;
}

body.is-petition-method .petition-method {
  display: block;
}

.chat-panel.is-chatting {
  width: min(100%, 890px);
  height: min(980px, calc(100vh - 112px));
  min-height: 660px;
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
  background: #f0f5ff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.chat-panel.is-chatting .topbar {
  min-height: 0;
  padding: 86px 46px 32px;
  align-items: flex-start;
  border-bottom: 0;
}

.chat-panel.is-chatting h1 {
  font-size: clamp(42px, 4.4vw, 58px);
  line-height: 0.98;
}

.chat-panel.is-chatting .topbar-subtitle {
  display: block;
}

.chat-panel.is-chatting .ghost-button {
  display: inline-block;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  color: #17306b;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 32, 64, 0.08);
}

.chat-panel.is-chatting .mode-picker {
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.chat-panel.is-chatting .mode-card {
  min-height: 92px;
  padding: 16px;
  border-radius: 8px;
  box-shadow: none;
}

.chat-panel.is-chatting .messages {
  display: flex;
  padding: 0 46px 22px;
  gap: 28px;
  background: transparent;
}

.chat-panel.is-chatting .message {
  max-width: min(650px, 88%);
  padding: 36px 42px;
  border-radius: 0 30px 30px;
  font-size: 30px;
  line-height: 1.5;
  letter-spacing: 0;
  box-shadow: 0 18px 48px rgba(20, 37, 72, 0.06);
}

.chat-panel.is-chatting .message.bot {
  background: #ffffff;
  border: 0;
}

.chat-panel.is-chatting .message.bot + .message.bot::before {
  content: "ASİSTAN • ŞİMDİ";
  display: block;
  margin: -8px 0 24px -34px;
  color: #757b8b;
  font-size: 21px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 2px;
}

.chat-panel.is-chatting .message.user {
  border-radius: 30px 0 30px 30px;
  background: #0d2f8b;
  box-shadow: 0 18px 48px rgba(13, 47, 139, 0.18);
}

.chat-panel.is-chatting .choice-row,
.chat-panel.is-chatting .result-actions {
  gap: 12px;
  margin-top: 22px;
}

.chat-panel.is-chatting .choice-row button,
.chat-panel.is-chatting .result-actions button,
.chat-panel.is-chatting .result-actions a {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  color: #0d2f8b;
  background: #dfeaff;
  font-size: 16px;
  box-shadow: none;
}

body.is-info-chat .quick-prompts {
  padding: 0 46px 20px;
  display: flex;
  gap: 16px;
}

.quick-prompts button {
  min-height: 50px;
  padding: 0 30px;
  border: 0;
  border-radius: 20px 20px 0 0;
  color: #082d87;
  background: #dce9ff;
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.chat-panel.is-chatting .composer {
  display: grid;
  margin: 0 32px 34px;
  padding: 16px 16px 16px 44px;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 14px;
  border: 0;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(20, 37, 72, 0.08);
}

.chat-panel.is-chatting textarea {
  min-height: 72px;
  padding: 19px 0;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: 27px;
  line-height: 1.25;
}

.chat-panel.is-chatting textarea::placeholder {
  color: #b2b6c1;
}

.chat-panel.is-chatting textarea:focus {
  box-shadow: none;
}

.chat-panel.is-chatting .send-button {
  width: 88px;
  min-height: 88px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 22px;
  color: #ffffff;
  background: #082d87;
  font-size: 54px;
  line-height: 1;
  font-weight: 400;
}

.chat-panel.is-chatting .send-button span {
  transform: translateY(-4px);
}

body.is-embed {
  min-height: 100vh;
  background: transparent;
}

body.is-embed .app-shell {
  width: 100%;
  min-height: 100vh;
  padding: 0;
  display: block;
}

body.is-embed .chat-panel.is-chatting {
  width: 100%;
  height: 100vh;
  min-height: 520px;
  background: #f0f5ff;
}

body.is-embed .chat-panel.is-chatting .topbar {
  padding: 20px 22px 14px;
  align-items: center;
}

body.is-embed .chat-panel.is-chatting h1 {
  font-size: 30px;
  line-height: 1.05;
}

body.is-embed .chat-panel.is-chatting .topbar-subtitle {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
}

body.is-embed .chat-panel.is-chatting .ghost-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 13px;
}

body.is-embed .chat-panel.is-chatting .messages {
  padding: 0 20px 16px;
  gap: 14px;
}

body.is-embed .chat-panel.is-chatting .message {
  max-width: 90%;
  padding: 14px 16px;
  border-radius: 0 16px 16px;
  font-size: 15px;
  line-height: 1.45;
}

body.is-embed .chat-panel.is-chatting .message.user {
  border-radius: 16px 0 16px 16px;
}

body.is-embed .chat-panel.is-chatting .message.bot + .message.bot::before {
  margin: 0 0 10px -8px;
  font-size: 11px;
  letter-spacing: 1px;
}

body.is-embed.is-info-chat .quick-prompts {
  padding: 0 18px 10px;
  gap: 8px;
  overflow-x: auto;
}

body.is-embed.is-info-only [data-quick-action="petition"] {
  display: none;
}

body.is-embed .quick-prompts button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px 12px 0 0;
  font-size: 13px;
}

body.is-embed .chat-panel.is-chatting .composer {
  margin: 0 14px 14px;
  padding: 10px 10px 10px 14px;
  grid-template-columns: 1fr auto;
  border-radius: 14px;
}

body.is-embed .chat-panel.is-chatting textarea {
  min-height: 44px;
  padding: 11px 0;
  font-size: 15px;
}

body.is-embed .chat-panel.is-chatting .send-button {
  width: 46px;
  min-height: 46px;
  border-radius: 12px;
  font-size: 28px;
}

@media (max-width: 720px) {
  .app-shell {
    padding: 22px 18px 34px;
  }

  body.is-petition-method .app-shell {
    padding: 44px 18px;
  }

  body.is-chatting .app-shell {
    padding: 0;
  }

  h1 {
    font-size: clamp(46px, 15vw, 68px);
  }

  .topbar {
    padding-bottom: 48px;
  }

  .mode-picker {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 0;
  }

  .mode-card {
    min-height: 360px;
    padding: 34px;
    border-radius: 34px;
  }

  .mode-icon {
    width: 72px;
    height: 72px;
    border-radius: 22px;
  }

  .mode-icon svg {
    width: 34px;
    height: 34px;
  }

  .mode-watermark-document {
    top: 34px;
    right: 34px;
    width: 92px;
    height: 92px;
  }

  .mode-watermark-question {
    top: 26px;
    right: 48px;
    font-size: 142px;
  }

  .mode-title {
    margin-top: 38px;
    font-size: 30px;
  }

  .mode-card small {
    font-size: 19px;
  }

  .mode-action {
    left: 34px;
    bottom: 38px;
    font-size: 17px;
    gap: 12px;
    letter-spacing: 3px;
  }

  .petition-method h2 {
    font-size: 30px;
  }

  .petition-method-copy {
    margin-bottom: 36px;
    font-size: 18px;
  }

  .petition-method-option {
    min-height: 132px;
    padding: 20px;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
  }

  .petition-option-icon {
    width: 54px;
    height: 54px;
  }

  .petition-option-title {
    flex-wrap: wrap;
    font-size: 21px;
  }

  .petition-option-copy {
    font-size: 15px;
  }

  .chat-panel.is-chatting {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
  }

  .chat-panel {
    width: 100%;
    border: 0;
    border-radius: 0;
  }

  .chat-panel.is-chatting .topbar {
    padding: 34px 22px 22px;
  }

  .chat-panel.is-chatting h1 {
    font-size: 38px;
  }

  .chat-panel.is-chatting .topbar-subtitle {
    margin-top: 10px;
    font-size: 20px;
  }

  .chat-panel.is-chatting .ghost-button {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 13px;
  }

  .chat-panel.is-chatting .mode-picker {
    grid-template-columns: 1fr;
    padding: 14px 15px;
  }

  .messages {
    padding: 15px;
  }

  .chat-panel.is-chatting .messages {
    padding: 0 20px 18px;
    gap: 20px;
  }

  .chat-panel.is-chatting .message {
    max-width: 92%;
    padding: 24px 26px;
    border-radius: 0 24px 24px;
    font-size: 21px;
  }

  .chat-panel.is-chatting .message.bot + .message.bot::before {
    margin: -4px 0 18px -20px;
    font-size: 15px;
  }

  body.is-info-chat .quick-prompts {
    padding: 0 18px 14px;
    gap: 10px;
    overflow-x: auto;
  }

  .quick-prompts button {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 16px 16px 0 0;
    font-size: 17px;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .chat-panel.is-chatting .composer {
    margin: 0 16px 20px;
    padding: 12px 12px 12px 22px;
    grid-template-columns: 1fr auto;
    border-radius: 18px;
  }

  .chat-panel.is-chatting textarea {
    min-height: 58px;
    padding: 14px 0;
    font-size: 19px;
  }

  .chat-panel.is-chatting .send-button {
    width: 64px;
    min-height: 64px;
    border-radius: 18px;
    font-size: 40px;
  }
}
