/* ai.cloudo3.com/tools — fast, friendly, responsive AI token tools. */

:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef2fb;
  --text: #1a2233;
  --muted: #5b6677;
  --border: #dbe2ef;
  --primary: #10a37f;
  --primary-ink: #ffffff;
  --primary-soft: #e2f5ef;
  --accent: #2563eb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(20, 40, 90, 0.08);
  --maxw: 880px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Arabic", "Noto Sans Thai", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
[data-theme="dark"] {
  --bg: #0f1420;
  --surface: #171e2e;
  --surface-2: #1f283b;
  --text: #e8edf7;
  --muted: #9aa7bd;
  --border: #2a3548;
  --primary: #1fb593;
  --primary-ink: #07120e;
  --primary-soft: #103128;
  --accent: #4f8cff;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.55rem, 4vw, 2.3rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); margin: 2rem 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
[dir="rtl"] .tk-brand, [dir="rtl"] .breadcrumb { direction: rtl; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }
.section { padding: 2rem 1rem 3rem; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--primary-ink); padding: .5rem 1rem; border-radius: 0 0 8px 0; z-index: 100; }
.skip-link:focus { left: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.2rem; }
.brand-name { font-size: 1.02rem; }
.main-nav { margin-inline-start: auto; display: flex; gap: 1rem; font-size: .95rem; }
.main-nav a { color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: .5rem; }

/* language switcher — scrollable, since there are many languages */
.lang-switch {
  position: relative;
}
.lang-switch summary {
  list-style: none; cursor: pointer; font-size: .85rem; padding: .35rem .7rem;
  border-radius: 999px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + .4rem);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: .4rem; display: grid; grid-template-columns: 1fr 1fr;
  gap: .1rem; width: 280px; max-height: 60vh; overflow: auto; z-index: 40;
}
.lang-menu a { font-size: .85rem; padding: .35rem .55rem; border-radius: 8px; color: var(--text); white-space: nowrap; }
.lang-menu a:hover { background: var(--surface-2); text-decoration: none; }
.lang-menu a[aria-current="true"] { background: var(--primary); color: var(--primary-ink); }
.theme-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 36px; height: 36px; border-radius: 999px; cursor: pointer; font-size: 1rem; }

/* ---------- breadcrumb / headings ---------- */
.breadcrumb { font-size: .85rem; color: var(--muted); padding: 1rem 0 .25rem; }
.breadcrumb a { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--primary); font-weight: 700; margin: 0 0 .35rem; }
.kb-head { padding-bottom: .5rem; }
.lead { font-size: 1.08rem; color: var(--muted); }
.tool-page { padding-bottom: 3rem; }

