@font-face {
  font-family: "Arif Noor Muzhary";
  src: url("arif_noor_muzhary.ttf?v=3") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #203c35;
  background: #f5f7f3;
  --green: #17634f;
  --muted: #60736b;
  --line: #dce5dd;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 90% 0%, #dfeee3 0, transparent 42%),
    radial-gradient(ellipse at 0% 35%, #f5efdf 0, transparent 40%);
}
button, textarea, input { font: inherit; }
button, summary, label { -webkit-tap-highlight-color: transparent; }
::selection { background: #c6e8d5; color: #123f31; }
.shell {
  width: 100%;
  max-width: 1040px;
  margin: auto;
  padding: clamp(24px, 5vw, 64px) clamp(12px, 4vw, 40px) 32px;
  overflow-wrap: anywhere;
}
header { padding: 0 0 8px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--green);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #318166;
  box-shadow: 0 0 0 5px #e1ece1;
}
h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(1.65rem, 5.5vw, 3.5rem);
  font-weight: 650;
  line-height: 1.14;
  letter-spacing: -.045em;
}
h1 span { color: var(--green); }
.sub { max-width: 610px; color: var(--muted); line-height: 1.75; font-size: .98rem; margin: 20px 0; }
.header-notes { display: flex; flex-wrap: wrap; gap: 8px; }
.header-notes span {
  border: 1px solid #d6e2d7;
  border-radius: 100px;
  padding: 6px 11px;
  font-size: .72rem;
  font-weight: 600;
  background: #ffffff80;
  color: #466454;
}
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 30px; counter-reset: panel; }
.panel {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 4px 6px #203b2d03, 0 14px 40px #203b2d06;
  overflow: hidden;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid #eaf0e9;
}
.panel-head > div:first-child { min-width: 0; flex: 1 1 180px; }
.grid > .panel { counter-increment: panel; }
.grid > .panel .label::before {
  content: "0" counter(panel);
  display: inline-block;
  margin-right: 10px;
  font-size: .7rem;
  font-weight: 600;
  color: #6d8477;
  letter-spacing: .06em;
}
.label { display: block; font-weight: 700; font-size: .94rem; }
.panel small { display: block; color: var(--muted); margin-top: 5px; font-size: .76rem; line-height: 1.5; }
.output-panel { border-color: #b9d5c6; }
.output-panel .panel-head { background: #eff7f1; }
.font-preview-panel .panel-head { background: #faf8f1; }
.input-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.primary, .ghost {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 16px;
  font-size: .85rem;
  font-weight: 650;
  line-height: 1.4;
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease;
  touch-action: manipulation;
}
.primary { background: var(--green); color: white; box-shadow: 0 3px 6px #174c3114; }
.ghost { background: #f4f7f2; border-color: #dce5dd; color: #375b4c; }
@media (hover: hover) {
  .primary:hover { background: #114c3c; box-shadow: 0 4px 12px #174c3126; }
  .ghost:hover { background: #e7efe5; }
  summary:hover { color: var(--green); }
}
button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid #5a9879;
  outline-offset: 3px;
}
.panel:focus-within { border-color: #6e9b80; }
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  height: 140px;
  min-height: 140px;
  border: 0;
  resize: vertical;
  overflow-y: auto;
  padding: 20px 24px;
  font-size: 1.4rem;
  line-height: 1.9;
  background: transparent;
  color: #172f25;
  direction: rtl;
  text-align: right;
  overflow-wrap: anywhere;
}
textarea:focus { outline: 2px solid #6e9b80; outline-offset: -3px; background: #fcfefb; }
#unicode { font-family: "Noto Sans Hanifi Rohingya", sans-serif; font-size: 1.7rem; unicode-bidi: plaintext; }
#legacyPreview { font-family: "Arif Noor Muzhary", sans-serif; font-size: 1.7rem; unicode-bidi: plaintext; font-feature-settings: "liga" 1, "mset" 1; }
textarea::placeholder { font-family: ui-sans-serif, system-ui, sans-serif; font-size: .92rem; color: #728278; opacity: 1; }
.meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 8px 22px 16px; color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
#unknownCount { color: #8a590d; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0 28px; }
.toggle { display: flex; align-items: center; gap: 9px; min-height: 44px; margin-left: auto; font-size: .8rem; color: var(--muted); cursor: pointer; }
.toggle input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--green); }
.hidden { display: none !important; }
.diagnostics { margin: 16px 0; }
.unknown-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px; }
.unknown-item, .chip { max-width: 100%; padding: 8px 10px; background: #fff5de; border: 1px solid #ecdbb5; border-radius: 8px; color: #745011; font-family: ui-monospace, monospace; }
.mapping-details { padding: 4px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mapping-details summary { padding: 16px 4px; cursor: pointer; font-size: .85rem; font-weight: 600; color: #4a6555; }
.mapping-table { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 8px; padding-bottom: 16px; }
.mapping-row { display: grid; grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr) minmax(0, 1.6fr); align-items: center; gap: 6px; min-height: 48px; padding: 8px; background: #ffffffb3; border: 1px solid #e1e8dc; border-radius: 9px; }
.legacy-map { text-align: center; font-size: 1.25rem; direction: rtl; }
.arrow { text-align: center; color: var(--muted); }
.hanifi-map, .hanifi { font-family: "Noto Sans Hanifi Rohingya", sans-serif; font-size: 1.4rem; text-align: center; direction: rtl; }
.code-map { color: var(--muted); font: .65rem ui-monospace, monospace; }
footer { margin-top: 28px; color: var(--muted); font-size: .73rem; line-height: 1.8; text-align: center; }
footer p { margin: 0 0 8px; font-size: .84rem; }
footer strong { color: var(--green); }
.social-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0 16px; }
.social-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: #ffffff80; color: var(--green); font-size: .8rem; font-weight: 650; text-decoration: none; }
.social-links a:hover { background: #e7efe5; text-decoration: underline; }
.social-links a:focus-visible { outline: 3px solid #5a9879; outline-offset: 3px; }
.social-icon { width: 24px; height: 24px; flex-shrink: 0; }
.social-facebook .social-icon { color: #1877f2; }
.social-youtube .social-icon { color: #f00; }
.social-links a { min-height: 48px; gap: 10px; cursor: pointer; touch-action: manipulation; }
.social-links a:active { background: #d6e8da; box-shadow: inset 0 2px 4px #173f311a; }
@media (max-width: 600px) {
  .shell { padding-top: 28px; }
  .eyebrow { margin-bottom: 16px; font-size: .65rem; }
  .grid { margin-top: 24px; gap: 16px; }
  .panel { border-radius: 15px; }
  .panel-head { padding: 15px; }
  .panel-head > div:first-child { flex-basis: 100%; }
  .input-buttons { width: 100%; }
  .input-buttons button { flex: 1; }
  #copyBtn { width: 100%; }
  textarea { min-height: 120px; padding: 16px; font-size: 1.2rem; }
  #unicode, #legacyPreview { font-size: 1.5rem; }
  .meta { padding: 8px 15px 14px; }
  .toggle { width: 100%; margin-left: 0; }
}
@media (max-width: 280px) {
  .shell { padding: 18px 8px; }
  h1 { font-size: 1.5rem; }
  .sub { font-size: .85rem; }
  .header-notes { gap: 5px; }
  .header-notes span { border-radius: 8px; }
  .panel-head { padding: 12px; }
  .label { font-size: .85rem; }
  .input-buttons { flex-direction: column; }
  .actions > button { width: 100%; }
  textarea { padding: 12px; min-height: 110px; }
  .mapping-row { grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); }
  .code-map { grid-column: 1 / -1; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
