/* Local extension settings — matches popup / cloud app palette */

:root {
  --av-bg: #161210;
  --av-panel: #1e1915;
  --av-field: rgba(237, 231, 218, 0.05);
  --av-ink: #ede7da;
  --av-ink-2: rgba(237, 231, 218, 0.62);
  --av-ink-3: rgba(237, 231, 218, 0.4);
  --av-line: rgba(237, 231, 218, 0.14);
  --av-line-2: rgba(237, 231, 218, 0.28);
  --av-accent: #e0603a;
  --av-ok: #78d6a6;
  --av-danger: #e8896f;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --jp-round: "Hiragino Maru Gothic ProN", "Zen Maru Gothic", "Hiragino Sans", sans-serif;
}

:root[data-theme="light"] {
  --av-bg: #f5efe0;
  --av-panel: #fdfaf1;
  --av-field: rgba(38, 34, 27, 0.04);
  --av-ink: #26221b;
  --av-ink-2: rgba(38, 34, 27, 0.62);
  --av-ink-3: rgba(38, 34, 27, 0.42);
  --av-line: rgba(38, 34, 27, 0.16);
  --av-line-2: rgba(38, 34, 27, 0.32);
  --av-accent: #d84e2a;
  --av-ok: #1c8f66;
  --av-danger: #b8492b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.av {
  background: var(--av-bg);
  color: var(--av-ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.av-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.av-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.av-hanko {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--av-accent);
  color: #fffdf6;
  font-family: var(--jp-round);
  font-weight: 900;
  font-size: 11px;
  transform: rotate(-6deg);
  box-shadow: 0 0 0 2px var(--av-bg), 0 0 0 3px var(--av-accent);
}

.av-title {
  font-family: var(--jp-round);
  font-size: 16px;
  font-weight: 800;
}

.av-sub {
  margin-top: 10px;
  font-size: 12px;
  color: var(--av-ink-3);
}

.av-saved {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--av-ok);
}

.av-card {
  margin-top: 16px;
  border: 1.5px solid var(--av-line);
  background: var(--av-panel);
  border-radius: 14px;
  padding: 16px 18px;
}

.av-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--av-ink-3);
  margin-bottom: 12px;
}

.av-fieldset {
  border: 0;
  margin-bottom: 14px;
}

.av-fieldset legend {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--av-ink-3);
  margin-bottom: 8px;
}

.av-fieldset label,
.av-card > label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--av-ink-2);
}

.av-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.av-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

input[type="number"],
input[type="password"],
select {
  display: block;
  margin-top: 5px;
  width: 100%;
  background: var(--av-bg);
  color: var(--av-ink);
  border: 1.5px solid var(--av-line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--av-accent);
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--av-accent);
}

.av-note {
  font-size: 11.5px;
  color: var(--av-ink-3);
  margin-bottom: 12px;
}

.av-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.av-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 12px;
  font-weight: 800;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  background: transparent;
}

.av-btn-ghost {
  border-color: var(--av-ink);
  color: var(--av-ink);
}
.av-btn-ghost:hover { background: var(--av-field); }

.av-btn-quiet {
  border-color: var(--av-line);
  color: var(--av-ink-3);
}
.av-btn-quiet:hover { color: var(--av-ink); }

.av-btn-sm { padding: 0.35rem 0.55rem; font-size: 11px; }
.av-icon-btn { padding: 0.35rem; min-width: 30px; }

.av-danger-text { color: var(--av-danger); border-color: var(--av-line); }

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--av-accent);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .av-grid { grid-template-columns: 1fr; }
}

.av-ja-en-banner {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--av-line);
  border-radius: 10px;
  background: var(--av-panel);
}
.av-ja-en-banner p { margin: 0 0 10px; font-size: 13px; line-height: 1.5; }
.av-ja-en-banner__actions { display: flex; flex-wrap: wrap; gap: 8px; }
