/* Shared across the standalone auth/billing pages (they don't load styles.css). */

:root {
  --action-primary: #C2410C;
  --action-primary-hover: #9A3412;
  --action-primary-active: #7C2D12;
  --action-primary-disabled: #6B7280;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Inline SVG icons: sized in em so they track the surrounding text, and
   stroked in currentColor so they inherit whatever context they sit in. */
.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.125em;
}

/* Shared application header for the creation and vault screens. */
app-header { display: block; }
.app-header {
  min-height: 108px;
  padding: 22px 28px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand meta"
    "description meta";
  align-items: center;
  column-gap: 24px;
  border-top: 6px solid #FF6B00;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #16213e;
  font-family: "Google Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
}
.app-header__brand { grid-area: brand; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-header__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #C2410C;
  font-size: 1.55rem;
  line-height: 1.25;
  letter-spacing: .01em;
}
.app-header__logo { display: block; width: 34px; height: 34px; flex: 0 0 34px; }
.app-header__details { display: contents; }
.app-header__description { grid-area: description; margin: 7px 0 0; color: #64748b; font-size: .95rem; line-height: 1.5; }
.app-header__meta { grid-area: meta; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 0; }
.app-header__user { max-width: 100%; overflow: hidden; color: #C2410C; font-size: .88rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.app-header__user span { overflow: hidden; text-overflow: ellipsis; }
.app-header__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-header__nav-link {
  padding: 6px 14px;
  border: 1px solid rgba(255, 107, 0, .3);
  border-radius: 8px;
  background: #FFF3EA;
  color: #16213e;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}
.app-header__nav-link:hover { background: var(--action-primary-hover); border-color: var(--action-primary-hover); color: #fff; }
.app-header__logout {
  min-height: 0;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: .84rem;
  font-weight: 400;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
}
.app-header__logout:hover { background: rgba(220, 38, 38, .08); color: #dc2626; }
.app-header__toggle { display: none; }

@media (max-width: 560px) {
  .app-header { min-height: 0; padding: 14px 16px; display: block; }
  .app-header__title { min-width: 0; font-size: 1.25rem; }
  .app-header__logo { width: 30px; height: 30px; flex-basis: 30px; }
  .app-header__toggle {
    display: grid;
    width: 44px;
    height: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(194, 65, 12, .24);
    border-radius: 999px;
    background: #FFF3EA;
    color: #9A3412;
    cursor: pointer;
    touch-action: manipulation;
  }
  .app-header__toggle:hover { background: #FFEDD5; }
  .app-header__toggle-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 160ms ease;
  }
  .app-header[data-expanded="true"] .app-header__toggle-icon { transform: rotate(180deg); }
  .app-header__details { display: grid; gap: 12px; padding-top: 10px; }
  .app-header[data-expanded="false"] .app-header__details { display: none; }
  .app-header__description { grid-area: auto; margin: 0; }
  .app-header__meta { grid-area: auto; align-items: flex-start; width: 100%; }
  .app-header__actions { gap: 8px; }
  .app-header__nav-link, .app-header__logout { min-height: 44px; display: inline-flex; align-items: center; }
}

@media (min-width: 561px) {
  .app-header__details { display: contents !important; }
}

@media (min-width: 561px) and (max-width: 760px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "brand" "description" "meta";
    row-gap: 10px;
  }
  .app-header__description { margin-top: 0; }
  .app-header__meta { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .app-header__toggle-icon { transition: none; }
}
