:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #687386;
  --line: #dfe4eb;
  --soft-line: #edf0f4;
  --canvas: #eef2f6;
  --surface: #ffffff;
  --soft-surface: #f8fafc;
  --blue: #2457d6;
  --blue-dark: #1945b5;
  --blue-soft: #eef4ff;
  --green: #0f8a68;
  --danger: #c93c3c;
  --app-notice-height: 0px;
  --shadow: 0 18px 50px rgba(23, 32, 51, .12);
  font-family: Inter, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { height: 100%; }

body {
  background: var(--canvas);
  color: var(--ink);
  height: 100%;
  margin: 0;
  overflow: hidden;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-header {
  align-items: center;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: 72px;
  padding: 0 24px;
  position: relative;
  z-index: 20;
}

.brand {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 10px;
  grid-column: 1;
  justify-self: start;
  text-decoration: none;
}

.brand-mark {
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
  display: block;
  height: 38px;
  object-fit: cover;
  width: 38px;
}

.brand strong { display: block; font-size: 14px; letter-spacing: -.01em; }
.brand small { color: var(--muted); display: block; font-size: 9px; margin-top: 1px; }

.document-switcher {
  background: #f1f4f8;
  border: 1px solid #e4e8ee;
  border-radius: 9px;
  display: flex;
  gap: 2px;
  grid-column: 2;
  padding: 3px;
}

.document-tab {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  min-width: 100px;
  padding: 8px 13px;
}

.document-tab.is-active {
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(23, 32, 51, .09);
  color: var(--ink);
}

.header-actions { align-items: center; display: flex; gap: 9px; grid-column: 3; justify-self: end; }

.primary-button,
.secondary-button,
.danger-button {
  align-items: center;
  border-radius: 7px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 750;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
}

.primary-button { background: var(--blue); border: 1px solid var(--blue); color: #fff; }
.primary-button:hover { background: var(--blue-dark); }
.primary-button svg { fill: none; height: 15px; margin-right: 7px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 15px; }
.secondary-button { background: #fff; border: 1px solid #ced5df; color: #334056; }
.secondary-button:hover { background: #f7f9fb; }
.danger-button { background: var(--danger); border: 1px solid var(--danger); color: white; }

.mobile-view-switch { display: none; }


.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.locale-picker select {
  background: #fff;
  border: 1px solid #ced5df;
  border-radius: 7px;
  color: #334056;
  font-size: 10px;
  height: 36px;
  padding: 0 8px;
}

.action-menu { position: relative; }
.action-menu summary {
  align-items: center;
  background: #fff;
  border: 1px solid #ced5df;
  border-radius: 7px;
  color: #526076;
  cursor: pointer;
  display: flex;
  font-size: 11px;
  font-weight: 700;
  gap: 6px;
  height: 36px;
  justify-content: center;
  list-style: none;
  min-width: 38px;
  padding: 0 11px;
  white-space: nowrap;
}
.action-menu summary svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.data-menu-short-label,
.data-menu-icon { display: none; }
.data-menu-chevron,
.export-menu-chevron { height: 12px; transition: transform .16s ease; width: 12px; }
.data-menu-icon { height: 16px; width: 16px; }
.action-menu[open] .data-menu-chevron,
.action-menu[open] .export-menu-chevron { transform: rotate(180deg); }
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 12px 32px rgba(23, 32, 51, .16);
  display: grid;
  gap: 7px;
  padding: 9px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 172px;
  z-index: 30;
}
.action-menu-panel .secondary-button { width: 100%; }
.export-actions { display: inline-flex; }
.export-actions > .primary-button { border-radius: 7px 0 0 7px; white-space: nowrap; }
.print-short-label { display: none; }
.export-menu summary { background: var(--blue); border-color: var(--blue); border-left-color: rgba(255, 255, 255, .35); border-radius: 0 7px 7px 0; color: #fff; min-width: 30px; padding: 0; width: 30px; }
.export-menu summary:hover { background: var(--blue-dark); }

.app-notice {
  align-items: flex-start;
  background: #eaf8f3;
  border-bottom: 1px solid #b9e2d4;
  color: #08664d;
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 10px;
  line-height: 1.5;
  padding: 10px 24px;
}
.app-notice::before { background: currentColor; border-radius: 50%; content: ''; flex: 0 0 auto; height: 8px; margin-top: 5px; width: 8px; }
.app-notice-message { min-width: 0; overflow-wrap: anywhere; }
.app-notice.is-saving { background: var(--blue-soft); border-color: #c8d8ff; color: var(--blue-dark); }
.app-notice.is-error { background: #fff1f1; border-color: #f1c3c3; color: #a72d2d; }
.app-notice-dismiss { background: transparent; border: 0; color: inherit; font: inherit; font-size: 11px; font-weight: 800; margin-left: auto; min-height: 28px; padding: 0 4px; text-decoration: underline; }
.app-notice-dismiss:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }

.locale-pending {
  align-items: center;
  background: var(--canvas);
  display: flex;
  height: calc(100vh - 72px);
  justify-content: center;
  padding: 32px;
}

.locale-pending-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  max-width: 560px;
  padding: 42px;
  text-align: center;
}

.locale-pending-card h1 { font-size: 24px; margin: 0 0 12px; }
.locale-pending-card p { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 0; }

.trust-capsule {
  align-items: stretch;
  background: rgba(255, 255, 255, .96);
  border: 1px solid #cfd7e1;
  border-radius: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 8px 28px rgba(23, 32, 51, .16);
  display: flex;
  max-width: calc(100vw - 28px - env(safe-area-inset-left) - env(safe-area-inset-right));
  overflow: hidden;
  position: fixed;
  right: calc(14px + env(safe-area-inset-right));
  z-index: 42;
}

.trust-source-link,
.trust-privacy-button,
.trust-version {
  align-items: center;
  background: transparent;
  border: 0;
  color: #344158;
  display: inline-flex;
  min-height: 40px;
}

.trust-source-link {
  justify-content: center;
  width: 40px;
}

.trust-source-link:hover,
.trust-privacy-button:hover { background: #f5f8fb; }

.trust-source-link:focus-visible,
.trust-privacy-button:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(36, 87, 214, .24);
  outline: 0;
}

.trust-source-link svg { fill: currentColor; height: 19px; width: 19px; }

.trust-privacy-button {
  border-right: 1px solid var(--line);
  gap: 7px;
  padding: 0 11px 0 10px;
  white-space: nowrap;
}

.trust-privacy-button svg { fill: currentColor; height: 19px; width: 19px; }
.trust-privacy-button span { font-size: 10px; font-weight: 750; }
.trust-version { color: var(--muted); font-size: 9px; font-weight: 650; padding: 0 10px; white-space: nowrap; }