/* ---------- tool widget ---------- */
.tool-widget { margin: 1.25rem 0 1.5rem; }
.tk-top { display: flex; flex-wrap: wrap; gap: 1rem; align-items: stretch; margin-bottom: .75rem; }
.tk-primary {
  flex: 1 1 220px; background: var(--primary-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem; display: flex; flex-direction: column; justify-content: center;
}
.tk-num { font-size: clamp(2.2rem, 7vw, 3.2rem); font-weight: 800; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
.tk-num-lbl { font-size: .95rem; color: var(--muted); margin-top: .2rem; }
.tk-badge { display: inline-block; margin-top: .5rem; font-size: .72rem; padding: .12rem .5rem; border-radius: 999px; width: fit-content; }
.tk-badge.is-exact { background: var(--primary); color: var(--primary-ink); }
.tk-badge.is-est { background: var(--surface-2); color: var(--muted); }
.tk-controls { flex: 1 1 220px; display: flex; flex-direction: column; gap: .75rem; justify-content: center; }
.tk-field { display: flex; flex-direction: column; gap: .25rem; }
.tk-field-lbl { font-size: .82rem; color: var(--muted); font-weight: 600; }
.tk-select, .tk-number {
  width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}

/* searchable model picker (combobox) */
.tk-combo { position: relative; }
.tk-combo-input {
  width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
.tk-combo-input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.tk-combo-menu {
  position: absolute; z-index: 30; top: calc(100% + 4px); inset-inline: 0; max-height: 16rem; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: .25rem;
}
.tk-combo-opt { padding: .45rem .55rem; border-radius: var(--radius-sm); cursor: pointer; font-size: .92rem; }
.tk-combo-opt:hover, .tk-combo-opt.is-active { background: var(--primary-soft); }
.tk-combo-opt.is-current { font-weight: 700; }
.tk-combo-empty { padding: .5rem .55rem; color: var(--muted); font-size: .9rem; }
.tk-cost-add { max-width: 22rem; margin: .25rem 0 .5rem; }
.tk-row-rm {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer;
  width: 1.4rem; height: 1.4rem; line-height: 1; border-radius: 999px; font-size: 1rem; padding: 0; margin-inline-end: .4rem;
  vertical-align: middle;
}
.tk-row-rm:hover { color: #d83a52; border-color: #d83a52; }
.tk-mlabel { vertical-align: middle; }
.tk-stats { display: flex; gap: 1.25rem; }
.tk-stat { display: flex; flex-direction: column; }
.tk-stat strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.tk-stat span { font-size: .8rem; color: var(--muted); }

.tk-input {
  width: 100%; min-height: 180px; resize: vertical; font: inherit; line-height: 1.55;
  padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.tk-input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.tk-actions { display: flex; gap: .6rem; margin: .75rem 0; }
.tk-btn {
  font: inherit; font-weight: 600; cursor: pointer; padding: .5rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--primary); background: var(--primary); color: var(--primary-ink);
}
.tk-btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.tk-btn:hover { filter: brightness(1.05); }

.tk-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: .9rem 0; }
@media (max-width: 560px) { .tk-fields { grid-template-columns: 1fr; } }

.tk-table-wrap { overflow-x: auto; }
.tk-table { width: 100%; border-collapse: collapse; margin-top: .5rem; font-size: .95rem; }
.tk-table th, .tk-table td { text-align: start; padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
.tk-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tk-mname { font-weight: 600; }
.tk-brand { font-weight: 400; color: var(--muted); font-size: .82rem; }
.tk-tnum, .tk-cost { font-variant-numeric: tabular-nums; font-weight: 700; }
.tk-ttype { font-size: .8rem; }
.tk-ttype.is-exact { color: var(--primary); font-weight: 600; }
.tk-ttype.is-est { color: var(--muted); }
.tk-note { margin-top: .75rem; }
.tk-sub { margin-bottom: .5rem; }

/* ---------- file token counter ---------- */
.tk-drop {
  border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 2rem 1rem; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.tk-drop:hover, .tk-drop.is-dragover { border-color: var(--primary); background: var(--primary-soft); }
.tk-drop-icon { font-size: 2rem; display: block; margin-bottom: .4rem; }
.tk-drop-main { font-weight: 600; }
.tk-drop-sub { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
.tk-file-info { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; margin: .9rem 0 .3rem; }
.tk-file-name { font-weight: 700; word-break: break-all; }
.tk-file-meta { font-size: .85rem; color: var(--muted); }
.tk-status { font-size: .9rem; color: var(--muted); margin: .5rem 0; }
.tk-status.is-error { color: #d83a52; }
.tk-vision-note { font-size: .85rem; color: var(--muted); margin-top: .5rem; }

.tk-convert { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.tk-conv-cell {
  flex: 1 1 140px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; text-align: center;
}
.tk-conv-cell strong { display: block; font-size: 1.9rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.tk-conv-cell span { font-size: .85rem; color: var(--muted); }
.tk-conv-result { margin-top: .4rem; }
.notice { background: var(--surface-2); padding: .75rem 1rem; border-radius: var(--radius-sm); }

/* ---------- key facts strip ---------- */
.tk-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin: 1.5rem 0 .5rem; padding: 0; }
.tk-fact { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .9rem; }
.tk-fact dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 .15rem; }
.tk-fact dd { margin: 0; font-weight: 700; font-size: 1.02rem; }

/* ---------- content sections ---------- */
.kb-about, .kb-howto, .faq, .related, .kb-section { margin-top: 2rem; }
.howto-list { padding-inline-start: 1.2rem; }
.howto-list li { margin: .4rem 0; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .25rem .9rem; margin: .5rem 0; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 600; padding: .6rem 0; }
.faq-a { padding-bottom: .6rem; }

/* ---------- cards / grid ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.kb-card { display: flex; gap: .7rem; align-items: center; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); }
.kb-card:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-1px); transition: .15s; }
.kb-card-icon { font-size: 1.5rem; }
.kb-card-title { font-weight: 700; display: block; }
.kb-card-cat { font-size: .8rem; color: var(--muted); }

/* ---------- home ---------- */
.hero { padding: 2.5rem 0 1rem; text-align: center; }
.hero .lead { max-width: 620px; margin: 0 auto 1.25rem; }
.home-section { padding: 1.5rem 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; padding: 1.5rem 1rem; }
.footer-brand { max-width: 360px; }
.footer-links { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; align-items: center; }
.footer-links a { color: var(--muted); font-size: .9rem; text-decoration: none; }
.footer-links a:hover { color: var(--primary); text-decoration: underline; }
.footer-meta { text-align: end; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .footer-inner { flex-direction: column; }
  .footer-meta { text-align: start; }
}
