:root {
  color-scheme: light;
  --canvas: #f4f7fa;
  --paper: #ffffff;
  --ink: #192d3e;
  --muted: #536a79;
  --line: #d2dfe6;
  --accent: #116b75;
  --accent-deep: #09515b;
  --accent-light: #e8f6f5;
  --focus: #09515b;
  --gold: #e5ad3e;
  --gold-soft: #fff6e2;
  --gold-ink: #8a5b0b;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
::selection { background: var(--gold); color: var(--ink); }

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
}

button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.page { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 26px;
  border-bottom: 1px solid var(--line);
}
.identity { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 18px; margin-left: 18px; }
.site-nav a { color: var(--accent-deep); font-size: 13px; font-weight: 650; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.identity-mark {
  display: block;
  flex: none;
  width: 44px;
  height: 44px;
}
.identity-text { display: grid; gap: 2px; }
.identity-text strong { font-size: 16px; letter-spacing: -0.02em; }
.identity-text small, .header-note { color: var(--muted); font-size: 12px; }

.intro { max-width: 760px; padding: 44px 0 30px; }
.intro h1 {
  margin: 0 0 16px;
  font-size: clamp(42px, 5.7vw, 72px);
  font-weight: 720;
  line-height: 1.03;
  letter-spacing: -0.055em;
}
.intro p { max-width: 650px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.65; }

.workbench { display: block; }
.editor { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 16px; background: var(--paper); box-shadow: 0 10px 28px rgba(24, 53, 68, 0.05); }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.editor-heading { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.live-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-ink); box-shadow: 0 0 0 4px var(--gold-soft); }
.toolbar-actions { display: flex; align-items: center; gap: 7px; }
.toolbar-actions button { min-height: 34px; padding: 7px 10px; border-radius: 7px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.consonant-setting { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.consonant-setting select { min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; }
.mode-button { border: 1px solid var(--gold); background: var(--gold-soft); color: var(--ink); }
.mode-button[aria-pressed="false"] { border-color: var(--line); background: #f4f6f7; color: var(--muted); }
.quiet-button { border: 1px solid transparent; background: transparent; color: var(--muted); }
.quiet-button:hover { border-color: var(--line); color: var(--ink); }

#typing-field {
  display: block;
  width: 100%;
  min-height: 275px;
  padding: 27px 28px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: "Noto Sans Devanagari", "Kohinoor Devanagari", "Mangal", ui-sans-serif, sans-serif;
  font-size: 26px;
  line-height: 1.7;
  letter-spacing: 0;
  caret-color: var(--gold-ink);
}
#typing-field::placeholder { color: #91a3ac; opacity: 1; }
#typing-field:focus-visible { outline: 3px solid var(--gold); outline-offset: -5px; }

.candidate-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-top: 1px solid #d3e7e7;
  background: var(--accent-light);
}
.candidate-panel[hidden] { display: none; }
.candidate-copy { font-size: 13px; font-weight: 650; color: var(--accent-deep); white-space: nowrap; }
.candidate-copy span { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.candidate-select {
  min-width: 140px;
  min-height: 38px;
  padding: 5px 30px 5px 11px;
  border: 1px solid #b8d8d9;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font-family: "Noto Sans Devanagari", "Kohinoor Devanagari", sans-serif;
  font-size: 17px;
  cursor: pointer;
}
.candidate-select:hover { border-color: var(--accent); }
.candidate-select:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.editor-footer { display: flex; justify-content: space-between; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.character-count { white-space: nowrap; }

.integration { margin: 48px 0 0; padding: 27px; border: 1px solid #c8dfe1; border-radius: 16px; background: #eaf4f4; }
.integration-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 430px); align-items: end; gap: 22px; }
.integration h2 { margin: 7px 0 0; font-size: clamp(27px, 3vw, 36px); line-height: 1.18; letter-spacing: -0.04em; }
.integration-heading p { margin: 0 0 2px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.integration-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.integration-fields, .integration-code { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.integration-fields { display: grid; gap: 15px; }
.sample-field { display: grid; gap: 7px; min-width: 0; }
.sample-field span, .code-label { color: var(--ink); font-size: 12px; font-weight: 700; }
.sample-field input { width: 100%; min-height: 43px; padding: 9px 12px; border: 1px solid #bdcfd7; border-radius: 7px; background: #fcfefe; color: var(--ink); font-family: "Noto Sans Devanagari", "Kohinoor Devanagari", "Mangal", ui-sans-serif, sans-serif; font-size: 17px; }
.sample-field input[type="email"] { font-family: inherit; }
.sample-field input::placeholder { color: #8298a3; opacity: 1; }
.sample-field input:focus-visible { border-color: var(--gold); outline: 3px solid var(--gold); outline-offset: 2px; }
.integration-code { display: flex; flex-direction: column; }
.integration-code pre { overflow: auto; margin: 13px 0 14px; padding: 14px; border-radius: 7px; background: #192d3e; color: #eff8f8; font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 2; }
.integration-code p { margin: auto 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.guide { margin: 54px 0 0; }
.guide-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); align-items: end; gap: 30px; margin-bottom: 22px; }
.section-label, .guide-number { color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; }
.guide h2 { margin: 7px 0 0; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.15; letter-spacing: -0.045em; }
.guide-heading p { margin: 0 0 2px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.guide-card { min-width: 0; padding: 24px 26px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.guide-card h3 { margin: 10px 0 9px; font-size: 20px; line-height: 1.3; letter-spacing: -0.03em; }
.guide-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.guide-card p + p { margin-top: 12px; }
.guide-card p strong { color: var(--ink); }
kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: white; color: var(--ink); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.key-examples { display: grid; gap: 0; margin: 15px 0; padding: 5px 13px; border-left: 3px solid var(--gold); background: var(--gold-soft); }
.key-examples > div { display: grid; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 37px; padding: 4px 0; }
.key-examples > div + div { border-top: 1px solid #dbe9ed; }
.key-examples kbd { width: fit-content; }
.key-examples > div > span { color: var(--accent); font-size: 18px; text-align: center; }
.key-examples strong { font: 650 19px "Noto Sans Devanagari", "Kohinoor Devanagari", sans-serif; }
.guide-card code { font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.mixed-text-example { display: grid; gap: 8px; margin: 15px 0; padding: 12px 13px; border-left: 3px solid var(--gold); background: var(--gold-soft); overflow-wrap: anywhere; }
.mixed-text-example > span { color: var(--accent); }
.mixed-text-example strong { font: 650 17px/1.7 "Noto Sans Devanagari", "Kohinoor Devanagari", sans-serif; }
.sound-table { width: 100%; margin-top: 13px; border-collapse: collapse; font-size: 13px; }
.sound-table th { padding: 7px 6px 7px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 650; text-align: left; }
.sound-table td { padding: 7px 6px 7px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sound-table td span { margin-left: 7px; font: 600 19px "Noto Sans Devanagari", "Kohinoor Devanagari", sans-serif; vertical-align: middle; }

.developer-note { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin: 56px 0 70px; padding-top: 25px; border-top: 1px solid var(--line); }
.developer-note h2 { margin: 0 0 5px; font-size: 16px; }
.developer-note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.developer-link { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 11px 15px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent-light); color: var(--accent-deep); font-size: 13px; font-weight: 650; text-decoration: none; }
.developer-link:hover { background: #d8eeec; }

@media (max-width: 850px) {
  .guide-heading, .integration-heading { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 600px) {
  .page { width: min(100% - 28px, 480px); }
  .site-header { padding: 17px 0; flex-wrap: wrap; gap: 14px; }
  .site-nav { margin-left: 0; gap: 16px; }
  .header-note { display: none; }
  .intro { padding: 40px 0 26px; }
  .intro p { font-size: 16px; }
  .editor-toolbar { align-items: flex-start; flex-wrap: wrap; padding: 13px; }
  .toolbar-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .toolbar-actions button { flex: 1 1 auto; }
  #typing-field { min-height: 300px; padding: 20px 17px; font-size: 23px; }
  .editor-footer { flex-wrap: wrap; padding: 12px 13px; }
  .candidate-panel { flex-wrap: wrap; padding: 12px 13px; }
  .candidate-select { width: 100%; }
  .integration { margin-top: 36px; padding: 17px; }
  .integration-layout { grid-template-columns: 1fr; }
  .integration-fields, .integration-code { padding: 16px; }
  .guide { margin-top: 42px; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-card { padding: 20px 19px; }
  .developer-note { display: block; margin-top: 44px; }
  .developer-link { margin-top: 17px; }
}
