/* powarca.com — base styles. Mobile first, no framework, no web fonts. */

:root {
  --ink: #12181f;
  --ink-soft: #5a6773;
  --line: #e3e8ee;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --accent: #1c6ef2;
  --accent-dark: #1557c4;
  --ok: #12805c;
  --warn: #b4341f;
  --radius: 10px;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.pw-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------------- header */

.pw-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.pw-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 60px;
}

.pw-logo {
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.pw-logo span { color: var(--accent); }

.pw-nav {
  margin-left: auto;
  display: flex;
  gap: 18px;
  font-size: 14px;
  flex-wrap: wrap;
}
.pw-nav a { color: var(--ink-soft); }

/* ------------------------------------------------------- language switch */

.pw-lang { display: flex; align-items: center; gap: 6px; }

.pw-lang__label {
  font-size: 12px;
  color: var(--ink-soft);
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.pw-lang select {
  font: inherit;
  font-size: 14px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  max-width: 165px;
}

.pw-footer__langs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.pw-footer__langs a { color: var(--ink-soft); }
.pw-footer__langs a:hover { color: var(--accent); }

/* ------------------------------------------------------------------- rtl */

[dir="rtl"] .pw-nav { margin-left: 0; margin-right: auto; }
[dir="rtl"] .pw-item__name { text-align: right; }
[dir="rtl"] .pw-cards a { text-align: right; }

/* ------------------------------------------------------------------ hero */

.pw-hero { padding: 44px 0 8px; }

.pw-hero h1 {
  font-size: clamp(26px, 4.4vw, 38px);
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.pw-hero p {
  margin: 0 0 8px;
  color: var(--ink-soft);
  max-width: 62ch;
}

.pw-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.pw-badges li {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------- app */

.pw-app {
  margin: 28px 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.pw-app__body { padding: 18px; }

/* ------------------------------------------------------------- pdf tools */

.pw-pdf {
  margin: 28px 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.pw-pdf .pw-field,
.pw-audio .pw-field { margin-top: 16px; }
.pw-pdf .pw-field input[type="text"] {
  font: inherit;
  font-size: 15px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 220px;
}

.pw-result { margin-top: 18px; }
.pw-result__ok {
  color: var(--ok);
  font-weight: 600;
  margin: 0 0 10px;
  font-size: 15px;
}
.pw-result__err {
  color: var(--warn);
  margin: 0;
  font-size: 14px;
}

.pw-drop {
  border: 2px dashed #c4ced9;
  border-radius: var(--radius);
  padding: 34px 18px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-soft);
  transition: border-color .12s, background .12s;
}

.pw-drop:hover,
.pw-drop:focus-visible,
.pw-drop.is-over {
  border-color: var(--accent);
  background: #eef4ff;
  outline: none;
}

.pw-drop__title { font-weight: 600; font-size: 17px; }
.pw-drop__hint  { color: var(--ink-soft); font-size: 14px; margin-top: 6px; }

.pw-options {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  /* Labels on one line, controls under them: bottom alignment made the shorter
     slider sit 20px below the two inputs. */
  align-items: flex-start;
  margin-top: 18px;
}

.pw-field { display: flex; flex-direction: column; gap: 6px; }
.pw-field label { font-size: 13px; color: var(--ink-soft); }

.pw-field select,
.pw-field input[type="number"] {
  font: inherit;
  font-size: 15px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  min-width: 120px;
}

.pw-field input[type="range"] { width: 160px; }

/* The three image options share one row. The number input would otherwise keep
   the platform default width (~177px) and push the row onto a second line. */
.pw-options { gap: 16px; }
.pw-options .pw-field input[type="number"] { width: 92px; min-width: 92px; }
.pw-options .pw-field input[type="range"] { width: 104px; }

.pw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.pw-btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.pw-btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.pw-btn:disabled { opacity: .55; cursor: default; }

.pw-btn--ghost {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--line);
  font-weight: 500;
}
.pw-btn--ghost:hover { background: var(--bg-soft); border-color: #c4ced9; }

/* ------------------------------------------------------------ file list */

.pw-list { list-style: none; margin: 18px 0 0; padding: 0; }

.pw-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.pw-item__name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.pw-item__meta { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.pw-item--done  .pw-item__meta { color: var(--ok); }
.pw-item--error .pw-item__meta { color: var(--warn); white-space: normal; }
.pw-item--error { border-color: #f0c8c0; background: #fff7f5; }

.pw-item__dl,
.pw-item__rm {
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 6px;
  cursor: pointer;
  padding: 5px 12px;
  color: var(--ink);
}
.pw-item__dl:hover { border-color: var(--accent); color: var(--accent); }
.pw-item__rm { padding: 5px 9px; color: var(--ink-soft); }
.pw-item__rm:hover { color: var(--warn); border-color: #f0c8c0; }

/* --------------------------------------------------------------- content */

.pw-section { padding: 40px 0 0; }

/* The four tools sit two to a row so a visitor can see all of them without
   scrolling. Each cell is a normal .pw-section, so the vertical rhythm is
   unchanged when the grid collapses to one column. */
.pw-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 26px;
  align-items: start;
}

@media (max-width: 900px) {
  .pw-tools { grid-template-columns: 1fr; }
}

/* The four tools carry different amounts of hint text, so without this the
   shorter ones (PDF) pull their tabs and buttons up out of line with the
   column beside them. */
.pw-tools .pw-drop {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pw-section h2 {
  font-size: 22px;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.pw-section h3 { font-size: 17px; margin: 22px 0 8px; }
.pw-section p, .pw-section li { color: #2c3742; }

/* Homepage conversion columns: one column per source format. */
.pw-cols {
  display: grid;
  /* 180px is the widest min that still fits five columns inside --wrap, so the
     ten source formats land as two even rows of five instead of 6 + 4. */
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px 22px;
  margin-top: 20px;
}

.pw-col h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.pw-col__list { list-style: none; margin: 0; padding: 0; }
.pw-col__list li { margin: 0 0 3px; }
.pw-col__list a { font-size: 14px; }

/* Sits under the converter when a target changes how the batch behaves. */
.pw-note {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* Operation picker inside the PDF widget: every choice stays visible, which a
   dropdown hides behind a click. */
.pw-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  /* The tabs sit under the drop zone, so spacing goes on top. Keeping every
     tool's drop zone first is what lets the four columns line up. */
  margin: 14px 0 0;
}

.pw-tab {
  font: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}

.pw-tab:hover { border-color: var(--accent); color: var(--accent); }

.pw-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

@media (max-width: 560px) {
  /* Phones need at least two columns side by side, otherwise the ten source
     formats read as one long list. 124px + a 14px gap fits two inside the
     narrowest wrap we care about (~280px of content). */
  .pw-cols { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 16px 14px; }
}

.pw-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.pw-cards a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 15px;
  color: var(--ink);
  font-size: 15px;
}
.pw-cards a:hover { border-color: var(--accent); text-decoration: none; }
.pw-cards small { display: block; color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.pw-faq dt { font-weight: 600; margin-top: 16px; }
.pw-faq dd { margin: 4px 0 0; color: #2c3742; }

/* Format comparison table on conversion pages. */
.pw-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 0;
  font-size: 15px;
}

.pw-table th,
.pw-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.pw-table thead th {
  font-size: 14px;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--line);
}

.pw-table tbody th {
  font-weight: 500;
  color: var(--ink-soft);
  width: 32%;
}

[dir="rtl"] .pw-table th,
[dir="rtl"] .pw-table td { text-align: right; }

/* ---------------------------------------------------------------- footer */

.pw-footer {
  margin-top: 52px;
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  font-size: 14px;
  color: var(--ink-soft);
}

.pw-footer__links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; }

/* Reserve space for a display ad so it never shifts the layout (protects CLS). */
.pw-ad-slot {
  margin: 34px 0;
  min-height: 90px;
  border: 1px dashed #dbe2ea;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa6b2;
  font-size: 13px;
}

[hidden] { display: none !important; }

@media (max-width: 560px) {
  .pw-item { flex-wrap: wrap; }
  .pw-item__name { flex-basis: 100%; }
  .pw-nav { width: 100%; margin-left: 0; padding-bottom: 10px; }
}
