html {
  --mobile-nav-row-height: 52px;
  --mobile-nav-handle-height: 0px;
  --mobile-nav-visible-rows: 1;
  --mobile-nav-bar-height: calc(
    var(--mobile-nav-handle-height)
    + (var(--mobile-nav-row-height) * var(--mobile-nav-visible-rows))
    + 12px
    + env(safe-area-inset-bottom, 0px)
  );
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", "Google Sans", Roboto, sans-serif;
  margin: 0;
  background: #f8fafc;
  color: #1f2937;
}

a {
  color: inherit;
}

/* Header */
.site-header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  color: #111827;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

/* 設定プルダウンが overflow で隠れないようにする */
.site-nav:has(.nav-dropdown.is-open),
.site-nav:has(.nav-dropdown:hover) {
  overflow: visible;
}

.site-nav a,
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #4b5563;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-nav a:hover,
.nav-dropdown-toggle:hover,
.nav-dropdown.is-open .nav-dropdown-toggle {
  background: #f3f4f6;
}

.site-nav a.active,
.site-nav .nav-dropdown-toggle.active {
  background: #e8f0fe;
  color: #1a73e8;
}

.nav-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.header-more-dropdown .nav-unread-badge {
  margin-left: auto;
}

.mobile-nav-item {
  position: relative;
}

.mobile-nav-unread,
.mobile-nav-item .nav-unread-badge {
  position: absolute;
  top: 2px;
  right: 10px;
  margin-left: 0;
  min-width: 16px;
  height: 16px;
  font-size: 9px;
}

.nav-trailing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
}

.header-actions > form.lang-switch-form,
.header-actions > .site-user-menu,
.header-actions > .header-more-menu {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
}

.mobile-only-flex {
  display: none !important;
}

.header-more-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1f2937;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  box-shadow: none;
}

.header-more-toggle:hover,
.header-more-menu.is-open .header-more-toggle {
  background: transparent;
  color: #111827;
}

.header-more-glyph {
  display: block;
  transform: scaleY(1.05);
}

.header-more-dropdown {
  right: 0;
  left: auto;
  min-width: 200px;
  /* 設定サブ展開時にグループ管理などが画面外で切れないようスクロール可能にする */
  max-height: min(72vh, calc(100dvh - 72px - env(safe-area-inset-bottom, 0px)));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

#settings-dropdown .nav-dropdown-menu {
  max-height: min(72vh, calc(100dvh - 72px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.header-more-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-more-icon {
  width: 1.25em;
  text-align: center;
}

/* ⋮内の設定サブメニュー（Webヘッダーの設定プルダウン相当） */
.header-more-submenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-more-submenu-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #374151;
  padding: 8px 12px;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.header-more-submenu-toggle:hover,
.header-more-submenu.is-open .header-more-submenu-toggle,
.header-more-submenu-toggle.active {
  background: #e8f0fe;
  color: #1a73e8;
}

.header-more-submenu-label {
  flex: 1 1 auto;
  min-width: 0;
}

.header-more-submenu-toggle .nav-dropdown-caret {
  margin-left: auto;
  font-size: 12px;
  transition: transform 0.15s ease;
}

.header-more-submenu.is-open .header-more-submenu-toggle .nav-dropdown-caret {
  transform: rotate(180deg);
}

.header-more-submenu-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 4px;
  padding: 2px 0;
}

.header-more-submenu-panel[hidden] {
  display: none !important;
}

.header-more-submenu-panel a {
  font-size: 13px;
  padding: 8px 10px 8px 34px;
}

.footer-nav-checklist {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer-nav-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 64px;
  gap: 8px;
  align-items: center;
  padding: 0 12px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
}

.footer-nav-head-col {
  text-align: center;
}

.footer-nav-check .footer-nav-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 64px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.footer-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.footer-nav-col {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}

.footer-nav-col input {
  width: 18px;
  height: 18px;
  accent-color: #1a73e8;
}

.footer-nav-check.is-disabled {
  opacity: 0.55;
}

.footer-nav-check.is-disabled .footer-nav-col {
  cursor: not-allowed;
}

.footer-nav-icon {
  width: 1.5em;
  text-align: center;
  flex-shrink: 0;
}

.todos-filter-row-status {
  display: contents;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  flex-shrink: 0;
}

.context-switcher .lang-switch-btn.is-active {
  background: #0f766e;
  color: #fff;
}

.lang-switch-form {
  margin: 0;
}

.site-user-menu {
  flex-shrink: 0;
}

.lang-switch-btn {
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  background: transparent;
  color: #4b5563;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.lang-switch-btn:hover {
  background: #f3f4f6;
}

.lang-switch-btn.is-active {
  background: #1a73e8;
  color: #fff;
}

.lang-toggle {
  display: inline-flex;
  flex-shrink: 0;
}

.lang-toggle-btn {
  min-width: 36px;
  padding: 5px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #1a73e8;
  color: #fff;
}

.lang-toggle-btn:hover {
  background: #1557b0;
  color: #fff;
}

.context-toggle-btn,
.context-toggle-btn.is-active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.context-toggle-btn:hover,
.context-toggle-btn.is-active:hover {
  background: #0d9488;
  color: #fff;
}

.user-dropdown-divider {
  height: 1px;
  margin: 6px 10px;
  background: #e5e7eb;
}

.mobile-only {
  display: none !important;
}

.user-dropdown-menu a.active {
  background: #e8f0fe;
  color: #1a73e8;
}

.auth-lang-switcher {
  position: absolute;
  top: 16px;
  right: 16px;
}

.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-dropdown-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  gap: 4px;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 6px;
  z-index: 400;
}

.nav-dropdown.is-open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

/* ヘッダー⋮はクリックのみ（ホバーでは開かない） */
.header-more-menu:not(.is-open):hover .nav-dropdown-menu {
  display: none !important;
}
.header-more-menu.is-open .nav-dropdown-menu {
  display: block !important;
}

.header-more-menu.is-open {
  z-index: 360;
}

.nav-dropdown.is-open {
  z-index: 401;
}

.nav-dropdown-menu a {
  display: block;
  text-decoration: none;
  color: #374151;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.nav-dropdown-menu a:hover {
  background: #f3f4f6;
}

.nav-dropdown-menu a.active {
  background: #e8f0fe;
  color: #1a73e8;
}

.site-user-menu {
  flex-shrink: 0;
}

.user-menu-toggle {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #1f2937;
  padding: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-menu-toggle:hover,
.user-menu-toggle:focus-visible {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.user-menu-avatar {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  user-select: none;
}

.user-dropdown-menu {
  right: 0;
  left: auto;
  min-width: 200px;
}

.user-dropdown-meta {
  padding: 8px 12px 10px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-dropdown-menu a,
.logout-form button {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: #374151;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

.user-dropdown-menu a:hover,
.logout-form button:hover {
  background: #f3f4f6;
}

.logout-form {
  margin: 0;
  padding: 0 6px 6px;
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  width: fit-content;
  white-space: nowrap;
  flex-shrink: 0;
}

.role-badge.user,
.role-badge.standard {
  background: #eef4ff;
  color: #1d4ed8;
}

.role-badge.light {
  background: #ecfdf5;
  color: #047857;
}

.role-badge.admin {
  background: #fef3c7;
  color: #b45309;
}

.role-badge.super_admin {
  background: #e8f0fe;
  color: #174ea6;
}

.feature-access-list,
.role-permission-summary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.feature-access-list li,
.role-permission-summary li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.feature-access-list li.is-denied {
  opacity: 0.55;
}

.feature-access-list li strong {
  font-size: 12px;
  font-weight: 600;
}

.feature-access-list li.is-allowed strong {
  color: #047857;
}

.feature-access-list li.is-denied strong {
  color: #9ca3af;
}

.role-permission-summary li {
  justify-content: flex-start;
}

.settings-subnav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.settings-subnav a {
  text-decoration: none;
  color: #4b5563;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  background: white;
}

.settings-subnav a:hover {
  background: #f9fafb;
}

.settings-subnav a.active {
  background: #e8f0fe;
  border-color: #bfdbfe;
  color: #1a73e8;
}

.help-topics {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

.help-topics a {
  text-decoration: none;
  color: #4b5563;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  background: white;
}

.help-topics a:hover {
  background: #f9fafb;
}

.help-topics a.active {
  background: #e8f0fe;
  border-color: #bfdbfe;
  color: #1a73e8;
}

.settings-setup-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  padding: 0;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.settings-setup-tabs::-webkit-scrollbar {
  display: none;
}

.settings-setup-tabs a {
  flex: 0 0 auto;
  text-decoration: none;
  color: #4b5563;
  padding: 10px 14px 11px;
  margin-bottom: -1px;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  border-radius: 0;
  white-space: nowrap;
}

.settings-setup-tabs a:hover {
  color: #1a73e8;
  background: #f3f6fb;
}

.settings-setup-tabs a.is-active {
  color: #174ea6;
  border-bottom-color: #1a73e8;
  background: #e8f0fe;
  border-radius: 8px 8px 0 0;
}

.help-section {
  line-height: 1.7;
}

.help-section h2 {
  font-size: 1.05rem;
  margin: 1.35rem 0 0.5rem;
}

.help-section h3 {
  font-size: 0.95rem;
  margin: 1rem 0 0.4rem;
}

.help-section p,
.help-section ul,
.help-section ol {
  margin: 0 0 0.75rem;
}

.help-section ul,
.help-section ol {
  padding-left: 1.3rem;
}

.storage-settings + .storage-settings {
  margin-top: 16px;
}

.line-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.line-settings-main .storage-provider-form {
  max-width: none;
}

.line-status-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.line-status-banner.is-on {
  background: #e6f4ea;
  color: #137333;
  border: 1px solid #ceead6;
}

.line-status-banner.is-off {
  background: #f1f3f4;
  color: #5f6368;
  border: 1px solid #dadce0;
}

.line-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #34a853;
  color: #fff;
  font-size: 12px;
}

.line-channel-form .req {
  color: #d93025;
}

.line-webhook-note {
  margin: -4px 0 0;
  font-size: 12px;
}

.line-qr-field {
  display: grid;
  gap: 8px;
}

.line-qr-label {
  font-size: 13px;
  color: #3c4043;
}

.line-qr-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.line-qr-preview img,
.line-side-qr img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
}

.line-qr-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #5f6368;
}

.line-qr-delete {
  border: none;
  background: none;
  color: #d93025;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  text-align: left;
}

.line-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.line-personal-link {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.line-settings-side {
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}

.line-settings-side h3,
.line-settings-side h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.line-settings-side h4 {
  font-size: 13px;
  margin-top: 14px;
}

.line-setup-steps {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: #3c4043;
  line-height: 1.5;
}

.line-notify-examples {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #e8f0fe;
  color: #174ea6;
}

.line-notify-examples ul {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.line-side-qr {
  margin-top: 14px;
}

.is-hidden-form {
  display: none;
}

@media (max-width: 900px) {
  .line-settings-layout {
    grid-template-columns: 1fr;
  }
}

.storage-provider-form {
  display: grid;
  gap: 12px;
  max-width: 640px;
}

.storage-provider-form label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: #3c4043;
}

.storage-provider-form input[type="text"],
.storage-provider-form input[type="password"],
.storage-provider-form input[type="url"],
.storage-provider-form input[type="number"],
.storage-provider-form select {
  padding: 8px 10px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 14px;
}

.storage-enable {
  display: flex !important;
  align-items: center;
  gap: 8px;
  grid-template-columns: none !important;
}

.storage-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ai-model-field {
  display: grid;
  gap: 4px;
}

.ai-model-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ai-model-row select {
  flex: 1 1 220px;
  min-width: 0;
}

.ai-model-row button {
  flex: 0 0 auto;
}

.settings-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(16, 35, 31, 0.1);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.04);
}

.settings-mode-option {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  grid-template-columns: none !important;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.settings-mode-option:has(input:checked) {
  background: linear-gradient(150deg, #0f766e, #0d9488);
  color: #f0fdfa;
}

.settings-mode-fields {
  display: grid;
  gap: 12px;
}

.settings-mode-fields[hidden] {
  display: none;
}

.line-code-issue-row {
  align-items: center;
}

.line-issued-code {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  line-height: 1.4;
  color: #137333;
}

.line-issued-code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #0b57d0;
}

.storage-test-result.is-ok,
.storage-test-live.is-ok {
  color: #137333;
}

.storage-test-result.is-fail,
.storage-test-live.is-fail {
  color: #c5221f;
}

.notification-list {
  margin-top: 12px;
}

.form-grid-row-schedule {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.schedule-option {
  margin-top: 8px;
}

.schedule-toggle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.schedule-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}

.time-range-panel {
  margin-top: 8px;
}

.todo-memo-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-memo-panel {
  width: 100%;
}

.todo-memo-input,
form.add textarea.todo-memo-input,
.edit-form textarea.todo-memo-input,
.modal-form textarea.todo-memo-input {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
  box-sizing: border-box;
}

.time-range-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.time-range-separator {
  color: #6b7280;
  font-weight: 600;
  font-size: 15px;
}

.time-range-inputs input[type="time"],
.schedule-time-cell input[type="time"] {
  width: 100%;
  max-width: 140px;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}

.schedule-time-cell input[type="time"] {
  max-width: 180px;
}

.reminder-checkboxes {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0;
}

.reminder-checkboxes legend {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  padding: 0 4px;
}

.reminder-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 4px;
}

.reminder-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #374151;
}

.edit-reminders {
  margin-top: 10px;
}

.notification-settings-form {
  margin-bottom: 20px;
}

.notification-channels {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 12px;
}

.notification-channels legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0 4px;
}

.channel-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 14px;
}

.notification-channel-detail {
  margin: 20px 0;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.notification-channel-detail h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.env-hint {
  background: #f3f4f6;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  overflow-x: auto;
}

.notify-via-fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0 0;
}

.notify-via-fieldset legend {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  padding: 0 4px;
}

.notify-via-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.notify-via-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #374151;
}

.notify-settings {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 10px 16px 14px;
  margin: 0;
  min-width: 0;
}

.notify-settings > legend {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  padding: 0 6px;
}

.notify-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 28px;
  align-items: start;
}

.notify-settings-heading {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.notify-method-list,
.notify-timing-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notify-timing-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 44px;
}

.notify-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #111827;
  width: auto;
  white-space: nowrap;
}

.modal-form label.notify-option,
.add-form-grid label.notify-option,
.edit-form label.notify-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  align-self: stretch;
  width: auto;
  white-space: nowrap;
  gap: 8px;
}

.notify-option input[type="radio"],
.notify-option input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0;
  width: 16px;
  height: 16px;
}

.notify-at-time-option {
  flex-wrap: nowrap;
}

.notify-at-time-option input[type="time"],
.modal-form .notify-at-time-option input[type="time"],
form.add .notify-at-time-option input[type="time"],
.edit-form .notify-at-time-option input[type="time"] {
  width: 4.75rem;
  min-width: 4.75rem;
  max-width: 4.75rem;
  min-height: 32px;
  padding: 2px 8px 2px 4px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
}

.notify-at-time-option input[type="time"]::-webkit-datetime-edit,
.notify-at-time-option input[type="time"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
  margin: 0;
}

.notify-at-time-option input[type="time"]::-webkit-calendar-picker-indicator {
  margin-inline: 0 2px;
  padding: 0;
  width: 12px;
  height: 12px;
  cursor: pointer;
}

.notify-settings-wrap {
  min-width: 0;
}

.notify-settings-note,
.notify-settings-disabled-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.notify-settings-disabled-hint {
  display: none;
}

.notify-settings-wrap.is-disabled .notify-settings,
.notify-settings-wrap.is-disabled .notify-settings-note {
  opacity: 0.45;
  pointer-events: none;
}

.notify-settings-wrap.is-disabled .notify-settings-disabled-hint {
  display: block;
}

@media (max-width: 720px) {
  .notify-settings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.notification-types {
  margin: 12px 0 20px;
}

.page-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.page-main-narrow {
  max-width: 720px;
}

.hint {
  color: #6b7280;
  font-size: 14px;
  margin: 0 0 12px;
  line-height: 1.5;
}

.banner {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}

.banner.notice { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.banner.error { background: #fdecea; color: #b42318; border: 1px solid #f5c2c0; }
.banner.warn { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.banner.info { background: #eef4ff; color: #1e3a8a; border: 1px solid #bfdbfe; }

.form-errors-list {
  margin: 6px 0 0;
  padding-left: 20px;
}

.form-errors-list li {
  margin-top: 2px;
}

.field-error {
  margin: -6px 0 0;
  color: #b42318;
  font-size: 13px;
}

.mypage-group-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.mypage-group-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mypage-group-name {
  font-weight: 600;
}

.group-status-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  background: #f3f4f6;
  color: #6b7280;
}

.group-status-badge.approved {
  background: #dcfce7;
  color: #166534;
}

.group-status-badge.pending {
  background: #fff7ed;
  color: #9a3412;
}

.group-status-badge.rejected {
  background: #fdecea;
  color: #b42318;
}

.auth-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  letter-spacing: 8px;
  text-align: center;
}

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

.panel {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

/* 公開品質の下敷き。素の四角い入力を作らない。
   :where() で包んで詳細度を 0 にしてあるので、個別のクラス指定が必ず優先される。
   :not() は中身の詳細度を持つため、外さないこと（外すとクラス6個分の強さになる） */
:where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
  select,
  textarea
) {
  padding: 10px 12px;
  border: 1px solid #d8dee9;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 14px;
}

:where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
  select,
  textarea
):focus-visible {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

button,
.button-link {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  background: #1a73e8;
  color: white;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
  line-height: 1.2;
}

button.secondary,
.button-link.secondary {
  background: #6b7280;
}

button.danger,
.button-link.danger {
  background: #b42318;
}

button.icon-btn,
.button-link.icon-btn {
  padding: 6px 12px;
  min-width: 36px;
  min-height: 36px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.calendar-toolbar .nav-group .button-link,
.todos-calendar-toolbar .nav-group .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  line-height: 1;
}

.calendar-toolbar .nav-group .icon-btn,
.todos-calendar-toolbar .nav-group .icon-btn {
  font-size: 18px;
  line-height: 1;
}

.button-link.mini {
  padding: 6px 10px;
  font-size: 12px;
}

code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* Forms */
form.add > label,
.edit-form > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #374151;
}

form.add textarea,
form.add input[type="date"],
form.add input[type="text"],
.edit-form textarea,
.edit-form input[type="text"],
.edit-form input[type="date"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}

form.add textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
  margin-top: 10px;
}

.field-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.field-row-4 {
  grid-template-columns: repeat(4, 1fr);
}

.field-row-2 {
  grid-template-columns: repeat(2, 1fr);
}

.add-form-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.form-grid-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}

.form-grid-row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.form-grid-spacer {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.form-grid-row-labels .field-label,
.form-grid-row-top .field-label {
  font-size: 13px;
  color: #4b5563;
}

#add-form .time-range-panel:not(.date-panel-hidden) {
  display: block;
}

form.add input[type="time"],
.edit-form input[type="time"] {
  width: 100%;
  max-width: 140px;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.form-grid-cell input[type="date"],
.form-grid-cell select {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: white;
  box-sizing: border-box;
}

.date-panel-hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .form-grid-row {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid-row-top {
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .field-row-3,
  .field-row-4,
  .field-row-2 {
    grid-template-columns: 1fr;
  }
}

form.add select,
.edit-form select,
.modal-form select,
.filter-bar select {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: white;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(160px, 2fr) minmax(100px, 1fr) minmax(100px, 1fr) minmax(100px, 1fr) auto;
  gap: 12px;
  align-items: end;
  width: 100%;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.filter-bar-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: flex-end;
  justify-self: end;
}

.filter-bar-actions button,
.filter-bar-actions a {
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.filter-group select,
.filter-group .filter-dropdown {
  width: 100%;
}

.filter-group label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
}

.filter-bar input[type="month"] {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}

.filter-period-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 4px;
}

.filter-period-mode-option {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.filter-group-period {
  min-width: 0;
}

.filter-group-categories {
  min-width: 0;
}

.filter-category-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  min-height: 42px;
  box-sizing: border-box;
  align-items: center;
}

.filter-category-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
}

.filter-dropdown {
  position: relative;
  width: 100%;
}

.filter-dropdown-trigger {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  box-sizing: border-box;
  text-align: left;
}

.filter-dropdown-trigger:hover {
  background: #f9fafb;
}

.filter-dropdown-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.filter-dropdown-caret {
  flex-shrink: 0;
  color: #6b7280;
  font-size: 10px;
  line-height: 1;
}

.filter-dropdown-panel[hidden] {
  display: none !important;
}

.filter-dropdown-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  padding: 6px 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  max-height: 220px;
  overflow-y: auto;
}

.filter-dropdown-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}

.filter-dropdown-check:hover {
  background: #f3f4f6;
}

.filter-dropdown-check input {
  margin: 0;
  flex-shrink: 0;
}

.filter-bar input[type="number"].filter-period-input {
  width: 100%;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.filter-bar select,
.filter-bar input[type="month"],
.filter-bar input[type="number"].filter-period-input {
  height: 42px;
  padding: 0 10px;
}

.filter-bar input[type="month"] {
  width: 100%;
  box-sizing: border-box;
}

.filter-bar button {
  height: 42px;
  padding: 0 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.filter-bar button.filter-today-btn,
.filter-bar a.filter-today-btn,
.filter-bar a.filter-clear-btn {
  background: #fff;
  color: #374151;
  box-shadow: inset 0 0 0 1px #d1d5db;
}

.filter-bar button.filter-today-btn:hover,
.filter-bar a.filter-today-btn:hover,
.filter-bar a.filter-clear-btn:hover {
  background: #f9fafb;
}

.filter-bar button.filter-today-btn.active,
.filter-bar a.filter-today-btn.active {
  background: #1a73e8;
  color: #fff;
  box-shadow: none;
}

.filter-bar button.filter-today-btn.active:hover,
.filter-bar a.filter-today-btn.active:hover {
  background: #1558b8;
}

a.filter-today-btn {
  text-decoration: none;
  box-sizing: border-box;
  height: 42px;
  padding: 0 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
}

a.filter-clear-btn {
  text-decoration: none;
  box-sizing: border-box;
  height: 42px;
  padding: 0 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
}

.filter-scope-hint {
  font-size: 11px;
  font-weight: 500;
  color: #1a73e8;
}

.filter-today-note {
  margin: -8px 0 12px;
}

.importance-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.category-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.importance-badge.importance-high {
  background: #fee2e2;
  color: #b91c1c;
}

.importance-badge.importance-medium {
  background: #e5e7eb;
  color: #4b5563;
}

.importance-badge.importance-low {
  background: #f3f4f6;
  color: #6b7280;
}

.category-badge.category-task {
  background: #dbeafe;
  color: #1d4ed8;
}

.category-badge.category-personal {
  background: #ede9fe;
  color: #6d28d9;
}

.category-badge.category-memo {
  background: #fef3c7;
  color: #b45309;
}

.category-badge.category-other {
  background: #f3f4f6;
  color: #374151;
}

.undated-heading {
  margin: 20px 0 8px;
  font-size: 15px;
  color: #4b5563;
}

.undated-section {
  opacity: 0.95;
}

.event-chip.importance-high:not(.done) {
  background: #fecaca;
  color: #991b1b;
}

.event-chip.importance-low:not(.done) {
  background: #f3f4f6;
  color: #6b7280;
}

.event-chip.category-personal:not(.done) {
  border-left: 3px solid #7c3aed;
}

.event-chip.category-memo:not(.done) {
  background: #fef08a;
  color: #854d0e;
}

.event-chip.category-other:not(.done) {
  background: #e5e7eb;
  color: #374151;
}

.event-chip.is-range:not(.done) {
  border-left: 3px solid #1a73e8;
}

.field-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}

.split-option,
.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 14px;
}

/* display 指定が hidden 属性に勝ってしまうため打ち消す */
.inline-check[hidden] {
  display: none;
}

/* 折りたたみの共通パーツ。details/summary なので JS が無くても開閉できる */
.app-accordion {
  margin: 0;
}

.app-accordion-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  cursor: pointer;
  list-style: none;
}

.app-accordion-summary::-webkit-details-marker {
  display: none;
}

.app-accordion-summary::marker {
  content: '';
}

.app-accordion-summary > h2,
.app-accordion-summary > h3 {
  margin: 0;
}

.app-accordion-summary:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 4px;
  border-radius: 8px;
}

.app-accordion-caret {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  line-height: 1;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.app-accordion[open] .app-accordion-caret {
  transform: rotate(180deg);
}

.app-accordion-note {
  font-size: 12px;
  color: #6b7280;
}

.app-accordion-body {
  margin-top: 14px;
}

.preview {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
}

.preview h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #475569;
}

.preview ol {
  margin: 0;
  padding-left: 20px;
}

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

/* Todo list */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.list-toolbar h2 {
  margin: 0;
  flex: 0 0 auto;
}

.todo-page-summary {
  font-size: 13px;
  color: #6b7280;
  flex: 1 1 auto;
}

.list-toolbar .bulk-actions {
  margin-left: auto;
}

.todo-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 4px 0 16px;
}

.todo-pagination-label {
  font-size: 14px;
  color: #6b7280;
}

.bulk-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bulk-actions button {
  padding: 6px 10px;
  font-size: 12px;
}

.todo-table-wrap {
  width: 100%;
  margin-top: 4px;
}

.todo-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid #e5e7eb;
}

.todo-table thead th {
  padding: 8px 6px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-align: left;
  vertical-align: bottom;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.todo-table tbody tr.todo-row td {
  padding: 10px 6px;
  vertical-align: middle;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.todo-table tbody tr.todo-row.done .todo-col-title {
  text-decoration: line-through;
  color: #9ca3af;
}

.todo-table .todo-col-check {
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

.todo-table .todo-col-check input {
  margin: 0;
}

.todo-table .todo-col-date,
.todo-table .todo-col-time {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.35;
  white-space: nowrap;
}

.todo-table .todo-col-check-w { width: 44px; }
.todo-table .todo-col-date-w { width: 200px; }
.todo-table .todo-col-title-w { width: auto; }
.todo-table .todo-col-time-w { width: 108px; }
.todo-table .todo-col-category-w { width: 88px; }
.todo-table .todo-col-importance-w { width: 64px; }
.todo-table .todo-col-actions-w { width: 160px; }

.todo-bulk-icon {
  display: none;
}

.todo-bulk-label {
  display: inline;
}

.todo-table .todo-col-date {
  min-width: 200px;
  overflow: visible;
}

.todo-table .todo-col-title {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.todo-table .todo-col-category,
.todo-table .todo-col-importance {
  white-space: nowrap;
  overflow: visible;
}

.todo-table tbody tr.todo-row td.todo-col-category,
.todo-table tbody tr.todo-row td.todo-col-importance {
  overflow: visible;
}

.todo-table thead th.todo-col-category,
.todo-table thead th.todo-col-importance {
  overflow: visible;
  text-overflow: clip;
}

.todo-table .todo-col-category .category-badge,
.todo-table .todo-col-importance .importance-badge {
  display: inline-block;
  max-width: none;
}

.todo-table .todo-col-actions {
  padding: 10px 4px;
}

.todo-table .todo-row-actions {
  display: flex;
  width: 100%;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: stretch;
}

.todo-table .todo-row-actions button,
.todo-table .todo-row-actions .button-link {
  flex: 0 0 auto;
  min-width: 0;
  padding: 5px 2px;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.todo-table .todo-row-actions .todo-row-icon-btn {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 14px;
  border-radius: 8px;
  gap: 0;
}

.todo-row-icon {
  display: inline;
  line-height: 1;
}

.todo-row-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.todo-table tr.edit-row td {
  padding: 12px 6px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
}

.edit-form-wrap {
  flex: 1;
  min-width: 0;
}

.edit-form {
  display: grid;
  gap: 8px;
}

.edit-form .add-form-grid {
  margin-top: 0;
}

.edit-form .form-actions {
  justify-content: flex-end;
}

.empty-msg {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}

/* Calendar ?Efixed 7-column grid */
.calendar-shell {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  width: 100%;
}

.dash-ai-usage {
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dash-ai-usage-head {
  margin-bottom: 14px;
}

.dash-ai-usage-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.dash-ai-usage-lead {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.dash-ai-usage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dash-ai-usage-card {
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
  min-width: 0;
}

.dash-ai-usage-card.is-off {
  opacity: 0.72;
}

.dash-ai-usage-card.is-warn {
  border-color: rgba(180, 83, 9, 0.45);
  background: #fffbeb;
}

.dash-ai-usage-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.dash-ai-usage-card-head h3 {
  margin: 0;
  font-size: 15px;
  color: #111827;
}

.dash-ai-usage-provider {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.dash-ai-usage-link {
  flex: 0 0 auto;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.3;
}

.dash-ai-usage-remaining {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.45;
}

.dash-ai-usage-dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.dash-ai-usage-dl > div {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  gap: 8px;
  font-size: 13px;
  align-items: baseline;
}

.dash-ai-usage-dl dt {
  margin: 0;
  color: #6b7280;
}

.dash-ai-usage-dl dd {
  margin: 0;
  color: #111827;
  font-weight: 550;
}

.dash-ai-usage-bar {
  margin-top: 12px;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.dash-ai-usage-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1a73e8;
}

.dash-ai-usage-bar-fill.is-warn {
  background: #d97706;
}

.dash-ai-usage-bar-fill.is-danger {
  background: #dc2626;
}

.dash-ai-usage-rate,
.dash-ai-usage-note {
  margin: 6px 0 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.45;
}

.dash-ai-usage-keys {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #374151;
}

.dash-ai-usage-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 11px;
  font-weight: 600;
}

.dash-ai-usage-badge.is-paid {
  background: #f3e8ff;
  color: #7c3aed;
}

@media (max-width: 820px) {
  .dash-ai-usage-grid {
    grid-template-columns: 1fr;
  }
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.calendar-toolbar-inline {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
}

.calendar-toolbar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.calendar-toolbar-row-nav {
  justify-content: space-between;
}

.calendar-toolbar-row-controls {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.calendar-toolbar-inline .calendar-nav-arrow {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  margin: 0;
  font-size: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #1a73e8;
}

.calendar-toolbar-inline .calendar-nav-arrow:hover,
.calendar-toolbar-inline .calendar-nav-arrow:focus-visible {
  background: rgba(26, 115, 232, 0.08) !important;
  color: #1557b0;
}

.calendar-toolbar-inline .calendar-nav-glyph {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: #1a73e8;
  transform: translateY(-1px);
}

.calendar-toolbar-inline .month-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  /* 旧レイアウトの absolute 指定を打ち消す */
  position: static;
  left: auto;
  top: auto;
  transform: none;
  pointer-events: auto;
  z-index: auto;
}

.calendar-toolbar-inline .calendar-chip-btn {
  flex: 0 0 auto;
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  white-space: nowrap;
}

.calendar-toolbar-inline .calendar-view-switch {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
}

.calendar-voice-toggle {
  flex: 0 0 auto;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #fff;
  color: #1f2937;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.calendar-voice-toggle .calendar-voice-icon {
  display: block;
  width: 18px;
  height: 18px;
}

.calendar-voice-toggle:hover,
.calendar-voice-toggle:focus-visible {
  background: rgba(26, 115, 232, 0.08);
  border-color: #93c5fd;
  color: #1a73e8;
}

.calendar-voice-toggle.is-active {
  background: #eef4ff;
  border-color: #93c5fd;
  color: #1a73e8;
}

.todos-voice-panel {
  margin: 8px 0 12px;
}

.todos-voice-panel[hidden] {
  display: none !important;
}

.list-toolbar-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.calendar-toolbar-inline .calendar-view-btn {
  flex: 0 0 auto;
  min-width: 28px;
  min-height: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 12px;
  box-sizing: border-box;
}

.calendar-toolbar-inline .calendar-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.calendar-toolbar-inline .calendar-action-btn {
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .calendar-toolbar.calendar-toolbar-inline {
    padding: 10px 8px;
    gap: 8px;
  }

  .calendar-toolbar-row-nav {
    flex-wrap: nowrap;
  }

  .calendar-toolbar-row-controls {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
  }

  .calendar-toolbar-row-controls::-webkit-scrollbar {
    display: none;
  }

  .calendar-toolbar-inline .month-label {
    font-size: 15px;
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
  }

  .calendar-toolbar-inline .calendar-nav-arrow {
    width: 36px;
    height: 36px;
  }

  /* 720px 以下の width:100% / flex:1 を打ち消す（縦積みの原因） */
  .calendar-toolbar-inline .calendar-view-switch {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
  }

  .calendar-toolbar-inline .calendar-view-btn {
    flex: 0 0 auto !important;
    min-width: 28px !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
  }

  .calendar-toolbar-inline .calendar-chip-btn {
    flex: 0 0 auto !important;
    width: auto !important;
  }

  .calendar-toolbar-inline .calendar-toolbar-actions {
    flex: 0 0 auto !important;
    width: auto !important;
    margin-left: auto;
  }

  .calendar-toolbar-inline .calendar-action-btn {
    width: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 !important;
  }

  .calendar-toolbar-inline .calendar-action-icon {
    display: inline !important;
  }

  .calendar-toolbar-inline .calendar-action-label {
    display: none !important;
  }

  /* JS なしでも表示（hidden 依存をやめた） */
  .calendar-height-resizer {
    display: block !important;
  }

  /* 中身に合わせて伸びないよう固定高（ドラッグで伸縮できるようにする） */
  .calendar-shell[data-calendar-view="month"] .calendar-day {
    height: var(--cal-day-min-height, 64px);
    min-height: var(--cal-day-min-height, 64px);
    max-height: var(--cal-day-min-height, 64px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    container-type: size;
    container-name: cal-day;
  }

  .calendar-shell[data-calendar-view="month"] .day-events {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  /*
   * 引き延ばし時に予定タイトルを複数行表示。
   * 日本語は word-break:break-all がないと折り返せず、1行省略のまま余白だけ増える。
   */
  html[data-cal-day-density="medium"] .calendar-shell .event-chip .event-title,
  html[data-cal-day-density="tall"] .calendar-shell .event-chip .event-title,
  html[data-cal-day-density="xl"] .calendar-shell .event-chip .event-title,
  .calendar-shell[data-cal-day-density="medium"] .event-chip .event-title,
  .calendar-shell[data-cal-day-density="tall"] .event-chip .event-title,
  .calendar-shell[data-cal-day-density="xl"] .event-chip .event-title {
    white-space: normal !important;
    display: block !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    line-break: anywhere;
  }

  html[data-cal-day-density="medium"] .calendar-shell .event-chip,
  .calendar-shell[data-cal-day-density="medium"] .event-chip {
    padding: 2px 3px;
    font-size: 9px;
  }

  html[data-cal-day-density="medium"] .calendar-shell .event-chip .event-title,
  .calendar-shell[data-cal-day-density="medium"] .event-chip .event-title {
    font-size: 9px !important;
    line-height: 1.25 !important;
    max-height: calc(1.25em * 2);
  }

  html[data-cal-day-density="tall"] .calendar-shell .event-chip,
  .calendar-shell[data-cal-day-density="tall"] .event-chip {
    padding: 2px 3px;
    font-size: 10px;
  }

  html[data-cal-day-density="tall"] .calendar-shell .event-chip .event-title,
  .calendar-shell[data-cal-day-density="tall"] .event-chip .event-title {
    font-size: 10px !important;
    line-height: 1.3 !important;
    max-height: calc(1.3em * 4);
  }

  html[data-cal-day-density="xl"] .calendar-shell .event-chip,
  .calendar-shell[data-cal-day-density="xl"] .event-chip {
    padding: 3px 4px;
    font-size: 11px;
  }

  html[data-cal-day-density="xl"] .calendar-shell .event-chip .event-title,
  .calendar-shell[data-cal-day-density="xl"] .event-chip .event-title {
    font-size: 11px !important;
    line-height: 1.35 !important;
    max-height: calc(1.35em * 8);
  }
}

/* セル実高ベース（data 属性が付かない場合の保険） */
@container cal-day (min-height: 72px) {
  .event-chip .event-title {
    white-space: normal !important;
    display: block !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    line-break: anywhere;
    font-size: 9px !important;
    line-height: 1.25 !important;
    max-height: calc(1.25em * 2);
  }
}

@container cal-day (min-height: 130px) {
  .event-chip .event-title {
    font-size: 10px !important;
    line-height: 1.3 !important;
    max-height: calc(1.3em * 4);
  }
}

@container cal-day (min-height: 200px) {
  .event-chip .event-title {
    font-size: 11px !important;
    line-height: 1.35 !important;
    max-height: calc(1.35em * 8);
  }
}

.calendar-toolbar .month-label {
  font-size: 22px;
  font-weight: 500;
}

.calendar-toolbar .nav-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.calendar-weekdays,
.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
}

.calendar-weekday {
  padding: 10px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}

.calendar-weekday.sun { color: #dc2626; }
.calendar-weekday.sat { color: #2563eb; }

.calendar-body {
  width: 100%;
}

.calendar-day {
  min-height: var(--cal-day-min-height, 110px);
  min-width: 0;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  padding: 6px;
  background: white;
  overflow: hidden;
}

.calendar-week .calendar-day:last-child {
  border-right: none;
}

.calendar-day.other-month {
  background: #f9fafb;
}

.calendar-day.other-month .day-num {
  color: #9ca3af;
}

.calendar-day.today {
  background: #eff6ff;
}

.calendar-day.today .day-num {
  background: #1a73e8;
  color: white;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.day-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 4px;
}

.day-header-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.day-num {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  flex: 0 0 auto;
  line-height: 26px;
  text-decoration: none;
}
a.day-num:hover,
a.day-num:focus-visible {
  color: #1a73e8;
  text-decoration: none;
}

.day-note-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid #f6e05e;
  background: #fff9c4;
  color: #5f4b00;
  border-radius: 999px;
  padding: 0 5px;
  min-height: 18px;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.day-note-badge:hover {
  background: #fff3b0;
}

.day-note-badge-icon {
  font-size: 10px;
  line-height: 1;
}

.day-note-badge-count {
  font-size: 10px;
  font-weight: 700;
}

.day-add-btn {
  border: none;
  background: transparent;
  color: #6b7280;
  padding: 0 4px;
  font-size: 16px;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
}

.day-add-btn:hover {
  background: #e5e7eb;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.day-events-mobile {
  display: none;
}

.desktop-only {
  display: inline-flex;
}

.event-chip {
  display: block;
  width: 100%;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.35;
  background: #dbeafe;
  color: #1e40af;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.event-chip:hover {
  filter: brightness(0.97);
}

.event-meet-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  vertical-align: middle;
  background: #1a73e8;
  color: #fff;
  text-decoration: none;
}

.event-hover-tooltip {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  background: #1f2937;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  max-width: min(280px, calc(100vw - 16px));
}

.event-hover-tooltip-copy,
.event-hover-tooltip-meet {
  pointer-events: auto;
}

.event-hover-tooltip-meet {
  display: block;
  margin-top: 6px;
  color: #93c5fd;
  text-decoration: underline;
}

.event-hover-tooltip-copy {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  text-align: center;
}

.event-hover-tooltip-copy:hover {
  background: rgba(255, 255, 255, 0.16);
}

.event-hover-tooltip.is-copied .event-hover-tooltip-copy {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.45);
}

.event-hover-tooltip-title {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}

.event-hover-tooltip-date,
.event-hover-tooltip-time {
  display: block;
  color: #d1d5db;
}

.event-chip.done {
  background: #e5e7eb !important;
  color: #6b7280 !important;
  border-left-color: #9ca3af !important;
  text-decoration: line-through;
  opacity: 0.85;
}

.event-chip.done .event-title,
.event-chip.done .event-time {
  color: #6b7280 !important;
  text-decoration: line-through;
}

.event-chip.note-chip {
  background: var(--note-bg, #fff9c4);
  border: 1px solid var(--note-border, #f6e05e);
  color: #3c4043;
  text-decoration: none;
}

.event-chip.note-chip:hover {
  filter: brightness(0.98);
  text-decoration: none;
}

.calendar-toolbar-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.calendar-view-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dadce0;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.calendar-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 8px 12px;
  border-right: 1px solid #e8eaed;
  color: #3c4043;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
}

.calendar-view-btn:last-child {
  border-right: none;
}

.calendar-view-btn:hover {
  background: #f1f3f4;
}

.calendar-view-btn.is-active {
  background: #e8f0fe;
  color: #174ea6;
}

/* Day / Week timed calendar */
.calendar-day-view,
.calendar-week-view {
  --cal-hour-height: 48px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.cal-allday-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
  align-items: start;
}

.cal-allday-label {
  font-size: 12px;
  color: #5f6368;
  font-weight: 600;
  padding-top: 6px;
}

.cal-allday-events {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 32px;
}

.cal-allday-empty {
  font-size: 12px;
  color: #9aa0a6;
}

.cal-allday-add {
  margin-left: auto;
}

.cal-timed-scroll {
  overflow: auto;
  max-height: min(70vh, 760px);
  background: #fff;
}

.cal-timed-grid {
  display: grid;
  grid-template-columns: 56px 1fr;
  min-height: calc(var(--cal-hour-height) * 24);
  position: relative;
}

.cal-week-timed-grid {
  grid-template-columns: 56px repeat(7, minmax(0, 1fr));
}

.cal-time-gutter {
  position: relative;
}

.cal-time-slot {
  height: var(--cal-hour-height);
  position: relative;
}

.cal-time-label {
  position: absolute;
  top: -0.6em;
  right: 8px;
  font-size: 11px;
  color: #80868b;
  line-height: 1;
}

.cal-time-slot:first-child .cal-time-label {
  top: 4px;
}

.cal-day-canvas {
  position: relative;
  border-left: 1px solid #e8eaed;
  min-height: calc(var(--cal-hour-height) * 24);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--cal-hour-height) - 1px),
      #f1f3f4 calc(var(--cal-hour-height) - 1px),
      #f1f3f4 var(--cal-hour-height)
    );
}

.cal-day-canvas.is-today {
  background-color: #f8fbff;
}

.cal-hour-line {
  height: var(--cal-hour-height);
  box-sizing: border-box;
}

.cal-timed-event {
  position: absolute;
  left: 4px;
  right: 4px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 22px;
  padding: 4px 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cal-timed-event-time {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.85;
}

.cal-week-header {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.cal-week-gutter-spacer {
  border-right: 1px solid #e8eaed;
}

.cal-week-day-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  border-left: 1px solid #f1f3f4;
  text-align: center;
}

.cal-week-day-head.is-today {
  background: #e8f0fe;
}

.cal-week-day-head.is-holiday .cal-week-daynum {
  color: #c5221f;
}

.cal-week-day-head.sun .cal-week-weekday,
.cal-week-day-head.sun .cal-week-daynum {
  color: #c5221f;
}

.cal-week-day-head.sat .cal-week-weekday,
.cal-week-day-head.sat .cal-week-daynum {
  color: #1a73e8;
}

.cal-week-weekday {
  font-size: 12px;
  color: #5f6368;
}

.cal-week-daynum {
  font-size: 18px;
  font-weight: 600;
  color: #202124;
  text-decoration: none;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.cal-week-day-head.is-today .cal-week-daynum {
  background: #1a73e8;
  color: #fff;
}

.cal-week-holiday {
  font-size: 10px;
  color: #c5221f;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-allday-row.cal-week-allday {
  /* ヘッダー／時間グリッドと同じ 8 列にして列ずれを防ぐ */
  grid-template-columns: 56px repeat(7, minmax(0, 1fr));
  gap: 0;
  padding: 6px 0;
  align-items: start;
}

.cal-week-allday > .cal-allday-label {
  padding: 4px 4px 0;
  box-sizing: border-box;
}

.cal-week-allday-cols {
  display: contents;
}

.cal-week-allday-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 36px;
  min-width: 0;
  padding: 2px;
  border-left: 1px solid #f1f3f4;
  box-sizing: border-box;
}

.cal-week-allday-col .day-add-btn {
  align-self: flex-start;
  margin: 0;
  flex: 0 0 auto;
  order: -1; /* 念のため常に最上段 */
}

/* Year view */
.calendar-year-view {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
}

.cal-year-month {
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.cal-year-month-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.cal-year-month-title a {
  color: #174ea6;
  text-decoration: none;
}

.cal-year-month-title a:hover {
  text-decoration: underline;
}

.cal-year-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 4px;
  font-size: 11px;
  color: #80868b;
  text-align: center;
}

.cal-year-weekdays .sun { color: #c5221f; }
.cal-year-weekdays .sat { color: #1a73e8; }

.cal-year-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.cal-year-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 6px;
  text-decoration: none;
  color: #202124;
  font-size: 12px;
}

.cal-year-day:hover {
  background: #f1f3f4;
}

.cal-year-day.other-month {
  color: #bdc1c6;
}

.cal-year-day.is-today .cal-year-daynum {
  background: #1a73e8;
  color: #fff;
  border-radius: 999px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-year-day.is-holiday .cal-year-daynum {
  color: #c5221f;
}

.cal-year-day.is-today.is-holiday .cal-year-daynum {
  color: #fff;
}

.cal-year-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #1a73e8;
  margin-top: 1px;
}

@media (max-width: 900px) {
  .calendar-year-view {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cal-week-holiday {
    display: none;
  }
}

@media (max-width: 720px) {
  .calendar-year-view {
    grid-template-columns: 1fr;
  }

  .calendar-view-switch {
    width: 100%;
  }

  .calendar-view-btn {
    flex: 1;
  }

  .calendar-toolbar-inline .calendar-view-switch {
    width: auto !important;
  }

  .calendar-toolbar-inline .calendar-view-btn {
    flex: 0 0 auto !important;
  }

  .cal-allday-row:not(.cal-week-allday) {
    grid-template-columns: 32px 1fr;
  }

  .cal-allday-row.cal-week-allday {
    grid-template-columns: 32px repeat(7, minmax(0, 1fr)) !important;
    padding: 4px 0;
    gap: 0;
  }

  /* 日表示のみ。週表示は下で7列を維持 */
  .cal-timed-grid:not(.cal-week-timed-grid) {
    grid-template-columns: 32px 1fr;
  }

  /* スマホ週表示: 横スクロールせず7日を画面幅に収める */
  .calendar-week-view {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .cal-week-timed-grid,
  .cal-week-header {
    grid-template-columns: 32px repeat(7, minmax(0, 1fr)) !important;
    min-width: 0 !important;
    width: 100%;
  }

  .calendar-week-view .cal-timed-scroll,
  .calendar-week-view .cal-week-header {
    overflow-x: hidden;
  }

  .cal-week-day-head {
    padding: 8px 1px;
    min-width: 0;
  }

  .cal-week-weekday {
    font-size: 10px;
  }

  .cal-week-daynum {
    font-size: 14px;
    width: 24px;
    height: 24px;
    line-height: 24px;
  }

  .cal-week-allday-col {
    padding: 2px 1px;
    min-width: 0;
  }

  .cal-week-allday-col .event-chip {
    font-size: 8px;
    padding: 1px 2px;
  }

  .cal-week-allday-col .day-add-btn {
    min-width: 24px;
    min-height: 24px;
    font-size: 16px;
  }

  .cal-time-label {
    right: 2px;
    font-size: 9px;
  }
}

.day-modal-note-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff9c4;
  border: 1px solid #f6e05e;
  color: #3c4043;
  font: inherit;
  cursor: pointer;
}

.day-modal-note-link:hover {
  background: #fff3b0;
}

.mobile-agenda-note {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.event-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-more {
  font-size: 11px;
  color: #6b7280;
  background: transparent;
  border: none;
  padding: 0 4px;
  cursor: pointer;
  text-align: left;
}

.event-more:hover {
  text-decoration: underline;
}

.calendar-day.is-quick-add-open {
  overflow: visible;
  z-index: 5;
}

.quick-add {
  margin-top: 6px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.quick-add textarea {
  width: 100%;
  min-height: 60px;
  padding: 6px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  resize: vertical;
}

.quick-add-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.quick-add-actions button {
  padding: 4px 8px;
  font-size: 11px;
}

.quick-add-modal-form textarea {
  min-height: 120px;
  resize: vertical;
}

.quick-add-modal-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.quick-add-modal-actions .button-link.secondary,
#todo-modal-memo-btn {
  margin-right: auto;
}
.todo-quick-add-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.todos-calendar-panel .calendar-day,
.todos-calendar-panel .cal-day-canvas,
.todos-calendar-panel .cal-week-allday-col,
.todos-calendar-panel .calendar-day-view {
  cursor: pointer;
}

.todos-calendar-panel .calendar-day {
  display: flex;
  flex-direction: column;
}

.todos-calendar-panel .day-events {
  flex: 1 1 auto;
  min-height: 20px;
}

.calendar-sidebar h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.undated-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.undated-list li {
  padding: 6px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}

.undated-list li.done {
  color: #9ca3af;
  text-decoration: line-through;
}

.undated-list li.done .undated-open {
  color: #9ca3af;
  text-decoration: line-through;
}

.undated-list li.done .undated-open:hover {
  text-decoration: line-through underline;
}

.undated-open {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #1a73e8;
  cursor: pointer;
  text-align: left;
}

.undated-open:hover {
  text-decoration: underline;
}

/* Modal */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-dialog {
  position: relative;
  width: min(480px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: white;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  padding: 20px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: #f3f4f6;
  color: #374151;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-form {
  display: grid;
  gap: 12px;
}

.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}

.modal-form label.inline-check,
.modal-form label.schedule-toggle {
  flex-direction: row;
  align-items: center;
  align-self: flex-start;
  width: auto;
  white-space: nowrap;
  gap: 8px;
}

.modal-form label.inline-check input[type="checkbox"],
.modal-form label.schedule-toggle input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0;
}

.modal-form .schedule-option {
  margin-top: 0;
}

.modal-form textarea,
.modal-form input[type="date"],
.modal-form input[type="datetime-local"],
.modal-form input[type="text"],
.modal-form input[type="password"],
.modal-form input[type="email"],
.modal-form input[type="number"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: white;
  box-sizing: border-box;
  min-height: 42px;
}

.modal-form input[type="datetime-local"] {
  color: #111827;
  color-scheme: light;
  appearance: none;
}

.modal-form input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.55;
  width: 18px;
  height: 18px;
}

.modal-form select {
  min-height: 42px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.modal-delete-form {
  display: none;
}

.modal-day-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.modal-day-list li {
  border-bottom: 1px solid #f3f4f6;
}

.modal-day-list button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 12px 4px;
  font: inherit;
  font-size: 14px;
  color: #1f2937;
  cursor: pointer;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-day-list button:hover {
  background: #f8fafc;
}

.modal-day-list button.done {
  color: #9ca3af;
  text-decoration: line-through;
}

.modal-day-list button.done .event-title {
  text-decoration: line-through;
}

.modal-date-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 13px;
  color: #4b5563;
}

.modal-date-mode .field-label {
  font-weight: 600;
}

.modal-date-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.modal-date-fields:has(#modal-end-date-label.date-panel-hidden) {
  grid-template-columns: minmax(0, 1fr);
}

.modal-form #modal-group-id:disabled {
  opacity: 0.7;
  cursor: default;
}

.event-chip.is-dragging,
.note-chip.is-dragging {
  opacity: 0.45;
}

.calendar-day.is-drop-target {
  outline: 2px solid #1a73e8;
  outline-offset: -2px;
  background: #e8f0fe;
}

.todos-display-toggle {
  display: inline-flex;
  border: 1px solid #dadce0;
  border-radius: 8px;
  overflow: hidden;
  margin-left: 8px;
  vertical-align: middle;
}

.todos-display-toggle a,
.todos-display-toggle button {
  padding: 6px 12px;
  font-size: 13px;
  color: #5f6368;
  text-decoration: none;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.todos-display-toggle a + a,
.todos-display-toggle a + button,
.todos-display-toggle button + a,
.todos-display-toggle button + button {
  border-left: 1px solid #dadce0;
}

.todos-display-toggle button {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: inherit;
  margin: 0;
}

.todos-display-toggle a.is-active {
  background: #e8f0fe;
  color: #1a73e8;
  font-weight: 600;
}

.todo-modal-title-block {
  display: grid;
  gap: 8px;
}

.todo-modal-title-label-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.todo-modal-title-label-row #modal-title-label {
  flex: 0 0 auto;
  margin: 0;
  font-size: 13px;
  color: #4b5563;
  white-space: nowrap;
}

.todo-shortcut-icons {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: nowrap;
  overflow: visible;
}

.todo-shortcut-icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border: 1px solid #d2e3fc;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f8ff 100%);
  box-shadow: 0 4px 10px rgba(26, 115, 232, 0.12);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.todo-shortcut-icon-btn:hover,
.todo-shortcut-icon-btn:focus-visible {
  border-color: #1a73e8;
  background: #e8f0fe;
  outline: none;
}

.todo-shortcut-icon-btn.is-more {
  font-size: 18px;
  color: #5f6368;
}

.todo-modal-title-input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid #d2e3fc;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  font: inherit;
  font-size: 15px;
  color: #202124;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.todo-modal-title-input:hover {
  border-color: #aecbfa;
}

.todo-modal-title-input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.18);
}

.todo-shortcut-picker {
  margin: 0;
  border: 1px solid #d2e3fc;
  border-radius: 12px;
  background: #f7faff;
  padding: 10px;
}

.todo-shortcut-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.todo-shortcut-picker-head strong {
  font-size: 13px;
}

.todo-shortcut-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
}

.todo-shortcut-picker-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: none;
  color: #202124;
}

.todo-shortcut-picker-item:hover {
  background: #e8f0fe;
}

.todo-shortcut-picker-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: #5f6368;
}

.todo-shortcut-save-picker {
  margin: 0 0 12px;
  border: 1px solid #d2e3fc;
  border-radius: 12px;
  background: #f8fbff;
  overflow: hidden;
}

.todo-shortcut-save-picker .todo-shortcut-picker-list {
  max-height: 180px;
}

.todo-shortcut-settings h3 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.todo-shortcut-settings > .hint {
  margin-bottom: 16px;
}

.todo-shortcut-card {
  display: grid;
  gap: 14px;
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid rgba(26, 115, 232, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.todo-shortcut-card h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #174ea6;
}

.todo-shortcut-field {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: #3c4043;
}

.todo-shortcut-field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: #3c4043;
}

.todo-shortcut-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #d2e3fc;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font: inherit;
  font-size: 15px;
  color: #202124;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.todo-shortcut-input:hover {
  border-color: #aecbfa;
}

.todo-shortcut-input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.18);
}

.todo-shortcut-input[type="time"] {
  min-width: 0;
}

.todo-shortcut-primary-btn,
.todo-shortcut-secondary-btn {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.todo-shortcut-primary-btn {
  background: linear-gradient(180deg, #2b7de9 0%, #1a73e8 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(26, 115, 232, 0.28);
}

.todo-shortcut-secondary-btn {
  background: #eef3ff;
  color: #174ea6;
}

.todo-shortcut-text-danger {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: #c5221f;
  box-shadow: none;
  padding: 6px 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.todo-shortcut-icon-pick {
  border: 1px dashed #c5d8f7;
  border-radius: 14px;
  padding: 12px;
  margin: 0;
  background: rgba(255, 255, 255, 0.7);
}

.todo-shortcut-icon-pick legend {
  padding: 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: #5f6368;
}

.todo-shortcut-icon-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.todo-shortcut-icon-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #e0e7ff;
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.todo-shortcut-icon-choice:hover {
  transform: translateY(-1px);
  border-color: #1a73e8;
}

.todo-shortcut-icon-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.todo-shortcut-icon-choice:has(input:checked) {
  border-color: #1a73e8;
  background: #e8f0fe;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.16);
}

.todo-shortcut-cat-list {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.todo-shortcut-cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.todo-shortcut-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #e8f0fe;
  font-size: 22px;
}

.todo-shortcut-cat-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.todo-shortcut-cat-meta strong {
  font-size: 16px;
}

.todo-shortcut-cat-meta span {
  font-size: 12px;
  color: #5f6368;
}

.todo-shortcut-fold {
  border: 1px solid #e8eef8;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
}

.todo-shortcut-fold-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
  color: #174ea6;
}

.todo-shortcut-fold-summary::-webkit-details-marker {
  display: none;
}

.todo-shortcut-fold-caret {
  margin-left: auto;
  color: #5f6368;
  transition: transform 0.15s ease;
}

.todo-shortcut-fold[open] > .todo-shortcut-fold-summary .todo-shortcut-fold-caret {
  transform: rotate(180deg);
}

.todo-shortcut-fold-body,
.todo-shortcut-fold > .todo-shortcut-title-form,
.todo-shortcut-fold > .todo-shortcut-edit-cat,
.todo-shortcut-fold > .todo-shortcut-add-cat,
.todo-shortcut-fold > .todo-shortcut-add-title {
  padding: 0 12px 12px;
}

.todo-shortcut-add-cat-fold,
.todo-shortcut-add-title-fold {
  margin-bottom: 12px;
}

.todo-shortcut-title-summary-text {
  flex: 1 1 auto;
  min-width: 0;
  color: #202124;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-shortcut-title-summary-meta {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: #5f6368;
  background: #eef3ff;
  border-radius: 999px;
  padding: 2px 8px;
}

.todo-shortcut-title-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.todo-shortcut-title-item {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.todo-shortcut-title-delete {
  margin-top: 8px;
}

.todo-shortcut-title-form,
.todo-shortcut-add-title,
.todo-shortcut-edit-cat,
.todo-shortcut-add-cat {
  display: grid;
  gap: 12px;
}

.todo-shortcut-settings [data-time-panel][hidden] {
  display: none !important;
}

.todo-shortcut-notify {
  margin-top: 4px;
}

.todo-shortcut-notify .notify-settings-wrap.is-disabled {
  opacity: 0.55;
}

.todo-shortcut-notify .notify-settings {
  background: rgba(255, 255, 255, 0.92);
}

.todo-shortcut-time-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.todo-shortcut-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.todo-shortcut-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.todo-shortcut-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #d2e3fc;
  background: #fff;
  color: #3c4043;
  font-size: 13px;
  font-weight: 600;
}

.todo-shortcut-chip:has(input:checked) span {
  border-color: #1a73e8;
  background: #e8f0fe;
  color: #174ea6;
}

.todo-shortcut-time-fields {
  display: grid;
  gap: 8px;
}

.todo-shortcut-time-range {
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
}

.todo-shortcut-time-sep {
  padding-bottom: 12px;
  color: #5f6368;
  font-weight: 700;
}

.todo-shortcut-inline-form {
  margin: 0;
  justify-self: end;
}

@media (max-width: 768px) {
  .todo-shortcut-icon-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 15px;
  }

  .todo-shortcut-time-range {
    grid-template-columns: 1fr;
  }

  .todo-shortcut-time-sep {
    display: none;
  }
}

.modal.modal-centered .modal-dialog.todo-gcal-dialog {
  max-width: min(640px, 100%);
  width: min(640px, 100%);
}

.todo-gcal-modal-body {
  padding: 12px 16px 16px;
  max-height: min(70vh, 640px);
  overflow: auto;
}

.todo-gcal-modal-body .google-calendar-embed h3 {
  margin: 16px 0 6px;
  font-size: 15px;
}

.todos-calendar-panel {
  margin-top: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.todos-calendar-panel .calendar-toolbar {
  margin-bottom: 0;
  border-bottom: 1px solid #e5e7eb;
}

.todos-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.todos-calendar-toolbar .month-label {
  font-size: 16px;
  font-weight: 700;
  color: #202124;
}

.todos-calendar-toolbar .nav-group {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.todos-filter-accordion {
  margin-bottom: 12px;
}

.todos-mobile-agenda {
  display: none;
}

.day-event-count {
  display: none;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #1a73e8;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.event-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #3b82f6;
  flex-shrink: 0;
}

.event-dot.importance-high {
  background: #dc2626;
}

.event-dot.importance-low {
  background: #94a3b8;
}

.event-dot.done {
  background: #cbd5e1;
}

.event-dot-more {
  font-size: 9px;
  color: #6b7280;
  font-weight: 600;
  line-height: 1;
}

.calendar-toolbar-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.calendar-action-btn {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.calendar-action-icon {
  display: none;
  font-size: 16px;
  line-height: 1;
}

.calendar-action-label {
  display: inline;
}

.calendar-height-resizer {
  display: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
  padding: 2px 12px 10px;
  text-align: center;
  border-top: 1px solid #e8eaed;
  background: #fff;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

.calendar-height-resizer-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  /* 見た目は丸でも、指で掴める領域は約44px確保 */
  width: 56px;
  min-width: 56px;
  height: 44px;
  min-height: 44px;
  margin: 0 auto;
  cursor: ns-resize;
  touch-action: none;
  border: none;
  background: transparent;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.calendar-height-resizer-knob {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #9aa0a6;
  box-shadow: 0 1px 3px rgba(23, 27, 31, 0.18);
  box-sizing: border-box;
  pointer-events: none;
}

.calendar-height-resizer-knob-grip {
  display: block;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: #9aa0a6;
  box-shadow: 0 3px 0 #9aa0a6, 0 -3px 0 #9aa0a6;
}

.calendar-height-resizer.is-dragging,
.calendar-height-resizer-handle.is-dragging {
  background: transparent;
}

.calendar-height-resizer.is-dragging .calendar-height-resizer-knob,
.calendar-height-resizer-handle.is-dragging .calendar-height-resizer-knob {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2), 0 1px 3px rgba(23, 27, 31, 0.18);
}

.calendar-height-resizer.is-dragging .calendar-height-resizer-knob-grip,
.calendar-height-resizer-handle.is-dragging .calendar-height-resizer-knob-grip {
  background: #1a73e8;
  box-shadow: 0 3px 0 #1a73e8, 0 -3px 0 #1a73e8;
}

body.cal-height-dragging {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.list-toolbar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.list-toolbar-title-row h2 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.list-toolbar-title-row .todos-display-toggle {
  margin-left: 0;
  flex: 0 0 auto;
}

.modal.modal-centered .modal-dialog {
  border-radius: 16px;
  max-width: min(480px, 100%);
}

.modal.modal-centered .modal-dialog.note-edit-dialog {
  max-width: min(840px, 100%);
  width: min(840px, 100%);
}

.note-edit-form .checklist-editor {
  max-height: 240px;
  overflow: auto;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
}

.note-edit-form .checklist-row .checklist-text {
  border-bottom: 1px solid #eee;
}

.note-edit-form textarea,
.note-edit-form input[type="text"] {
  width: 100%;
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
  box-shadow: none;
  font: inherit;
  padding: 4px 0;
  border-radius: 0;
}

.note-edit-form input[type="text"] {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: #202124;
  resize: none;
}

.note-edit-form textarea {
  font-size: 14px;
  line-height: 1.5;
  color: #3c4043;
  min-height: 140px;
}

.note-edit-form label:has(#note-edit-title),
.note-edit-form label:has(#note-edit-body) {
  gap: 2px;
  color: #80868b;
  font-size: 12px;
}

.note-edit-form .note-composer-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  align-items: start;
  margin-bottom: 4px;
}

.note-edit-form .note-date-field,
.note-edit-form .note-category-field,
.note-edit-form .note-share-field,
.modal-form.note-edit-form label.note-date-field,
.modal-form.note-edit-form label.note-category-field,
.modal-form.note-edit-form label.note-share-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  margin: 0;
}

.note-edit-form .note-date-field .field-label,
.note-edit-form .note-category-field .field-label,
.note-edit-form .note-share-field .field-label {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.2;
}

.note-edit-form .note-date-field input[type="date"],
.note-edit-form .note-category-field select,
.note-edit-form .note-share-field select {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: inherit;
}

.note-compose-form textarea,
.note-compose-form input[type="text"],
.note-compose-form input[type="date"] {
  width: 100%;
}

.note-compose-form .note-date-field input[type="date"] {
  width: auto;
  flex: 0 1 auto;
}

.note-compose-form .note-composer-footer {
  margin-top: 12px;
}

.note-modal-dialog {
  background: var(--note-bg, #fff);
  border: 1px solid var(--note-border, #dadce0);
}

.note-modal-meta {
  margin: 0 0 12px;
  font-size: 13px;
  color: #5f6368;
}

.note-modal-content {
  margin-bottom: 16px;
}

.note-modal-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  font-size: 14px;
  color: #3c4043;
}

.note-modal-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.note-modal-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.note-modal-checklist li.is-done span:last-child {
  text-decoration: line-through;
  color: #80868b;
}

.settings-steps {
  margin: 8px 0 0;
  padding-left: 20px;
  line-height: 1.8;
}

.info-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
  color: #4b5563;
}

.holiday-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.inline-form {
  margin: 0;
}

.holiday-add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.holiday-date-block {
  grid-column: 1 / -1;
}

.date-mode-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.date-mode-radios {
  display: flex;
  gap: 12px;
}

.date-mode-fields {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.date-mode-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-mode-inputs input[type="date"] {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}

.inline-date-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}

.field-label {
  font-size: 13px;
  color: #4b5563;
}

.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}

.holiday-add-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}

.holiday-add-form input[type="date"],
.holiday-add-form input[type="text"] {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}

.holiday-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.holiday-table th,
.holiday-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}

.holiday-table th {
  font-size: 12px;
  color: #6b7280;
  background: #fafafa;
}

.holiday-table .empty-cell {
  color: #6b7280;
  text-align: center;
  padding: 20px;
}

.holiday-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.holiday-type.national {
  background: #fee2e2;
  color: #b91c1c;
}

.holiday-type.custom {
  background: #e0e7ff;
  color: #3730a3;
}

.holiday-type.national_ph {
  background: #dbeafe;
  color: #1d4ed8;
}

.holiday-type.national_ph {
  background: #dbeafe;
  color: #1d4ed8;
}

.holiday-type.weekday {
  background: #d1fae5;
  color: #047857;
}

.weekday-rule-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
}

.weekday-rule-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}

.weekday-rule-form input[type="date"],
.weekday-rule-form input[type="text"],
.weekday-rule-form textarea {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}

.weekday-checkboxes {
  grid-column: 1 / -1;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
}

.weekday-check-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px 10px;
  overflow-x: auto;
}

.weekday-checkboxes legend {
  font-size: 13px;
  color: #4b5563;
  padding: 0 6px;
  margin-bottom: 6px;
}

.weekday-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
}

.exclude-holiday-check {
  margin-top: 8px;
}

.selected-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e5e7eb;
}

.selected-preview-label {
  font-size: 12px;
  color: #6b7280;
}

.selected-preview-items {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.exception-picker-field {
  grid-column: 1 / -2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exception-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exception-picker input[type="date"] {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}

.exception-preview {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.exception-chip.removable {
  cursor: pointer;
}

.weekday-rule-form button[type="submit"] {
  align-self: end;
}

.weekday-rule-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fafafa;
}

.weekday-rule-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.weekday-rule-period {
  font-size: 13px;
  color: #6b7280;
}

.weekday-rule-days {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.weekday-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #d1fae5;
  color: #047857;
  font-size: 12px;
  font-weight: 600;
}

.weekday-exceptions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.exceptions-label {
  font-size: 13px;
  color: #4b5563;
}

.inline-hint {
  margin: 0;
}

.exception-chip {
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
}

.exception-chip:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.exception-add-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.exception-add-form input[type="date"] {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12px;
}

.empty-hint {
  margin-top: 0;
}

button.mini-btn,
a.mini-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a.mini-btn {
  background: #fff;
  color: #1f2937;
  border: 1px solid #d1d5db;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

a.mini-btn:hover,
a.mini-btn:focus-visible {
  background: #f8fafc;
  border-color: #9ca3af;
}

.calendar-day.is-holiday.is-holiday-national,
.calendar-day.is-holiday:not([class*="is-holiday-"]) {
  background: #fff1f2;
}

.calendar-day.is-holiday.is-holiday-national.other-month,
.calendar-day.is-holiday:not([class*="is-holiday-"]).other-month {
  background: #fdf2f8;
}

.calendar-day.is-holiday.is-holiday-national.today,
.calendar-day.is-holiday:not([class*="is-holiday-"]).today {
  background: #ffe4e6;
}

.calendar-day.is-holiday.is-holiday-national .day-num,
.calendar-day.is-holiday:not([class*="is-holiday-"]) .day-num {
  color: #dc2626;
  font-weight: 700;
}

.calendar-day.is-holiday.is-holiday-national.today .day-num,
.calendar-day.is-holiday:not([class*="is-holiday-"]).today .day-num {
  background: #dc2626;
  color: white;
}

.calendar-day.is-holiday.is-holiday-national .holiday-label,
.calendar-day.is-holiday:not([class*="is-holiday-"]) .holiday-label {
  color: #dc2626;
}

.calendar-day.is-holiday.is-holiday-national_ph {
  background: #eff6ff;
}

.calendar-day.is-holiday.is-holiday-national_ph.other-month {
  background: #f0f9ff;
}

.calendar-day.is-holiday.is-holiday-national_ph.today {
  background: #dbeafe;
}

.calendar-day.is-holiday.is-holiday-national_ph .day-num {
  color: #2563eb;
  font-weight: 700;
}

.calendar-day.is-holiday.is-holiday-national_ph.today .day-num {
  background: #2563eb;
  color: white;
}

.calendar-day.is-holiday.is-holiday-national_ph .holiday-label {
  color: #2563eb;
}

.calendar-day.is-holiday.is-holiday-custom {
  background: #eef2ff;
}

.calendar-day.is-holiday.is-holiday-custom.other-month {
  background: #f5f3ff;
}

.calendar-day.is-holiday.is-holiday-custom.today {
  background: #e0e7ff;
}

.calendar-day.is-holiday.is-holiday-custom .day-num {
  color: #4338ca;
  font-weight: 700;
}

.calendar-day.is-holiday.is-holiday-custom.today .day-num {
  background: #4338ca;
  color: white;
}

.calendar-day.is-holiday.is-holiday-custom .holiday-label {
  color: #4338ca;
}

.calendar-day.is-holiday.is-holiday-weekday {
  background: #ecfdf5;
}

.calendar-day.is-holiday.is-holiday-weekday.other-month {
  background: #f0fdf4;
}

.calendar-day.is-holiday.is-holiday-weekday.today {
  background: #d1fae5;
}

.calendar-day.is-holiday.is-holiday-weekday .day-num {
  color: #059669;
  font-weight: 700;
}

.calendar-day.is-holiday.is-holiday-weekday.today .day-num {
  background: #059669;
  color: white;
}

.calendar-day.is-holiday.is-holiday-weekday .holiday-label {
  color: #059669;
}

.holiday-label {
  font-size: 10px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .holiday-add-form {
    grid-template-columns: 1fr;
  }

  .weekday-rule-form {
    grid-template-columns: 1fr;
  }

  .exception-picker-field {
    grid-column: 1;
  }

  .weekday-check-row {
    flex-wrap: wrap;
  }
}

/* LINE integration settings */
.line-integration-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.line-integration-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 20px;
  align-items: start;
}

.line-settings-form label,
.line-qr-field {
  display: block;
  margin-bottom: 16px;
}

.line-settings-form input[type="text"],
.line-settings-form input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.line-settings-form input[type="file"] {
  padding: 8px;
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: #6b7280;
}

.field-hint code {
  font-size: 11px;
  word-break: break-all;
}

.required {
  color: #dc2626;
}

.line-status-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.line-status-banner.enabled {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #86efac;
}

.line-status-banner.disabled {
  background: #f9fafb;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.line-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.line-status-text {
  margin: 4px 0 0;
  font-size: 13px;
}

.line-qr-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}

.line-qr-preview img {
  border-radius: 4px;
  object-fit: cover;
}

.line-qr-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.line-qr-meta code {
  font-size: 11px;
  color: #6b7280;
  word-break: break-all;
}

.line-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.line-form-actions button.secondary {
  background: #fff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.line-form-actions button.secondary:hover {
  background: #f9fafb;
}

.line-test-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.line-help-panel h3 {
  margin: 20px 0 10px;
  font-size: 15px;
}

.line-notify-examples {
  margin-top: 8px;
}

.line-notify-examples .info-list {
  margin: 0;
}

.line-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.line-users-table th,
.line-users-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}

.line-users-table th {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: #f9fafb;
}

.line-user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.line-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.line-user-avatar.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e5e7eb;
  font-size: 18px;
}

.line-user-id {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #6b7280;
  word-break: break-all;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.active {
  background: #dcfce7;
  color: #166534;
}

.status-badge.inactive {
  background: #f3f4f6;
  color: #6b7280;
}

button.link,
.line-users-table button.link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

button.link.danger,
.line-qr-delete-form button {
  color: #dc2626;
}

.empty-cell {
  text-align: center;
  color: #9ca3af;
  padding: 24px !important;
}

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

/* ===== Google Keep style notes ===== */
.notes-page {
  background: #f8f9fa;
}

.notes-main {
  max-width: min(1480px, 100%);
  margin: 0 auto;
}

.notes-top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.notes-top-actions > .button-link,
.notes-top-actions > a.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  box-sizing: border-box;
  flex: 0 0 auto;
}

.notes-filter-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.notes-filter-form-inline {
  flex: 1 1 280px;
}

.notes-top-trailing {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

.notes-period-form {
  margin: 0;
}

.notes-period-label,
.notes-status-filter,
.notes-category-filter,
.notes-jump-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #3c4043;
  margin: 0;
  min-height: 38px;
}

.notes-period-label.is-filtered {
  color: #1a73e8;
  font-weight: 600;
}

.notes-period-label.is-filtered select {
  border-color: #93c5fd;
  background: #eef4ff;
  color: #1a73e8;
  font-weight: 600;
}

.notes-period-label select,
.notes-status-filter select,
.notes-category-filter select,
.notes-jump-filter select,
.notes-search-label input[type="search"] {
  box-sizing: border-box;
  min-height: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
}

.notes-period-label select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.notes-month-group + .notes-month-group {
  margin-top: 18px;
}

.notes-month-heading {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #3c4043;
}

.note-card.is-completed {
  opacity: 0.72;
}

.note-card.is-completed .note-card-title,
.note-card.is-completed .note-card-body {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.note-complete-btn {
  color: #5f6368;
}

.note-complete-btn .note-complete-icon {
  display: block;
  flex-shrink: 0;
}

.note-complete-btn:hover {
  color: #188038;
  background: rgba(24, 128, 56, 0.1);
}

.note-complete-btn.is-done {
  color: #188038;
}

.note-complete-btn.is-done:hover {
  color: #137333;
  background: rgba(24, 128, 56, 0.14);
}

/* グローバル button スタイルより後から上書きし、ビューポート右下に固定 */
body.notes-page .notes-attach-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  z-index: 120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #1a73e8;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 10px 28px rgba(26, 115, 232, 0.35);
  cursor: pointer;
}

body.notes-page .notes-attach-fab:hover {
  background: #1765cc;
}

body.notes-page .notes-year-dock {
  position: fixed;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px;
  border-radius: 999px;
  background: rgba(20, 24, 28, 0.86);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(8, 12, 16, 0.35);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.notes-page .notes-year-dock[hidden] {
  display: none !important;
}

body.notes-page .notes-year-dock.is-hiding {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

body.notes-page .notes-year-dock-field {
  display: flex;
  margin: 0;
}

body.notes-page .notes-year-dock select {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  min-height: 38px;
  height: 38px;
  margin: 0;
  padding: 0 30px 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

body.notes-page .notes-year-dock select option {
  color: #11151a;
}

body.notes-page .notes-year-dock-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
  min-height: 38px;
  height: 38px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #11151a;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
}

body.notes-page .notes-year-dock-top:hover {
  background: #e8eef5;
}

@media (max-width: 768px) {
  body.notes-page .notes-attach-fab {
    right: 12px;
    bottom: calc(136px + env(safe-area-inset-bottom, 0px));
    width: 48px;
    height: 48px;
  }

  body.notes-page .notes-year-dock {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 12px;
  }
}

.notes-search-label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 320px;
  min-height: 38px;
}

.notes-search-label input[type="search"] {
  width: 100%;
}

.notes-category-filter select {
  min-width: 120px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.notes-bulk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
}

.notes-bulk-bar:not(.has-selection) {
  display: none;
}

.notes-top-select-all {
  margin-right: 4px;
  flex: 0 0 auto;
}

.notes-filter-open-btn {
  display: none;
}

.notes-archive-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  box-sizing: border-box;
  flex: 0 0 auto;
  white-space: nowrap;
}

.note-bulk-select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
}

.notes-bulk-actions {
  flex: 1 1 auto;
}

.notes-page-summary,
.notes-selected-count {
  font-size: 13px;
  color: #5f6368;
  margin-left: auto;
}

.notes-selected-count[hidden] {
  display: none !important;
}

.notes-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 8px 0 24px;
}

.notes-pagination-label {
  font-size: 14px;
  color: #5f6368;
}

.note-bulk-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  margin: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
  line-height: 0;
}

.note-card:hover .note-bulk-check,
.note-card:focus-within .note-bulk-check,
.note-bulk-check:has(.note-check:checked) {
  opacity: 1;
}

.note-bulk-check .note-check {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  vertical-align: top;
}

.notes-view-list .note-bulk-check,
.notes-view-titles .note-bulk-check {
  position: static;
  opacity: 1;
  flex: 0 0 auto;
  padding-top: 14px;
  margin-left: 2px;
}

.notes-view-titles .note-bulk-check {
  padding-top: 8px;
}

.notes-input-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}

.notes-search {
  flex: 0 0 min(280px, 32%);
  min-width: 0;
}

.notes-search input[type="search"] {
  width: 100%;
  max-width: none;
  padding: 14px 16px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}

.notes-view-toggle {
  display: flex;
  flex: 0 0 auto;
  border: 1px solid #dadce0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}

.notes-view-btn {
  border: none;
  background: transparent;
  color: #5f6368;
  padding: 12px 14px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.notes-view-btn:hover {
  background: #f1f3f4;
}

.notes-view-btn.is-active {
  background: #e8f0fe;
  color: #1a73e8;
}

.notes-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #5f6368;
  margin: 8px 4px 12px;
  letter-spacing: 0.02em;
}

.notes-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  min-height: 36px;
}

.notes-section-header .notes-section-title {
  margin: 0;
  flex: 1 1 auto;
  min-height: 1em;
}

.notes-section-header .notes-cols-toggle {
  flex: 0 0 auto;
  margin-left: auto;
}

.notes-view-list .notes-section-header .notes-cols-toggle,
.notes-view-titles .notes-section-header .notes-cols-toggle,
.notes-cols-toggle[hidden] {
  display: none;
}

.notes-grid {
  margin-bottom: 24px;
}

/* 指定列数どおりに左→右へ配置（高いカードでも列を潰さない） */
.notes-view-gallery .notes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.notes-view-gallery.notes-cols-1 .notes-grid {
  grid-template-columns: minmax(0, 1fr);
}

.notes-view-gallery.notes-cols-2 .notes-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notes-view-gallery.notes-cols-3 .notes-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.notes-view-gallery.notes-cols-4 .notes-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.notes-view-gallery.notes-cols-5 .notes-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.notes-view-gallery .note-card {
  width: auto;
  height: auto;
  margin: 0;
  min-width: 0;
}

.notes-display-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.notes-cols-toggle {
  display: flex;
  border: 1px solid #dadce0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}

.notes-cols-btn {
  border: none;
  background: transparent;
  color: #5f6368;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  min-width: 34px;
}

.notes-cols-btn:hover {
  background: #f1f3f4;
}

.notes-cols-btn.is-active {
  background: #e8f0fe;
  color: #1a73e8;
}
.note-attachments-field {
  margin: 10px 0 4px;
  display: grid;
  gap: 6px;
}

.note-attachments-label {
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.note-attachments-label input[type="file"] {
  font-size: 13px;
}

.note-attachments-hint {
  margin: 0;
  font-size: 12px;
}

.note-attachment-picked,
.note-attachment-list,
.note-card-attachments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.note-attachment-picked li,
.note-attachment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 13px;
}

.note-attachment-remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #b42318;
  font-size: 12px;
  cursor: pointer;
}

.note-card-attachments {
  margin: 8px 0 4px;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}

.note-attachment-thumb {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(32, 33, 36, 0.12);
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.04);
}

.note-attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.note-attachment-file {
  display: grid;
  gap: 2px;
  grid-column: 1 / -1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(32, 33, 36, 0.12);
  background: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  color: inherit;
}

.note-attachment-name {
  font-size: 12px;
  font-weight: 560;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-attachment-size {
  font-size: 11px;
  color: var(--photos-muted, #5f6368);
}

.notes-view-list .note-card-attachments {
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  max-width: 280px;
}

.note-composer {
  flex: 1 1 360px;
  min-width: 0;
  max-width: none;
  margin: 0;
}

.note-composer-form {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
  overflow: hidden;
}

.note-composer-collapsed {
  padding: 14px 16px;
  color: #5f6368;
  cursor: text;
  font-size: 15px;
}

.note-composer-expanded {
  padding: 12px 16px 8px;
}

.note-composer-expanded input[type="text"],
.note-composer-expanded textarea,
.note-card-edit input[type="text"],
.note-card-edit textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  padding: 4px 0;
}

.note-composer-expanded input[type="text"] {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.note-composer-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
}

.note-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.note-color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--note-border, #dadce0);
  background: var(--note-color, #fff);
  cursor: pointer;
  padding: 0;
}

.note-color-dot.is-selected {
  box-shadow: 0 0 0 2px #1a73e8;
}

.note-composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-btn {
  border: none;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 4px;
}

.text-btn:hover {
  background: #f1f3f4;
}

.text-btn.is-active {
  background: #e8f0fe;
  color: #1a73e8;
  font-weight: 600;
}

.note-card {
  break-inside: avoid;
  background: var(--note-bg, #fff);
  border: 1px solid var(--note-border, #dadce0);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
  position: relative;
  height: auto;
  align-self: start;
  transition: box-shadow 0.15s ease;
}

.note-card:hover {
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.18);
}

/* ??????E????E??E????????E?E*/
@media (hover: hover) and (pointer: fine) {
  .notes-view-gallery .note-card:hover,
  .notes-view-gallery .note-card:focus-within {
    z-index: 30;
    box-shadow: 0 8px 28px rgba(60, 64, 67, 0.28);
  }

  .notes-view-gallery .note-card:hover .note-card-body,
  .notes-view-gallery .note-card:focus-within .note-card-body {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    white-space: pre-wrap;
    max-height: min(70vh, 960px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .notes-view-gallery .note-card:hover .note-checklist-preview,
  .notes-view-gallery .note-card:focus-within .note-checklist-preview {
    max-height: min(70vh, 960px);
    overflow-y: auto;
  }

  .notes-view-gallery .note-card:hover .note-checklist-preview.is-truncated::after,
  .notes-view-gallery .note-card:focus-within .note-checklist-preview.is-truncated::after {
    display: none;
  }

  .notes-view-list .note-card:hover .note-card-body,
  .notes-view-list .note-card:focus-within .note-card-body,
  .notes-view-list .note-card:hover .note-checklist-preview,
  .notes-view-list .note-card:focus-within .note-checklist-preview {
    max-height: min(50vh, 480px);
    overflow-y: auto;
  }

  .notes-view-list .note-card:hover .note-checklist-preview.is-truncated::after,
  .notes-view-list .note-card:focus-within .note-checklist-preview.is-truncated::after {
    display: none;
  }
}

.note-card.is-dragging {
  opacity: 0.55;
}

.note-drag-handle {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: #80868b;
  font-size: 14px;
  line-height: 1;
  cursor: grab;
  opacity: 0;
  touch-action: none;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.note-card:hover .note-drag-handle,
.note-card:focus-within .note-drag-handle,
.note-drag-handle:focus-visible {
  opacity: 1;
}

.note-drag-handle:hover,
.note-drag-handle:focus-visible {
  background: rgba(232, 240, 254, 0.95);
  color: #1a73e8;
  outline: none;
}

.note-drag-handle:active {
  cursor: grabbing;
}

.notes-view-list .note-drag-handle,
.notes-view-titles .note-drag-handle {
  position: static;
  opacity: 1;
  flex: 0 0 auto;
  margin-top: 10px;
}

.notes-view-titles .note-drag-handle {
  margin-top: 4px;
}

.note-card.is-highlighted {
  box-shadow: 0 0 0 2px #1a73e8, 0 2px 8px rgba(26, 115, 232, 0.2);
}

.note-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.note-card-date {
  font-size: 11px;
  color: #5f6368;
  margin: 0;
}

.note-card-category,
.note-card-share {
  font-size: 11px;
  color: #80868b;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.note-card-share {
  color: #5f6368;
}

.note-composer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 8px;
}

.note-date-field,
.note-category-field,
.note-share-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.note-date-field .field-label,
.note-category-field .field-label,
.note-share-field .field-label {
  font-size: 12px;
  color: #5f6368;
  white-space: nowrap;
}

.note-date-field input[type="date"],
.note-category-field select,
.note-share-field select {
  border: 1px solid #dadce0;
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: inherit;
  min-height: 30px;
  box-sizing: border-box;
}

.notes-date-filter {
  margin: 0;
  width: 100%;
}

.note-card-view {
  padding: 12px 14px 10px 38px;
  cursor: pointer;
}

.note-card.is-editing .note-card-view {
  display: none;
}

.note-card.is-editing .note-bulk-check {
  display: none;
}

.note-card-edit {
  display: none;
  padding: 12px 14px 8px 14px;
}

.note-card.is-editing .note-card-edit {
  display: block;
}

.note-pin-badge {
  position: absolute;
  top: 8px;
  right: 40px;
  font-size: 12px;
  opacity: 0.7;
}

.note-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: #202124;
  margin: 0 0 10px;
  padding: 0;
  border: none;
  padding-right: 28px;
  word-break: break-word;
}

.note-card-body {
  font-size: 14px;
  line-height: 1.55;
  color: #3c4043;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  border: none;
  padding: 0;
}

/* ?????: ????E0??????E??E??E???E??E*/
.notes-view-gallery .note-card-body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 20;
  overflow: hidden;
  white-space: pre-line;
}

.notes-view-gallery .note-checklist-preview {
  max-height: calc(1.45em * 20 + 4px * 19);
  overflow: hidden;
  position: relative;
}

.notes-view-gallery .note-checklist-preview.is-truncated::after {
  content: '?';
  display: block;
  margin-top: 2px;
  color: #80868b;
  font-size: 14px;
  line-height: 1.45;
}

.note-checklist-preview {
  list-style: none;
  margin: 0;
  padding: 0;
}

.note-checklist-preview li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 4px;
  word-break: break-word;
}

.note-checklist-preview li.is-done span:last-child {
  text-decoration: line-through;
  color: #80868b;
}

.check-icon {
  flex: 0 0 auto;
  font-size: 13px;
  line-height: 1.45;
}

.note-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 10px;
  opacity: 1;
  transition: opacity 0.15s ease;
}

.note-card:hover .note-card-actions,
.note-card:focus-within .note-card-actions {
  opacity: 1;
}

.note-inline-form {
  display: inline;
  margin: 0;
}

.note-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  color: #5f6368;
  flex-shrink: 0;
}

.note-icon-btn:hover {
  background: rgba(60, 64, 67, 0.08);
}

.note-icon-btn.danger {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.note-icon-btn.danger:hover {
  background: rgba(220, 38, 38, 0.16);
}

.checklist-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checklist-row .checklist-text {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  padding: 4px 0;
}

.checklist-remove {
  border: none;
  background: transparent;
  color: #80868b;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}

.notes-empty {
  text-align: center;
  color: #80868b;
  padding: 48px 16px;
}

.notes-view-list .notes-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  max-width: 100%;
}

.notes-view-list .note-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: auto;
  margin: 0;
  align-self: stretch;
  padding-left: 10px;
  box-sizing: border-box;
}

.notes-view-list .note-card-view {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  grid-template-areas:
    "date title actions"
    "date body actions";
  gap: 4px 14px;
  align-items: start;
  padding: 12px 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.notes-view-list .note-pin-badge {
  position: static;
  grid-area: actions;
  justify-self: end;
  margin-bottom: 4px;
}

.notes-view-list .note-card-meta {
  grid-area: date;
  margin: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
}

.notes-view-list .note-card-date {
  margin: 0;
  font-size: 12px;
}

.notes-view-list .note-card-title {
  grid-area: title;
  margin: 0;
  padding-right: 0;
  font-size: 15px;
}

.notes-view-list .note-card-body,
.notes-view-list .note-checklist-preview {
  grid-area: body;
  margin: 0;
  max-height: 3em;
  overflow: hidden;
}

.notes-view-list .note-checklist-preview li {
  margin-bottom: 2px;
}

.notes-view-list .note-card-actions {
  grid-area: actions;
  margin: 0;
  opacity: 1;
  align-self: end;
  justify-self: end;
}

.notes-view-list .note-card.is-editing .note-card-edit {
  flex: 1 1 auto;
  min-width: 0;
}

.notes-view-titles .notes-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  max-width: 100%;
}

.notes-view-titles .note-card {
  display: flex;
  align-items: center;
  gap: 4px;
  width: auto;
  margin: 0;
  align-self: stretch;
  padding-left: 4px;
  box-sizing: border-box;
  border-radius: 10px;
}

.notes-view-titles .note-card-view {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.notes-view-titles .note-pin-badge {
  /* 操作列にピンボタンがあるので一覧では省き、タイトル幅を確保 */
  display: none;
}

.notes-view-titles .note-card-meta,
.notes-view-titles .note-card-body,
.notes-view-titles .note-checklist-preview,
.notes-view-titles .note-card-attachments {
  display: none;
}

.notes-view-titles .note-card-title {
  flex: 1 1 10em;
  margin: 0;
  padding-right: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* 全角およそ10文字分は必ず見えるようにする */
  min-width: 10em;
}

.note-card-title-only {
  display: none;
}

.notes-view-titles .note-card-title-only {
  display: block;
  color: #5f6368;
  font-weight: 500;
}

.notes-view-titles .note-card-actions {
  flex: 0 1 auto;
  margin: 0;
  opacity: 1;
  align-self: center;
  min-width: 0;
  max-width: calc(100% - 10em);
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.notes-view-titles .note-card-actions::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.notes-view-titles .note-icon-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 13px;
}

.notes-view-titles .note-translate-label {
  display: none;
}

.notes-view-titles .note-card.is-editing .note-card-edit {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 520px) {
  .notes-view-titles .note-card-view {
    display: grid;
    grid-template-columns: minmax(10em, 1fr) auto;
    align-items: center;
    column-gap: 6px;
    row-gap: 0;
  }

  .notes-view-titles .note-card-title {
    grid-column: 1;
    min-width: 10em;
    width: auto;
  }

  .notes-view-titles .note-card-actions {
    grid-column: 2;
    max-width: none;
    justify-self: end;
  }

  .notes-view-titles .note-bulk-check,
  .notes-view-titles .note-drag-handle {
    flex: 0 0 auto;
  }
}

@media (max-width: 1100px) {
  .notes-view-gallery.notes-cols-5 .notes-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .notes-view-gallery.notes-cols-4 .notes-grid,
  .notes-view-gallery.notes-cols-5 .notes-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .notes-input-row {
    flex-wrap: wrap;
  }

  .notes-filter-form-inline {
    flex: 1 1 200px;
  }

  .notes-search-label {
    flex: 1 1 140px;
    max-width: none;
  }

  .note-composer {
    flex: 1 1 calc(100% - 56px);
  }

  .notes-view-toggle {
    flex: 0 0 auto;
  }

  /* タブレット幅: 多列指定を少し抑える（切替UIは残す） */
  .notes-view-gallery.notes-cols-4 .notes-grid,
  .notes-view-gallery.notes-cols-5 .notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  /* スマートフォン幅のみ: 横枚数切替を非表示、常に1列 */
  .notes-cols-toggle {
    display: none !important;
  }

  .notes-view-gallery .notes-grid,
  .notes-view-gallery.notes-cols-1 .notes-grid,
  .notes-view-gallery.notes-cols-2 .notes-grid,
  .notes-view-gallery.notes-cols-3 .notes-grid,
  .notes-view-gallery.notes-cols-4 .notes-grid,
  .notes-view-gallery.notes-cols-5 .notes-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  /* スマホ: 選択時はページ件数の代わりに選択件数を表示 */
  .notes-bulk-bar.has-selection .notes-page-summary {
    display: none;
  }

  .notes-archive-link {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .notes-top-actions-bar {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .notes-top-trailing {
    flex-wrap: nowrap;
    gap: 6px;
    margin-left: auto;
  }

  .notes-top-select-all {
    font-size: 13px;
    gap: 4px;
  }

  .notes-filter-form-inline {
    display: none !important;
    pointer-events: none !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
  }

  .notes-filter-open-btn {
    display: inline-flex !important;
  }

  #notes-filter-modal[hidden] {
    display: none !important;
    pointer-events: none !important;
  }

  #notes-filter-modal:not([hidden]) {
    display: flex !important;
    pointer-events: auto !important;
  }

  .notes-filter-modal-form {
    display: grid;
    gap: 14px;
    padding: 12px 16px 16px;
  }

  .notes-filter-modal-form .notes-period-label,
  .notes-filter-modal-form .notes-status-filter,
  .notes-filter-modal-form .notes-category-filter,
  .notes-filter-modal-form .notes-search-label {
    display: grid;
    gap: 6px;
    width: 100%;
    min-height: 0;
  }

  .notes-filter-modal-form .notes-period-label select,
  .notes-filter-modal-form .notes-status-filter select,
  .notes-filter-modal-form .notes-category-filter select,
  .notes-filter-modal-form .notes-search-label input[type="search"] {
    width: 100%;
    min-height: 42px;
    height: 42px;
  }

  .notes-filter-modal-form .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
  }

  /* タッチ端末でも選択チェックを見えるようにする */
  .note-bulk-check {
    opacity: 1;
  }
}

@media (min-width: 481px) {
  .notes-selected-count {
    display: none !important;
  }

  .notes-filter-open-btn,
  #notes-filter-modal {
    display: none !important;
    pointer-events: none !important;
  }
}

@media (max-width: 520px) {
  .notes-view-list .note-card-view {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "date actions"
      "title actions"
      "body actions";
  }

  .notes-view-list .note-card-date {
    align-self: start;
  }

  .note-card-actions {
    opacity: 1;
  }
}

/* ===== Finance (?????) ===== */
body.finance-page {
  background: #f3f6fb;
}

.finance-main {
  max-width: 1100px;
  margin: 0 auto;
}

.finance-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.finance-csv-panel {
  position: relative;
}

.finance-csv-panel > summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.finance-csv-panel > summary::-webkit-details-marker {
  display: none;
}

.finance-csv-panel-body {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 320px;
  max-width: 420px;
  padding: 12px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.finance-csv-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.finance-csv-import-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finance-csv-import-form-accounts {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e8eaed;
}

.finance-csv-form-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #202124;
}

.finance-csv-file-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.finance-csv-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #5f6368;
}

.notes-csv-panel {
  position: relative;
}

.notes-csv-panel > summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
}

.notes-csv-panel > summary::-webkit-details-marker {
  display: none;
}

.notes-csv-panel-body {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 300px;
  max-width: 400px;
  padding: 12px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.notes-csv-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.notes-csv-import-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notes-csv-form-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.notes-csv-file-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #5f6368;
}

.notes-csv-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: #5f6368;
}

.finance-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.finance-quick-entry {
  margin-bottom: 16px;
  padding: 16px;
  border: 2px solid #1a73e8;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.12);
}

.finance-quick-entry-head {
  margin-bottom: 10px;
}

.finance-quick-entry-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.finance-quick-entry-lead {
  margin: 0;
}

.finance-quick-entry-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.finance-quick-type-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.finance-quick-type-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid #dadce0;
  background: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.finance-quick-type-tab input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.finance-quick-type-tab.is-income.is-active,
.finance-quick-type-tab.is-income:has(input:checked) {
  background: #e6f4ea;
  border-color: #137333;
  color: #137333;
}

.finance-quick-type-tab.is-expense.is-active,
.finance-quick-type-tab.is-expense:has(input:checked) {
  background: #fce8e6;
  border-color: #c5221f;
  color: #c5221f;
}

.finance-quick-type-tab.is-transfer.is-active,
.finance-quick-type-tab.is-transfer:has(input:checked) {
  background: #e8f0fe;
  border-color: #1a73e8;
  color: #1a73e8;
}

.finance-expense-categories {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.finance-expense-categories[hidden] {
  display: none;
}

.finance-expense-category-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.finance-expense-category-btn:hover {
  border-color: #c5221f;
  color: #c5221f;
}

.finance-expense-category-btn.is-active {
  background: #fce8e6;
  border-color: #c5221f;
  color: #c5221f;
}

.finance-expense-category-btn.is-manage {
  border-style: dashed;
  color: #1a73e8;
  background: #f8fbff;
}

.finance-expense-category-btn.is-manage:hover,
.finance-expense-category-btn.is-manage:focus-visible {
  border-color: #1a73e8;
  color: #174ea6;
}

.finance-expense-category-empty {
  margin: 0 4px 0 0;
}

.finance-expense-manage-hint {
  margin: 0 16px 8px;
}

.finance-expense-other-rename {
  position: absolute;
  top: 4px;
  right: 30px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #80868b;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.finance-expense-other-rename:hover {
  background: #f1f3f4;
  color: #1a73e8;
}

.finance-expense-other-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 8px 4px 4px;
}

.finance-expense-other-item {
  position: relative;
  display: flex;
  min-width: 0;
}

.finance-expense-other-option {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 44px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #202124;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.finance-expense-other-item.is-custom .finance-expense-other-option {
  padding-right: 60px;
}

.finance-expense-other-option:hover {
  border-color: #c5221f;
  color: #c5221f;
  background: #fce8e6;
}

.finance-expense-other-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #80868b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.finance-expense-other-delete:hover {
  background: #f1f3f4;
  color: #c5221f;
}

.finance-expense-other-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e8eaed;
}

.finance-expense-other-add-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.finance-expense-other-add-caption {
  font-size: 13px;
  font-weight: 600;
  color: #5f6368;
}

.finance-expense-other-add input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 14px;
}

.finance-expense-other-add-btn,
#finance-expense-other-add-btn {
  min-height: 42px;
  white-space: nowrap;
}

.finance-expense-other-add-error {
  grid-column: 1 / -1;
  margin: 0;
  color: #c5221f;
}

.finance-category-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f3f4;
  color: #5f6368;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.finance-quick-entry-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.finance-quick-entry-row-main {
  display: grid;
  grid-template-columns: minmax(132px, 0.7fr) minmax(160px, 1.2fr) minmax(120px, 0.9fr);
  gap: 10px;
  align-items: end;
}

.finance-quick-entry-row-main.is-transfer {
  grid-template-columns:
    minmax(128px, 0.7fr)
    minmax(140px, 1.1fr)
    minmax(140px, 1.1fr)
    minmax(120px, 0.85fr)
    minmax(120px, 0.85fr);
  overflow-x: auto;
}

.finance-quick-entry-row-main .finance-quick-field-to-account[hidden],
.finance-quick-entry-row-main .finance-quick-field-to-amount[hidden] {
  display: none !important;
}

.finance-quick-entry-row-memo {
  display: flex;
  gap: 10px;
  align-items: end;
}

.finance-quick-field-memo {
  flex: 1 1 auto;
  min-width: 0;
}

.finance-quick-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.finance-quick-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #5f6368;
}

.finance-quick-field input,
.finance-quick-field select {
  height: 40px;
  padding: 8px 10px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}

.finance-quick-field input:focus,
.finance-quick-field select:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.finance-quick-submit {
  height: 40px;
  min-width: 108px;
  padding: 0 20px;
  border: none;
  border-radius: 8px;
  background: #1a73e8;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.finance-quick-submit.is-income {
  background: #137333;
}

.finance-quick-submit.is-expense {
  background: #c5221f;
}

.finance-quick-submit.is-transfer {
  background: #1a73e8;
}

.finance-quick-submit:hover {
  filter: brightness(0.95);
}

.finance-amount-field-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.finance-amount-field-wrap .finance-amount-calc {
  flex: 1 1 auto;
  min-width: 0;
}

.finance-easy-amount-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
  padding: 0 8px;
}

.finance-easy-amount-btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #1a73e8;
}

.finance-easy-amount-btn--icon:hover {
  background: #e8f0fe;
  color: #1558b0;
}

.finance-easy-amount-icon {
  fill: currentColor;
  stroke: none;
}

.finance-amount-field-wrap--compact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
}

.finance-list-schedule-form .finance-amount-field-wrap--compact .finance-amount-calc {
  width: 88px;
  flex: 0 0 88px;
}

.finance-card-schedule-form .finance-amount-field-wrap--compact {
  width: 100%;
}

.finance-card-schedule-form .finance-amount-field-wrap--compact .finance-amount-calc {
  flex: 1 1 auto;
  min-width: 0;
}

.finance-easy-amount-dialog {
  max-width: 360px;
}

.finance-easy-amount-body {
  padding: 16px 20px 8px;
}

.finance-easy-amount-display-wrap {
  text-align: center;
  margin-bottom: 16px;
}

.finance-easy-amount-display-label {
  margin: 0 0 4px;
  font-size: 13px;
  color: #5f6368;
}

.finance-easy-amount-current {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: #202124;
  font-variant-numeric: tabular-nums;
}

.finance-easy-amount-mode-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.finance-easy-amount-mode-btn {
  height: 44px;
  border-radius: 8px;
  border: 2px solid #dadce0;
  background: #fff;
  color: #3c4043;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.finance-easy-amount-mode-btn.is-active {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #fff;
}

.finance-easy-amount-mode-btn:hover:not(.is-active) {
  background: #f8f9fa;
}

.finance-easy-amount-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.finance-easy-amount-preset-btn {
  height: 56px;
  border-radius: 12px;
  border: 2px solid #e8eaed;
  background: #f8f9fa;
  color: #202124;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.finance-easy-amount-preset-btn:hover {
  background: #e8f0fe;
  border-color: #1a73e8;
}

.finance-easy-amount-preset-btn:active {
  background: #d2e3fc;
}

.finance-easy-amount-help {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.finance-easy-amount-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid #e8eaed;
}

.finance-quick-entry-hint {
  margin: 10px 0 0;
  font-size: 13px;
}

.finance-voice-entry {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #c5d8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notes-main > .finance-voice-entry {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #c5d8f0;
  border-radius: 12px;
  background: #f8fbff;
  border-top-style: solid;
}

.panel > .finance-voice-entry {
  margin-top: 14px;
}

.finance-voice-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.finance-voice-entry-head strong {
  font-size: 14px;
  color: #174ea6;
}

.finance-voice-entry-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.finance-voice-mic-btn {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid #1a73e8;
  background: #fff;
  color: #174ea6;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.finance-voice-mic-btn.is-listening {
  background: #e8f0fe;
  border-color: #d93025;
  color: #c5221f;
}

.finance-voice-mic-btn:disabled,
.finance-voice-mic-btn.is-disabled,
.finance-voice-parse-btn:disabled,
#finance-voice-parse-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.finance-voice-mic-btn.is-disabled {
  pointer-events: auto;
}

.finance-voice-transcript {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #dadce0;
  font-size: 14px;
}

.finance-voice-parse-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.finance-voice-status {
  margin: 0;
  min-height: 1.2em;
}

.finance-voice-status.is-error {
  color: #c5221f;
}

.ai-llm-panel {
  margin: 16px 0 24px;
}

.finance-easy-amount-inline-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  vertical-align: middle;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #1a73e8;
}

.finance-account-quick-btns {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.finance-account-quick-btn {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #dadce0;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.finance-account-quick-btn.income {
  border-color: #137333;
  color: #137333;
  background: #e6f4ea;
}

.finance-account-quick-btn.expense {
  border-color: #c5221f;
  color: #c5221f;
  background: #fce8e6;
}

.finance-account-list-actions .finance-account-quick-btn {
  flex: 0 0 auto;
  min-width: 52px;
  border-radius: 0;
  box-shadow: none;
}

.finance-account-list-row .finance-account-list-actions .finance-account-quick-btn.income {
  background: #e6f4ea;
  color: #137333;
  border-color: transparent;
}

.finance-account-list-row .finance-account-list-actions .finance-account-quick-btn.expense {
  background: #fce8e6;
  color: #c5221f;
  border-color: transparent;
}

.finance-list-schedule-form input[name="memo"] {
  flex: 1 1 auto;
  min-width: 72px;
  width: auto;
  max-width: 160px;
}

.finance-list-schedule-form .finance-amount-field-wrap--compact + input[name="memo"],
.finance-list-schedule-form input[name="memo"] {
  flex: 1 1 auto;
}

.finance-list-schedule-form input[type="date"],
.finance-list-schedule-form input[name="amount"],
.finance-list-schedule-form input[name="memo"] {
  height: 34px;
  font-size: 13px;
}

.finance-list-schedule-label {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 3.5em;
  color: #5f6368;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  white-space: nowrap;
  letter-spacing: 0;
}

.finance-quick-income {
  background: #e6f4ea;
  border-color: #137333;
  color: #137333;
}

.finance-quick-income:hover {
  background: #ceead6;
}

.finance-quick-expense {
  background: #fce8e6;
  border-color: #c5221f;
  color: #c5221f;
}

.finance-quick-expense:hover {
  background: #f9d8d6;
}

.finance-entry-guide {
  margin-bottom: 16px;
  padding: 12px 16px;
}

.finance-entry-guide summary {
  cursor: pointer;
  font-weight: 600;
  color: #1a73e8;
}

.finance-entry-guide-body {
  margin-top: 12px;
}

.finance-entry-guide-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.finance-entry-guide-card {
  padding: 12px 14px;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  background: #f8f9fa;
}

.finance-entry-guide-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.finance-entry-guide-card p,
.finance-entry-guide-card li {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.45;
  color: #3c4043;
}

.finance-entry-guide-card ul {
  margin: 8px 0 0;
  padding-left: 1.2em;
}

.finance-summary-static {
  cursor: default;
}

.finance-summary-static:hover,
.finance-summary-static:focus-visible {
  border-color: #e8eaed;
  background: #f8fafc;
  box-shadow: none;
}

.finance-transaction-type-hint {
  margin: -4px 0 0;
  padding: 10px 12px;
  background: #e8f0fe;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.finance-list-schedule-label {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 3.5em;
  font-size: 12px;
  font-weight: 600;
  color: #5f6368;
  white-space: nowrap;
  letter-spacing: 0;
}

.finance-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.finance-tab-cluster {
  display: inline-flex;
  align-items: stretch;
}

.finance-tab-cluster .finance-tab {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.finance-tab-remove-form {
  margin: 0;
  display: flex;
}

.finance-tab-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 8px 8px;
  border: 1px solid #dadce0;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  background: #fff;
  color: #80868b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.finance-tab-remove:hover,
.finance-tab-remove:focus-visible {
  color: #c5221f;
  border-color: #c5221f;
  outline: none;
}

.finance-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dadce0;
  color: #3c4043;
  text-decoration: none;
  font-size: 14px;
}

.finance-tab.is-add {
  border-style: dashed;
  color: #1a73e8;
  background: #f8fbff;
  cursor: pointer;
  font: inherit;
}

.finance-tab.is-add:hover,
.finance-tab.is-add:focus-visible {
  border-color: #1a73e8;
  outline: none;
}

.finance-add-currency-form {
  margin: 0;
}

.finance-add-currency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.finance-add-currency-form .button-link {
  width: 100%;
}

.finance-add-currency-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 12px;
  padding-top: 12px;
  border-top: 1px solid #e8eaed;
}

.finance-add-currency-custom label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.finance-add-currency-custom input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 14px;
  text-transform: uppercase;
}

.finance-period-form {
  margin-left: auto;
}

.finance-period-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #5f6368;
}

.finance-period-label input[type="month"] {
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
}

.finance-section-title {
  margin: 0 0 12px;
  font-size: 18px;
}

.finance-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.finance-section-head .finance-section-title {
  margin: 0;
}

.finance-section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.finance-view-toggle {
  display: inline-flex;
  border: 1px solid #dadce0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.finance-view-toggle-btn {
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: #5f6368;
  font-size: 13px;
  cursor: pointer;
}

.finance-view-toggle-btn.is-active {
  background: #e8f0fe;
  color: #1a73e8;
  font-weight: 600;
}

.finance-accounts-view[data-view="cards"] .finance-account-list {
  display: none;
}

.finance-accounts-view[data-view="list"] .finance-account-cards {
  display: none;
}

.finance-accounts-view[data-view="list"] .finance-account-list {
  display: block;
}

.finance-account-setting-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.finance-account-setting-balance {
  margin-left: 8px;
  font-weight: 600;
}

.finance-kind-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 11px;
  font-weight: 500;
}

.finance-account-setting-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.finance-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.finance-balance-overview {
  margin-bottom: 16px;
}

.finance-tab-context {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #e8f0fe;
  color: #174ea6;
  font-size: 13px;
  font-weight: 600;
}

.finance-balance-overview-region {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
}

.finance-balance-overview-region-label {
  font-size: 12px;
  font-weight: 700;
  color: #1a73e8;
  padding-left: 4px;
}

.finance-balance-overview-region-cards {
  display: flex;
  gap: 12px;
}

.finance-account-region-block {
  margin-bottom: 20px;
}

.finance-account-region-block:last-child {
  margin-bottom: 0;
}

.finance-account-region-title {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #e8f0fe;
  color: #174ea6;
  font-size: 15px;
  font-weight: 700;
}

.finance-account-region-block[data-region="ph"] .finance-account-region-title {
  background: #fef7e0;
  color: #b06000;
}

.finance-balance-overview-region[data-region="ph"] .finance-balance-overview-region-label {
  color: #b06000;
}

.finance-balance-overview-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  margin-bottom: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.finance-balance-overview-item {
  flex: 0 0 auto;
  min-width: 168px;
  max-width: 260px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #dadce0;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
  box-sizing: border-box;
}

.finance-balance-overview-main {
  min-width: 220px;
  max-width: none;
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e8f0fe 0%, #f8f9fa 100%);
  border: 1px solid #d2e3fc;
  box-shadow: none;
}

.finance-balance-overview-account {
  position: relative;
  cursor: pointer;
  text-align: left;
}

.finance-balance-overview-account:hover,
.finance-balance-overview-account:focus-visible {
  border-color: #1a73e8;
  outline: none;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
}

.finance-balance-overview-account .finance-kind-badge {
  margin-bottom: 6px;
}

.finance-balance-overview-account-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #3c4043;
  line-height: 1.35;
  margin-bottom: 6px;
}

.finance-balance-overview-account-balance {
  display: block;
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  line-height: 1.2;
  color: #1a73e8;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.finance-balance-overview-account-label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #80868b;
}

.finance-balance-overview-remove-form {
  position: absolute;
  top: 6px;
  right: 6px;
  margin: 0;
}

.finance-balance-overview-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #f1f3f4;
  color: #5f6368;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.finance-balance-overview-remove:hover {
  background: #fce8e6;
  color: #d93025;
}

.finance-balance-overview-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 118px;
  border: 2px dashed #c6c9cc;
  background: #fafafa;
  color: #5f6368;
  cursor: pointer;
}

.finance-balance-overview-add:hover,
.finance-balance-overview-add:focus-visible {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #f8fbff;
  outline: none;
}

.finance-balance-overview-add-icon {
  font-size: 24px;
  line-height: 1;
}

.finance-balance-overview-add-label {
  font-size: 12px;
  font-weight: 600;
}

.finance-overview-pin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.finance-overview-add-divider {
  text-align: center;
  margin: 8px 0;
}

.finance-balance-overview-total {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.15rem, 2.8vw, 1.65rem);
  line-height: 1.2;
  color: #1a73e8;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.finance-balance-overview-breakdown,
.finance-balance-overview-schedules {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 13px;
  color: #5f6368;
}

.finance-balance-overview-schedules {
  margin-top: 8px;
  color: #b06000;
}

.finance-card-schedule-form {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed #c4c7c5;
  border-radius: 8px;
  background: #f8f9fa;
}

.finance-card-schedule-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 11px;
  color: #5f6368;
}

.finance-card-schedule-field input {
  font-size: 13px;
}

.finance-card-schedule-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.finance-card-schedule-save {
  color: #1a73e8;
  font-weight: 600;
}

.finance-calc-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.finance-amount-calc.is-invalid-calc {
  border-color: #c5221f !important;
  background: #fce8e6;
}

.finance-account-list-tail {
  display: contents;
}

.finance-list-schedule-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
}

.finance-list-schedule-form input[type="date"],
.finance-list-schedule-form input[type="number"],
.finance-list-schedule-form input[type="text"],
.finance-list-schedule-form .finance-amount-calc {
  box-sizing: border-box;
  height: 34px;
  padding: 8px 10px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
}

.finance-list-schedule-form input[type="date"] {
  width: 148px;
  flex: 0 0 148px;
}

.finance-list-schedule-form input[type="text"],
.finance-list-schedule-form .finance-amount-calc {
  width: 100px;
  flex: 0 0 100px;
}

.finance-list-schedule-form .finance-amount-field-wrap--compact .finance-amount-calc {
  width: 88px;
  flex: 0 0 88px;
}

.finance-list-schedule-form input[name="memo"] {
  flex: 1 1 96px;
  min-width: 72px;
  max-width: 160px;
  width: auto;
}

.finance-list-schedule-label {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 3.5em;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #5f6368;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.finance-list-schedule-empty {
  display: block;
  min-height: 34px;
}

.finance-account-list-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.finance-account-list-row {
  display: grid;
  grid-template-columns: minmax(110px, 160px) minmax(260px, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f3f4;
  cursor: pointer;
}

.finance-accounts-view[data-view="list"] .finance-account-list-row {
  grid-template-columns: minmax(110px, 160px) minmax(260px, 1fr) auto;
}

.finance-account-list-row .finance-card-usage-history.is-list {
  grid-column: 1 / -1;
}

.finance-account-list-row .finance-account-list-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.finance-account-list-row .finance-account-list-actions .finance-account-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-width: 52px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #dadce0;
  font-size: 13px;
  font-weight: 600;
}

.finance-account-list-row .finance-account-list-actions .finance-account-quick-btn.income {
  background: #e6f4ea;
  color: #137333;
  border-color: #ceead6;
}

.finance-account-list-row .finance-account-list-actions .finance-account-quick-btn.expense {
  background: #fce8e6;
  color: #c5221f;
  border-color: #f9d8d6;
}

.finance-account-list-manage {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #dadce0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.finance-account-list-manage .text-btn,
.finance-account-list-manage .finance-account-filter-link,
.finance-account-list-manage .finance-account-delete-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-width: 44px;
  padding: 0 10px;
  margin: 0;
  border: none;
  border-right: 1px solid #e8eaed;
  border-radius: 0;
  white-space: nowrap;
  box-sizing: border-box;
  text-decoration: none;
  font-size: 13px;
}

.finance-account-list-manage .finance-account-filter-link {
  color: #1a73e8;
}

.finance-account-list-manage .finance-account-delete-form {
  padding: 0;
  border-right: none;
}

.finance-account-list-manage .finance-account-delete-form .text-btn {
  width: 100%;
  height: 100%;
  border-right: none;
}

.finance-account-list-manage > :last-child {
  border-right: none;
}

.finance-summary-item {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e8eaed;
  text-align: left;
}

.finance-summary-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font: inherit;
  color: inherit;
  width: 100%;
}

.finance-summary-clickable:hover,
.finance-summary-clickable:focus-visible {
  border-color: #1a73e8;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
  outline: none;
}

.finance-summary-hint {
  margin: 0 0 10px;
  font-size: 13px;
}

.finance-summary-action {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #1a73e8;
  font-weight: 500;
}

.finance-summary-detail-dialog {
  width: min(720px, 100%);
}

.finance-summary-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.finance-summary-detail-meta strong {
  font-size: 18px;
}

.finance-summary-detail-meta strong.income {
  color: #137333;
}

.finance-summary-detail-meta strong.expense {
  color: #c5221f;
}

.finance-summary-detail-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.finance-summary-detail-category-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #dadce0;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.finance-summary-detail-category-chip:hover,
.finance-summary-detail-category-chip.is-active {
  border-color: #c5221f;
  background: #fce8e6;
}

.finance-summary-detail-category-label {
  font-size: 13px;
  font-weight: 700;
  color: #202124;
}

.finance-summary-detail-category-meta {
  font-size: 11px;
  color: #5f6368;
}

.finance-summary-detail-table-wrap {
  max-height: min(55vh, 480px);
  overflow: auto;
  border: 1px solid #e8eaed;
  border-radius: 10px;
}

.finance-summary-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.finance-summary-detail-table th,
.finance-summary-detail-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e8eaed;
  text-align: left;
  vertical-align: top;
}

.finance-summary-detail-table th {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  font-size: 12px;
  color: #5f6368;
}

.finance-summary-detail-table th.is-num,
.finance-summary-detail-table td.is-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.finance-summary-detail-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.finance-summary-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.finance-summary-detail-account {
  color: #5f6368;
  font-size: 12px;
}

.finance-summary-detail-memo {
  color: #202124;
}

.finance-summary-detail-empty {
  margin: 12px;
}

.finance-summary-label {
  display: block;
  font-size: 12px;
  color: #5f6368;
  margin-bottom: 4px;
}

.finance-summary-value {
  font-size: 18px;
  color: #202124;
}

.finance-summary-value.income {
  color: #137333;
}

.finance-summary-value.expense {
  color: #c5221f;
}

.finance-account-group {
  margin-bottom: 18px;
}

.finance-account-group-title {
  margin: 0 0 8px;
  font-size: 13px;
  color: #5f6368;
  font-weight: 600;
}

.finance-account-cards {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.finance-account-card {
  flex: 0 0 auto;
  min-width: 150px;
  max-width: 200px;
  padding: 0;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #dadce0;
  color: inherit;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.finance-account-card.is-dragging {
  opacity: 0.55;
}

.finance-account-drag-handle {
  align-self: stretch;
  padding: 6px 10px;
  border: 0;
  border-bottom: 1px solid #f1f3f4;
  background: #f8f9fa;
  color: #80868b;
  font-size: 14px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}

.finance-account-drag-handle:active {
  cursor: grabbing;
}

.finance-account-card-body {
  padding: 10px 14px 12px;
  cursor: pointer;
  text-align: left;
}

.finance-account-card-body:hover,
.finance-account-card-body:focus-visible {
  background: #fafafa;
  outline: none;
}

.finance-account-card.is-selected {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.finance-account-card:has(.finance-card-usage-history) {
  min-width: 220px;
  max-width: 300px;
}

.finance-account-add-card {
  min-width: 132px;
  max-width: 160px;
  min-height: 120px;
  padding: 12px 14px;
  border: 2px dashed #c6c9cc;
  background: #fafafa;
  color: #5f6368;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-align: center;
}

.finance-account-add-card:hover,
.finance-account-add-card:focus-visible {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #f8fbff;
  outline: none;
}

.finance-account-add-icon {
  font-size: 24px;
  line-height: 1;
  font-weight: 300;
}

.finance-account-add-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.finance-account-list-add-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px dashed #c6c9cc;
  border-radius: 8px;
  background: #fafafa;
  color: #5f6368;
  font-size: 13px;
  cursor: pointer;
}

.finance-account-list-add-row:hover,
.finance-account-list-add-row:focus-visible {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #f8fbff;
  outline: none;
}

.finance-card-usage-history {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e8eaed;
}

.finance-card-usage-configured {
  margin: 0 0 4px;
  font-size: 11px;
  color: #5f6368;
}

.finance-card-usage-configured strong {
  color: #c5221f;
  margin-left: 4px;
}

.finance-card-usage-configured-detail {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: #80868b;
}

.finance-card-usage-configured-hint {
  margin: 0 0 8px;
  font-size: 10px;
  line-height: 1.35;
}

.finance-card-usage-empty {
  margin: 0;
  font-size: 11px;
}

.finance-card-usage-title {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: #5f6368;
}

.finance-card-usage-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.finance-card-usage-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11px;
  line-height: 1.35;
}

.finance-card-usage-item:last-child {
  margin-bottom: 0;
}

.finance-card-usage-label {
  flex: 1 1 auto;
  min-width: 0;
  color: #202124;
  word-break: break-word;
}

.finance-card-usage-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  color: #5f6368;
}

.finance-card-usage-amount {
  font-weight: 600;
  color: #c5221f;
}

.finance-card-usage-history.is-list {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 0 8px;
  border-top: 0;
}

.finance-card-usage-history.is-list .finance-card-usage-item {
  font-size: 12px;
}

.finance-drag-hint {
  margin: 0 0 12px;
  font-size: 13px;
}

.finance-drag-hint-icon {
  display: inline-block;
  padding: 0 4px;
  color: #80868b;
}

.finance-accounts-view[data-view="list"] .finance-drag-hint {
  display: none;
}

.finance-account-adjustment {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #b06000;
}

.finance-account-filter-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: #1a73e8;
  text-decoration: none;
}

.finance-account-filter-link:hover {
  text-decoration: underline;
}

.finance-account-card-body .finance-account-delete-form {
  display: inline-block;
  margin-top: 8px;
  margin-left: 8px;
}

.finance-account-modal-delete {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e8eaed;
  text-align: left;
}

.finance-account-schedule-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 8px;
  border: 1px dashed #c2c7cf;
  border-radius: 8px;
  background: #f8f9fa;
  color: #1a73e8;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.finance-account-schedule-btn:hover {
  background: #e8f0fe;
  border-color: #1a73e8;
}

.finance-account-schedule-label {
  display: block;
  font-size: 11px;
  color: #5f6368;
  margin-bottom: 2px;
}

.finance-account-schedule-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e8eaed;
}

.finance-account-schedule-title {
  margin: 0 0 8px;
  font-size: 13px;
  color: #5f6368;
}

.finance-account-schedule-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f3f4;
  font-size: 13px;
}

.finance-account-schedule-item:last-child {
  border-bottom: 0;
}

.finance-account-schedule-memo {
  color: #5f6368;
  font-size: 12px;
}

.finance-schedule-list {
  margin-bottom: 12px;
}

.finance-schedule-account-name {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #202124;
}

.finance-schedule-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e8eaed;
}

.finance-account-list {
  display: none;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
}

.finance-account-list-row {
  display: grid;
  grid-template-columns: minmax(110px, 160px) minmax(260px, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f3f4;
  cursor: pointer;
}

.finance-account-list-row:last-child {
  border-bottom: 0;
}

.finance-account-list-row:hover,
.finance-account-list-row:focus-visible {
  background: #f8f9fa;
  outline: none;
}

.finance-account-list-row.is-selected {
  background: #e8f0fe;
}

.finance-account-list-name {
  font-size: 14px;
  color: #202124;
  font-weight: 500;
  line-height: 1.3;
}

.finance-account-list-balance {
  font-size: 14px;
  color: #202124;
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
}

.finance-account-list-identity .finance-adjustment-badge {
  margin-left: 0;
}

.finance-account-list-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.finance-account-filter-link {
  text-decoration: none;
}

.finance-adjustment-badge.is-empty {
  visibility: hidden;
}

@media (max-width: 720px) {
  .finance-account-list-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "identity"
      "schedule"
      "actions";
  }

  .finance-account-list-identity { grid-area: identity; }
  .finance-account-list-row .finance-list-schedule-form,
  .finance-account-list-row .finance-list-schedule-empty {
    grid-area: schedule;
    justify-content: flex-start;
  }

  .finance-account-list-row .finance-account-list-actions {
    grid-area: actions;
    justify-self: stretch;
    flex-wrap: wrap;
  }

  .finance-list-schedule-form,
  .finance-list-schedule-empty {
    min-width: 0;
  }
}

.finance-account-name {
  display: block;
  font-size: 12px;
  color: #5f6368;
  margin-bottom: 6px;
}

.finance-account-balance {
  font-size: 16px;
  color: #202124;
}

.finance-account-balance-label {
  display: block;
  font-size: 11px;
  color: #80868b;
  margin-top: 2px;
}

.finance-account-settings {
  margin-top: 16px;
  padding: 16px;
  border-top: 1px solid #e8eaed;
  border: 1px solid #d2e3fc;
  border-radius: 12px;
  background: #f8fbff;
}

.finance-account-settings[hidden] {
  display: none !important;
}

.finance-settings-hint {
  margin: 0 0 12px;
  font-size: 13px;
}

.finance-adjustment-badge {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef7e0;
  color: #b06000;
  font-size: 12px;
  font-weight: 500;
}

.finance-account-setting-row {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  background: #fafafa;
}

.finance-account-setting-row summary {
  cursor: pointer;
  font-size: 14px;
}

.finance-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 10px;
}

.finance-inline-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.finance-inline-form input,
.finance-inline-form select {
  min-width: 160px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}

.finance-transactions.panel {
  scroll-margin-top: 72px;
}

.finance-transactions.panel.is-highlight {
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.25);
  transition: box-shadow 0.3s ease;
}

.finance-transaction-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e8eaed;
  border-radius: 8px;
}

.finance-transaction-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
  line-height: 1.25;
}

.finance-transaction-table.is-resizable th {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finance-col-resize {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 2;
}

.finance-col-resize::after {
  content: '';
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 3px;
  width: 1px;
  background: transparent;
}

.finance-transaction-table th:hover .finance-col-resize::after,
.finance-col-resize:hover::after,
body.is-finance-col-resizing .finance-col-resize.is-active::after {
  background: #1a73e8;
}

body.is-finance-col-resizing,
body.is-finance-col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.finance-transactions-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 12px;
}

.finance-transaction-balance-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f1f8ff;
  border: 1px solid #d2e3fc;
  font-size: 13px;
}

.finance-transaction-balance-account {
  font-weight: 600;
  color: #1a73e8;
}

.finance-transaction-balance-item strong {
  font-variant-numeric: tabular-nums;
}

.finance-transaction-balance.is-empty {
  color: #9aa0a6;
}

.finance-transaction-balance {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.finance-transaction-table th,
.finance-transaction-table td {
  padding: 1px 6px;
  border-bottom: 1px solid #e8eaed;
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-transaction-table th {
  padding: 3px 6px;
  background: #f8f9fa;
  color: #5f6368;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.finance-transaction-table th.is-num,
.finance-transaction-table td.is-num {
  text-align: right;
}

.finance-transaction-table th.is-col-left,
.finance-transaction-table td.is-col-left {
  text-align: left;
}

.finance-transaction-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.finance-transaction-filter-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: #5f6368;
}

.finance-transaction-filter-select {
  min-width: 72px;
  padding: 4px 6px;
  font-size: 12px;
}

.finance-tx-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 6px 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.finance-tx-bulk-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #3c4043;
  cursor: pointer;
}

.finance-tx-bulk-count {
  font-size: 12px;
  color: #5f6368;
}

.finance-tx-bulk-btn {
  font-size: 13px;
  padding: 4px 8px;
}

.finance-transaction-table th.is-check,
.finance-transaction-table td.finance-transaction-check-cell {
  width: 36px;
  text-align: center;
  vertical-align: middle;
}

.finance-transaction-check-cell input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.finance-transactions-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.finance-transaction-table th.is-actions,
.finance-transaction-table td.finance-transaction-actions-cell {
  text-align: left;
  white-space: nowrap;
}

.finance-transaction-table tbody tr:hover {
  background: #fafafa;
}

.finance-transaction-row.type-transfer td:first-child {
  border-left: 4px solid #34a853;
}

.finance-transaction-row.type-income td:first-child {
  border-left: 4px solid #137333;
}

.finance-transaction-row.type-expense td:first-child {
  border-left: 4px solid #c5221f;
}

.finance-transaction-date-cell {
  white-space: nowrap;
  color: #5f6368;
  font-size: 12px;
}

.finance-transaction-type-cell {
  white-space: nowrap;
}

.finance-transaction-account-cell {
  min-width: 0;
  color: #202124;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-transaction-memo-cell {
  width: auto;
  min-width: 0;
  max-width: none;
  color: #5f6368;
  overflow: hidden;
}

button.finance-transaction-memo-trigger {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #5f6368;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

button.finance-transaction-memo-trigger:hover,
button.finance-transaction-memo-trigger:focus-visible {
  background: transparent;
  color: #202124;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.finance-memo-bubble {
  position: fixed;
  z-index: 2100;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 10px;
  background: #1f2937;
  color: #fff;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  pointer-events: none;
}

.finance-memo-bubble.is-pinned {
  pointer-events: auto;
}

.finance-memo-bubble::after {
  content: '';
  position: absolute;
  left: 16px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #1f2937;
  transform: rotate(45deg);
}

.finance-memo-bubble.is-below::after {
  top: -6px;
  bottom: auto;
}

.finance-transaction-amount-cell .finance-transaction-amount {
  margin-left: 0;
  font-size: 12px;
}

.finance-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #eef3fc;
  color: #1a73e8;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.finance-transaction-category-cell {
  white-space: nowrap;
}

.finance-transaction-table .finance-category-badge {
  margin-left: 0;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
}

.finance-transaction-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1;
}

.finance-transaction-actions .finance-inline-form,
.finance-transaction-actions .finance-delete-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  gap: 0;
  flex-wrap: nowrap;
}

.finance-transaction-actions .text-btn,
.finance-transaction-actions .finance-delete-form button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 1px 4px;
  font-size: 11px;
  line-height: 1.2;
  height: auto;
}

.finance-transaction-desc {
  flex: 0 1 auto;
  min-width: 48px;
  max-width: 28%;
  font-size: 14px;
  color: #202124;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-transaction-amount {
  font-size: 15px;
  font-weight: 600;
  color: #202124;
  white-space: nowrap;
}

.finance-transaction-amount.expense {
  color: #c5221f;
}

.finance-transaction-amount.income {
  color: #137333;
}

.finance-transaction-memo {
  flex: 1 1 auto;
  min-width: 40px;
  font-size: 13px;
  color: #5f6368;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-transaction-memo::before {
  content: none;
}

.finance-transactions-hint {
  margin: -4px 0 12px;
}

.finance-transaction-row.is-scheduled {
  background: #fffbf2;
}

.finance-transaction-row.is-scheduled:hover {
  background: #fff8e8;
}

.finance-transaction-purchase-date {
  margin-left: 4px;
  font-size: 11px;
  color: #80868b;
}

.finance-transaction-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #1967d2;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.finance-transaction-badge-scheduled {
  background: #fef7e0;
  color: #b06000;
}

.text-btn.danger,
button.text-btn.danger {
  background: transparent;
  color: #d93025;
}

.text-btn.danger:hover,
button.text-btn.danger:hover {
  background: #fce8e6;
  color: #b31412;
}

.finance-delete-form button[type="submit"] {
  min-width: 3em;
  background: transparent;
  color: #d93025;
  padding: 6px 8px;
}

.finance-delete-form button[type="submit"]:hover {
  background: #fce8e6;
  color: #b31412;
}

.finance-schedule-edit-form,
.finance-schedule-delete-form {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8eaed;
}

.finance-schedule-edit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.finance-modal-dialog {
  max-width: min(520px, 100%);
}

.finance-form .finance-type-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.finance-form .finance-type-fieldset legend {
  width: 100%;
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 4px;
}

.finance-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.finance-form input[type="text"],
.finance-form input[type="date"],
.finance-form input[type="number"],
.finance-form .finance-amount-calc,
.finance-form select,
#finance-account-form input[type="text"],
#finance-account-form .finance-amount-calc,
#finance-account-form select {
  box-sizing: border-box;
  width: 100%;
  height: 34px;
  padding: 8px 10px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
}

#finance-transaction-form input[type="text"],
#finance-transaction-form input[type="date"],
#finance-transaction-form input[type="number"],
#finance-transaction-form .finance-amount-calc,
#finance-transaction-form select,
#finance-transaction-form textarea {
  box-sizing: border-box;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
}

#finance-transaction-form textarea {
  min-height: 72px;
}

@media (max-width: 768px) {
  .finance-top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .finance-period-form {
    margin-left: 0;
  }

  .finance-quick-actions {
    margin-left: 0;
    width: 100%;
  }

  .finance-quick-entry {
    position: static;
  }

  .finance-quick-entry-row-main {
    grid-template-columns: 1fr 1fr;
  }

  .finance-quick-entry-row-main.is-transfer {
    grid-template-columns: 1fr 1fr;
  }

  .finance-quick-entry-row-main .finance-quick-field-amount,
  .finance-quick-entry-row-main .finance-quick-field-to-amount {
    grid-column: auto;
  }

  .finance-quick-entry-row-memo {
    flex-direction: column;
    align-items: stretch;
  }

  .finance-quick-submit {
    width: 100%;
  }
}

/* ===== Transit ===== */
body.transit-page {
  --transit-ink: #10231f;
  --transit-teal: #0f766e;
  --transit-line: rgba(16, 35, 31, 0.1);
  --transit-shadow: 0 18px 40px rgba(16, 35, 31, 0.07);
  background:
    radial-gradient(circle at 8% -10%, rgba(15, 118, 110, 0.12), transparent 42%),
    radial-gradient(circle at 96% 0%, rgba(14, 165, 233, 0.1), transparent 36%),
    #f4f7f6;
  color: var(--transit-ink);
}

.transit-main {
  max-width: 980px;
  margin: 0 auto;
}

.transit-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px 22px;
  border: 1px solid var(--transit-line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 0%, rgba(15, 118, 110, 0.16), transparent 46%),
    radial-gradient(circle at 92% 10%, rgba(14, 165, 233, 0.14), transparent 40%),
    linear-gradient(180deg, #f6fbfa 0%, #ffffff 100%);
  box-shadow: var(--transit-shadow);
}

.transit-kicker {
  margin: 0 0 4px;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--transit-teal);
}

.transit-page-title {
  margin: 0 0 6px;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  letter-spacing: -0.03em;
  color: var(--transit-ink);
}

.transit-hero-lead {
  margin: 0;
  max-width: 38em;
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
}

.transit-hero-mark {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #0f766e, #0ea5e9);
  font-size: 26px;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.22);
}

.transit-category-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0 0 16px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}

.transit-category-tabs::-webkit-scrollbar {
  display: none;
}

.transit-category-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--transit-line);
  color: #334155;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 650;
  box-shadow: 0 6px 16px rgba(16, 35, 31, 0.04);
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.transit-category-tab:hover {
  background: #d9f3ee;
  transform: translateY(-1px);
}

.transit-category-tab.is-active {
  background: linear-gradient(150deg, #0f766e, #0d9488);
  border-color: transparent;
  color: #f0fdfa;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
}

.transit-page .panel {
  border: 1px solid var(--transit-line);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: var(--transit-shadow);
}

body.transit-page .panel .transit-section-title {
  margin: 0 0 12px;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--transit-ink);
}

.transit-panel-head {
  margin-bottom: 14px;
}

.transit-panel-head .transit-section-title {
  margin: 0 0 4px;
}

body.transit-page .transit-section-head .transit-section-title {
  margin: 0;
}

.transit-panel-head .hint {
  margin: 0;
}

.transit-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.transit-section-head .transit-section-title {
  margin: 0;
}

.transit-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.transit-places {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px 8px;
  align-items: end;
  min-width: 0;
  max-width: 100%;
}

.transit-field {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 0;
  max-width: 100%;
}

.transit-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.transit-field-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
}

.transit-place-mic,
.ai-assist-mic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  background: #ecfdf8;
  color: #0f766e;
  cursor: pointer;
}

.transit-place-mic:hover,
.transit-place-mic:focus-visible,
.ai-assist-mic:hover,
.ai-assist-mic:focus-visible {
  background: #0f766e;
  color: #f0fdfa;
  outline: none;
}

.transit-place-mic.is-listening,
.ai-assist-mic.is-listening {
  background: #fce8e6;
  border-color: #f6aea9;
  color: #c5221f;
  animation: transit-mic-pulse 1s ease infinite;
}

.transit-place-mic:disabled,
.ai-assist-mic:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  animation: none;
}

@keyframes transit-mic-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.transit-voice-status:empty {
  display: none;
}

.transit-field-control {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body.transit-page .transit-field-control input,
body.transit-page .transit-field select,
body.transit-page .transit-datetime-selects select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--transit-line);
  border-radius: 14px;
  background: #fff;
  font-size: 15px;
}

body.transit-page .transit-field-control input {
  font-size: 16px;
}

/* PlaceAutocompleteElement は既定の min-width が大きく、スマホでカードからはみ出す */
.pac-holder {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body.transit-page .pac-holder gmp-place-autocomplete,
.pac-holder gmp-place-autocomplete,
gmp-place-autocomplete {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

body.transit-page .pac-holder gmp-place-autocomplete {
  min-height: 46px;
  border-radius: 14px;
}

body.transit-page .pac-holder gmp-place-autocomplete::part(input) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-size: 16px;
}

.transit-places-swap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 46px;
  margin: 0 0 1px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #ecfdf8;
  color: var(--transit-teal);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.transit-places-swap:hover,
.transit-places-swap:focus-visible {
  background: #0f766e;
  color: #f0fdfa;
  outline: none;
}

.transit-places-swap.is-spin span {
  display: inline-block;
  animation: transit-swap-spin 0.35s ease;
}

@keyframes transit-swap-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(180deg); }
}

.transit-search-results {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--transit-line);
}

.transit-search-results-title {
  margin: 0 0 12px;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
  color: var(--transit-ink);
}

.transit-search-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.transit-search-links a {
  text-decoration: none;
}

body.transit-page .transit-search-links .button-link.secondary {
  background: #fff;
  color: var(--transit-teal);
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  font-weight: 700;
}

body.transit-page .transit-search-links .button-link.secondary:hover {
  background: #d9f3ee;
  transform: translateY(-1px);
}

.pac-container {
  z-index: 4000;
}

.transit-search-actions,
.transit-form-actions,
.map-route-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.transit-search-btn,
.transit-add-btn {
  border-radius: 14px;
  padding: 12px 22px;
  background: linear-gradient(150deg, #0f766e, #0d9488);
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
}

.transit-search-btn:hover,
.transit-add-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.transit-time-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--transit-line);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbfa 0%, #ffffff 100%);
}

.transit-time-label {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
}

.transit-datetime-selects {
  display: grid;
  grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.transit-time-types {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.transit-time-types label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 6px 4px;
  border-radius: 999px;
  border: 1px solid var(--transit-line);
  background: #fff;
  font-size: 12.5px;
  font-weight: 650;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.transit-time-types label:hover {
  background: #d9f3ee;
}

.transit-time-types label:has(input:checked) {
  background: linear-gradient(150deg, #0f766e, #0d9488);
  border-color: transparent;
  color: #f0fdfa;
}

.transit-time-types input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.transit-search-save {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#transit-share-search,
.transit-share-itinerary {
  border-radius: 999px;
  color: #0f766e;
  font-weight: 700;
}

.transit-share-empty {
  padding: 4px 18px 16px;
}

.transit-itinerary-head .transit-share-itinerary {
  margin-left: auto;
}

.transit-empty {
  text-align: center;
  padding: 22px 12px 10px;
}

.transit-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--transit-line);
  font-size: 24px;
  box-shadow: var(--transit-shadow);
}

.transit-empty h3 {
  margin: 12px 0 4px;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
}

.transit-empty .hint {
  margin: 0;
}

.transit-favorite-list,
.map-route-list {
  display: grid;
  gap: 10px;
}

.transit-favorite-card,
.map-route-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  background: #fff;
}

body.transit-page .transit-favorite-card {
  border: 1px solid var(--transit-line);
  border-radius: 16px;
  padding: 14px 16px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

body.transit-page .transit-favorite-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(16, 35, 31, 0.08);
}

.transit-favorite-name,
.map-route-card strong {
  margin: 0 0 4px;
  font-size: 16px;
}

.transit-favorite-route,
.transit-favorite-line,
.transit-favorite-notes,
.map-route-card span {
  display: block;
  font-size: 13px;
  color: #5f6368;
}

.transit-favorite-actions,
.map-route-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body.transit-page .transit-favorite-actions .text-btn {
  border-radius: 999px;
  padding: 6px 10px;
}

.transit-inline-form,
.map-inline-form {
  display: inline;
}

.transit-all-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.transit-all-group {
  padding: 14px;
  border: 1px solid var(--transit-line);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbfa 0%, #ffffff 100%);
}

.transit-all-group-title {
  margin: 0 0 8px;
  font-size: 14px;
}

.transit-all-item {
  display: block;
  margin-bottom: 4px;
  color: var(--transit-teal);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.transit-all-item:hover {
  text-decoration: underline;
}

.transit-modal-dialog {
  max-width: min(520px, 100%);
}

body.transit-page .ai-assist {
  background:
    radial-gradient(circle at 0% 0%, rgba(15, 118, 110, 0.07), transparent 44%),
    #fff;
}

@media (max-width: 720px) {
  .transit-hero {
    padding: 16px;
  }

  .transit-hero-mark {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    font-size: 22px;
  }

  .transit-places {
    grid-template-columns: minmax(0, 1fr);
  }

  .transit-page .panel {
    padding: 16px 14px;
  }

  .transit-places-swap {
    justify-self: center;
    width: 42px;
    height: 36px;
    margin: 0;
    transform: rotate(90deg);
  }

  .transit-datetime-selects {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .transit-time-types {
    gap: 4px;
  }

  .transit-time-types label {
    padding: 6px 2px;
    font-size: 12px;
  }

  .transit-search-btn {
    width: 100%;
    text-align: center;
  }
}

/* ===== Map ===== */
body.map-page {
  background: #f3f6fb;
}

.map-main {
  max-width: 1400px;
  margin: 0 auto;
}

.map-api-warning code {
  font-family: Consolas, monospace;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.map-sidebar {
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.map-page-title {
  margin: 0 0 12px;
  font-size: 22px;
}

.map-section-title {
  margin: 0 0 10px;
  font-size: 16px;
}

.map-route-form,
.map-save-form {
  display: grid;
  gap: 10px;
}

.map-route-form label,
.map-save-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.map-route-form input,
.map-route-form select,
.map-save-form input {
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.map-save-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e8eaed;
}

.map-route-card.is-selected {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
}

.map-route-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  flex: 1 1 auto;
  min-width: 0;
}

.map-route-mode {
  font-size: 11px;
  color: #1a73e8;
}

.map-canvas-panel {
  padding: 0;
  overflow: hidden;
}

.map-canvas {
  width: 100%;
  min-height: 480px;
  height: calc(100vh - 140px);
  max-height: none;
  background: #e8eaed;
  position: relative;
}

.map-canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #5f6368;
}

.map-directions-panel {
  padding: 12px 16px 16px;
  border-top: 1px solid #e8eaed;
  max-height: 220px;
  overflow: auto;
}

.map-results-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e8eaed;
}

.map-route-results {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.map-result-card {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 12px 12px 14px;
  border: 1px solid #e8eaed;
  border-left: 4px solid transparent;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.map-result-card:hover {
  background: #f8fbff;
}

.map-result-card.is-selected {
  border-left-color: #1a73e8;
  background: #f8fbff;
  box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.18);
}

.map-result-duration {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.map-result-modes {
  margin: 0 0 4px;
  font-size: 13px;
  color: #3c4043;
}

.map-result-meta {
  margin: 0;
  font-size: 12px;
  color: #5f6368;
}

.map-directions-steps {
  max-height: 240px;
  overflow: auto;
}

.map-directions-summary {
  margin: 0 0 8px;
  font-weight: 600;
}

.map-direction-step {
  padding: 6px 0;
  border-bottom: 1px solid #f1f3f4;
  font-size: 13px;
}

@media (max-width: 960px) {
  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-sidebar {
    max-height: none;
  }

  .map-canvas {
    min-height: 360px;
    height: 50vh;
  }
}

@media (max-width: 768px) {
  .lang-switcher {
    margin-left: 0;
  }

  .lang-switch-btn {
    padding: 4px 8px;
    font-size: 11px;
  }

  .lang-toggle-btn {
    min-width: 36px;
    padding: 5px 10px;
  }

  .transit-favorite-card,
  .map-route-card {
    flex-direction: column;
  }
}

/* ===== Smartphone layout ===== */
.mobile-bottom-nav {
  display: none;
}

.mobile-month-agenda {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: var(--mobile-nav-bar-height);
  }

  .page-main {
    padding: 16px 12px 24px;
  }

  .site-header {
    overflow: visible;
  }

  .site-header-inner {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 52px;
    min-height: 52px;
    padding: 0 10px;
    gap: 6px;
    overflow: visible;
  }

  .site-logo {
    font-size: 15px;
    max-width: calc(100% - 168px);
    min-width: 0;
    flex: 0 1 auto;
  }

  .site-logo span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-logo-icon {
    width: 30px;
    height: 30px;
  }

  .site-nav {
    display: none;
  }

  .nav-trailing,
  .site-header .header-actions {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin-left: auto;
    gap: 4px;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    align-self: center;
  }

  .site-header .header-actions > form,
  .site-header .header-actions > .site-user-menu,
  .site-header .header-actions > .header-more-menu,
  .site-header .header-actions > .nav-dropdown {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    float: none !important;
  }

  .mobile-only-flex {
    display: inline-flex !important;
  }

  .lang-toggle-btn,
  .context-toggle-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 11px;
    line-height: 1;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .header-more-toggle,
  .user-menu-toggle {
    width: 32px;
    height: 32px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .site-header .header-more-toggle {
    background: transparent !important;
    color: #1f2937 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .user-dropdown-divider.mobile-only {
    display: block !important;
  }

  .mobile-bottom-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    overflow: visible;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
    touch-action: pan-y;
  }

  .mobile-bottom-nav.is-reordering {
    touch-action: none;
  }

  .mobile-nav-chrome {
    display: none;
  }

  .mobile-bottom-nav.is-reordering .mobile-nav-chrome {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    box-sizing: border-box;
    min-height: 32px;
    padding: 0 4px 4px;
    overflow: visible;
    flex: 0 0 auto;
  }

  .mobile-bottom-nav button.mobile-nav-done[hidden] {
    display: none !important;
  }

  .mobile-bottom-nav button.mobile-nav-done {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    padding: 0 12px;
    height: 28px;
    min-height: 28px;
    max-height: 28px;
    border: 0;
    border-radius: 999px;
    background: #1a73e8;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    transform: none;
    overflow: visible;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
  }

  .mobile-bottom-nav.is-reordering .mobile-nav-item {
    cursor: grab;
  }

  .mobile-nav-item.is-placeholder {
    opacity: 0.35;
  }

  .mobile-nav-item.is-drag-ghost {
    position: fixed;
    z-index: 400;
    margin: 0;
    pointer-events: none;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    transform: scale(1.08);
  }

  .mobile-nav-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    min-width: 0;
    max-height: calc(var(--mobile-nav-row-height) * var(--mobile-nav-visible-rows));
    overflow: hidden;
    transition: max-height 0.22s ease;
  }

  .mobile-nav-item {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    width: 100%;
    min-height: var(--mobile-nav-row-height);
    padding: 4px 2px;
    text-decoration: none;
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
  }

  .mobile-nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-item.active {
    color: #1a73e8;
    background: #eef4ff;
  }

  .mobile-nav-icon {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-month-agenda {
    display: block;
    margin-top: 16px;
  }

  .mobile-month-agenda h3 {
    margin: 0 0 12px;
    font-size: 16px;
  }

  .mobile-agenda-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .mobile-agenda-list li {
    border-bottom: 1px solid #f3f4f6;
  }

  .mobile-agenda-list li.done .mobile-agenda-title {
    color: #9ca3af;
    text-decoration: line-through;
  }

  .mobile-agenda-list li.done .mobile-agenda-date,
  .mobile-agenda-list li.done .mobile-agenda-meta {
    color: #9ca3af;
    text-decoration: line-through;
  }

  .mobile-agenda-item {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 2px 10px;
    padding: 12px 4px;
    border: none;
    background: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
  }

  .mobile-agenda-item:active {
    background: #f8fafc;
  }

  .mobile-agenda-date {
    grid-row: 1 / span 2;
    align-self: center;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
    min-width: 88px;
  }

  .mobile-agenda-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    word-break: break-word;
  }

  .mobile-agenda-meta {
    font-size: 12px;
    color: #6b7280;
  }

  .calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    flex-wrap: wrap;
  }

  /* calendar-toolbar-inline のスマホ配置は max-width:900px 側で定義 */

  .calendar-toolbar .month-label {
    font-size: 18px;
    text-align: center;
    width: auto;
  }

  .calendar-toolbar .nav-group {
    justify-content: center;
    gap: 8px;
  }

  .calendar-toolbar .nav-group .button-link,
  .calendar-toolbar .nav-group .icon-btn {
    min-height: 34px;
    min-width: 34px;
    padding: 5px 11px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .calendar-toolbar .nav-group .icon-btn {
    font-size: 18px;
  }

  .calendar-toolbar-links {
    width: 100%;
    flex-direction: row;
    align-items: stretch;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .calendar-view-switch {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }

  .calendar-view-btn {
    flex: 1;
    min-height: 44px;
    min-width: 0;
    padding: 8px 4px;
    font-size: 13px;
  }

  .calendar-toolbar-inline .calendar-view-switch {
    flex: 0 0 auto !important;
    width: auto !important;
  }

  .calendar-toolbar-inline .calendar-view-btn {
    flex: 0 0 auto !important;
    min-height: 32px !important;
    height: 32px !important;
    min-width: 28px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
  }

  .calendar-toolbar-actions {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 6px;
    width: auto;
  }

  .calendar-action-btn {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .calendar-toolbar-inline .calendar-action-btn {
    width: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 !important;
  }

  .calendar-action-icon {
    display: inline;
  }

  .calendar-action-label {
    display: none;
  }

  .calendar-toolbar-inline .calendar-action-icon {
    display: inline !important;
  }

  .calendar-toolbar-inline .calendar-action-label {
    display: none !important;
  }

  .calendar-toolbar-inline .month-label {
    position: static !important;
    transform: none !important;
    font-size: 15px;
  }

  .calendar-toolbar > .button-link {
    justify-self: end;
    font-size: 13px;
    padding: 8px 10px;
  }

  .calendar-weekday {
    padding: 6px 2px;
    font-size: 10px;
  }

  .calendar-day {
    min-height: var(--cal-day-min-height, 64px);
    padding: 3px 2px;
    cursor: pointer;
  }

  .calendar-shell[data-calendar-view="month"] .calendar-day {
    height: var(--cal-day-min-height, 64px);
    min-height: var(--cal-day-min-height, 64px);
    max-height: var(--cal-day-min-height, 64px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    container-type: size;
    container-name: cal-day;
  }

  .calendar-shell[data-calendar-view="month"] .day-events {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .day-events {
    gap: 1px;
  }

  /* ダッシュボード月表示: モバイルはコンパクトチップ */
  .calendar-shell[data-calendar-view="month"] .day-events-desktop {
    display: none !important;
  }

  .calendar-shell[data-calendar-view="month"] .day-events-mobile {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  /* ToDo カレンダー: モバイルでもテキストチップを表示 */
  .todos-calendar-panel .day-events {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .todos-calendar-panel[data-calendar-view="month"] .calendar-day {
    cursor: pointer;
  }

  .todos-mobile-agenda {
    display: block;
    margin-top: 14px;
  }

  .todos-calendar-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .todos-calendar-toolbar .month-label {
    text-align: center;
    font-size: 17px;
    order: 0;
  }

  .todos-calendar-toolbar .nav-group {
    justify-content: center;
    order: 1;
  }

  .todos-calendar-toolbar .nav-group .button-link,
  .todos-calendar-toolbar .nav-group .icon-btn {
    min-height: 34px;
    min-width: 34px;
    padding: 5px 11px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .todos-calendar-toolbar .nav-group .icon-btn {
    font-size: 18px;
  }

  .list-toolbar-title-row {
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }

  .list-toolbar-title-row h2 {
    font-size: 15px;
    line-height: 1.3;
  }

  .todos-display-toggle {
    display: inline-flex;
    width: auto;
    margin-left: 0;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .todos-display-toggle a,
  .todos-display-toggle button {
    flex: 0 0 auto;
    text-align: center;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    padding: 6px 10px;
  }

  .day-event-count {
    display: none !important;
  }

  .desktop-only {
    display: none !important;
  }

  .day-header-actions {
    flex-direction: row;
  }

  .calendar-day .quick-add {
    display: none !important;
  }

  .calendar-day.other-month {
    opacity: 0.55;
  }

  .day-num {
    font-size: 11px;
  }

  .calendar-day.today .day-num {
    width: 22px;
    height: 22px;
    font-size: 11px;
    line-height: 22px;
  }

  .day-add-btn {
    min-width: 28px;
    min-height: 28px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .holiday-label {
    display: none;
  }

  .event-chip {
    min-height: 13px;
    height: auto;
    padding: 1px 3px;
    border-radius: 2px;
    font-size: 8px;
    line-height: 1.15;
    overflow: hidden;
  }

  .event-chip .event-title {
    display: block;
    font-size: 8px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .event-meet-badge {
    display: none;
  }

  .event-more {
    font-size: 8px;
    padding: 0;
    min-height: 11px;
    line-height: 1.15;
  }

  .calendar-sidebar {
    margin-top: 16px;
  }

  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal.modal-centered {
    padding: 16px;
    align-items: center;
    justify-content: center;
  }

  .modal-dialog {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    padding: 16px;
    overflow-y: auto;
  }

  .modal.modal-centered .modal-dialog {
    width: min(480px, 100%);
    max-width: calc(100vw - 32px);
    border-radius: 14px;
    max-height: 85vh;
  }

  .modal-actions {
    flex-wrap: nowrap;
    justify-content: stretch;
  }

  .modal-actions button {
    flex: 1;
    min-height: 44px;
  }

  .settings-subnav {
    display: none;
  }

  .filter-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .filter-group {
    min-width: 0;
    width: 100%;
  }

  .todos-filter-accordion .filter-bar > .filter-group:not(.filter-group-period):not(.filter-group-categories),
  .todos-filter-accordion .filter-group-categories {
    width: auto;
  }

  .todos-filter-row-status {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .todos-filter-row-status .filter-group {
    width: auto;
    min-width: 0;
  }

  .todos-filter-row-status .filter-group label {
    font-size: 12px;
  }

  .todos-filter-row-status select,
  .todos-filter-row-status .filter-dropdown-trigger {
    width: 100%;
    min-width: 0;
  }

  .filter-bar-actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
  }

  .filter-bar-actions button,
  .filter-bar-actions a {
    flex: 1 1 0;
    width: auto;
    min-height: 40px;
    justify-content: center;
    white-space: nowrap;
  }

  .filter-bar button {
    width: auto;
    min-height: 40px;
  }

  .list-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .list-toolbar .bulk-actions {
    width: 100%;
    margin-left: 0;
  }

  .bulk-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .bulk-actions button {
    width: 100%;
    min-height: 40px;
    font-size: 13px;
  }

  /* Todo一覧: 一括操作はアイコン1行、内容列を優先表示 */
  #todo-list-panel .todo-bulk-actions.bulk-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #todo-list-panel .todo-bulk-actions .todo-bulk-btn {
    flex: 0 0 auto;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    border-radius: 10px;
  }

  #todo-list-panel .todo-bulk-actions .todo-bulk-icon {
    display: inline;
  }

  #todo-list-panel .todo-bulk-actions .todo-bulk-label {
    display: none;
  }

  #todo-list-panel .todo-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #todo-list-panel .todo-table {
    min-width: 780px;
    width: 100%;
  }

  #todo-list-panel .todo-table .todo-col-check-w {
    width: 36px;
  }

  #todo-list-panel .todo-table .todo-col-date-w {
    width: 88px;
  }

  #todo-list-panel .todo-table .todo-col-title-w {
    width: auto;
    min-width: 120px;
  }

  #todo-list-panel .todo-table .todo-col-time-w {
    width: 78px;
  }

  #todo-list-panel .todo-table .todo-col-category-w {
    width: 72px;
  }

  #todo-list-panel .todo-table .todo-col-importance-w {
    width: 56px;
  }

  #todo-list-panel .todo-table .todo-col-actions-w {
    width: 148px;
  }

  #todo-list-panel .todo-table .todo-col-date {
    min-width: 0;
    max-width: none;
    white-space: normal;
    font-size: 11px;
    line-height: 1.3;
  }

  #todo-list-panel .todo-table .todo-col-title {
    min-width: 120px;
    width: auto;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.35;
  }

  #todo-list-panel .todo-table .todo-col-time,
  #todo-list-panel .todo-table .todo-col-category,
  #todo-list-panel .todo-table .todo-col-importance {
    font-size: 11px;
    white-space: nowrap;
    overflow: visible;
  }

  #todo-list-panel .todo-table td.todo-col-category,
  #todo-list-panel .todo-table td.todo-col-importance {
    overflow: visible;
  }

  #todo-list-panel .todo-table thead th.todo-col-category,
  #todo-list-panel .todo-table thead th.todo-col-importance,
  #todo-list-panel .todo-table thead th.todo-col-time {
    overflow: visible;
    text-overflow: clip;
  }

  #todo-list-panel .todo-table .todo-col-category .category-badge,
  #todo-list-panel .todo-table .todo-col-importance .importance-badge {
    padding: 2px 6px;
    font-size: 10px;
  }

  #todo-list-panel .todo-table .todo-col-actions {
    width: 148px;
    padding: 6px 4px;
  }

  #todo-list-panel .todo-table .todo-row-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    width: auto;
  }

  #todo-list-panel .todo-table .todo-row-actions .todo-row-icon-btn {
    flex: 0 0 auto;
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    font-size: 14px;
    border-radius: 8px;
  }

  #todo-list-panel .todo-table .todo-row-actions .todo-row-icon {
    display: inline;
  }

  #todo-list-panel .todo-table .todo-row-actions .todo-row-label {
    display: none;
  }

  .todo-table {
    min-width: 640px;
  }

  .todo-table .todo-row-actions {
    flex-wrap: wrap;
  }

  .todo-table .todo-row-actions button,
  .todo-table tr.edit-row button {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 12px;
  }

  #todo-list-panel .todo-table .todo-row-actions button,
  #todo-list-panel .todo-table .todo-row-actions .button-link {
    min-height: 32px;
    padding: 0;
    font-size: 14px;
  }

  .list-toolbar .bulk-actions {
    width: 100%;
    margin-left: 0;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .form-grid-row {
    grid-template-columns: 1fr;
  }

  .form-grid-row-top {
    gap: 8px;
  }

  .add-form-grid {
    gap: 10px;
  }

  .line-form-actions {
    flex-direction: column;
  }

  .line-form-actions button {
    width: 100%;
    min-height: 44px;
  }

  .event-hover-tooltip {
    display: none !important;
  }

  .site-user-menu {
    display: inline-flex !important;
    align-items: center;
  }

  .user-menu-toggle {
    width: 34px;
    height: 34px;
  }

  .user-menu-avatar {
    font-size: 12px;
  }

  .mobile-bottom-nav {
    padding-left: 4px;
    padding-right: 4px;
  }

  .mobile-nav-item {
    font-size: 10px;
  }

  .mobile-nav-icon {
    font-size: 16px;
  }
}

/* Auth pages */
.auth-body {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(180deg, #eef4ff 0%, #f8fafc 40%);
}

.auth-shell {
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

/* 特商法・規約など本文が長い法務ページ用 */
.auth-shell-wide {
  max-width: min(960px, calc(100% - 32px));
}

.auth-shell-wide .auth-card {
  max-width: none;
  text-align: left;
}

.auth-shell-wide .auth-card h1 {
  text-align: left;
}

.auth-shell-wide .legal-dl {
  grid-template-columns: minmax(160px, 240px) 1fr;
  gap: 12px 28px;
}

.apply-plan-fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 4px;
}

.apply-plan-fieldset legend {
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
}

.apply-plan-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  font-size: 14px;
}

.apply-plan-option + .apply-plan-option {
  border-top: 1px solid #f3f4f6;
}

.apply-plan-option input {
  margin-top: 4px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: #1a73e8;
  text-decoration: none;
  margin-bottom: 24px;
}

.auth-brand .site-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.auth-card h1 {
  margin: 0 0 16px;
  font-size: 22px;
  text-align: center;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}

.auth-form label.checkbox-inline,
.auth-form .agree-terms-row {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
}

.auth-form label.checkbox-inline input[type="checkbox"],
.auth-form .agree-terms-row input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}

.auth-form .agree-terms-hint {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

.auth-form .agree-terms-row a.is-read {
  color: #15803d;
}

.agree-terms-box {
  margin: 8px 0 4px;
  padding: 14px 14px 12px;
  border: 1px solid #c7d7ef;
  border-radius: 12px;
  background: #f5f9ff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agree-terms-box-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #174ea6;
}

.agree-terms-box-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #3c4043;
}

.agree-terms-actions {
  display: grid;
  gap: 8px;
}

.agree-terms-open-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #93b4e4;
  background: #fff;
  color: #174ea6;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.agree-terms-open-btn:hover,
.agree-terms-open-btn:focus-visible {
  background: #eef5ff;
  outline: none;
}

.agree-terms-open-btn.is-read {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.agree-terms-status {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
}

.agree-terms-status[data-status="done"] {
  background: #dcfce7;
  color: #166534;
}

.agree-terms-check-wrap {
  padding-top: 4px;
  border-top: 1px dashed #c7d7ef;
}

.agree-terms-check-wrap.is-locked {
  opacity: 0.85;
  cursor: not-allowed;
}

.agree-terms-check-wrap.is-ready {
  opacity: 1;
  cursor: default;
}

.agree-terms-tap-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #b45309;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
}

.auth-remember {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
}
.auth-form label.auth-remember {
  flex-direction: row;
  align-items: center;
}
.auth-remember input {
  width: auto;
  min-height: 0;
  margin: 0;
  flex-shrink: 0;
}

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  font-size: 14px;
}

.auth-links a {
  color: #1a73e8;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-link-button {
  border: none;
  background: none;
  padding: 0;
  color: #1a73e8;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.auth-link-button:hover {
  text-decoration: underline;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}

.stack-form input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]),
.stack-form select,
.stack-form textarea {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
}

.admin-invite-message {
  width: 100%;
  min-height: 9rem;
  resize: vertical;
  line-height: 1.6;
  background: #f8fafc;
  color: #1f2937;
}

.profile-dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 16px;
  margin: 0;
}

.profile-dl dt {
  color: #6b7280;
  font-size: 13px;
}

.profile-dl dd {
  margin: 0;
  font-size: 14px;
}

.admin-user-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  background: #fafafa;
}

.admin-user-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef2f6;
}

.admin-user-card-head h2 {
  margin: 0;
}

.admin-page-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-page-actions .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.admin-page-actions .button-link:hover,
.admin-page-actions .button-link:focus-visible {
  filter: brightness(1.06);
}

.admin-page-actions .button-link.secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.admin-page-actions .button-link.secondary:hover,
.admin-page-actions .button-link.secondary:focus-visible {
  filter: none;
  background: #f8fafc;
  border-color: #9ca3af;
}

.admin-back-link::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.admin-user-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.admin-user-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
}

.admin-user-form input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]),
.admin-user-form select {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
}

.admin-user-delete-form {
  margin-top: 8px;
}

.admin-users-table-wrap {
  overflow-x: auto;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 780px;
}

.admin-users-table th,
.admin-users-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}

.admin-users-table th {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: #f9fafb;
  white-space: nowrap;
}

.admin-users-table input,
.admin-users-table select {
  width: 100%;
  max-width: 220px;
  padding: 7px 9px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  box-sizing: border-box;
}

.admin-users-row-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.admin-users-self-tag {
  white-space: nowrap;
  margin-left: 4px;
}

.admin-users-password-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  flex-wrap: nowrap;
}

.admin-users-password-row input {
  max-width: 140px;
}

.admin-users-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  white-space: nowrap;
}

.admin-users-name-cell {
  white-space: nowrap;
}

.admin-users-actions .inline-form {
  display: inline;
  margin: 0;
}

.admin-users-actions .mini-btn {
  text-decoration: none;
}

.admin-users-table-readonly {
  min-width: 640px;
}

.menu-feature-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  max-width: 14rem;
}

.menu-feature-label {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.menu-features-popup-trigger {
  white-space: nowrap;
}

.menu-features-popup-dialog {
  max-width: 22rem;
}

.menu-features-popup-list {
  margin: 0;
  padding: 0.75rem 1.25rem 1.25rem;
  list-style: disc;
}

.menu-features-popup-list li {
  margin: 0.25rem 0;
}

.admin-users-usage-cell {
  max-width: 16rem;
  font-size: 0.82rem;
  line-height: 1.35;
}

.admin-usage-month-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-user-detail {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
}

.admin-user-detail > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  align-items: start;
}

.admin-user-detail dt {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
}

.admin-user-detail dd {
  margin: 0;
  font-size: 14px;
}

@media (max-width: 768px) {
  .admin-user-detail > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.menu-feature-fieldset {
  border: 1px solid var(--border, #d8dee6);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 0;
  grid-column: 1 / -1;
}

.menu-feature-fieldset legend {
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.menu-feature-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 6px;
}

.menu-feature-checks-compact {
  max-width: 280px;
  gap: 4px 10px;
}

.menu-feature-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.admin-user-form label.menu-feature-check,
.stack-form label.menu-feature-check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: auto;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  white-space: normal;
}

.admin-user-form input[type="checkbox"],
.stack-form input[type="checkbox"] {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  flex-shrink: 0;
  accent-color: #1a73e8;
}

.menu-feature-fieldset.is-admin-locked .menu-feature-checks {
  opacity: 0.55;
  pointer-events: none;
}

.group-menu-form {
  margin-top: 12px;
}

.group-menu-form .mini-btn {
  margin-top: 8px;
}

@media (max-width: 768px) {
  .profile-dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .profile-dl dt {
    margin-top: 8px;
  }

  .admin-user-form {
    grid-template-columns: 1fr;
  }

  .admin-users-password-row {
    flex-wrap: wrap;
  }

  .admin-users-password-row input {
    max-width: none;
  }

  .menu-feature-checks-compact {
    max-width: none;
  }
}

/* ??????E????? */
.note-action-translate {
  position: relative;
  font-size: 13px;
  gap: 1px;
}

.note-translate-label {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.note-action-translate.is-translated {
  background: rgba(26, 115, 232, 0.14);
  color: #1a73e8;
}

.note-action-translate.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.note-action-translate.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(26, 115, 232, 0.35);
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: note-translate-spin 0.7s linear infinite;
}

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

/* ??E> AI?? */
.translation-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.translation-key-table {
  margin-top: 8px;
}

.translation-usage-cell {
  font-size: 13px;
  line-height: 1.5;
}

.translation-usage-rate.is-warn {
  color: #b45309;
}

.translation-usage-rate.is-danger {
  color: #d93025;
}

.translation-key-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.modal-dialog-wide {
  width: min(640px, 100%);
}

.translation-modal-form .translation-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.translation-modal-form .translation-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #5f6368;
}

.translation-key-input {
  display: flex;
  gap: 6px;
  align-items: center;
}

.translation-key-input input {
  flex: 1;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.translation-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.translation-modal-submit-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.translation-test-result.is-ok {
  color: #188038;
}

.translation-test-result.is-error {
  color: #d93025;
}

@media (max-width: 640px) {
  .translation-modal-form .translation-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Finance report */
.finance-report-page .finance-report-main {
  max-width: 960px;
}

.finance-report-toolbar {
  margin-bottom: 16px;
}

.finance-report-top-bar {
  width: 100%;
}

.finance-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.finance-report-link {
  margin-left: 4px;
}

.finance-report {
  padding: 24px;
}

.finance-report-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8eaed;
}

.finance-report-title {
  margin: 0 0 8px;
  font-size: 24px;
}

.finance-report-meta {
  margin: 0;
  color: #5f6368;
  font-size: 15px;
}

.finance-report-meta-sep {
  margin: 0 6px;
}

.finance-report-summary {
  margin-bottom: 28px;
}

.finance-report-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.finance-report-stat {
  background: #f8f9fa;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  padding: 12px 14px;
}

.finance-report-stat-label {
  display: block;
  font-size: 13px;
  color: #5f6368;
  margin-bottom: 4px;
}

.finance-report-stat-value {
  font-size: 18px;
  font-weight: 600;
}

.finance-report-stat-value.is-income {
  color: #188038;
}

.finance-report-stat-value.is-expense {
  color: #d93025;
}

.finance-report-section {
  margin-bottom: 28px;
}

.finance-report-table-wrap {
  overflow-x: auto;
}

.finance-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.finance-report-table th,
.finance-report-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e8eaed;
  text-align: left;
  vertical-align: top;
}

.finance-report-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #3c4043;
}

.finance-report-table .is-num {
  text-align: right;
  white-space: nowrap;
}

.finance-report-table .is-income {
  color: #188038;
}

.finance-report-table .is-expense {
  color: #d93025;
}

.finance-report-balance-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  font-weight: 600;
}

@media print {
  .no-print,
  body.finance-report-page .site-header {
    display: none !important;
  }

  body.finance-report-page {
    background: #fff;
  }

  .finance-report {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  .finance-report-section {
    break-inside: avoid;
  }
}

/* ===== Photos album ===== */
.photos-page {
  --photos-ink: #171b1f;
  --photos-muted: #6b7280;
  --photos-paper: #f6f4f1;
  --photos-panel: #ffffff;
  --photos-line: rgba(23, 27, 31, 0.08);
  --photos-accent: #2f6f7e;
  --photos-accent-soft: rgba(47, 111, 126, 0.14);
  --photos-deep: #1a1f24;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(47, 111, 126, 0.10), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(45, 74, 92, 0.08), transparent 55%),
    linear-gradient(180deg, #f8f6f3 0%, #eef1f4 100%);
  min-height: 100vh;
}

.photos-page .photos-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}

.photos-page .photos-busy-overlay[hidden] {
  display: none !important;
}

.photos-busy-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: min(100%, 260px);
  max-width: 360px;
  padding: 22px 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  text-align: center;
}

.photos-busy-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(47, 111, 126, 0.2);
  border-top-color: var(--photos-accent, #2f6f7e);
  border-radius: 50%;
  animation: photos-busy-spin 0.8s linear infinite;
}

.photos-busy-message {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #171b1f;
}

.photos-busy-hint {
  margin: 0;
  font-size: 12px;
  color: #5f6b76;
}

body.photos-is-busy {
  cursor: wait;
}

body.photos-is-busy .photos-main {
  pointer-events: none;
}

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

.photos-delete-toast {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 8800;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 360px);
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(23, 27, 31, 0.92);
  color: #f5f7f8;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
  pointer-events: none;
}

.photos-delete-toast[hidden] {
  display: none !important;
}

.photos-delete-toast-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: photos-busy-spin 0.8s linear infinite;
}

.photos-delete-toast-message {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
}

.photos-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 28px;
  margin-bottom: 18px;
  padding: 8px 2px 4px;
}

.photos-kicker {
  margin: 0 0 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--photos-accent);
}

.photos-title {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--photos-ink);
  letter-spacing: -0.02em;
}

.photos-hero-copy {
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
}

.photos-lead {
  margin: 0;
  max-width: min(100%, 22rem);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  line-height: 1.35;
  color: var(--photos-muted);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photos-hero-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 14px;
  margin-left: auto;
  min-width: 0;
  flex: 1 1 auto;
  align-self: center;
  padding-bottom: 0;
}

.photos-hero-meta .photos-cols-control {
  flex: 0 0 auto;
  flex-shrink: 0;
  margin-left: 0;
  position: relative;
  z-index: 1;
}

.photos-hero-meta:has(.photos-year-scope-banner) {
  margin-left: 12px;
}

/* 年スコープ表示中はアルバム枚数がバナー内と重複するので非表示 */
.photos-hero-meta:has(.photos-year-scope-banner) .photos-lead {
  display: none !important;
}

.photos-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.photos-dup-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--photos-muted);
  cursor: pointer;
  user-select: none;
}

.photos-dup-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--photos-accent);
}

.photos-dup-dialog {
  width: min(920px, 96vw);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
}

.photos-dup-body {
  padding: 0 20px 20px;
  overflow: auto;
  overflow-x: hidden;
  max-width: 100%;
}

.photos-dup-lead {
  margin: 0 0 12px;
  color: var(--photos-muted);
  font-size: 14px;
  line-height: 1.5;
}

.photos-dup-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 14px;
}

.photos-dup-status {
  font-size: 13px;
  color: var(--photos-muted);
}

.photos-dup-empty {
  margin: 24px 0;
  text-align: center;
  color: var(--photos-muted);
}

.photos-dup-group {
  border: 1px solid var(--photos-line);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.photos-dup-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}

.photos-dup-group-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.photos-dup-group-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 100%;
  overflow: hidden;
}

.photos-dup-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(23, 27, 31, 0.06);
  max-width: 100%;
  box-sizing: border-box;
}

.photos-dup-check {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 36px;
  cursor: pointer;
}

.photos-dup-check-input,
.photos-dup-group-check {
  width: 18px;
  height: 18px;
  accent-color: var(--photos-accent);
  cursor: pointer;
}

.photos-dup-media {
  position: relative;
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  max-width: 96px;
  max-height: 96px;
  border-radius: 10px;
  overflow: hidden;
  background: #e8ecef;
}

.photos-dup-thumb {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover;
  display: block;
  border: 0;
}

.photos-dup-play {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.photos-dup-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.photos-dup-name-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--photos-muted);
}

.photos-dup-name {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  border: 1px solid var(--photos-line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  color: var(--photos-ink);
  background: #fff;
}

.photos-dup-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photos-dup-item-sub {
  margin: 0;
  font-size: 12px;
  color: var(--photos-muted);
}

@media (max-width: 640px) {
  .photos-dup-media {
    flex-basis: 72px;
    width: 72px;
    height: 72px;
    max-width: 72px;
    max-height: 72px;
  }
}

.photos-upload-btn,
.photos-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.photos-upload-btn {
  position: relative;
  background: var(--photos-ink);
  color: #fff;
  box-shadow: 0 10px 24px rgba(23, 27, 31, 0.18);
  margin: 0;
  border: 0;
}

.photos-upload-btn-label {
  pointer-events: none;
}

.photos-year-scope-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  margin-right: auto;
  padding: 6px 14px;
  border-radius: 999px;
  overflow: hidden;
}

.photos-year-scope-line {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  font-size: 13px;
  line-height: 1.35;
}

.photos-year-scope-banner a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.photos-year-scope-count.is-collapsed {
  display: none;
}

.photos-year-scope-mobile {
  display: none;
}

.photos-year-scope-tip-anchor {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
}

.photos-year-scope-tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 5;
  max-width: min(92vw, 280px);
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff;
  color: #1b5e20;
  border: 1px solid #c8e6c9;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.photos-year-scope-tip::after {
  content: '';
  position: absolute;
  left: 18px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid #c8e6c9;
  border-bottom: 1px solid #c8e6c9;
  transform: rotate(45deg);
}

.photos-year-scope-tip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.photos-year-scope-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #81c784;
  background: rgba(232, 245, 233, 0.95);
  color: #1b5e20;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.photos-year-scope-all-btn:hover {
  background: #e8f5e9;
  border-color: #66bb6a;
}

@media (max-width: 768px) {
  .photos-year-scope-banner.banner.notice {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-self: center;
    width: auto;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    color: inherit;
    overflow: visible;
    border-radius: 0;
    flex: none;
  }

  .photos-year-scope-desktop {
    display: none !important;
  }

  .photos-year-scope-mobile {
    display: block;
    max-width: 100%;
    min-width: 0;
  }

  .photos-year-scope-tip-anchor {
    max-width: 100%;
  }

  .photos-year-scope-all-btn {
    text-decoration: none;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 12px;
    font-size: 12px;
    overflow: hidden;
  }

  .photos-hero-meta {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 6px;
    margin-left: 0 !important;
    min-width: 0;
  }

  .photos-hero-meta .photos-cols-control {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0 !important;
    justify-self: end;
  }

  .photos-hero-meta .photos-lead {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
  }
}

.photos-file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.archive-list li {
  padding: 12px 0;
  border-top: 1px solid var(--line, #e5e7eb);
}

.photos-pending-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--photos-line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(23, 27, 31, 0.08);
}

.photos-pending-bar[hidden] {
  display: none !important;
}

.photos-pending-count {
  flex: 1 1 140px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--photos-ink);
}

.photos-pending-bar .photos-upload-btn,
.photos-pending-bar .photos-secondary-btn {
  position: static;
  overflow: visible;
  flex: 0 0 auto;
}

.photos-add-sheet[hidden] {
  display: none !important;
}

.photos-add-sheet {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
}

.photos-add-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(12, 16, 20, 0.45);
  cursor: pointer;
}

.photos-add-sheet-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  /* 画面が低いときはパネル内だけスクロールさせ、上下の余白を保つ */
  max-height: 100%;
  overflow-y: auto;
  margin: 0;
  padding: 20px 18px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(23, 27, 31, 0.24);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* スクロールが出る高さでもボタンが潰れないようにする */
.photos-add-sheet-panel > * {
  flex-shrink: 0;
}

.photos-upload-album {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--photos-muted);
}

.photos-upload-album select {
  max-width: 220px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--photos-line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--photos-ink);
}

.photos-add-sheet-album {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  margin-bottom: 6px;
}

.photos-add-sheet-album select {
  max-width: none;
  min-height: 44px;
}

.photos-dashboard-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--photos-muted);
}

.photos-dashboard-field select {
  color: var(--photos-ink, #111827);
  background: #fff;
  color-scheme: light;
}

.photos-album-dashboard-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  color: #4b5563;
}

.photos-album-dashboard-field select {
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--photos-line, #d1d5db);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--photos-ink, #111827);
  color-scheme: light;
}

.photos-add-sheet-panel h2 {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.35rem;
  color: var(--photos-ink);
}

.photos-add-sheet-hint {
  margin: 0 0 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--photos-muted);
}

.photos-add-sheet-action {
  width: 100%;
}

.photos-add-sheet-note {
  margin: -4px 0 4px;
}

/* フォルダ取り込みの確認 */
.photos-folder-import[hidden] {
  display: none !important;
}

.photos-folder-import {
  position: fixed;
  inset: 0;
  z-index: 1310;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
}

.photos-folder-import-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(100%, 560px);
  max-height: 100%;
  padding: 20px 18px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(23, 27, 31, 0.24);
}

.photos-folder-import-panel h2 {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.35rem;
  color: var(--photos-ink);
}

.photos-folder-import-hint,
.photos-folder-import-total {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--photos-muted);
}

.photos-folder-import-total {
  font-weight: 600;
  color: var(--photos-ink);
}

.photos-folder-import-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--photos-line);
  border-radius: 14px;
}

.photos-folder-import-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--photos-line);
}

.photos-folder-import-row:last-child {
  border-bottom: 0;
}

.photos-folder-import-row.is-off {
  opacity: 0.45;
}

.photos-folder-import-check {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.photos-folder-import-name {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--photos-line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--photos-ink);
}

.photos-folder-import-loose {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: var(--photos-muted);
}

.photos-folder-import-count {
  flex: 0 0 auto;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  color: var(--photos-muted);
  font-variant-numeric: tabular-nums;
}

.photos-folder-import-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.photos-folder-import-actions button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
  box-shadow: none;
}

@media (max-width: 560px) {
  .photos-folder-import-row {
    flex-wrap: wrap;
  }
  .photos-folder-import-count {
    width: 100%;
    padding-left: 28px;
  }
}

.photos-upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(23, 27, 31, 0.22);
}

.photos-upload-btn-large {
  margin-top: 8px;
}

.photos-secondary-btn {
  border: 1px solid var(--photos-line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--photos-ink);
  backdrop-filter: blur(8px);
}

.photos-secondary-btn:hover {
  background: #fff;
}

label.photos-camera-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
  overflow: hidden;
}

label.photos-camera-btn input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

label.photos-camera-btn span {
  pointer-events: none;
}

.photos-toolbar-select {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.photos-toolbar-select select {
  appearance: none;
  border: 1px solid rgba(23, 27, 31, 0.14);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center;
  border-radius: 999px;
  padding: 7px 28px 7px 12px;
  font: inherit;
  font-size: 13px;
  color: #1f2933;
  cursor: pointer;
}

/* 「すべて」の表示範囲（トグル右・overflow 外に置きフォーカス枠の欠けを防ぐ） */
.photos-kind-filter-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.photos-kind-scope-wrap {
  display: inline-flex;
  align-items: center;
  margin: 0;
  max-width: min(100%, 16rem);
}

.photos-kind-scope-wrap[hidden] {
  display: none !important;
}

.photos-kind-scope-select {
  appearance: none;
  border: 1px solid rgba(23, 27, 31, 0.14);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center;
  border-radius: 999px;
  padding: 7px 28px 7px 12px;
  font: inherit;
  font-size: 12px;
  color: #1f2933;
  cursor: pointer;
  max-width: 100%;
  min-width: 0;
}

.photos-kind-scope-select:focus {
  outline: none;
  border-color: rgba(47, 111, 126, 0.55);
  box-shadow: 0 0 0 2px rgba(47, 111, 126, 0.22);
}

.photos-kind-scope-select:focus-visible {
  outline: none;
  border-color: rgba(47, 111, 126, 0.55);
  box-shadow: 0 0 0 2px rgba(47, 111, 126, 0.22);
}

.photos-folder-watch-status {
  font-size: 12px;
  color: #2563eb;
  font-weight: 600;
  align-self: center;
}

/* フォルダ監視は Web（PC幅）のみ。スマホには出さない */
.photos-dir-watch-only {
  display: none !important;
}

@media (min-width: 769px) {
  button.photos-dir-watch-only:not([hidden]) {
    display: inline-flex !important;
  }

  span.photos-dir-watch-only:not([hidden]) {
    display: inline !important;
  }
}

.photos-secondary-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.photos-album-delete-form {
  display: none;
  margin: 0;
}

.photos-album-modal-actions {
  justify-content: flex-end;
}

.photos-album-modal-actions [data-close-album-modal] {
  margin-right: auto;
}

.photos-album-modal-dialog {
  max-width: min(560px, 100%) !important;
  width: min(560px, 100%);
}

.photos-album-cover-picker {
  display: grid;
  gap: 10px;
  margin: 4px 0 2px;
  min-width: 0;
}

.photos-album-cover-picker[hidden] {
  display: none !important;
}

.photos-album-cover-picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.photos-album-cover-picker-head strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--photos-ink, #171b1f);
}

.photos-album-cover-picker-head .hint {
  margin: 0;
  font-size: 12px;
}

.photos-album-cover-preview {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(23, 27, 31, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.photos-album-cover-preview[hidden] {
  display: none !important;
}

.photos-album-cover-preview img {
  display: block;
  width: min(100%, 180px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  background: #e8eaed;
}

.photos-album-cover-preview-meta {
  margin: 0;
  font-size: 12px;
  color: var(--photos-muted, #5f6b76);
  text-align: center;
  word-break: break-word;
}

.photos-album-cover-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: min(42vh, 300px);
  overflow: auto;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.photos-album-cover-option {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

.photos-album-cover-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid rgba(23, 27, 31, 0.12);
  border-radius: 10px;
  overflow: hidden;
  background: #e8eaed;
  isolation: isolate;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.photos-album-cover-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: transform 0.18s ease, filter 0.15s ease;
}

.photos-album-cover-option:hover .photos-album-cover-thumb,
.photos-album-cover-option:focus-visible .photos-album-cover-thumb {
  border-color: var(--photos-accent, #2f6f7e);
  box-shadow: 0 6px 16px rgba(23, 27, 31, 0.16);
  transform: translateY(-2px);
}

.photos-album-cover-option:hover .photos-album-cover-thumb img,
.photos-album-cover-option:focus-visible .photos-album-cover-thumb img {
  transform: scale(1.06);
  filter: brightness(1.06) contrast(1.04);
}

.photos-album-cover-option:hover .photos-album-cover-caption,
.photos-album-cover-option:focus-visible .photos-album-cover-caption {
  color: var(--photos-ink, #171b1f);
  font-weight: 600;
}

.photos-album-cover-option:focus-visible {
  outline: none;
}

.photos-album-cover-option.is-selected .photos-album-cover-thumb {
  border-color: var(--photos-accent, #2f6f7e);
  box-shadow: 0 0 0 2px rgba(47, 111, 126, 0.28);
}

.photos-album-cover-option.is-selected:hover .photos-album-cover-thumb,
.photos-album-cover-option.is-selected:focus-visible .photos-album-cover-thumb {
  box-shadow: 0 0 0 2px rgba(47, 111, 126, 0.35), 0 6px 16px rgba(23, 27, 31, 0.16);
}

.photos-album-cover-option.is-selected .photos-album-cover-thumb::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--photos-accent, #2f6f7e);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  z-index: 1;
}

.photos-album-cover-caption {
  display: block;
  min-width: 0;
  padding: 0 2px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--photos-muted, #5f6b76);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photos-album-cover-play {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 9px;
  line-height: 18px;
  text-align: center;
  z-index: 1;
}

.photos-album-cover-empty {
  grid-column: 1 / -1;
  margin: 0;
}

@media (max-width: 560px) {
  .photos-album-cover-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(38vh, 260px);
  }
}

.photos-danger-btn {
  color: #9b2c2c;
  border-color: rgba(155, 44, 44, 0.28);
  background: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.photos-danger-btn:hover {
  background: #fff5f5;
  color: #822727;
}

.photos-pwa-guide-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.photos-pwa-guide-lead {
  margin: 0;
  color: var(--photos-ink, #202124);
  font-size: 15px;
  line-height: 1.5;
}

.photos-pwa-guide-steps {
  margin: 0;
  padding-left: 1.25em;
  color: var(--photos-ink, #202124);
  line-height: 1.7;
}

.photos-storage {
  margin: 0 0 12px;
  padding: 12px 16px;
  border: 1px solid var(--photos-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  font-family: 'Outfit', sans-serif;
}

.photos-storage[hidden] {
  display: none;
}

.photos-hero-title-group {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.photos-current-album {
  display: inline-block;
  max-width: min(100%, 28rem);
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  font-weight: 600;
  color: var(--photos-accent, #2f6f7e);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photos-album-jump-wrap {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: min(100%, 18rem);
}

.photos-album-jump {
  width: 100%;
  max-width: 18rem;
  min-height: 36px;
  padding: 4px 28px 4px 10px;
  border: 1px solid rgba(47, 111, 126, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%232f6f7e' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--photos-accent, #2f6f7e);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  appearance: none;
  cursor: pointer;
}

.photos-album-flag {
  display: inline-flex;
  align-items: center;
  align-self: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(47, 111, 126, 0.22);
  background: rgba(47, 111, 126, 0.08);
  color: var(--photos-accent, #2f6f7e);
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.photos-storage-panel-total {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--photos-muted, #5f6b76);
  line-height: 1.35;
  max-width: min(100%, 36rem);
}

.photos-storage-panel-total-used {
  font-weight: 700;
  color: var(--photos-ink, #171b1f);
}

.photos-storage-panel-total.is-over .photos-storage-panel-total-used {
  color: #c62828;
}

.photos-add-sheet-dup {
  margin: 2px 0 4px;
  padding: 8px 4px;
}

.photos-year-auto-hint {
  margin: 0 0 12px;
  text-align: right;
  font-size: 13px;
  color: var(--photos-muted);
}

.photos-year-auto-hint a {
  margin-left: 0.35em;
  white-space: nowrap;
}

.photos-storage-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px 12px;
  font-size: 13px;
  color: var(--photos-muted);
  margin-bottom: 10px;
}

.photos-storage-head strong {
  color: var(--photos-ink);
}

.photos-storage-head-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  justify-content: flex-start;
}

.photos-storage-summary {
  font-size: 13px;
  color: var(--photos-muted);
}

.photos-storage-summary strong {
  color: var(--photos-ink);
}

.photos-storage-summary-total {
  flex: 1 1 auto;
  min-width: 0;
}

.app-accordion-body > .photos-storage-head {
  justify-content: flex-start;
  margin-bottom: 10px;
}

.photos-storage-usage-btn {
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.3;
}

.photos-sim-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}

.photos-sim-form {
  display: grid;
  gap: 14px;
}

.photos-sim-fieldset {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--photos-line, rgba(32, 33, 36, 0.12));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  min-width: 0;
}

.photos-sim-fieldset legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--photos-ink, #202124);
}

.photos-sim-fieldset label {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--photos-muted, #5f6368);
}

.photos-sim-fieldset label:first-of-type {
  margin-top: 4px;
}

.photos-sim-fieldset input[type="number"],
.photos-sim-fieldset select {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--photos-line, rgba(32, 33, 36, 0.16));
  border-radius: 10px;
  background: #fff;
  color: var(--photos-ink, #202124);
  font: inherit;
}

.photos-sim-fieldset input[type="range"] {
  width: 100%;
}

.photos-sim-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.photos-sim-row .photos-sim-grow {
  min-width: 0;
}

.photos-sim-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.photos-sim-split-summary {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--photos-ink, #202124);
  font-weight: 550;
}

.photos-sim-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.photos-sim-result {
  padding: 16px 18px;
  border: 1px solid var(--photos-line, rgba(32, 33, 36, 0.12));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  position: sticky;
  top: 8px;
}

.photos-sim-result h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--photos-muted, #5f6368);
  font-weight: 600;
}

.photos-sim-total {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 650;
  color: var(--photos-ink, #202124);
  font-family: 'Outfit', sans-serif;
}

.photos-sim-total-jpy {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--photos-ink, #202124);
}

.photos-sim-result-dl {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.photos-sim-result-dl > div {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.photos-sim-result-dl dt {
  margin: 0;
  flex: 0 0 auto;
  color: var(--photos-muted, #5f6368);
  white-space: nowrap;
}

.photos-sim-result-dl dd {
  margin: 0;
  flex: 1 1 auto;
  text-align: right;
  color: var(--photos-ink, #202124);
  font-weight: 550;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .photos-sim-layout {
    grid-template-columns: 1fr;
  }

  .photos-sim-result {
    position: static;
  }

  .photos-sim-row {
    grid-template-columns: 1fr;
  }
}

.photos-storage-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--photos-muted);
}

.modal.modal-centered .modal-dialog.photos-usage-dialog {
  width: min(1120px, 96vw);
  max-width: min(1120px, 96vw);
}

.photos-usage-body {
  padding: 4px 4px 0;
}

.photos-usage-lead {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--photos-muted, #5f6368);
  line-height: 1.55;
}

.photos-usage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.photos-usage-card {
  padding: 16px 18px;
  border: 1px solid var(--photos-line, rgba(32, 33, 36, 0.12));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  min-width: 0;
}

.photos-usage-card.is-off {
  opacity: 0.62;
}

.photos-usage-card.is-over {
  border-color: rgba(194, 65, 12, 0.35);
}

.photos-usage-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  margin-bottom: 12px;
}

.photos-usage-card-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--photos-ink, #202124);
}

.photos-usage-card-head span {
  font-size: 12px;
  color: var(--photos-muted, #5f6368);
}

.photos-usage-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  margin: 0;
}

.photos-usage-dl > div {
  display: grid;
  grid-template-columns: 6.5em 1fr;
  gap: 8px;
  font-size: 13px;
  align-items: baseline;
}

.photos-usage-dl dt {
  margin: 0;
  color: var(--photos-muted, #5f6368);
}

.photos-usage-dl dd {
  margin: 0;
  color: var(--photos-ink, #202124);
  font-weight: 550;
}

.photos-usage-note,
.photos-usage-muted,
.photos-usage-foot {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--photos-muted, #5f6368);
  line-height: 1.5;
}

.photos-usage-mini-bar {
  margin-top: 10px;
}

@media (max-width: 820px) {
  .photos-usage-grid {
    grid-template-columns: 1fr;
  }

  .photos-usage-dl {
    grid-template-columns: 1fr;
  }
}

.photos-storage-over {
  margin-left: 6px;
  font-style: normal;
  font-weight: 600;
  color: #b45309;
}

.photos-storage-block-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(180, 83, 9, 0.12);
  color: #9a3412;
  font-size: 13px;
  line-height: 1.45;
}

.photos-storage-bar {
  position: relative;
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(23, 27, 31, 0.08);
  overflow: hidden;
}

.photos-storage-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--photos-accent);
  transition: width 0.25s ease;
}

.photos-storage-bar-fill.is-warn {
  background: #c2410c;
}

.photos-storage-bar-free-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: rgba(23, 27, 31, 0.45);
  pointer-events: none;
}

.photos-storage-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--photos-muted);
}

/* 「B2へアーカイブ」が何を対象にするかは誤解しやすいので、ボタンの近くで明示する */
.photos-archive-mode-note {
  margin: 6px 0 0;
  line-height: 1.6;
}

/* 年を送ったあとツールバーまで戻らずに済むよう、スクロール中は手元に出しておく */
.photos-year-dock {
  position: fixed;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding: 8px;
  border-radius: 22px;
  background: rgba(20, 24, 28, 0.86);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(8, 12, 16, 0.35);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.photos-year-dock[hidden] {
  display: none !important;
}

.photos-year-dock.is-hiding {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.photos-year-dock-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.photos-year-dock-select {
  display: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: min(92vw, 360px);
}

.photos-year-dock-select:not([hidden]) {
  display: inline-flex;
}

.photos-year-dock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.photos-year-dock-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.photos-year-dock-range.is-active {
  background: #eef4ff;
  color: #1a73e8;
}

.photos-year-dock-field {
  display: flex;
}

.photos-year-dock select {
  appearance: none;
  min-height: 38px;
  padding: 0 30px 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.photos-year-dock select option {
  color: #11151a;
}

.photos-year-dock-top {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #11151a;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.photos-year-dock-top:hover {
  background: #e8eef5;
}

@media (max-width: 768px) {
  /* モバイルは下部ナビが居るので、その上に重ねる */
  .photos-year-dock {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 12px;
  }

  /* スマホは下の選択バーがあるのでドック内の選択ボタンは出さない */
  .photos-year-dock-select {
    display: none !important;
  }
}

.photos-album-covers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.photos-album-covers[hidden] {
  display: none;
}

.photos-cover-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: #2a3138;
  box-shadow: 0 10px 24px rgba(23, 27, 31, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photos-cover-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(23, 27, 31, 0.16);
}

.photos-cover-card.is-active {
  outline: 2px solid var(--photos-accent);
  outline-offset: 2px;
}

.photos-cover-card.is-all {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 16px;
  background:
    linear-gradient(145deg, #2f6f7e 0%, #1a1f24 70%);
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.photos-cover-all-label {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.photos-cover-meta {
  font-size: 12px;
  opacity: 0.8;
}

.photos-cover-image,
.photos-cover-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photos-cover-placeholder {
  background:
    linear-gradient(135deg, #3a4450, #1a1f24 60%);
}

.photos-cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(12, 14, 16, 0.78));
}

.photos-cover-play {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 2;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(47, 111, 126, 0.9);
  color: #fff;
  font-size: 13px;
  padding-left: 2px;
  pointer-events: none;
}

.photos-cover-text {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: 'Outfit', sans-serif;
  z-index: 1;
}

.photos-cover-text strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.photos-cover-text span {
  font-size: 12px;
  opacity: 0.82;
}

.photos-day-group {
  margin-bottom: 18px;
}

.photos-day-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 8px;
}

.photos-day-label {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--photos-ink);
}

.photos-day-count {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  color: var(--photos-muted);
}

.photos-lightbox-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
}

.photos-cover-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.photos-cover-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.photos-album-rail {
  display: none;
}

.photos-album-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--photos-line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--photos-ink);
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.photos-album-chip:hover {
  background: #fff;
}

.photos-album-chip.is-active {
  background: var(--photos-ink);
  border-color: var(--photos-ink);
  color: #fff;
}

.photos-album-count {
  min-width: 1.4em;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--photos-accent-soft);
  color: var(--photos-accent);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.photos-album-chip.is-active .photos-album-count {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.photos-hidden-reveal-note {
  margin: 8px 0 0;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--photos-accent, #0f766e);
}

.is-fading-out {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.photos-album-lock {
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: 24px 12px;
}

.photos-album-lock-card {
  width: min(100%, 420px);
  padding: 24px 20px;
  border-radius: 18px;
  border: 1px solid var(--photos-line, #e5e7eb);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(23, 27, 31, 0.08);
}

.photos-album-lock-card h2 {
  margin: 0 0 8px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.4rem;
  color: var(--photos-ink, #171b1f);
}

.photos-album-lock-card > p {
  margin: 0 0 16px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  color: var(--photos-muted, #6b7280);
}

.photos-cover-card.is-hidden-album {
  outline: 1px dashed rgba(15, 118, 110, 0.45);
}

.photos-empty {
  min-height: 420px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  border: 1px dashed rgba(23, 27, 31, 0.18);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.35)),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(23, 27, 31, 0.03) 18px,
      rgba(23, 27, 31, 0.03) 19px
    );
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.photos-empty.is-dragover {
  border-color: var(--photos-accent);
  box-shadow: 0 0 0 4px var(--photos-accent-soft);
}

.photos-empty-frame {
  text-align: center;
  padding: 28px 20px;
  max-width: 420px;
}

.photos-empty-title {
  margin: 0 0 8px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.7rem;
  color: var(--photos-ink);
}

.photos-empty-text {
  margin: 0 0 18px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--photos-muted);
}

.photos-empty-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: min(100%, 320px);
  margin: 0 auto;
}

.photos-empty-actions .photos-upload-btn,
.photos-empty-actions .photos-secondary-btn {
  position: static;
  overflow: visible;
  width: 100%;
}

.photos-masonry {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

#photos-gallery[data-cols="1"] .photos-masonry { grid-template-columns: repeat(1, minmax(0, 1fr)); }
#photos-gallery[data-cols="2"] .photos-masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#photos-gallery[data-cols="3"] .photos-masonry { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#photos-gallery[data-cols="4"] .photos-masonry { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#photos-gallery[data-cols="5"] .photos-masonry { grid-template-columns: repeat(5, minmax(0, 1fr)); }
#photos-gallery[data-cols="6"] .photos-masonry { grid-template-columns: repeat(6, minmax(0, 1fr)); }
#photos-gallery[data-cols="7"] .photos-masonry { grid-template-columns: repeat(7, minmax(0, 1fr)); }

.photos-tile {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  break-inside: avoid;
  position: relative;
  cursor: zoom-in;
  background: #d7dbe0;
  aspect-ratio: 1 / 1;
  box-shadow: 0 4px 14px rgba(23, 27, 31, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.photos-tile img,
.photos-tile-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
  pointer-events: none;
}

.photos-tile img.photos-tile-video {
  background: #2a3138;
}

.photos-tile-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(23, 27, 31, 0.28));
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.photos-tile:hover,
.photos-tile:focus-visible {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 18px 36px rgba(23, 27, 31, 0.16);
  outline: none;
}

.photos-tile:hover img,
.photos-tile:focus-visible img,
.photos-tile:hover .photos-tile-video,
.photos-tile:focus-visible .photos-tile-video {
  transform: scale(1.04);
}

.photos-tile.is-video {
  background: #2a3138;
}

.photos-play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(47, 111, 126, 0.92);
  color: #fff;
  font-size: 18px;
  padding-left: 3px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.photos-lightbox-stage video {
  width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 16px;
  background: #0d0f12;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.photos-lightbox-stage img[hidden],
.photos-lightbox-stage video[hidden] {
  display: none !important;
}

.photos-lightbox[hidden] {
  display: none !important;
}

.photos-lightbox {
  position: fixed;
  inset: 0;
  /* mobile-bottom-nav(300) より上。詳細モーダル(4000)より下 */
  z-index: 320;
  display: grid;
  justify-items: center;
  align-items: safe center;
  overflow: auto;
  padding: 12px;
  box-sizing: border-box;
}

.photos-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 16, 0.86);
  backdrop-filter: blur(8px);
}

.photos-lightbox-stage {
  position: relative;
  z-index: 1;
  width: min(1072px, calc(100vw - 16px));
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* 前へ／次へを写真の左右外に置く。上は固定の全画面／閉じる用 */
  padding: 52px 56px 0;
  box-sizing: border-box;
  min-height: 0;
}

.photos-lightbox-stage img {
  width: 100%;
  max-height: calc(100dvh - 160px);
  object-fit: contain;
  border-radius: 16px;
  background: #0d0f12;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.photos-lightbox-media {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  touch-action: none;
}

.photos-lightbox-media.is-zoomed {
  cursor: grab;
}

.photos-lightbox-media.is-panning {
  cursor: grabbing;
}

.photos-lightbox-media img,
.photos-lightbox-media video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 160px);
  object-fit: contain;
  border-radius: 16px;
  background: #0d0f12;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  transform-origin: center center;
}

.photos-lightbox-unplayable {
  max-width: min(100%, 420px);
  margin: 0;
  padding: 20px 22px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.86);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.photos-lightbox-unplayable[hidden] {
  display: none !important;
}

.photos-lightbox-unplayable a {
  display: inline-block;
  margin-top: 8px;
  color: #fff;
  font-weight: 600;
}

.photos-crop-dialog {
  width: min(920px, 96vw);
  max-width: 96vw;
}

.photos-crop-hint {
  margin: 0 0 10px;
}

.photos-crop-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.photos-crop-stage {
  display: grid;
  place-items: center;
  min-height: 240px;
  max-height: min(58vh, 560px);
  overflow: auto;
  background: #111827;
  border-radius: 12px;
  padding: 12px;
}

.photos-crop-frame {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.photos-crop-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.photos-crop-overlay {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.photos-crop-shade {
  position: absolute;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.photos-crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: move;
  pointer-events: auto;
  touch-action: none;
  box-sizing: border-box;
}

.photos-crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 1px solid #111827;
  border-radius: 2px;
  pointer-events: auto;
  touch-action: none;
}

.photos-crop-handle[data-handle="nw"] { left: -7px; top: -7px; cursor: nwse-resize; }
.photos-crop-handle[data-handle="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
.photos-crop-handle[data-handle="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; }
.photos-crop-handle[data-handle="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }

.photos-trim-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* author display rules beat UA [hidden]; keep toggles working */
.photos-lightbox-actions[hidden],
#photos-lb-main-actions[hidden],
#photos-lb-edit-actions[hidden],
.photos-lightbox-actions [hidden],
.photos-ss-controls [hidden],
.photos-secondary-btn[hidden],
.photos-trim-form[hidden],
.photos-taken-at-form[hidden] {
  display: none !important;
}

.photos-detail-dialog,
.photos-bulk-edit-dialog {
  width: min(420px, 100%);
}

.photos-bulk-edit-form select,
.photos-bulk-edit-form input[type="datetime-local"] {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  color: #111827;
  background: #fff;
  color-scheme: light;
  box-sizing: border-box;
}

.photos-detail-list {
  margin: 0;
  padding: 4px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photos-detail-row {
  display: grid;
  grid-template-columns: 6.5em 1fr;
  gap: 8px 12px;
  align-items: start;
}

.photos-detail-row[hidden] {
  display: none !important;
}

.photos-detail-row dt {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

.photos-detail-row dd {
  margin: 0;
  font-size: 13px;
  color: #111827;
  word-break: break-word;
}

.photos-taken-at-form {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.photos-taken-at-form label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  white-space: nowrap;
}

.photos-taken-at-form input[type="datetime-local"] {
  min-height: 26px;
  padding: 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  font: inherit;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  color-scheme: dark;
}

.photos-lightbox-meta .photos-taken-at-form input[type="datetime-local"] {
  max-width: 128px;
}

.photos-lightbox-meta .photos-dashboard-form select {
  min-height: 26px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  font: inherit;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  /* native option list must stay light or Windows shows white-on-white */
  color-scheme: light;
}

.photos-lightbox-meta .photos-dashboard-form select option,
.photos-dashboard-field select option,
.photos-bulk-edit-form select option {
  color: #111827;
  background: #fff;
}

.photos-lightbox-meta .photos-trim-form input[type="number"] {
  width: 2.8rem;
  min-height: 26px;
  padding: 0 4px;
  font-size: 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.photos-lightbox-meta .photos-trim-form label {
  font-size: 10px;
  white-space: nowrap;
}

.photos-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 8px 0 16px;
  overflow-x: visible;
  -webkit-overflow-scrolling: touch;
}

.photos-toolbar > * {
  flex: 0 0 auto;
}

.photos-toolbar-select-row {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.photos-toolbar-select-row[hidden] {
  display: none !important;
}

.photos-range-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--photos-muted, #5f6368);
}

.photos-toolbar .photos-mode-toggle + .photos-mode-toggle {
  margin-left: 0;
}

.photos-mode-toggle {
  display: inline-flex;
  border: 1px solid var(--photos-line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--photos-panel);
  box-shadow: 0 1px 2px rgba(23, 27, 31, 0.06);
}

.photos-mode-btn {
  border: 0;
  background: transparent;
  color: var(--photos-ink);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
}

.photos-mode-btn:hover {
  background: rgba(47, 111, 126, 0.08);
}

.photos-mode-btn.is-active {
  background: var(--photos-accent);
  color: #fff;
  font-weight: 600;
}

.photos-cols-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--photos-line);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 2px rgba(23, 27, 31, 0.06);
  backdrop-filter: blur(8px);
  --cols-fill: 50%;
}

.photos-cols-control[hidden] {
  display: none !important;
}

.photos-cols-icon {
  display: inline-flex;
  color: var(--photos-muted);
  flex: 0 0 auto;
}

.photos-cols-icon.is-dense {
  color: var(--photos-accent);
}

/* 両端のアイコンは 1 列ずつの増減ボタン。見た目はアイコンのまま押せるようにする */
.photos-cols-step {
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.photos-cols-step:hover:not(:disabled) {
  background: rgba(47, 111, 126, 0.12);
  color: var(--photos-accent);
}

.photos-cols-step:disabled {
  opacity: 0.35;
  cursor: default;
}

.photos-cols-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 96px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--photos-accent) 0%,
    var(--photos-accent) var(--cols-fill),
    rgba(23, 27, 31, 0.12) var(--cols-fill),
    rgba(23, 27, 31, 0.12) 100%
  );
  outline: none;
  cursor: pointer;
}

.photos-cols-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--photos-accent);
  box-shadow: 0 2px 8px rgba(47, 111, 126, 0.35);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.photos-cols-slider::-webkit-slider-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(47, 111, 126, 0.4);
}

.photos-cols-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
}

.photos-cols-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--photos-accent);
  box-shadow: 0 2px 8px rgba(47, 111, 126, 0.35);
  cursor: grab;
}

.photos-cols-slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: transparent;
}

.photos-cols-value {
  min-width: 1.1em;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--photos-ink);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.photos-bulk-bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.photos-bulk-bar[hidden] {
  display: none !important;
}

.photos-bulk-count {
  font-size: 13px;
  color: var(--photos-ink);
  font-weight: 500;
}

.photos-bulk-move {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--photos-ink);
}

.photos-bulk-move select {
  min-width: 140px;
  border-radius: 8px;
  border: 1px solid var(--photos-line);
  background: var(--photos-panel);
  color: var(--photos-ink);
  padding: 6px 8px;
}

.photos-tile-wrap {
  position: relative;
  min-width: 0;
  margin: 0;
}

.photos-tile-check {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(12, 14, 16, 0.72);
  place-items: center;
}

.photos-tile-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.photos-list-meta {
  display: none;
}

#photos-gallery .photos-tile-wrap[hidden],
#photos-gallery .photos-tile-wrap.is-page-hidden {
  display: none !important;
}

#photos-gallery[data-photos-mode="select"] .photos-tile-check,
#photos-gallery[data-photos-mode="list"] .photos-tile-check,
#photos-gallery[data-photos-mode="archive"] .photos-tile-check {
  display: grid;
  pointer-events: auto;
  z-index: 3;
}

#photos-gallery[data-photos-mode="select"] .photos-tile,
#photos-gallery[data-photos-mode="list"] .photos-tile,
#photos-gallery[data-photos-mode="archive"] .photos-tile {
  cursor: pointer;
}

#photos-gallery[data-photos-mode="select"] .photos-tile-wrap.is-selected .photos-tile,
#photos-gallery[data-photos-mode="list"] .photos-tile-wrap.is-selected .photos-tile,
#photos-gallery[data-photos-mode="archive"] .photos-tile-wrap.is-selected .photos-tile {
  outline: 3px solid #1a73e8;
  outline-offset: -3px;
}

#photos-range-mode.is-active {
  background: #eef4ff;
  border-color: #93c5fd;
  color: #1a73e8;
  font-weight: 700;
}

#photos-gallery .photos-tile-wrap.is-range-anchor .photos-tile {
  outline: 3px solid #f59e0b;
  outline-offset: -3px;
}

#photos-gallery .photos-tile-wrap.is-range-anchor::after {
  content: attr(data-range-anchor-label);
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 3;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.95);
  color: #111827;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
}

#photos-gallery[data-photos-mode="list"] .photos-masonry {
  display: flex !important;
  flex-direction: column;
  grid-template-columns: none !important;
  gap: 10px;
}

#photos-gallery[data-photos-mode="list"] .photos-tile-wrap:not([hidden]):not(.is-page-hidden) {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0 0 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--photos-line);
}

#photos-gallery[data-photos-mode="list"] .photos-tile-wrap[hidden],
#photos-gallery[data-photos-mode="list"] .photos-tile-wrap.is-page-hidden {
  display: none !important;
}

#photos-gallery[data-photos-mode="list"] .photos-tile {
  margin: 0 !important;
  width: 48px !important;
  height: 48px !important;
  min-height: 0 !important;
  max-width: 48px !important;
  max-height: 48px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 6px;
  box-shadow: none;
}

#photos-gallery[data-photos-mode="list"] .photos-tile img,
#photos-gallery[data-photos-mode="list"] .photos-tile-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#photos-gallery[data-photos-mode="list"] .photos-play-badge {
  width: 22px;
  height: 22px;
  font-size: 9px;
  padding-left: 1px;
  box-shadow: none;
}

#photos-gallery[data-photos-mode="list"] .photos-list-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  min-width: 0;
}

#photos-gallery[data-photos-mode="list"] .photos-list-meta strong {
  grid-column: 1;
  grid-row: 1;
  color: var(--photos-ink);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#photos-gallery[data-photos-mode="list"] .photos-list-meta span {
  grid-column: 1;
  grid-row: 2;
  color: var(--photos-muted);
  font-size: 11px;
}

#photos-gallery[data-photos-mode="list"] .photos-list-download {
  grid-column: 2;
  grid-row: 1 / span 2;
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
}

#photos-gallery[data-photos-mode="list"] .photos-day-header {
  margin: 12px 0 6px;
}

.photos-select-actions,
.photos-pager {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.photos-select-actions[hidden],
.photos-pager[hidden] {
  display: none !important;
}

.photos-pager-btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--photos-line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--photos-ink);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.photos-pager-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.photos-pager-status {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  color: var(--photos-muted);
  white-space: nowrap;
}

.photos-day-group[hidden],
.photos-day-group.is-page-hidden {
  display: none !important;
}

.photos-lightbox-close,
.photos-lightbox-nav,
.photos-lightbox-fs {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
}

.photos-lightbox-fs {
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(60px, calc(env(safe-area-inset-right, 0px) + 48px));
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  z-index: 3;
  line-height: 1;
}

.photos-lightbox-fs:hover,
.photos-lightbox-fs.is-active {
  background: rgba(255, 255, 255, 0.22);
}

.photos-lightbox:fullscreen,
.photos-lightbox:-webkit-full-screen,
.photos-lightbox.is-fullscreen {
  background: #07090b;
  display: grid;
  place-items: center;
  padding: 0;
}

.photos-lightbox:fullscreen .photos-lightbox-meta,
.photos-lightbox:-webkit-full-screen .photos-lightbox-meta,
.photos-lightbox.is-fullscreen .photos-lightbox-meta,
.photos-lightbox:fullscreen .photos-lightbox-fs,
.photos-lightbox:-webkit-full-screen .photos-lightbox-fs,
.photos-lightbox.is-fullscreen .photos-lightbox-fs,
.photos-lightbox:fullscreen .photos-lightbox-close,
.photos-lightbox:-webkit-full-screen .photos-lightbox-close,
.photos-lightbox.is-fullscreen .photos-lightbox-close {
  display: none !important;
}

.photos-lightbox:fullscreen .photos-lightbox-stage,
.photos-lightbox:-webkit-full-screen .photos-lightbox-stage,
.photos-lightbox.is-fullscreen .photos-lightbox-stage {
  width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  gap: 0;
  padding: 0 56px;
}

.photos-lightbox:fullscreen .photos-lightbox-media img,
.photos-lightbox:fullscreen .photos-lightbox-media video,
.photos-lightbox:-webkit-full-screen .photos-lightbox-media img,
.photos-lightbox:-webkit-full-screen .photos-lightbox-media video,
.photos-lightbox.is-fullscreen .photos-lightbox-media img,
.photos-lightbox.is-fullscreen .photos-lightbox-media video {
  width: 100%;
  height: 100dvh;
  max-width: 100%;
  max-height: 100dvh;
  object-fit: contain;
  border-radius: 0;
}

.photos-lightbox-close {
  top: max(10px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
  z-index: 3;
}

.photos-lightbox-nav {
  top: 50%;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  transform: translateY(-50%);
  line-height: 0;
}

.photos-lightbox-nav .photos-lightbox-chevron {
  display: block;
  flex: 0 0 auto;
}

.photos-lightbox-nav.is-prev { left: 6px; }
.photos-lightbox-nav.is-next { right: 6px; }

.photos-lightbox-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  flex: 0 0 auto;
  color: #f3f4f6;
  font-family: 'Outfit', sans-serif;
  overflow: hidden;
  min-width: 0;
  width: 100%;
}

.photos-lightbox-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  /* flex-end + overflow だと先頭が切れるため start 固定 */
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
  -webkit-overflow-scrolling: touch;
}

.photos-lightbox-date {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(243, 244, 246, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photos-lightbox-date[hidden] {
  display: none !important;
}

.photos-lightbox.is-edit-mode .photos-lightbox-date {
  display: none !important;
}

.photos-lightbox-toolbar .photos-lightbox-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

.photos-lightbox-meta .photos-secondary-btn,
.photos-lightbox-meta .photos-cover-btn,
.photos-lightbox-meta .photos-delete-btn {
  min-height: 26px;
  height: 26px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.photos-lightbox-meta .photos-secondary-btn {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  backdrop-filter: blur(6px);
}

.photos-lightbox-meta .photos-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.photos-lightbox-meta .photos-cover-btn {
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.14);
}

.photos-lightbox-meta .photos-delete-btn {
  padding: 0 8px;
  font-size: 10px;
}

.photos-lightbox-meta .photos-lb-label {
  font-size: 10px;
  opacity: 0.8;
}

.photos-lightbox-meta form {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  flex: 0 0 auto;
}

.photos-lightbox-meta .photos-trim-form {
  gap: 4px;
}

.photos-delete-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 1100px) {
  #photos-gallery:not([data-cols]) .photos-masonry {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  #photos-gallery:not([data-cols]) .photos-masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .photos-lightbox-stage {
    width: min(100vw - 8px, 1072px);
    padding: 44px 48px 0;
  }
  .photos-lightbox-nav.is-prev { left: 2px; }
  .photos-lightbox-nav.is-next { right: 2px; }
  .photos-cols-slider { width: 88px; }
}

@media (max-width: 560px) {
  #photos-gallery:not([data-cols]) .photos-masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }
  .photos-tile { border-radius: 8px; }
  .photos-hero-actions {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    padding: 8px 0 10px;
    background: linear-gradient(180deg, rgba(247, 245, 240, 0.96), rgba(247, 245, 240, 0.88));
    backdrop-filter: blur(8px);
  }
  .photos-upload-btn,
  .photos-secondary-btn { flex: 1 1 auto; }
  .photos-storage-toggle {
    flex: 1 1 auto;
  }
  .photos-current-album {
    max-width: min(100%, 14rem);
    font-size: 1.05rem;
  }
  .photos-album-jump-wrap {
    max-width: min(100%, 12.5rem);
  }
  .photos-album-jump {
    font-size: 13px;
    min-height: 34px;
  }
  .photos-hero-title-row .photos-ops-open {
    margin-left: auto;
  }
  .photos-lead {
    white-space: normal;
    max-width: min(100%, 16rem);
    font-size: 13px;
  }
  .photos-storage-panel-total {
    flex: 1 1 100%;
    white-space: normal;
  }
  .photos-cols-control {
    margin-left: 0;
  }
  .photos-lightbox-stage {
    padding: 44px 40px 0;
    max-height: calc(100dvh - 16px - env(safe-area-inset-bottom, 0px));
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }

  .photos-lightbox-media img,
  .photos-lightbox-media video,
  .photos-lightbox-stage img {
    max-height: calc(100dvh - 170px - env(safe-area-inset-bottom, 0px));
  }

  .photos-lightbox-toolbar {
    padding-bottom: 2px;
  }

  .photos-lightbox-toolbar .photos-lightbox-actions {
    margin-left: 0;
  }

  .photos-lightbox-meta .photos-secondary-btn,
  .photos-lightbox-meta .photos-cover-btn,
  .photos-lightbox-meta .photos-delete-btn {
    flex: 0 0 auto;
  }
}

/* 写真プレビュー／スライドショー中は下ナビを隠して操作ボタンを確保 */
@media (max-width: 768px) {
  body:has(#photos-lightbox:not([hidden])) .mobile-bottom-nav,
  body:has(.photos-slideshow:not([hidden])) .mobile-bottom-nav {
    display: none !important;
  }

  body:has(#photos-lightbox:not([hidden])),
  body:has(.photos-slideshow:not([hidden])) {
    padding-bottom: 0;
  }
}

/* Photos slideshow (PowerPoint-like) */
.photos-slideshow[hidden] {
  display: none !important;
}

.photos-slideshow {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: #07090b;
}

.photos-ss-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.photos-ss-viewport {
  position: absolute;
  inset: 0;
  perspective: 1400px;
}

.photos-ss-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 0, 0) scale(1);
  filter: none;
  clip-path: inset(0 0 0 0);
  transition:
    opacity 0.65s ease,
    transform 0.65s ease,
    filter 0.65s ease,
    clip-path 0.65s ease;
  will-change: opacity, transform, filter, clip-path;
}

.photos-ss-layer.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.photos-ss-layer img,
.photos-ss-layer video {
  max-width: min(96vw, 1600px);
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  background: #111;
}

.photos-ss-layer img[hidden],
.photos-ss-layer video[hidden] {
  display: none !important;
}

/* Incoming / outgoing base */
.photos-ss-layer.is-incoming {
  z-index: 3;
  opacity: 0;
}
.photos-ss-layer.is-incoming.is-in {
  opacity: 1;
}
.photos-ss-layer.is-outgoing {
  z-index: 1;
  opacity: 1;
}
.photos-ss-layer.is-outgoing.is-out {
  opacity: 0;
}

/* fade (default) */
.photos-ss-layer.effect-fade.is-incoming { opacity: 0; }
.photos-ss-layer.effect-fade.is-incoming.is-in { opacity: 1; }
.photos-ss-layer.effect-fade.is-outgoing.is-out { opacity: 0; }

/* slides */
.photos-ss-layer.effect-slide-left.is-incoming { transform: translate3d(8%, 0, 0); opacity: 0; }
.photos-ss-layer.effect-slide-left.is-incoming.is-in { transform: translate3d(0, 0, 0); opacity: 1; }
.photos-ss-layer.effect-slide-left.is-outgoing.is-out { transform: translate3d(-8%, 0, 0); opacity: 0; }
.photos-ss-layer.effect-slide-right.is-incoming { transform: translate3d(-8%, 0, 0); opacity: 0; }
.photos-ss-layer.effect-slide-right.is-incoming.is-in { transform: translate3d(0, 0, 0); opacity: 1; }
.photos-ss-layer.effect-slide-right.is-outgoing.is-out { transform: translate3d(8%, 0, 0); opacity: 0; }
.photos-ss-layer.effect-slide-up.is-incoming { transform: translate3d(0, 10%, 0); opacity: 0; }
.photos-ss-layer.effect-slide-up.is-incoming.is-in { transform: translate3d(0, 0, 0); opacity: 1; }
.photos-ss-layer.effect-slide-up.is-outgoing.is-out { transform: translate3d(0, -10%, 0); opacity: 0; }
.photos-ss-layer.effect-slide-down.is-incoming { transform: translate3d(0, -10%, 0); opacity: 0; }
.photos-ss-layer.effect-slide-down.is-incoming.is-in { transform: translate3d(0, 0, 0); opacity: 1; }
.photos-ss-layer.effect-slide-down.is-outgoing.is-out { transform: translate3d(0, 10%, 0); opacity: 0; }

/* zoom */
.photos-ss-layer.effect-zoom-in.is-incoming { transform: scale(1.18); opacity: 0; }
.photos-ss-layer.effect-zoom-in.is-incoming.is-in { transform: scale(1); opacity: 1; }
.photos-ss-layer.effect-zoom-in.is-outgoing.is-out { transform: scale(0.92); opacity: 0; }
.photos-ss-layer.effect-zoom-out.is-incoming { transform: scale(0.88); opacity: 0; }
.photos-ss-layer.effect-zoom-out.is-incoming.is-in { transform: scale(1); opacity: 1; }
.photos-ss-layer.effect-zoom-out.is-outgoing.is-out { transform: scale(1.12); opacity: 0; }

/* blur */
.photos-ss-layer.effect-blur.is-incoming { filter: blur(18px); opacity: 0; transform: scale(1.04); }
.photos-ss-layer.effect-blur.is-incoming.is-in { filter: blur(0); opacity: 1; transform: scale(1); }
.photos-ss-layer.effect-blur.is-outgoing.is-out { filter: blur(16px); opacity: 0; }

/* wipe */
.photos-ss-layer.effect-wipe-left.is-incoming { clip-path: inset(0 0 0 100%); opacity: 1; }
.photos-ss-layer.effect-wipe-left.is-incoming.is-in { clip-path: inset(0 0 0 0); }
.photos-ss-layer.effect-wipe-left.is-outgoing.is-out { clip-path: inset(0 100% 0 0); opacity: 1; }
.photos-ss-layer.effect-wipe-right.is-incoming { clip-path: inset(0 100% 0 0); opacity: 1; }
.photos-ss-layer.effect-wipe-right.is-incoming.is-in { clip-path: inset(0 0 0 0); }
.photos-ss-layer.effect-wipe-right.is-outgoing.is-out { clip-path: inset(0 0 0 100%); opacity: 1; }

/* flip / rotate / cube */
.photos-ss-layer.effect-flip.is-incoming { transform: rotateY(85deg) scale(0.96); opacity: 0; }
.photos-ss-layer.effect-flip.is-incoming.is-in { transform: rotateY(0deg) scale(1); opacity: 1; }
.photos-ss-layer.effect-flip.is-outgoing.is-out { transform: rotateY(-75deg) scale(0.96); opacity: 0; }
.photos-ss-layer.effect-rotate.is-incoming { transform: rotate(-8deg) scale(0.94); opacity: 0; }
.photos-ss-layer.effect-rotate.is-incoming.is-in { transform: rotate(0deg) scale(1); opacity: 1; }
.photos-ss-layer.effect-rotate.is-outgoing.is-out { transform: rotate(8deg) scale(0.94); opacity: 0; }
.photos-ss-layer.effect-cube.is-incoming { transform: translateX(40%) rotateY(55deg); opacity: 0; }
.photos-ss-layer.effect-cube.is-incoming.is-in { transform: translateX(0) rotateY(0); opacity: 1; }
.photos-ss-layer.effect-cube.is-outgoing.is-out { transform: translateX(-35%) rotateY(-45deg); opacity: 0; }

/* ken burns: soft fade + slow zoom on active */
.photos-ss-layer.effect-kenburns.is-incoming { opacity: 0; transform: scale(1.02); }
.photos-ss-layer.effect-kenburns.is-incoming.is-in { opacity: 1; transform: scale(1.08); transition: opacity 0.8s ease, transform 5s ease-out; }
.photos-ss-layer.effect-kenburns.is-outgoing.is-out { opacity: 0; transform: scale(1.12); }

.photos-ss-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 8;
}

.photos-ss-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #5ec8d8, #2f6f7e);
}

.photos-ss-nav,
.photos-ss-close,
.photos-ss-fs,
.photos-ss-chrome-peek {
  position: absolute;
  z-index: 9;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.photos-ss-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 72px;
  border-radius: 14px;
  font-size: 34px;
  line-height: 1;
}

.photos-ss-nav.is-prev { left: 16px; }
.photos-ss-nav.is-next { right: 16px; }
.photos-ss-nav:hover,
.photos-ss-close:hover,
.photos-ss-fs:hover,
.photos-ss-fs.is-active,
.photos-ss-chrome-peek:hover { background: rgba(255, 255, 255, 0.22); }

.photos-ss-close {
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 24px;
}

.photos-ss-fs {
  top: 16px;
  right: 68px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.photos-ss-chrome-peek {
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.photos-ss-chrome-peek[hidden],
.photos-slideshow.is-fullscreen .photos-ss-chrome-peek,
.photos-slideshow:fullscreen .photos-ss-chrome-peek,
.photos-slideshow:-webkit-full-screen .photos-ss-chrome-peek,
.photos-slideshow.is-fullscreen .photos-ss-fs,
.photos-slideshow:fullscreen .photos-ss-fs,
.photos-slideshow:-webkit-full-screen .photos-ss-fs,
.photos-slideshow.is-fullscreen .photos-ss-close,
.photos-slideshow:fullscreen .photos-ss-close,
.photos-slideshow:-webkit-full-screen .photos-ss-close,
.photos-slideshow.is-fullscreen .photos-ss-fs-action,
.photos-slideshow:fullscreen #photos-ss-fs-action,
.photos-slideshow:-webkit-full-screen #photos-ss-fs-action {
  display: none !important;
}

.photos-ss-chrome {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 18px 20px 20px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
  color: #fff;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.photos-slideshow.is-chrome-hidden .photos-ss-chrome {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

.photos-slideshow.is-chrome-hidden .photos-ss-layer img,
.photos-slideshow.is-chrome-hidden .photos-ss-layer video {
  width: 98vw;
  height: 94dvh;
  max-width: 98vw;
  max-height: 94dvh;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

.photos-slideshow.is-fullscreen,
.photos-slideshow:fullscreen,
.photos-slideshow:-webkit-full-screen {
  background: #000;
}

.photos-slideshow.is-fullscreen .photos-ss-layer img,
.photos-slideshow.is-fullscreen .photos-ss-layer video,
.photos-slideshow:fullscreen .photos-ss-layer img,
.photos-slideshow:fullscreen .photos-ss-layer video,
.photos-slideshow:-webkit-full-screen .photos-ss-layer img,
.photos-slideshow:-webkit-full-screen .photos-ss-layer video {
  width: 100vw;
  height: calc(100dvh - 132px);
  max-width: 100vw;
  max-height: calc(100dvh - 132px);
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

.photos-slideshow.is-fullscreen.is-chrome-hidden .photos-ss-layer img,
.photos-slideshow.is-fullscreen.is-chrome-hidden .photos-ss-layer video,
.photos-slideshow:fullscreen.is-chrome-hidden .photos-ss-layer img,
.photos-slideshow:fullscreen.is-chrome-hidden .photos-ss-layer video,
.photos-slideshow:-webkit-full-screen.is-chrome-hidden .photos-ss-layer img,
.photos-slideshow:-webkit-full-screen.is-chrome-hidden .photos-ss-layer video {
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

.photos-ss-meta {
  min-width: 0;
  flex: 1 1 220px;
}

.photos-ss-caption {
  margin: 0 0 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photos-ss-counter {
  margin: 0;
  font-size: 12px;
  opacity: 0.75;
}

.photos-ss-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.photos-ss-btn,
.photos-ss-field select {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
}

.photos-ss-btn {
  min-height: 36px;
  padding: 0 14px;
  cursor: pointer;
}

.photos-ss-btn.is-playing {
  background: rgba(47, 111, 126, 0.85);
  border-color: transparent;
}

.photos-ss-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: 0.95;
}

.photos-ss-field select {
  min-height: 34px;
  padding: 0 10px;
  max-width: 150px;
}

.photos-ss-field select option {
  color: #111;
}

.photos-ss-music {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.photos-ss-music-file {
  max-width: 140px;
  font-size: 11px;
  color: #fff;
}

.photos-ss-music input[type="range"] {
  width: 88px;
  accent-color: #7ec8d4;
}

.photos-ss-music-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;
}

.photos-ss-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .photos-ss-nav { width: 40px; height: 56px; font-size: 28px; }
  .photos-ss-nav.is-prev { left: 8px; }
  .photos-ss-nav.is-next { right: 8px; }
  .photos-ss-chrome { padding: 14px 12px 16px; }
  .photos-ss-field select { max-width: 120px; }
}

/* ===== AI settings / AI chat ===== */
.ai-settings-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0 18px;
  flex-wrap: wrap;
}
.ai-settings-tab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #dadce0;
  color: #3c4043;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
}
.ai-settings-tab.is-active {
  background: #e8f0fe;
  border-color: #aecbfa;
  color: #174ea6;
}
.ai-settings-subtitle {
  margin: 8px 0 6px;
  font-size: 16px;
}

.deepl-usage-panel {
  margin: 12px 0 20px;
  padding: 14px 16px;
  border: 1px solid #d8dee6;
  border-radius: 10px;
  background: #f8fafc;
}

.deepl-usage-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.deepl-usage-heading {
  margin: 0 0 4px;
  font-size: 14px;
}

.deepl-usage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.deepl-usage-card {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.deepl-usage-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.deepl-plan-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.deepl-plan-badge.is-free {
  background: #eef6ff;
  border-color: #bfd7ff;
  color: #1d4ed8;
}

.deepl-plan-badge.is-paid {
  background: #ecfdf3;
  border-color: #a7f3d0;
  color: #047857;
}

.deepl-usage-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.deepl-usage-label {
  font-size: 12px;
  color: #64748b;
}

.deepl-usage-value {
  font-size: 18px;
  font-weight: 600;
}

.deepl-usage-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.deepl-usage-bar-fill {
  display: block;
  height: 100%;
  background: #3b82f6;
}

.deepl-usage-bar-fill.is-warn {
  background: #f59e0b;
}

.deepl-usage-bar-fill.is-danger {
  background: #ef4444;
}

.deepl-usage-rate-text,
.deepl-fetched-at {
  margin: 4px 0 0;
}

.deepl-cost-block {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.deepl-cost-total {
  margin-top: 2px;
  font-weight: 600;
}

.deepl-pricing-form {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.deepl-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 10px 0;
}

.deepl-pricing-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 13px;
}

.transit-preference-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: end;
}

.transit-preference-row .transit-field {
  flex: 1 1 160px;
  min-width: 160px;
}

.transit-operator-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 180px;
  min-height: 46px;
  margin: 0;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--transit-line, rgba(16, 35, 31, 0.1));
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.transit-operator-btn::after {
  content: "▾";
  position: absolute;
  right: 12px;
  color: #64748b;
  font-size: 12px;
}

.transit-operator-btn:hover,
.transit-operator-btn:focus-visible {
  border-color: rgba(15, 118, 110, 0.45);
  background: #f0fdfa;
  outline: none;
}

.transit-operator-btn.is-set {
  border-color: rgba(15, 118, 110, 0.35);
  background: #ecfdf8;
  color: #0f766e;
}

.transit-operator-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transit-operator-modal-body {
  display: grid;
  gap: 12px;
}

.transit-operator-modal-body .transit-field input[type="search"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--transit-line, rgba(16, 35, 31, 0.1));
  border-radius: 14px;
  background: #fff;
  font-size: 15px;
}

.transit-operator-list {
  display: grid;
  gap: 6px;
  max-height: min(52vh, 420px);
  overflow: auto;
  padding: 2px 2px 8px;
}

.transit-operator-region {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 10px 0 2px;
  padding: 6px 4px 4px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.transit-operator-item {
  display: grid;
  gap: 2px;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--transit-line, rgba(16, 35, 31, 0.1));
  border-radius: 14px;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.transit-operator-item strong {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.transit-operator-item span {
  font-size: 12px;
  color: #64748b;
}

.transit-operator-item:hover,
.transit-operator-item:focus-visible {
  background: #f0fdfa;
  border-color: rgba(15, 118, 110, 0.35);
  outline: none;
}

.transit-operator-item.is-selected {
  background: #ecfdf8;
  border-color: #0f766e;
}

.transit-operator-item.is-selected strong {
  color: #0f766e;
}

.transit-operator-empty {
  margin: 0;
}

.transit-itineraries {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 16px;
}

.transit-itinerary-card {
  border: 1px solid var(--transit-line, rgba(16, 35, 31, 0.1));
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(16, 35, 31, 0.05);
}

.transit-itinerary-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.transit-itinerary-head .transit-share-itinerary {
  margin-left: auto;
}

.transit-itinerary-badge.is-nishitetsu,
.transit-itinerary-badge.is-preferred {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: #d9f3ee;
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
}

.transit-itinerary-meta {
  color: #5f6368;
  font-size: 13px;
  margin-bottom: 8px;
}

.transit-itinerary-legs {
  margin: 0;
  padding: 0;
  list-style: none;
  line-height: 1.6;
  font-size: 13px;
}

.transit-itinerary-legs li {
  position: relative;
  padding: 6px 0 6px 18px;
  border-left: 2px solid #d9f3ee;
  margin-left: 5px;
}

.transit-itinerary-legs li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 13px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #0f766e;
}

.transit-itinerary-legs .is-walk {
  color: #5f6368;
}

.transit-itinerary-legs .is-walk::before {
  background: #94a3b8;
}

.transit-external-title {
  margin: 8px 0;
  font-size: 14px;
}

.transit-raptor-error {
  color: #c5221f;
}

.transit-engine-note {
  margin: 0 0 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
}

.media-player-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.media-player-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 20px;
  align-items: flex-start;
}

.media-player-title {
  margin: 0 0 4px;
  font-size: 1.5rem;
}

.media-upload-form {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.media-upload-btn {
  cursor: pointer;
}

.media-player-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.media-audio-el,
.media-video-el {
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  background: #0f172a;
}

.media-video-el {
  max-height: min(70vh, 640px);
  background: #000;
}

.media-now-playing strong {
  display: block;
  font-size: 1.05rem;
}

.media-list-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.media-track-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.media-track-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.media-track-play {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.media-track-play:hover,
.media-track-play.is-active {
  background: #e8f0fe;
}

.media-track-index {
  width: 28px;
  text-align: center;
  color: #5f6368;
  font-variant-numeric: tabular-nums;
}

.media-track-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.media-track-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-video-thumb {
  width: 72px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: #111827;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.media-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-video-thumb-fallback {
  color: #fff;
  font-size: 14px;
}

.media-video-add-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.media-youtube-add {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.media-youtube-form {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.media-youtube-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  min-width: 0;
}

.media-youtube-form input[type="url"],
.media-youtube-form input[type="text"],
.media-youtube-form .media-field-input,
.video-page .media-field-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #c5cad3;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.4;
  background: #fff;
  color: #1f2937;
}

.media-youtube-form .button-link,
.media-youtube-form .media-youtube-submit {
  height: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  white-space: nowrap;
}

.media-video-frame {
  width: 100%;
}

.media-video-frame[hidden],
.media-youtube-frame[hidden],
.media-tiktok-frame[hidden] {
  display: none !important;
}

/* 16:9 を padding で確保（高さ0で音だけになるのを防ぐ） */
.media-youtube-frame:not([hidden]) {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}

.media-youtube-el {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.media-now-playing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.media-now-playing-text {
  min-width: 0;
  flex: 1 1 200px;
}

.media-transport {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}

.media-transport .secondary {
  min-height: 36px;
  padding: 6px 12px;
}

.yt-result-play-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: #1a73e8;
}

/* 動画プレイヤーは文書内に置き、一覧のクリックを奪わない */
body.video-page .media-player-stage-video {
  position: sticky;
  top: var(--site-header-offset, 56px);
  z-index: 20;
  margin: 0;
  border-radius: 10px;
  max-width: none;
  padding: 10px 14px 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

body.video-page .media-player-stage-video.is-idle .media-video-frame {
  display: none;
}

body.video-page .media-player-stage-video .media-video-el {
  display: block;
  max-width: min(1080px, 100%);
  max-height: min(52vh, 520px);
  margin: 0 auto;
}

body.video-page .media-player-stage-video .media-youtube-frame:not([hidden]) {
  width: min(100%, calc(min(52vh, 520px) * 16 / 9));
  height: auto;
  padding-bottom: 0;
  aspect-ratio: 16 / 9;
  max-height: min(52vh, 520px);
  margin: 0 auto;
}

.media-tiktok-frame:not([hidden]) {
  position: relative;
  display: block;
  width: min(100%, calc(min(52vh, 520px) * 9 / 16));
  height: auto;
  aspect-ratio: 9 / 16;
  max-height: min(52vh, 520px);
  margin: 0 auto;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}

.media-tiktok-el {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

body.video-page .media-player-stage-spacer {
  width: 100%;
  flex-shrink: 0;
  pointer-events: none;
}

.media-library-filter-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 13px;
}

@media (max-width: 820px) {
  .media-youtube-form {
    grid-template-columns: 1fr;
  }
}

.media-youtube-search-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 8px 0 4px;
}

.media-youtube-search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #dadce0;
  border-radius: 24px;
  font-size: 15px;
  background: #fff;
}

.media-youtube-search-panel .is-error {
  color: #c5221f;
}

.media-youtube-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.yt-result-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.yt-result-play {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.yt-result-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #111827;
}

.yt-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yt-result-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.yt-result-title {
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.yt-result-save {
  align-self: stretch;
}

.media-youtube-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.media-youtube-pager a.secondary,
.media-youtube-pager .button-link.secondary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.media-pager-status {
  font-size: 13px;
  color: var(--muted, #5f6368);
}

.media-library-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin: 0 0 12px;
}

.media-library-filter .media-library-filter-label {
  flex: 1 1 220px;
  margin: 0;
}

.media-library-head {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.media-library-head .media-list-title {
  margin: 0;
  flex: 0 0 auto;
}

.media-library-create {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.media-library-rename {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.media-library-create .media-field-input,
.media-library-rename .media-field-input {
  width: min(260px, 42vw);
  height: 42px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #c5cad3;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.media-library-create .button-link {
  height: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .media-library-head {
    flex-wrap: wrap;
  }

  .media-library-create {
    width: 100%;
    margin-left: 0;
  }

  .media-library-create .media-field-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
}

.media-library-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.media-library-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  min-height: 28px;
  line-height: 1.2;
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #fff;
  text-decoration: none;
  color: #374151;
  font-size: 12px;
}

.media-library-tab .hint {
  font-size: 11px;
  line-height: 1;
}

.media-library-tab.is-active {
  background: #e8f0fe;
  border-color: #aecbfa;
  color: #174ea6;
  font-weight: 600;
}

.media-library-manage {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.media-list-subtitle {
  margin: 8px 0 12px;
  font-size: 1rem;
}

.media-move-form select {
  max-width: 140px;
  height: 32px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}


/* ===== Travel ===== */
.travel-main {
  max-width: 980px;
  margin: 0 auto;
}

.travel-page-head {
  margin-bottom: 16px;
}

.travel-page-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 650;
  color: #111827;
}

.travel-page-lead {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.travel-deadline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.travel-deadline-card {
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
}

.travel-deadline-card.is-warn {
  border-color: rgba(217, 119, 6, 0.45);
  background: #fffbeb;
}

.travel-deadline-card.is-danger {
  border-color: rgba(220, 38, 38, 0.4);
  background: #fef2f2;
}

.travel-deadline-card h2 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #6b7280;
}

.travel-deadline-date {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  color: #111827;
}

.travel-deadline-days {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.travel-deadline-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.45;
}

.travel-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.travel-next-banner {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #e8f0fe;
  color: #174ea6;
  font-size: 13px;
}

.travel-tips {
  margin: 0 0 16px;
  padding-left: 1.2em;
  font-size: 13px;
  color: #374151;
  line-height: 1.55;
}

.travel-panel {
  margin-bottom: 16px;
  padding: 16px 18px;
}

.travel-section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 650;
}

.travel-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}

.travel-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
}

.travel-form input,
.travel-form select,
.travel-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(16, 35, 31, 0.14);
  border-radius: 10px;
  background: #fff;
  color: #10231f;
  font: inherit;
}

.travel-form input:focus,
.travel-form select:focus,
.travel-form textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
  border-color: #0f766e;
}

.travel-form textarea {
  min-height: 64px;
  resize: vertical;
}

.travel-form-notes {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  font-size: 12px;
  color: #6b7280;
}

.travel-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  grid-template-columns: none !important;
  min-height: 36px;
  margin-top: 18px;
  color: #202124 !important;
  font-size: 13px !important;
}

.travel-check input {
  width: auto;
  min-height: 0;
}

.travel-form-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.travel-search-airports {
  align-items: end;
}

.travel-search-swap-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.travel-places-swap {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(16, 35, 31, 0.12);
  border-radius: 12px;
  background: linear-gradient(150deg, #0f766e, #0d9488);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.travel-places-swap:hover {
  transform: translateY(-1px);
}

.travel-airport-control {
  position: relative;
  display: block;
}

.travel-airport-suggest {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid rgba(16, 35, 31, 0.12);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(16, 35, 31, 0.12);
  max-height: 240px;
  overflow: auto;
}

.travel-airport-suggest button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  color: #10231f;
}

.travel-airport-suggest button:hover {
  background: rgba(15, 118, 110, 0.08);
}

.travel-watch-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.travel-watch-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid rgba(16, 35, 31, 0.1);
  border-radius: 14px;
  background: #fff;
}

.travel-watch-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.travel-watch-save {
  margin-top: 12px;
}

.travel-trip-list {
  display: grid;
  gap: 12px;
}

.travel-trip-card {
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}

.travel-trip-card-head h3 {
  margin: 0;
  font-size: 15px;
  color: #111827;
}

.travel-trip-route {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.travel-compare-dl {
  margin: 10px 0 0;
  display: grid;
  gap: 6px;
}

.travel-compare-dl > div {
  display: grid;
  grid-template-columns: 4.5em 1fr;
  gap: 8px;
  font-size: 13px;
}

.travel-compare-dl dt {
  margin: 0;
  color: #6b7280;
}

.travel-compare-dl dd {
  margin: 0;
  color: #111827;
}

.travel-winner {
  display: inline-block;
  margin-left: 6px;
  font-weight: 650;
  color: #0f9d58;
}

.travel-trip-notes {
  margin: 8px 0 0;
  font-size: 12px;
  color: #4b5563;
}

.travel-trip-edit {
  margin-top: 10px;
}

.travel-trip-edit summary {
  cursor: pointer;
  font-size: 13px;
  color: #1a73e8;
}

.travel-delete-form {
  margin-top: 8px;
}

@media (max-width: 820px) {
  .travel-deadline-grid,
  .travel-form-grid {
    grid-template-columns: 1fr;
  }

  .travel-watch-item {
    flex-direction: column;
  }
}

.travel-field-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px dotted #9aa0a6;
  cursor: help;
}

.travel-tip-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* ===== Travel phase2 / dashboard ===== */
.dash-travel {
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dash-travel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-travel-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.dash-travel-lead {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.dash-travel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dash-travel-card {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}

.dash-travel-card.is-warn {
  border-color: rgba(217, 119, 6, 0.45);
  background: #fffbeb;
}

.dash-travel-card.is-danger {
  border-color: rgba(220, 38, 38, 0.4);
  background: #fef2f2;
}

.dash-travel-card h3 {
  margin: 0 0 4px;
  font-size: 13px;
  color: #6b7280;
}

.dash-travel-date {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  color: #111827;
}

.dash-travel-days {
  margin: 4px 0 0;
  font-size: 13px;
  color: #374151;
}

.dash-travel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
  font-size: 12px;
  color: #4b5563;
}

.dash-travel-alert-count {
  color: #b45309;
  font-weight: 600;
}

.travel-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.travel-section-head .travel-section-title {
  margin: 0;
}

.travel-alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.travel-alert-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.travel-alert-item.is-warn {
  border-color: rgba(217, 119, 6, 0.35);
  background: #fffbeb;
}

.travel-alert-item.is-danger {
  border-color: rgba(220, 38, 38, 0.3);
  background: #fef2f2;
}

.travel-alert-item p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #374151;
}

.travel-alert-time {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: #9ca3af;
}

.travel-watch-sources {
  margin: 0 0 12px;
  padding-left: 1.2em;
  font-size: 13px;
}

.travel-promo-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.travel-promo-card {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}

.travel-promo-head h3 {
  margin: 0;
  font-size: 15px;
}

.travel-promo-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.travel-promo-head code {
  font-size: 14px;
  font-weight: 650;
}

.travel-snapshot-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

.travel-snapshot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.travel-snapshot-table th,
.travel-snapshot-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

.travel-snapshot-table th {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
}

.travel-snapshot-date {
  display: block;
  color: #9ca3af;
  font-size: 11px;
}

@media (max-width: 820px) {
  .dash-travel-grid {
    grid-template-columns: 1fr;
  }

  .dash-travel-head,
  .travel-section-head,
  .travel-alert-item {
    flex-direction: column;
    align-items: stretch;
  }
}

.travel-promo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}

.travel-badge-muted {
  background: #f3f4f6;
  color: #6b7280;
}

.travel-badge-auto {
  background: #ecfdf5;
  color: #047857;
}

.travel-watch-sources .travel-badge {
  margin-left: 6px;
}

.travel-fare-table-result {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.travel-fare-clear-form {
  margin-top: 8px;
}

.travel-fare-cheapest {
  margin: 12px 0 16px;
  padding: 12px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
}

.travel-fare-cheapest h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.travel-fare-cheapest ul {
  margin: 0;
  padding-left: 18px;
}

.travel-fare-cheapest li {
  margin: 4px 0;
  font-size: 13px;
}

.travel-fare-cheapest ul {
  list-style: none;
  padding-left: 0;
}

.travel-flight-candidate {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(16, 35, 31, 0.08);
}

.travel-flight-candidate:last-child {
  border-bottom: 0;
}

.travel-candidate-select {
  margin-left: auto;
}

.travel-flight-candidate strong {
  display: block;
}

.travel-estimate-label {
  font-size: 11px;
  color: #64748b;
  margin-right: 4px;
}

.travel-matrix-airline {
  display: block;
  font-size: 10px;
  color: #475569;
  font-weight: 600;
}

.travel-flight-meta {
  margin-bottom: 8px;
}

.travel-fare-table tr.is-cheapest td {
  background: #ecfdf5;
  font-weight: 650;
}

.travel-fare-table tr.is-filled td {
  color: #6b7280;
  background: #f9fafb;
}

.travel-fare-matrix-wrap {
  overflow: auto;
  max-width: 100%;
  margin-top: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.travel-fare-matrix {
  border-collapse: collapse;
  font-size: 12px;
  min-width: 100%;
}

.travel-fare-matrix th,
.travel-fare-matrix td {
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  text-align: center;
  white-space: nowrap;
}

.travel-fare-matrix thead th {
  background: #f9fafb;
  font-weight: 600;
  color: #6b7280;
}

.travel-fare-matrix tbody th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
  text-align: left;
}

.travel-fare-matrix td.is-empty {
  color: #d1d5db;
  background: #fafafa;
}

.travel-fare-matrix td.is-cheapest {
  background: #dcfce7;
  font-weight: 700;
  color: #166534;
}

.travel-fare-return-field.is-hidden {
  display: none;
}

.travel-accordion {
  margin: 0;
}

.travel-accordion-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.travel-accordion-summary::-webkit-details-marker {
  display: none;
}

.travel-accordion-summary .travel-section-title {
  margin: 0;
}

.travel-accordion[open] .travel-form {
  margin-top: 14px;
}

.travel-quote-preview {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #d2e3fc;
  border-radius: 12px;
  background: #f8fbff;
}

.travel-quote-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: #174ea6;
}

.travel-quote-warn {
  color: #b45309 !important;
}

.travel-official-box {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
}

.travel-official-box > p {
  margin: 0 0 6px;
}

.dash-travel-promo {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.dash-travel-promo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dash-travel-promo-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: #111827;
}

.dash-travel-promo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.dash-travel-promo-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.dash-travel-promo-item.is-warn {
  border-color: rgba(217, 119, 6, 0.35);
  background: #fffbeb;
}

.dash-travel-promo-item.is-danger {
  border-color: rgba(220, 38, 38, 0.3);
  background: #fef2f2;
}

.dash-travel-promo-item.is-read {
  opacity: 0.72;
}

.dash-travel-promo-body p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #374151;
  white-space: pre-line;
}

.dash-travel-promo-time,
.dash-travel-promo-read {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: #9ca3af;
}

@media (max-width: 820px) {
  .dash-travel-promo-item,
  .dash-travel-promo-head {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Messages */
.message-room-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.message-room-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  text-decoration: none;
  background: #fff;
}
.message-room-card:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}
.message-chat-main {
  max-width: 860px;
}
.message-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: min(70vh, 720px);
}
.message-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.message-chat-head h1 {
  margin: 0;
  font-size: 18px;
}
.message-thread {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 4px 16px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  min-height: 280px;
  max-height: 55vh;
}
.message-bubble {
  max-width: min(85%, 520px);
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px 12px;
}
.message-bubble.is-mine {
  align-self: flex-end;
  background: #e8f0fe;
  border-color: #c7d7fe;
}
.message-bubble header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}
.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.message-attachments {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.message-attachments img {
  max-width: 220px;
  max-height: 180px;
  border-radius: 8px;
  display: block;
}
.message-compose {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}
.message-compose textarea {
  width: 100%;
  resize: vertical;
}
.message-compose-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.message-attach-btn {
  cursor: pointer;
}

/* Translate */
.translate-panel {
  display: grid;
  gap: 12px;
}
.translate-lang-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.translate-lang-row label {
  flex: 1;
  min-width: 120px;
}
.translate-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.translate-form textarea,
#translate-output {
  width: 100%;
}

/* ===== Messages workspace ===== */
.msg-app {
  --msg-ink: #10231f;
  --msg-teal: #0f766e;
  --msg-mint: #d9f3ee;
  --msg-wash: #eef6f4;
  --msg-line: rgba(16, 35, 31, 0.1);
  --msg-header-offset: 64px;
  background:
    radial-gradient(circle at 12% 0%, rgba(15, 118, 110, 0.14), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(14, 165, 233, 0.12), transparent 36%),
    linear-gradient(180deg, #f3faf8 0%, #eef2f6 100%);
  font-family: Manrope, "Segoe UI", sans-serif;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.msg-app > header,
.msg-app > .site-header,
.msg-app > .app-header {
  flex-shrink: 0;
}
.msg-shell {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom, 0px));
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.msg-shell > .banner {
  flex-shrink: 0;
  margin-bottom: 8px;
}
.msg-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
  height: 100%;
}
.msg-rail,
.msg-stage {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--msg-line);
  border-radius: 22px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(16, 35, 31, 0.06);
  min-height: 0;
}
.msg-rail {
  padding: 18px 14px;
  overflow: auto;
}
.msg-rail-head h1,
.msg-stage-head h2,
.msg-stage-empty h2,
.tr-hero h1 {
  font-family: Fraunces, Georgia, serif;
  letter-spacing: -0.03em;
  color: var(--msg-ink);
  margin: 0;
}
.msg-kicker,
.tr-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--msg-teal);
}
.msg-rail-group + .msg-rail-group {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--msg-line);
}
.msg-rail-label {
  margin: 10px 8px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.msg-rail-recent-section {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--msg-line);
}
.msg-rail-recent-group {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
}
.msg-rail-recent {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 4px;
}
.msg-rail-recent-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: rgba(15, 118, 110, 0.04);
}
.msg-rail-recent-item:hover,
.msg-rail-recent-item:focus-visible {
  background: var(--msg-mint);
  outline: none;
}
.msg-rail-recent-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.msg-rail-recent-meta strong {
  font-size: 12px;
  font-weight: 800;
  color: #0f766e;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-rail-recent-meta time {
  flex-shrink: 0;
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}
.msg-rail-recent-preview {
  font-size: 13px;
  line-height: 1.35;
  color: #334155;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.msg-rail-recent-item.is-unread {
  background: rgba(220, 38, 38, 0.06);
  box-shadow: inset 3px 0 0 #dc2626;
}
.msg-rail-recent-item.is-unread .msg-rail-recent-preview {
  font-weight: 600;
  color: #0f172a;
}
.msg-unread-dot {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.msg-unread-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 4px 12px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
}
.msg-unread-divider::before,
.msg-unread-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(220, 38, 38, 0.35);
}
.msg-unread-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  font-size: 10px;
  font-weight: 800;
  width: fit-content;
}
.msg-entry.is-unread .msg-bubble,
.msg-bubble.is-unread {
  box-shadow: inset 3px 0 0 #dc2626;
  background: rgba(254, 242, 242, 0.95);
}
.msg-entry.is-mine.is-unread .msg-bubble,
.msg-entry.is-mine .msg-bubble.is-unread {
  box-shadow: none;
  background: inherit;
}
.msg-entry.is-hash-target .msg-bubble {
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.45);
}
.msg-rail-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.msg-rail-item:hover,
.msg-rail-item.is-active {
  background: var(--msg-mint);
}
.msg-rail-item.is-unread {
  background: rgba(220, 38, 38, 0.06);
  box-shadow: inset 3px 0 0 #dc2626;
}
.msg-rail-item.is-unread:hover,
.msg-rail-item.is-unread.is-active {
  background: rgba(220, 38, 38, 0.1);
}
.msg-rail-item.is-unread .msg-rail-copy strong {
  font-weight: 800;
}
.msg-rail-item.is-unread .msg-rail-copy small {
  color: #334155;
  font-weight: 600;
}
.msg-rail-unread {
  margin-left: auto;
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.msg-rail-unread-label {
  color: #b91c1c;
  font-weight: 800;
}
.msg-rail-badge,
.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  background: #12352f;
  color: #ecfeff;
}
.msg-avatar {
  background: linear-gradient(145deg, #0f766e, #0ea5e9);
  font-size: 12px;
}
.msg-rail-copy {
  min-width: 0;
  display: grid;
}
.msg-rail-copy strong {
  font-size: 14px;
}
.msg-rail-copy small {
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.msg-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  flex-shrink: 0;
  z-index: 3;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--msg-line);
  backdrop-filter: blur(12px);
}
.msg-back-btn {
  display: none;
  appearance: none;
  border: 0;
  background: rgba(16, 35, 31, 0.06);
  color: var(--msg-ink);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.msg-stage-head-main {
  min-width: 0;
  flex: 1 1 auto;
}
.msg-stage-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
}
.msg-stage-peer-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.msg-stage-peer-name {
  font-weight: 800;
  line-height: 1.2;
}
.msg-bg-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--msg-line);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}
.msg-bg-btn:hover,
.msg-bg-btn:focus-visible {
  background: var(--msg-mint);
  color: var(--msg-teal);
  outline: none;
}
.msg-compose-dock {
  flex-shrink: 0;
  z-index: 3;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--msg-line);
  backdrop-filter: blur(12px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.msg-stage-sub {
  display: block;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  font-family: Manrope, sans-serif;
}
.msg-entry {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 100%;
}
.msg-entry.is-mine {
  align-items: flex-end;
}
.msg-entry-aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  max-width: min(78%, 520px);
}
.msg-entry.is-mine .msg-entry-aside {
  justify-content: flex-end;
  text-align: right;
}
.msg-entry-name {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}
.msg-entry.is-sticker .msg-entry-aside {
  display: none;
}
.msg-bubble-time {
  display: block;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(-2px);
  transition: opacity 0.18s ease, max-height 0.18s ease, margin 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.msg-bubble:hover .msg-bubble-time,
.msg-bubble:focus-within .msg-bubble-time,
.msg-bubble.is-time-visible .msg-bubble-time {
  opacity: 0.85;
  max-height: 24px;
  margin-bottom: 6px;
  transform: none;
}
.msg-bubble.is-mine .msg-bubble-time {
  text-align: right;
}
.msg-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #f7faf9;
  background-image:
    linear-gradient(180deg, transparent, rgba(15, 118, 110, 0.04)),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 10px,
      rgba(15, 118, 110, 0.03) 10px,
      rgba(15, 118, 110, 0.03) 11px
    );
  background-size: auto, auto;
  background-position: center, center;
  background-repeat: no-repeat, repeat;
}
.msg-thread[data-bg="mint"] {
  background-color: #e7f7f3;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(45, 212, 191, 0.28), transparent 42%),
    radial-gradient(circle at 80% 90%, rgba(14, 165, 233, 0.18), transparent 40%);
}
.msg-thread[data-bg="sky"] {
  background-color: #eaf4ff;
  background-image:
    linear-gradient(160deg, rgba(125, 211, 252, 0.35), transparent 55%),
    linear-gradient(20deg, rgba(167, 139, 250, 0.18), transparent 45%);
}
.msg-thread[data-bg="dusk"] {
  background-color: #1e293b;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(244, 114, 182, 0.28), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(56, 189, 248, 0.22), transparent 42%);
}
.msg-thread[data-bg="paper"] {
  background-color: #f6f1e7;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(148, 163, 184, 0.18) 28px
    );
}
.msg-thread[data-bg="plain"] {
  background-color: #f1f5f9;
  background-image: none;
}
.msg-thread[data-bg="ocean"] {
  background-color: #dbeafe;
  background-image:
    linear-gradient(180deg, rgba(14, 116, 144, 0.22), transparent 50%),
    radial-gradient(circle at 70% 20%, rgba(56, 189, 248, 0.35), transparent 45%);
}
.msg-thread[data-bg="sakura"] {
  background-color: #fff1f5;
  background-image:
    radial-gradient(circle at 18% 18%, rgba(251, 113, 133, 0.28), transparent 40%),
    radial-gradient(circle at 82% 78%, rgba(244, 114, 182, 0.2), transparent 42%);
}
.msg-thread[data-bg="forest"] {
  background-color: #ecfdf3;
  background-image:
    linear-gradient(145deg, rgba(22, 163, 74, 0.18), transparent 48%),
    radial-gradient(circle at 80% 10%, rgba(74, 222, 128, 0.25), transparent 40%);
}
.msg-thread[data-bg="sand"] {
  background-color: #faf3e8;
  background-image:
    linear-gradient(160deg, rgba(217, 119, 6, 0.12), transparent 55%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 18px,
      rgba(180, 140, 90, 0.08) 19px
    );
}
.msg-thread[data-bg="midnight"] {
  background-color: #0b1220;
  background-image:
    radial-gradient(circle at 20% 15%, rgba(59, 130, 246, 0.35), transparent 42%),
    radial-gradient(circle at 85% 85%, rgba(14, 165, 233, 0.2), transparent 40%);
}
.msg-thread[data-bg="citrus"] {
  background-color: #fffbeb;
  background-image:
    radial-gradient(circle at 25% 20%, rgba(250, 204, 21, 0.35), transparent 42%),
    radial-gradient(circle at 80% 80%, rgba(132, 204, 22, 0.2), transparent 45%);
}
.msg-thread[data-bg="aurora"] {
  background-color: #ecfeff;
  background-image:
    linear-gradient(120deg, rgba(34, 211, 238, 0.28), transparent 45%),
    linear-gradient(300deg, rgba(16, 185, 129, 0.22), transparent 50%);
}
.msg-thread[data-bg="peach"] {
  background-color: #fff7ed;
  background-image:
    radial-gradient(circle at 15% 25%, rgba(251, 146, 60, 0.28), transparent 42%),
    radial-gradient(circle at 90% 70%, rgba(253, 186, 116, 0.22), transparent 40%);
}
.msg-thread[data-bg="slate"] {
  background-color: #111827;
  background-image:
    linear-gradient(160deg, rgba(71, 85, 105, 0.55), transparent 55%),
    radial-gradient(circle at 70% 30%, rgba(148, 163, 184, 0.2), transparent 40%);
}
.msg-thread[data-bg="meadow"] {
  background-color: #f0fdf4;
  background-image:
    radial-gradient(circle at 30% 10%, rgba(163, 230, 53, 0.28), transparent 40%),
    radial-gradient(circle at 75% 85%, rgba(74, 222, 128, 0.22), transparent 42%);
}
.msg-thread[data-bg="image"] {
  background-color: #0f172a;
  background-image: var(--msg-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.msg-thread[data-bg="image"]::before {
  content: "";
  position: sticky;
  top: 0;
  display: block;
  height: 0;
  pointer-events: none;
}
/* 暗い背景でも吹き出し内は常に濃い文字。外側の名前／ヒントだけ明るくする */
.msg-thread[data-bg="dusk"] .msg-thread-hint,
.msg-thread[data-bg="midnight"] .msg-thread-hint,
.msg-thread[data-bg="slate"] .msg-thread-hint,
.msg-thread[data-bg="image"] .msg-thread-hint,
.msg-thread[data-bg="dusk"] .msg-entry-name,
.msg-thread[data-bg="midnight"] .msg-entry-name,
.msg-thread[data-bg="slate"] .msg-entry-name,
.msg-thread[data-bg="image"] .msg-entry-name,
.msg-thread[data-bg="dusk"] .msg-unread-divider,
.msg-thread[data-bg="midnight"] .msg-unread-divider,
.msg-thread[data-bg="slate"] .msg-unread-divider,
.msg-thread[data-bg="image"] .msg-unread-divider {
  color: #e2e8f0;
}
.msg-thread[data-bg="dusk"] .msg-unread-divider::before,
.msg-thread[data-bg="dusk"] .msg-unread-divider::after,
.msg-thread[data-bg="midnight"] .msg-unread-divider::before,
.msg-thread[data-bg="midnight"] .msg-unread-divider::after,
.msg-thread[data-bg="slate"] .msg-unread-divider::before,
.msg-thread[data-bg="slate"] .msg-unread-divider::after,
.msg-thread[data-bg="image"] .msg-unread-divider::before,
.msg-thread[data-bg="image"] .msg-unread-divider::after {
  background: rgba(226, 232, 240, 0.45);
}
.msg-bg-hint {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}
.msg-bg-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: min(50vh, 360px);
  overflow: auto;
}
.msg-bg-preset {
  min-height: 58px;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 8px;
  color: #10231f;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  background: #eef6f4;
  text-align: left;
}
.msg-bg-preset.is-mint { background: linear-gradient(145deg, #ccfbf1, #99f6e4); }
.msg-bg-preset.is-sky { background: linear-gradient(145deg, #dbeafe, #bae6fd); }
.msg-bg-preset.is-dusk { background: linear-gradient(145deg, #334155, #7c3aed); color: #f8fafc; }
.msg-bg-preset.is-paper { background: linear-gradient(145deg, #faf6ef, #e7dcc8); }
.msg-bg-preset.is-plain { background: #f1f5f9; }
.msg-bg-preset.is-ocean { background: linear-gradient(145deg, #bae6fd, #0284c7); color: #f8fafc; }
.msg-bg-preset.is-sakura { background: linear-gradient(145deg, #ffe4e6, #fb7185); }
.msg-bg-preset.is-forest { background: linear-gradient(145deg, #bbf7d0, #16a34a); color: #f8fafc; }
.msg-bg-preset.is-sand { background: linear-gradient(145deg, #ffedd5, #d6b38a); }
.msg-bg-preset.is-midnight { background: linear-gradient(145deg, #0f172a, #1d4ed8); color: #f8fafc; }
.msg-bg-preset.is-citrus { background: linear-gradient(145deg, #fef08a, #84cc16); }
.msg-bg-preset.is-aurora { background: linear-gradient(145deg, #a5f3fc, #34d399); }
.msg-bg-preset.is-peach { background: linear-gradient(145deg, #ffedd5, #fb923c); }
.msg-bg-preset.is-slate { background: linear-gradient(145deg, #334155, #0f172a); color: #f8fafc; }
.msg-bg-preset.is-meadow { background: linear-gradient(145deg, #d9f99d, #4ade80); }
.msg-bg-preset.is-active {
  border-color: var(--msg-teal);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.18);
}
.msg-bg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.msg-bg-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 14px;
  background: #0f766e;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.msg-bubble {
  max-width: min(78%, 520px);
  align-self: flex-start;
  padding: 12px 14px;
  border-radius: 18px 18px 18px 6px;
  background: #fff;
  border: 1px solid var(--msg-line);
  color: var(--msg-ink, #10231f);
  animation: msgIn 0.28s ease both;
}
.msg-bubble.is-mine {
  align-self: flex-end;
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(160deg, #0f766e, #0d9488);
  color: #f0fdfa;
  border-color: transparent;
}
.msg-bubble.is-sticker {
  max-width: none;
  padding: 2px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.msg-bubble.is-sticker.is-mine {
  background: transparent;
  color: inherit;
}
.msg-sticker-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-height: 0;
}
.msg-bubble.is-mine .msg-sticker-line {
  justify-content: flex-end;
}
.msg-sticker-emoji {
  margin: 0;
  font-size: clamp(2.1rem, 9vw, 3.1rem);
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  display: inline-block;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.12));
  -webkit-tap-highlight-color: transparent;
}
.msg-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.msg-bubble.is-sticker .msg-footer {
  margin-top: 4px;
}
.msg-bubble.is-mine.is-sticker .msg-act {
  background: rgba(16, 35, 31, 0.06);
  color: #10231f;
}
.msg-bubble.is-mine.is-sticker .msg-menu-btn {
  background: rgba(16, 35, 31, 0.06);
  color: #10231f;
}
.msg-bubble.is-mine.is-sticker .msg-react-chip {
  border-color: var(--msg-line);
  background: #fff;
  color: #10231f;
}
.msg-bubble.is-mine.is-sticker .msg-react-open {
  border-color: rgba(16, 35, 31, 0.18);
  background: rgba(255, 255, 255, 0.75);
  color: #10231f;
}
.msg-sticker-pop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  margin: 0;
  padding: 24px;
  border: 0;
  background: rgba(15, 23, 42, 0.35);
  cursor: pointer;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
}
.msg-sticker-pop[open],
.msg-sticker-pop.is-open {
  display: grid;
  place-items: center;
}
.msg-sticker-pop::backdrop {
  background: transparent;
}
.msg-sticker-pop-emoji {
  font-size: clamp(4.5rem, 28vw, 8rem);
  line-height: 1;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.28));
  animation: msgStickerPop 0.22s ease both;
  pointer-events: none;
}
@keyframes msgStickerPop {
  from { transform: scale(0.55); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}
.msg-bubble-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 11px;
  opacity: 0.75;
}
.msg-bubble p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}
.msg-files {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.msg-file-item {
  display: grid;
  gap: 6px;
  justify-items: start;
}
.msg-file-preview {
  display: block;
}
.msg-files img {
  max-width: 220px;
  border-radius: 12px;
  display: block;
}
.msg-file-link {
  color: var(--msg-ink, #10231f);
  text-decoration: underline;
}
.msg-bubble.is-mine .msg-file-link {
  color: #f0fdfa;
}
.msg-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.msg-file-action {
  appearance: none;
  border: 0;
  background: rgba(15, 23, 42, 0.06);
  color: var(--msg-ink, #10231f);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 5px 10px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
}
.msg-file-action:hover {
  background: rgba(15, 23, 42, 0.1);
}
.msg-file-action:disabled {
  opacity: 0.55;
  cursor: wait;
}
.msg-bubble.is-mine .msg-file-action {
  background: rgba(255, 255, 255, 0.22);
  color: #f0fdfa;
}
.msg-bubble.is-mine .msg-file-action:hover {
  background: rgba(255, 255, 255, 0.32);
}
.msg-compose {
  border-top: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 18px 14px;
}
.msg-compose-row {
  --msg-compose-h: 44px;
  --msg-compose-btn-h: 36px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}
.msg-compose-input-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-self: flex-end;
}
.msg-compose textarea,
.msg-compose-input-wrap textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--msg-line);
  border-radius: 22px;
  padding: 10px 76px 10px 14px;
  margin: 0;
  resize: none;
  height: var(--msg-compose-h);
  min-height: var(--msg-compose-h);
  max-height: 160px;
  overflow-x: hidden;
  overflow-y: hidden;
  scrollbar-width: thin;
  -ms-overflow-style: auto;
  font: inherit;
  line-height: 1.35;
  color: var(--msg-ink, #10231f);
  background: #f8fffd;
}
.msg-compose textarea::placeholder,
.msg-compose-input-wrap textarea::placeholder {
  color: #64748b;
  opacity: 1;
}
.msg-compose textarea::-webkit-scrollbar,
.msg-compose-input-wrap textarea::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.msg-compose textarea::-webkit-scrollbar-thumb,
.msg-compose-input-wrap textarea::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.45);
  border-radius: 999px;
}
.msg-compose-inner-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  top: auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  z-index: 2;
}
.msg-compose-side {
  display: inline-flex;
  align-items: flex-end;
  align-self: flex-end;
  gap: 6px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  min-height: var(--msg-compose-btn-h, 36px);
}
.msg-compose-side > * {
  margin: 0;
  align-self: flex-end;
}
.msg-compose-bar,
.msg-compose-tools {
  display: contents;
}
.msg-attach {
  border: 1px dashed rgba(15, 118, 110, 0.35);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
  color: var(--msg-teal);
}
.msg-camera {
  border-style: solid;
  background: rgba(15, 118, 110, 0.08);
}
.msg-attach-names {
  display: block;
  min-width: 0;
  font-size: 12px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-attach-names:empty {
  display: none;
}
.msg-send {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  height: var(--msg-compose-btn-h, 36px);
  min-height: var(--msg-compose-btn-h, 36px);
  max-height: var(--msg-compose-btn-h, 36px);
  padding: 0 14px;
  margin: 0;
  background: var(--msg-ink);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1;
  font-size: 13px;
}
.msg-send-icon {
  display: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.msg-send-label {
  display: inline;
}
.msg-hint,
.msg-thread-hint,
.msg-empty-rail,
.msg-stage-empty {
  color: #64748b;
}
.msg-stage-empty {
  margin: auto;
  text-align: center;
  padding: 40px 24px;
  max-width: 420px;
}
.msg-chip-link {
  display: inline-flex;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--msg-mint);
  color: var(--msg-teal);
  text-decoration: none;
  font-weight: 700;
}
.msg-type-pill {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
  font-family: Manrope, sans-serif;
}
.msg-type-channel {
  background: rgba(15, 118, 110, 0.14);
  color: #0f766e;
}
.msg-type-dm {
  background: rgba(14, 165, 233, 0.16);
  color: #0369a1;
}
.msg-bubble.is-mine .msg-type-channel,
.msg-bubble.is-mine .msg-type-dm {
  background: rgba(255, 255, 255, 0.2);
  color: #ecfeff;
}
.msg-avatar-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.msg-avatar-wrap--lg {
  width: 40px;
  height: 40px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}
.msg-avatar-wrap--lg .msg-avatar {
  width: 40px;
  height: 40px;
}
.msg-presence {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #94a3b8;
}
.msg-presence.is-online {
  background: #16a34a;
}
.msg-presence.is-offline {
  background: #94a3b8;
}
.msg-stage-name-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.msg-bubble-meta {
  flex-wrap: wrap;
  align-items: center;
}
.msg-quote {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-left: 3px solid rgba(15, 118, 110, 0.45);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.08);
  font-size: 12px;
  opacity: 0.9;
}
.msg-bubble.is-mine .msg-quote {
  border-left-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
}
.msg-bubble-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 0;
  opacity: 0.92;
}
.msg-act {
  border: 0;
  background: rgba(16, 35, 31, 0.06);
  color: var(--msg-ink, #10231f);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.msg-act-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  line-height: 0;
}
.msg-act-svg {
  display: block;
  width: 16px;
  height: 16px;
}
.msg-bubble.is-mine .msg-act {
  background: rgba(255, 255, 255, 0.16);
  color: #f0fdfa;
}
.msg-reacts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0;
  align-items: center;
}
.msg-react-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--msg-line);
  background: #fff;
  border-radius: 999px;
  padding: 1px 6px;
  min-height: 22px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.msg-react-chip.is-mine {
  border-color: #0f766e;
  background: var(--msg-mint);
}
.msg-bubble.is-mine .msg-react-chip {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
}
.msg-react-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #f8fffd;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.msg-react-pick:hover {
  background: var(--msg-mint);
}
.msg-translated {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.1);
  font-size: 13px;
}
.msg-reply-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 8px 18px 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--msg-mint);
  font-size: 13px;
}
.msg-reply-bar[hidden] {
  display: none !important;
}
.msg-reply-bar span {
  color: #64748b;
  margin-left: 8px;
}
.msg-icon-btn {
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: #64748b;
}
.msg-compose-input-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-self: flex-end;
}
.msg-compose-tools {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
button.msg-icon-tool,
label.msg-icon-tool,
.msg-icon-tool {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--msg-compose-btn-h, 36px);
  height: var(--msg-compose-btn-h, 36px);
  min-width: var(--msg-compose-btn-h, 36px);
  min-height: var(--msg-compose-btn-h, 36px);
  max-width: var(--msg-compose-btn-h, 36px);
  max-height: var(--msg-compose-btn-h, 36px);
  margin: 0;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  line-height: 0;
  position: relative;
  z-index: 2;
  -webkit-appearance: none;
  appearance: none;
  vertical-align: bottom;
  box-shadow: none;
  outline: none;
  text-decoration: none;
  font: inherit;
}
button.msg-icon-tool:hover,
button.msg-icon-tool:focus-visible,
label.msg-icon-tool:hover,
label.msg-icon-tool:focus-visible,
.msg-icon-tool:hover,
.msg-icon-tool:focus-visible {
  background: #f8fffd;
  border-color: rgba(15, 118, 110, 0.35);
  color: var(--msg-teal, #0f766e);
  box-shadow: none;
}
button.msg-icon-tool.is-listening,
.msg-icon-tool.is-listening {
  background: rgba(15, 118, 110, 0.1);
  border-color: rgba(15, 118, 110, 0.45);
  color: var(--msg-teal, #0f766e);
}
.msg-icon-svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  pointer-events: none;
}
.msg-icon-tool input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.msg-compose-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  position: static;
  z-index: 2;
  pointer-events: auto;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  background: transparent;
  color: inherit;
  font-size: 20px;
  box-shadow: none;
}
.msg-compose-emoji span {
  display: block;
  line-height: 1;
  font-size: 20px;
}
.msg-compose-emoji:hover,
.msg-compose-emoji:focus-visible {
  transform: scale(1.08);
  outline: none;
}
.msg-quick-ok {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  position: static;
  z-index: 2;
  pointer-events: auto;
  background: transparent;
  color: inherit;
  font-size: 20px;
  box-shadow: none;
}
.msg-quick-ok span {
  display: block;
  line-height: 1;
  font-size: 20px;
}
.msg-quick-ok:hover,
.msg-quick-ok:focus-visible {
  transform: scale(1.1);
  outline: none;
}
.msg-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}
.msg-dialog textarea {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--msg-line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}
.msg-toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 5000;
  max-width: min(90vw, 420px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(16, 35, 31, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}
.msg-toast[hidden] {
  display: none !important;
}
.msg-dialog:not([open]):not(.is-open) {
  display: none;
}
.msg-dialog[open],
.msg-dialog.is-open {
  display: block;
}
.msg-menu-btn {
  display: none;
  margin-top: 0;
  border: 0;
  background: rgba(16, 35, 31, 0.08);
  color: var(--msg-ink, #10231f);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.msg-bubble.is-mine .msg-menu-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #f0fdfa;
}
.msg-react-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(16, 35, 31, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--msg-ink, #10231f);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.msg-bubble.is-mine .msg-react-open {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: #f0fdfa;
}
.msg-emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.msg-emoji-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: #f8fffd;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 12px;
}
.msg-emoji-pick:hover {
  background: var(--msg-mint);
}
.msg-sheet-actions {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.msg-sheet-act {
  border: 1px solid var(--msg-line);
  background: #f8fffd;
  color: #10231f;
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.msg-sheet-act:hover {
  background: var(--msg-mint);
  color: #10231f;
}
.msg-dialog {
  border: 0;
  padding: 0;
  margin: auto;
  background: transparent;
  max-width: min(92vw, 420px);
  color: #10231f;
}
.msg-dialog::backdrop {
  background: rgba(16, 35, 31, 0.35);
}
.msg-dialog-card {
  background: #fff;
  color: #10231f;
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 18px 40px rgba(16, 35, 31, 0.18);
}
.msg-dialog-card h3 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  color: #10231f;
}
.msg-forward-list {
  display: grid;
  gap: 6px;
  max-height: 50vh;
  overflow: auto;
}
.msg-forward-item {
  text-align: left;
  border: 1px solid var(--msg-line);
  background: #f8fffd;
  color: #10231f;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
}
.msg-forward-item:hover {
  background: var(--msg-mint);
  color: #10231f;
}
.msg-dialog-cancel {
  border: 0;
  background: transparent;
  color: #64748b;
  font-weight: 700;
  cursor: pointer;
  padding: 8px;
}
@keyframes msgPulse {
  50% { transform: scale(1.04); }
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ===== Translate atelier ===== */
.tr-app {
  --tr-ink: #10231f;
  --tr-teal: #0f766e;
  background:
    radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.16), transparent 34%),
    radial-gradient(circle at 10% 20%, rgba(15, 118, 110, 0.16), transparent 40%),
    #f4f8f7;
  font-family: Manrope, "Segoe UI", sans-serif;
  min-height: 100vh;
}
.tr-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.tr-hero {
  margin-bottom: 18px;
}
.tr-hero h1 {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1;
}
.tr-board {
  display: grid;
  gap: 14px;
}
.tr-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(16, 35, 31, 0.08);
}
.tr-lang {
  display: grid;
  min-width: 140px;
}
.tr-pane-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0f766e;
}
.tr-lang select {
  border: 1px solid rgba(16, 35, 31, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  background: #fff;
  color: #10231f;
}
.tr-swap {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(16, 35, 31, 0.1);
  background: #fff;
  color: #0f766e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.tr-swap:hover {
  background: #d9f3ee;
  border-color: rgba(15, 118, 110, 0.35);
}
.tr-swap svg {
  pointer-events: none;
}
.tr-swap.is-spin svg {
  animation: tr-swap-spin 0.35s ease;
}
@keyframes tr-swap-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(180deg); }
}
.tr-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tr-mic,
.tr-go {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
}
.tr-mic {
  background: #fff;
  border: 1px solid rgba(15, 118, 110, 0.25);
  color: var(--tr-teal);
}
.tr-mic.is-live {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}
.tr-go {
  background: linear-gradient(135deg, #0f766e, #0ea5e9);
  color: #fff;
}
.tr-go:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.tr-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: 360px;
}
.tr-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(16, 35, 31, 0.08);
  box-shadow: 0 18px 40px rgba(16, 35, 31, 0.05);
}
.tr-pane-out {
  background:
    linear-gradient(160deg, rgba(15, 118, 110, 0.08), rgba(14, 165, 233, 0.08)),
    rgba(255, 255, 255, 0.9);
}
.tr-pane textarea {
  flex: 1;
  width: 100%;
  min-height: 280px;
  border: 0;
  resize: vertical;
  background: transparent;
  font: inherit;
  font-size: 18px;
  line-height: 1.55;
  color: var(--tr-ink);
}
.tr-pane textarea:focus {
  outline: none;
}
.tr-status {
  margin: 0;
  color: var(--tr-teal);
  font-weight: 700;
}

@media (max-width: 860px) {
  body.msg-app {
    padding-bottom: 0;
  }
  .msg-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(100px, 24vh) minmax(0, 1fr);
    min-height: 0;
    height: 100%;
  }
  .msg-layout:not(.has-active-chat) {
    grid-template-rows: minmax(0, 1fr);
  }
  .msg-layout:not(.has-active-chat) .msg-stage {
    display: none;
  }
  .msg-layout:not(.has-active-chat) .msg-rail {
    height: 100%;
    max-height: none;
  }
  .msg-rail {
    max-height: none;
    min-height: 0;
  }
  .msg-stage {
    min-height: 0;
  }
  .msg-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .msg-stage-head {
    padding: 8px 10px;
    gap: 8px;
    background: rgba(255, 255, 255, 0.98);
  }
  .msg-stage-head h2 {
    font-size: 1rem;
    margin: 0;
  }
  .msg-avatar-wrap--lg {
    width: 32px;
    height: 32px;
    margin-right: 0;
  }
  .msg-avatar-wrap--lg .msg-avatar {
    width: 32px;
    height: 32px;
  }
  .msg-stage-peer-name {
    font-size: 15px;
  }
  .msg-stage-sub {
    font-size: 11px;
  }
  .msg-entry-aside .msg-type-pill {
    display: none;
  }
  .msg-entry-name {
    font-size: 11px;
  }
  .msg-bubble {
    padding: 8px 11px;
    max-width: min(86%, 520px);
  }
  .msg-footer {
    margin-top: 4px;
  }
  .msg-menu-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  .msg-compose {
    padding: 8px 10px;
  }
  .msg-compose-row {
    --msg-compose-h: 40px;
    --msg-compose-btn-h: 32px;
    gap: 6px;
  }
  .msg-compose-input-wrap textarea,
  .msg-compose textarea {
    max-height: 140px;
    padding: 8px 68px 8px 12px;
    border-radius: 20px;
  }
  .msg-compose-inner-actions {
    right: 6px;
    bottom: 7px;
    gap: 0;
  }
  .msg-compose-emoji,
  .msg-quick-ok {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    font-size: 16px;
  }
  .msg-compose-emoji span,
  .msg-quick-ok span {
    font-size: 16px;
  }
  .msg-send {
    width: var(--msg-compose-btn-h, 32px);
    min-width: var(--msg-compose-btn-h, 32px);
    max-width: var(--msg-compose-btn-h, 32px);
    padding: 0;
    font-size: 12px;
  }
  .msg-send-label {
    display: none;
  }
  .msg-send-icon {
    display: block;
    width: 15px;
    height: 15px;
  }
  .msg-icon-svg {
    width: 15px;
    height: 15px;
  }
  .msg-compose-dock {
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .msg-bg-presets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .msg-thread {
    padding: 6px 10px 10px;
    gap: 8px;
  }
  .msg-bubble-actions,
  .msg-react-open {
    display: none !important;
  }
  .msg-menu-btn {
    display: inline-flex !important;
  }
  .msg-files img {
    max-width: min(200px, 70vw);
  }

  /* 会話中: 一覧・アプリ枠を隠しメッセージ最大化 */
  body.msg-mobile-chat:not(.msg-inbox-open) {
    padding-bottom: 0 !important;
  }
  body.msg-mobile-chat:not(.msg-inbox-open) > .site-header,
  body.msg-mobile-chat:not(.msg-inbox-open) > .mobile-bottom-nav {
    display: none !important;
  }
  body.msg-mobile-chat:not(.msg-inbox-open) .msg-shell {
    max-width: none;
    padding: 0;
    height: 100dvh;
    max-height: 100dvh;
  }
  body.msg-mobile-chat:not(.msg-inbox-open) .msg-shell > .banner {
    margin: 0;
    border-radius: 0;
  }
  body.msg-mobile-chat:not(.msg-inbox-open) .msg-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    height: 100%;
    gap: 0;
  }
  body.msg-mobile-chat:not(.msg-inbox-open) .msg-rail {
    display: none !important;
  }
  body.msg-mobile-chat:not(.msg-inbox-open) .msg-stage {
    border-radius: 0;
    border: 0;
    box-shadow: none;
    min-height: 100%;
    height: 100%;
  }
  body.msg-mobile-chat:not(.msg-inbox-open) .msg-stage-head {
    /* 名前・状態は吹き出し枠の外（スレッド上のスリムバー） */
    background: rgba(243, 250, 248, 0.96);
    border-bottom: 1px solid rgba(16, 35, 31, 0.08);
  }

  /* 戻る: 会話一覧のみ */
  body.msg-mobile-chat.msg-inbox-open {
    padding-bottom: var(--mobile-nav-bar-height);
  }
  body.msg-mobile-chat.msg-inbox-open .msg-layout {
    grid-template-rows: minmax(0, 1fr);
  }
  body.msg-mobile-chat.msg-inbox-open .msg-stage {
    display: none !important;
  }
  body.msg-mobile-chat.msg-inbox-open .msg-rail {
    display: block !important;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }
  body.msg-mobile-chat.msg-inbox-open .msg-shell {
    max-width: none;
    padding: 0 0 calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .tr-panes {
    grid-template-columns: 1fr;
  }
  .tr-actions {
    margin-left: 0;
    width: 100%;
  }
}

/* ===== Google-like Translate UI ===== */
.gt-app {
  --gt-blue: #1a73e8;
  --gt-blue-soft: #e8f0fe;
  --gt-ink: #202124;
  --gt-muted: #5f6368;
  --gt-line: #dadce0;
  --gt-bg: #fff;
  background: #fff;
  color: var(--gt-ink);
  font-family: "Google Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
.gt-shell {
  max-width: 1000px;
  margin: 0 auto;
  padding: 12px 16px 40px;
}
.gt-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 18px;
}
.gt-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--gt-muted);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}
.gt-mode.is-active {
  background: var(--gt-blue-soft);
  color: var(--gt-blue);
}
.gt-mode-ico {
  width: 18px;
  text-align: center;
  font-size: 13px;
}
.gt-langs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--gt-line);
  padding-bottom: 4px;
}
.gt-lang-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
}
.gt-chip {
  border: 0;
  background: transparent;
  color: var(--gt-muted);
  padding: 10px 6px 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.gt-chip.is-active {
  color: var(--gt-blue);
  border-bottom-color: var(--gt-blue);
}
.gt-lang-more {
  border: 0;
  background: transparent;
  color: var(--gt-muted);
  font-weight: 600;
  cursor: pointer;
  max-width: 110px;
}
.gt-swap {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--gt-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.gt-swap:hover { background: #f1f3f4; color: var(--gt-ink); }
.gt-swap svg { pointer-events: none; }
.gt-swap.is-spin svg { animation: tr-swap-spin 0.35s ease; }
.gt-board {
  border: 1px solid var(--gt-line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.gt-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 320px;
}
.gt-panes-compact { min-height: 220px; border-top: 1px solid var(--gt-line); }
.gt-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  min-width: 0;
}
.gt-pane + .gt-pane { border-left: 1px solid var(--gt-line); }
.gt-pane-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gt-blue);
}
.gt-pane textarea {
  flex: 1;
  width: 100%;
  min-height: 220px;
  border: 0;
  resize: vertical;
  font: inherit;
  font-size: 18px;
  line-height: 1.5;
  color: var(--gt-ink);
  background: transparent;
}
.gt-pane textarea:focus { outline: none; }
.gt-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.gt-pane-head .gt-pane-label {
  margin: 0;
}
.gt-icon-btn {
  border: 0;
  background: transparent;
  color: var(--gt-muted, #5f6368);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.gt-icon-btn:hover,
.gt-icon-btn:focus-visible {
  background: rgba(26, 115, 232, 0.08);
  color: var(--gt-blue);
  outline: none;
}
.gt-icon-btn.is-ok {
  color: #137333;
}
.gt-pane-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.gt-mic, .gt-go, .gt-file-btn, .gt-clear {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}
.gt-clear {
  background: #fff;
  border: 1px solid var(--gt-line);
  color: #5f6368;
  margin-right: auto;
}
.gt-mic {
  background: #fff;
  border: 1px solid var(--gt-line);
  color: var(--gt-blue);
}
.gt-mic.is-live { background: #fce8e6; color: #c5221f; border-color: #f6aea9; }
.gt-go, .gt-file-btn {
  background: var(--gt-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gt-go:disabled, .gt-file-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.gt-upload {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 280px;
}
.gt-drop {
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--gt-muted);
  border-right: 1px solid var(--gt-line);
  padding: 24px;
}
.gt-drop.is-drag { background: var(--gt-blue-soft); }
.gt-cloud {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gt-blue-soft);
  color: var(--gt-blue);
  font-size: 28px;
}
.gt-upload-side {
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  color: var(--gt-muted);
}
.gt-hint { margin: 0; font-size: 12px; color: var(--gt-muted); }
.gt-preview {
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  margin-top: 8px;
}
.gt-web {
  display: flex;
  gap: 10px;
  padding: 20px;
  flex-wrap: wrap;
}
.gt-web input {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--gt-line);
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit;
}
.gt-status {
  margin: 10px 0 0;
  color: var(--gt-blue);
  font-weight: 600;
  min-height: 1.2em;
}
.gt-utils {
  display: flex;
  gap: 28px;
  margin-top: 22px;
  padding-left: 4px;
}
.gt-util {
  border: 0;
  background: transparent;
  color: var(--gt-muted);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.gt-util-ico {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gt-line);
  display: grid;
  place-items: center;
  font-size: 18px;
}
.gt-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.32);
  z-index: 1200;
}
.gt-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: #fff;
  z-index: 1210;
  box-shadow: -8px 0 24px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
}
.gt-drawer[hidden],
.gt-drawer-backdrop[hidden] {
  display: none !important;
}
.gt-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--gt-line);
}
.gt-drawer-head h2 { margin: 0; font-size: 18px; }
.gt-drawer-close {
  border: 0;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  color: var(--gt-muted);
}
.gt-drawer-body {
  overflow: auto;
  padding: 12px 16px 24px;
  display: grid;
  gap: 10px;
}
.gt-hist {
  border: 1px solid var(--gt-line);
  border-radius: 12px;
  padding: 12px;
}
.gt-hist-meta {
  display: flex;
  justify-content: space-between;
  color: var(--gt-muted);
  font-size: 12px;
}
.gt-hist-title {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}
.gt-hist-actions {
  display: flex;
  gap: 8px;
}
.gt-hist-actions button {
  border: 1px solid var(--gt-line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}
@media (max-width: 860px) {
  .gt-langs { grid-template-columns: 1fr; }
  .gt-swap { justify-self: center; }
  .gt-panes, .gt-upload { grid-template-columns: 1fr; }
  .gt-pane + .gt-pane { border-left: 0; border-top: 1px solid var(--gt-line); }
  .gt-drop { border-right: 0; border-bottom: 1px solid var(--gt-line); }
}
/* ===== Mobile UI: dash quick panels / notes toggles / photos ops ===== */
.dash-title-short { display: none; }
.dash-travel-alert-count-short { display: none; }

.dash-quick-panels {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-quick-modal-bar {
  display: none;
}

@media (min-width: 769px) {
  .dash-quick-modal-sheet {
    display: contents;
  }
}

.notes-top-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.notes-icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #1f2937;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.notes-icon-svg {
  display: block;
  flex-shrink: 0;
}

.notes-icon-toggle.is-active {
  background: #eef4ff;
  border-color: #93c5fd;
  color: #1a73e8;
}

.notes-view-toggle-inline {
  display: inline-flex;
  margin-left: 0;
}

.notes-top-actions-bar .notes-archive-link {
  border-radius: 8px;
}

.notes-voice-panel[hidden],
.notes-bulk-actions[hidden] {
  display: none !important;
}

@media (min-width: 769px) {
  .notes-icon-toggle {
    display: none;
  }

  .notes-voice-panel[hidden] {
    display: block !important;
  }
}

.notes-bulk-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.notes-bulk-actions .notes-bulk-btn,
.notes-bulk-actions .secondary,
.notes-bulk-actions .danger {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.photos-hero-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px 16px;
  width: 100%;
  position: relative;
  /* sticky 操作バーより上、.site-header(100) より下（高いとタイトルがヘッダーに重なる） */
  z-index: 50;
}

.photos-hero-title-row .photos-hero-title-group {
  flex: 0 1 auto;
  align-self: center;
}

.photos-ops-open {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(23, 27, 31, 0.14);
  background: #fff;
  color: #171b1f;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 51;
  pointer-events: auto;
}

.photos-ops-panel-head {
  display: none;
}

.photos-kicker { display: none !important; }

@media (max-width: 768px) {
  .dash-quick-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: start;
    margin-bottom: 12px;
  }

  .dash-quick-panels > .dash-quick-panel.dash-ai-usage,
  .dash-quick-panels > .dash-quick-panel.dash-travel {
    margin: 0;
    min-width: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .dash-quick-panels details:not([open]) .app-accordion-body {
    display: none;
  }

  .dash-quick-panels details[open] {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .dash-quick-panels details[open] > .dash-quick-summary {
    position: relative;
    z-index: 1;
  }

  .dash-quick-panels details[open] > .dash-quick-modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 480;
    margin: 0;
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    background: rgba(15, 23, 42, 0.42);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dash-quick-modal-sheet {
    width: min(94vw, 480px);
    max-height: min(86vh, 720px);
    overflow: auto;
    margin: auto;
    padding: 14px 14px 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  }

  .dash-quick-modal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
  }

  .dash-quick-modal-bar strong {
    font-size: 16px;
    color: #111827;
  }

  .dash-quick-modal-close {
    border: 0;
    background: transparent;
    width: 36px;
    height: 36px;
    font-size: 26px;
    line-height: 1;
    color: #374151;
    cursor: pointer;
    border-radius: 8px;
  }

  .dash-quick-modal-close:hover {
    background: #f3f4f6;
  }

  body.dash-quick-modal-open {
    overflow: hidden;
  }

  .dash-title-full { display: none !important; }
  .dash-title-short { display: inline !important; }
  .dash-travel-alert-count-full { display: none !important; }
  .dash-travel-alert-count-short {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #c2410c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
  }

  .dash-quick-summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 34px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }

  .dash-quick-summary h2 {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    line-height: 1;
  }

  .dash-quick-summary .app-accordion-caret {
    display: none !important;
  }

  .notes-input-row .notes-view-toggle {
    display: none;
  }

  .photos-ops-open { display: inline-flex; }

  .photos-ops-backdrop[hidden] {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }

  /* 暗転のみ。クリックを奪わない（操作ボタン無反応の再発防止） */
  .photos-ops-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 420;
    background: rgba(15, 23, 42, 0.28);
    pointer-events: none !important;
  }

  .photos-ops-panel[hidden] { display: none !important; }

  .photos-ops-panel:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 420px);
    max-height: min(80vh, 640px);
    overflow: auto;
    z-index: 430;
    padding: 14px 14px 16px;
    border-radius: 16px;
    background: rgba(247, 245, 240, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  }

  /* 選択/一覧: 下部シート（ぼかしはヒットテストを邪魔しやすいので付けない） */
  .photos-ops-panel[data-ops-compact]:not([hidden]) {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    transform: none;
    width: 100%;
    max-width: none;
    max-height: min(42vh, 360px);
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(247, 245, 240, 0.97);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body:has(.photos-ops-panel[data-ops-compact]:not([hidden])) #photos-gallery {
    padding-bottom: calc(min(42vh, 360px) + 12px);
  }

  .photos-ops-panel[data-ops-compact] .photos-ops-full-only,
  .photos-ops-panel[data-ops-compact] .photos-ops-panel-head strong {
    display: none !important;
  }

  .photos-ops-panel[data-ops-compact] .photos-select-actions {
    display: inline-flex !important;
    flex-wrap: wrap;
  }

  .photos-ops-panel[data-ops-compact] .photos-bulk-bar:not([hidden]) {
    display: inline-flex !important;
    flex-wrap: wrap;
    width: 100%;
  }

  .photos-ops-panel[data-ops-compact] .photos-toolbar-select-row:not([hidden]) {
    display: flex !important;
  }

  .photos-ops-panel[data-ops-compact="select"] .photos-pager {
    display: none !important;
  }

  .photos-ops-panel[data-ops-compact="list"] .photos-pager {
    display: inline-flex !important;
  }

  .photos-ops-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .photos-ops-close {
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #374151;
  }

  .photos-ops-panel .photos-hero-actions,
  .photos-ops-panel .photos-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  /* 操作モーダル内の追加〜保存容量枠は sticky 用不透明背景を外す */
  .photos-ops-panel .photos-hero-actions {
    position: static;
    top: auto;
    z-index: auto;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .photos-page .photos-toolbar {
    display: none;
  }

  .photos-ops-panel:not([hidden]) .photos-toolbar {
    display: flex !important;
  }

  /* 選択/一覧/アーカイブ中は操作シートを閉じても選択バーを常時表示（下ナビの上に置く） */
  body.photos-page:has(#photos-gallery[data-photos-mode="select"]) .photos-toolbar,
  body.photos-page:has(#photos-gallery[data-photos-mode="list"]) .photos-toolbar,
  body.photos-page:has(#photos-gallery[data-photos-mode="archive"]) .photos-toolbar {
    display: flex !important;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    left: 0;
    right: 0;
    /* .mobile-bottom-nav と同じ高さ帯の上。bottom:0 だと全選択/範囲選択がナビ裏に隠れる */
    bottom: var(--mobile-nav-bar-height);
    z-index: 280;
    margin: 0;
    padding: 8px 10px;
    max-height: min(42vh, 280px);
    overflow-x: hidden;
    overflow-y: auto;
    background: rgba(247, 245, 240, 0.98);
    border-top: 1px solid rgba(23, 27, 31, 0.08);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.08);
  }

  /* 範囲操作を上段、モード切替を下段にして見失いにくくする */
  body.photos-page:has(#photos-gallery[data-photos-mode="select"]) .photos-toolbar-select-row,
  body.photos-page:has(#photos-gallery[data-photos-mode="list"]) .photos-toolbar-select-row,
  body.photos-page:has(#photos-gallery[data-photos-mode="archive"]) .photos-toolbar-select-row {
    order: -1;
    flex: 0 0 auto;
    width: 100%;
    display: flex !important; /* JS の hidden 取りこぼしでも選択行を出す */
  }

  body.photos-page:has(#photos-gallery[data-photos-mode="select"]) .photos-select-actions,
  body.photos-page:has(#photos-gallery[data-photos-mode="list"]) .photos-select-actions,
  body.photos-page:has(#photos-gallery[data-photos-mode="archive"]) .photos-select-actions {
    display: inline-flex !important;
  }

  body.photos-page:has(#photos-gallery[data-photos-mode="select"]) #photos-range-mode,
  body.photos-page:has(#photos-gallery[data-photos-mode="list"]) #photos-range-mode,
  body.photos-page:has(#photos-gallery[data-photos-mode="archive"]) #photos-range-mode {
    display: inline-flex !important;
    min-height: 36px;
    font-weight: 700;
  }

  body.photos-page:has(#photos-gallery[data-photos-mode="select"]) .photos-toolbar .photos-mode-toggle-view,
  body.photos-page:has(#photos-gallery[data-photos-mode="list"]) .photos-toolbar .photos-mode-toggle-view,
  body.photos-page:has(#photos-gallery[data-photos-mode="archive"]) .photos-toolbar .photos-mode-toggle-view {
    width: 100%;
    justify-content: stretch;
  }

  body.photos-page:has(#photos-gallery[data-photos-mode="select"]) .photos-toolbar .photos-mode-toggle-view .photos-mode-btn,
  body.photos-page:has(#photos-gallery[data-photos-mode="list"]) .photos-toolbar .photos-mode-toggle-view .photos-mode-btn,
  body.photos-page:has(#photos-gallery[data-photos-mode="archive"]) .photos-toolbar .photos-mode-toggle-view .photos-mode-btn {
    flex: 1 1 0;
    text-align: center;
  }

  body.photos-page:has(#photos-gallery[data-photos-mode="select"]) .photos-toolbar .photos-ops-full-only,
  body.photos-page:has(#photos-gallery[data-photos-mode="list"]) .photos-toolbar .photos-ops-full-only,
  body.photos-page:has(#photos-gallery[data-photos-mode="archive"]) .photos-toolbar .photos-ops-full-only {
    display: none !important;
  }

  body.photos-page:has(#photos-gallery[data-photos-mode="select"]) .photos-range-hint,
  body.photos-page:has(#photos-gallery[data-photos-mode="list"]) .photos-range-hint,
  body.photos-page:has(#photos-gallery[data-photos-mode="archive"]) .photos-range-hint {
    flex-basis: auto;
    width: 100%;
  }

  body.photos-page:has(#photos-gallery[data-photos-mode="select"]) #photos-gallery,
  body.photos-page:has(#photos-gallery[data-photos-mode="list"]) #photos-gallery,
  body.photos-page:has(#photos-gallery[data-photos-mode="archive"]) #photos-gallery {
    padding-bottom: calc(220px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 769px) {
  .photos-ops-backdrop { display: none !important; }
  .photos-ops-panel-head { display: none !important; }
  .photos-ops-panel[hidden] {
    display: contents !important;
  }
  .photos-ops-panel {
    display: contents;
  }
  .photos-ops-toolbar-slot:empty { display: none; }
}

/* ヘッダー右アクションは常に1行（メッセージ等のページ固有CSSより後で勝たせる） */
@media (max-width: 768px) {
  body .site-header .site-header-inner {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
  }

  body .site-header .header-actions {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    gap: 4px !important;
  }

  body .site-header .header-actions > * {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    flex: 0 0 auto !important;
  }

  body .site-header .header-more-toggle {
    background: transparent !important;
    color: #1f2937 !important;
  }
}

/* ===== Dashboard today hub ===== */
.dash-home {
  --dash-home-line: rgba(32, 33, 36, 0.12);
  --dash-home-muted: #5f6368;
  --dash-home-text: #202124;
  --dash-home-accent: #1a73e8;
  --dash-home-warn: #b45309;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dash-home-greeting {
  padding: 18px 20px;
  border: 1px solid var(--dash-home-line);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 70%);
}

.dash-home-feedback {
  margin: 0 0 10px;
}

.dash-home-feedback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #c5d8f5;
  background: #eef5ff;
  color: #174ea6;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dash-home-feedback-btn:hover,
.dash-home-feedback-btn:focus-visible {
  background: #e0edff;
  outline: none;
}

.dash-home-date {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--dash-home-muted);
  letter-spacing: 0.02em;
}

.dash-home-hello {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--dash-home-text);
}

.dash-home-counts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.dash-home-counts li {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
  color: var(--dash-home-text);
}

.dash-home-counts li.is-attention {
  color: var(--dash-home-warn);
  font-weight: 600;
}

.dash-home-count-todo {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.dash-home-count-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.dash-home-count-link:hover,
.dash-home-count-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.dash-home-unread {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.dash-home-unread a {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(220, 38, 38, 0.06);
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(220, 38, 38, 0.12);
}

.dash-home-unread a:hover,
.dash-home-unread a:focus-visible {
  background: rgba(220, 38, 38, 0.1);
  outline: none;
}

.dash-home-unread-from {
  font-size: 12px;
  font-weight: 700;
  color: var(--dash-home-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-home-unread-group {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
}

.dash-home-unread-preview {
  font-size: 13px;
  line-height: 1.35;
  color: var(--dash-home-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dash-home-count-icon {
  font-size: 13px;
  line-height: 1;
}

.dash-home-count-num {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dash-home-count-label {
  color: var(--dash-home-muted);
}

.dash-app-install {
  margin: 0 0 16px;
  border: 1px solid var(--dash-home-line, rgba(32, 33, 36, 0.12));
  border-radius: 16px;
  background: #fff;
  padding: 0 4px;
}

.dash-app-install > .app-accordion-summary {
  padding: 14px 14px;
}

.dash-app-install > .app-accordion-summary > h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dash-home-text, #202124);
}

.dash-app-install > .app-accordion-body {
  padding: 0 14px 14px;
}

.dash-app-install-lead {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--dash-home-muted);
  line-height: 1.5;
}

.dash-app-install-desc {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--dash-home-text, #202124);
  line-height: 1.55;
}

.dash-app-install-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.dash-app-install-note {
  margin: 10px 0 0;
}

.dash-app-install-btn {
  display: inline-flex;
  flex: 1 1 calc(33.333% - 8px);
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 7.5rem;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #c7d7fe;
  background: #1a73e8;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  white-space: nowrap;
}

.dash-pwa-guide-install-wrap {
  margin: 12px 0 0;
}

@media (max-width: 520px) {
  .dash-app-install-btn {
    flex: 1 1 100%;
  }
}

.dash-app-install-btn.secondary,
button.dash-app-install-btn.secondary {
  background: #fff;
  color: #1a73e8;
}

.dash-app-install-btn.is-disabled {
  background: #e8eef7;
  border-color: #dbe3f0;
  color: #64748b;
  cursor: default;
  pointer-events: none;
}

.dash-app-install-btn:hover:not(.is-disabled),
.dash-app-install-btn:focus-visible:not(.is-disabled) {
  filter: brightness(1.05);
}

.dash-pwa-guide-body {
  padding: 4px 2px 8px;
  line-height: 1.6;
}

.dash-pwa-guide-lead {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--dash-home-text, #202124);
}

.dash-pwa-guide-steps {
  margin: 0 0 12px;
  padding-left: 1.25rem;
  color: var(--dash-home-text, #202124);
}

.dash-pwa-guide-steps li {
  margin: 0 0 6px;
}

.dash-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dash-home-card {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--dash-home-line);
  border-radius: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-home-photos {
  grid-column: 1 / -1;
}

.dash-home-card-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dash-home-text);
}

.dash-home-card-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--dash-home-muted);
}

.dash-home-card-note {
  color: var(--dash-home-muted);
  font-size: 12px;
}

.dash-home-countdown {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--dash-home-accent);
}

.dash-home-empty {
  margin: 0;
  font-size: 14px;
  color: var(--dash-home-muted);
}

.dash-home-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-home-list li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 14px;
  line-height: 1.4;
}

.dash-home-list li.is-overdue .dash-home-list-time,
.dash-home-list li.is-overdue .dash-home-list-title {
  color: var(--dash-home-warn);
}

.dash-home-list li.is-next .dash-home-list-title {
  font-weight: 700;
}

.dash-home-list-time {
  color: var(--dash-home-muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.dash-home-list-title {
  color: var(--dash-home-text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.dash-home-list-title:hover {
  color: var(--dash-home-accent);
  text-decoration: underline;
}

.dash-home-card-foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.dash-home-action,
.dash-home-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--dash-home-accent);
  text-decoration: none;
}

.dash-home-action:hover,
.dash-home-more:hover {
  text-decoration: underline;
}

.dash-home-photo-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  transition: opacity 0.22s ease;
}

.dash-home-photo-grid.is-rotating {
  opacity: 0.35;
}

.dash-home-photo-link {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f3f4;
  cursor: pointer;
}

.dash-home-photo-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dash-home-lightbox[hidden] {
  display: none !important;
}

.dash-home-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.dash-home-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
}

.dash-home-lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: min(960px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.dash-home-lightbox-stage img,
.dash-home-lightbox-stage video {
  max-width: 100%;
  max-height: 72vh;
  min-height: min(40vh, 280px);
  border-radius: 12px;
  background: #111;
  object-fit: contain;
}

.dash-home-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.dash-home-lightbox-meta {
  margin: 0;
  color: #f8fafc;
  font-size: 13px;
  text-align: center;
}

.dash-home-lightbox-open {
  color: #dbeafe;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.dash-home-lightbox-open:hover {
  text-decoration: underline;
}

body.dash-home-lightbox-open {
  overflow: hidden;
}

.dash-home-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 4px 2px 0;
  font-size: 13px;
}

.dash-home-pins {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  min-width: 0;
}

.dash-home-pins-label {
  color: var(--dash-home-muted);
  font-weight: 600;
  flex: none;
}

.dash-home-pins-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-width: 0;
}

.dash-home-pins-list a {
  color: var(--dash-home-text);
  text-decoration: none;
}

.dash-home-pins-list a:hover {
  color: var(--dash-home-accent);
  text-decoration: underline;
}

.dash-home-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  color: var(--dash-home-muted);
}

.dash-home-links a {
  color: var(--dash-home-muted);
  text-decoration: none;
  font-weight: 600;
}

.dash-home-links a:hover {
  color: var(--dash-home-accent);
  text-decoration: underline;
}

.dash-calendar-accordion {
  margin-top: 8px;
  padding: 12px 14px 14px;
  border: 1px solid var(--dash-home-line, rgba(32, 33, 36, 0.12));
  border-radius: 14px;
  background: #fff;
}

.dash-calendar-summary {
  padding: 2px 0;
}

.dash-calendar-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.dash-calendar-accordion > .app-accordion-body {
  margin-top: 12px;
}

@media (max-width: 768px) {
  .dash-home-greeting {
    padding: 14px 16px;
  }

  .dash-home-grid {
    grid-template-columns: 1fr;
  }

  .dash-home-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-home-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* LiveKit DM 通話（試作） */
.msg-call-btn,
.msg-call-end {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.msg-call-btn {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: #0f766e;
  color: #fff;
}
.msg-call-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}
.msg-call-dialog {
  width: min(96vw, 1080px);
  max-width: min(96vw, 1080px);
}
.msg-call-card {
  width: auto;
  max-width: none;
  max-height: 92vh;
  overflow: auto;
}
.msg-call-head,
.msg-call-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.msg-call-head h3 {
  margin: 0;
}
.msg-call-status {
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
}
.msg-call-hint {
  margin: 10px 0;
  color: #64748b;
  font-size: 13px;
}
.msg-call-videos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.msg-call-tile {
  position: relative;
  min-height: min(46vh, 440px);
  overflow: hidden;
  border-radius: 14px;
  background: #10231f;
  color: #fff;
}
.msg-call-tile > span {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 9px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 11px;
  font-weight: 700;
}
.msg-call-tile > div {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: #0b1614;
}
.msg-call-tile video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: min(46vh, 440px);
  object-fit: cover;
  background: #0b1614;
}
.msg-call-tile video.is-local {
  transform: none;
}
.msg-call-local-tip {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}
.msg-call-device {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
.msg-call-device select {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
}
.msg-call-controls {
  margin-top: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.msg-call-end {
  min-height: 36px;
  padding: 7px 12px;
  background: #dc2626;
  color: #fff;
  font-weight: 800;
}
@media (max-width: 560px) {
  .msg-call-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    margin: 0;
  }
  .msg-call-card {
    min-height: 100dvh;
    max-height: none;
    border-radius: 0;
    padding: 14px;
  }
  .msg-call-videos {
    grid-template-columns: 1fr;
  }
  .msg-call-tile,
  .msg-call-tile video {
    min-height: min(34vh, 280px);
  }
}

.msg-call-incoming-dialog {
  width: min(420px, calc(100vw - 24px));
}
.msg-call-incoming-card {
  text-align: center;
}
.msg-call-incoming-dialog[open] .msg-call-incoming-card,
.msg-call-incoming-dialog.is-open .msg-call-incoming-card {
  animation: msgCallIncomingGlow 1.1s ease-in-out infinite;
}
.msg-call-incoming-from {
  margin: 8px 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f766e;
  animation: msgCallPulse 1.2s ease-in-out infinite;
}
.msg-call-incoming-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.usage-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.usage-purpose-group {
  margin-top: 18px;
}
.usage-purpose-group:first-of-type {
  margin-top: 0;
}
.usage-purpose-group h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #10231f;
}
.usage-overview-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #dbe5e1;
  border-radius: 12px;
  background: #f8fbfa;
}
.usage-overview-card strong { color: #10231f; }
.usage-overview-card .usage-overview-free {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  color: #0f766e;
  font-weight: 600;
}
.usage-overview-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
}
.usage-overview-card span,
.usage-overview-card a { font-size: 12px; color: #64748b; }
.usage-overview-card b { color: #0f766e; font-size: 14px; }
.usage-overview-card a { color: #0369a1; font-weight: 700; }
.usage-overview-card.is-off {
  opacity: 0.72;
  background: #f1f5f4;
}
.usage-overview-card.is-over {
  border-color: #f59e0b;
  background: #fffbeb;
}
.usage-overview-card.is-over b { color: #b45309; }
.usage-overview-card.is-warn {
  border-color: #f59e0b;
  background: #fffbeb;
}
.usage-overview-card.is-critical {
  border-color: #f97316;
  background: #fff7ed;
}
.usage-overview-card.is-stopped {
  border-color: #ef4444;
  background: #fef2f2;
}

.pricing-catalog-group {
  margin-top: 1.25rem;
}
.pricing-catalog-group h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.pricing-catalog-table td:nth-child(2) {
  font-weight: 600;
  white-space: nowrap;
}
.usage-overview-warn {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}
.usage-overview-warn.is-warn { color: #b45309; }
.usage-overview-warn.is-critical { color: #c2410c; }
.usage-overview-warn.is-stopped { color: #b91c1c; }

.usage-limit-warnings {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.usage-limit-warning {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.usage-limit-warning.is-warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.usage-limit-warning.is-critical {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
}
.usage-limit-warning.is-stopped {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.usage-limit-warnings.is-compact {
  margin: 0;
  gap: 4px;
  align-self: center;
  max-width: 14rem;
}
.usage-limit-warnings.is-compact .usage-limit-warning {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
}

.usage-limit-table-wrap {
  overflow-x: auto;
  margin: 12px 0 20px;
}

.usage-limit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.usage-limit-table th,
.usage-limit-table td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  vertical-align: middle;
}

.usage-limit-table thead th {
  background: #f8fafc;
  text-align: center;
}

.usage-limit-table tbody th {
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
  background: #fafafa;
}

.usage-limit-table input[type="number"] {
  width: 100%;
  min-width: 72px;
  box-sizing: border-box;
}

.usage-limit-platform {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}

.usage-limit-form button[type="submit"] {
  margin-top: 8px;
}
.msg-call-accept,
.msg-call-decline {
  min-width: 112px;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}
.msg-call-accept {
  background: #0f766e;
  color: #fff;
}
.msg-call-decline {
  background: #dc2626;
  color: #fff;
}
@keyframes msgCallPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.72; transform: scale(1.03); }
}
@keyframes msgCallIncomingGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.18); }
  50% { box-shadow: 0 0 0 12px rgba(15, 118, 110, 0.08); }
}

/* Mail (Thunderbird-like MVP) */
.mail-page { max-width: none; padding-bottom: 24px; }
.mail-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px;
  align-items: center;
}
.mail-tabs a {
  padding: 8px 14px; border-radius: 999px; text-decoration: none;
  background: #e8f3ef; color: #0f5132; font-weight: 600; font-size: 13px;
}
.mail-tabs a.active { background: #0f766e; color: #fff; }
.mail-mobile-tools {
  display: none;
  position: relative;
  margin-left: auto;
}
.mail-mobile-tools-toggle {
  list-style: none;
  cursor: pointer;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  border: 1px solid #cfe0da;
  background: #fff;
  color: #0f766e;
  font-size: 18px; line-height: 1;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.12);
}
.mail-mobile-tools-toggle::-webkit-details-marker { display: none; }
.mail-mobile-tools-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(320px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #cfe0da;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 42, 36, 0.16);
}
.mail-list-tools {
  display: flex; align-items: center; gap: 8px;
  flex: 0 0 auto; min-width: max-content;
}
.mail-shell,
.mail-shell-v2 {
  --mail-sidebar-w: 248px;
  --mail-list-w: 360px;
  display: grid;
  grid-template-columns: var(--mail-sidebar-w) 6px var(--mail-list-w) 6px minmax(0, 1fr);
  min-height: min(78vh, 920px);
  border: 1px solid #cfe0da;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(1200px 280px at 0% 0%, rgba(15, 118, 110, 0.08), transparent 60%),
    linear-gradient(180deg, #f7fbf9 0%, #eef5f2 100%);
  box-shadow: 0 18px 40px rgba(15, 42, 36, 0.08);
}
.mail-split {
  cursor: col-resize;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(15, 118, 110, 0.02));
  transition: background .15s ease;
}
.mail-split:hover,
.mail-split:active { background: rgba(15, 118, 110, 0.22); }
.mail-sidebar {
  padding: 14px 12px;
  overflow: auto;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(6px);
}
.mail-sidebar-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 12px;
}
.mail-sidebar-head strong { font-size: 15px; letter-spacing: .02em; }
.mail-compose-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 12px; border-radius: 999px; text-decoration: none;
  background: #0f766e; color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.25);
}
.mail-account-nav,
.mail-folder-nav,
.mail-message-list,
.mail-account-list,
.mail-domain-request-list {
  list-style: none; margin: 0; padding: 0;
}
.mail-account-nav a,
.mail-folder-nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 10px; text-decoration: none;
  color: #1f2937; font-size: 13px;
}
.mail-account-nav a.active,
.mail-folder-nav a.active { background: rgba(15, 118, 110, 0.14); color: #0f766e; font-weight: 700; }
.mail-folder-title { font-size: 12px; color: #64748b; margin-top: 8px; }
.mail-account-group-title {
  margin: 8px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #64748b;
}
.mail-other-accounts { margin-top: 10px; }
.mail-other-accounts > summary {
  cursor: pointer; list-style: none; font-size: 12px; font-weight: 700; color: #475569;
  display: flex; align-items: center; gap: 6px;
}
.mail-other-accounts > summary::-webkit-details-marker { display: none; }
.mail-other-accounts > summary::before {
  content: ''; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  border-left: 6px solid #94a3b8; transition: transform .15s ease;
}
.mail-other-accounts[open] > summary::before { transform: rotate(90deg); }
.mail-other-accounts .mail-account-nav { margin-top: 6px; }
.mail-account-tree {
  margin: 0 0 6px;
  border-radius: 12px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(207, 224, 218, 0.8);
}
.mail-account-tree > summary {
  list-style: none; cursor: pointer; padding: 8px 10px;
  display: flex; align-items: center; gap: 6px;
}
.mail-account-tree > summary::-webkit-details-marker { display: none; }
.mail-account-tree > summary::before {
  content: ''; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  border-left: 6px solid #0f766e; transition: transform .15s ease; flex: 0 0 auto;
}
.mail-account-tree[open] > summary::before { transform: rotate(90deg); }
.mail-account-tree-link {
  flex: 1; text-decoration: none; color: #0f172a; font-weight: 650; font-size: 13px;
}
.mail-account-tree-link.active { color: #0f766e; }
.mail-folder-nav-nested { padding: 0 8px 8px 22px; }
.mail-folder-nav-nested a { padding: 6px 8px; }
.mail-folder-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mail-label-color, #94a3b8); flex: 0 0 auto;
}
.mail-folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-folder-count { font-size: 11px; color: #94a3b8; }
.mail-folder-section {
  margin: 8px 0 4px; font-size: 11px; font-weight: 700; color: #64748b; letter-spacing: .04em;
}
.mail-list-pane {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: rgba(255,255,255,0.72);
}
.mail-list-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid #dbe5e1;
  flex-wrap: nowrap; min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.mail-list-toolbar strong {
  font-size: 14px; flex: 0 0 auto; white-space: nowrap;
}
.mail-list-toolbar .mail-filter-row {
  display: flex; align-items: center; gap: 6px;
  flex: 0 0 auto; min-width: max-content;
}
.mail-list-toolbar-actions {
  display: flex; align-items: center; gap: 6px; flex: 0 0 auto;
}
.mail-list-toolbar .mail-toolbar-btn {
  flex: 0 0 auto; white-space: nowrap;
}
.mail-filter-field {
  position: relative; display: flex; align-items: center; flex: 0 0 auto;
}
.mail-filter-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; pointer-events: none;
}
.mail-filter-input {
  flex: 0 0 auto; width: 216px; min-width: 160px;
  padding: 7px 30px 7px 31px;
  border: 1px solid #dbe7e3; border-radius: 999px; font-size: 12px;
  background: rgba(255,255,255,0.92); color: #10231f;
  transition: width .18s ease, border-color .15s ease, box-shadow .15s ease;
}
.mail-filter-input:focus {
  outline: none; width: 260px;
  border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15,118,110,0.14);
}
.mail-filter-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.mail-filter-clear {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(15,118,110,0.1); color: #0f766e;
  font-size: 13px; line-height: 1;
}
.mail-filter-clear:hover { background: rgba(15,118,110,0.18); }
.mail-filter-clear[hidden] { display: none; }
.mail-list-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-bottom: 1px solid #e8efec; background: rgba(248,250,252,0.9);
  min-width: 0;
}
.mail-select-all {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  color: #475569; flex: 0 0 auto; white-space: nowrap;
}
.mail-bulk-bar {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 4px;
  flex: 1 1 auto; min-width: 0; overflow-x: auto;
}
.mail-bulk-bar[hidden] { display: none !important; }
.mail-bulk-bar [hidden] { display: none !important; }
.mail-bulk-bar .mail-toolbar-btn {
  flex: 0 0 auto; padding: 4px 8px; font-size: 12px; white-space: nowrap;
}
.mail-bulk-count {
  font-size: 12px; color: #64748b; margin-right: 2px;
  flex: 0 0 auto; white-space: nowrap;
}
.mail-move-select {
  flex: 0 0 auto; max-width: 120px; padding: 4px 6px; border-radius: 8px;
  border: 1px solid #dbe7e3; font-size: 12px; background: #fff;
}
.mail-move-select-dialog {
  max-width: none; width: 100%; padding: 8px 10px; font-size: 14px;
}
.mail-folder-create {
  padding: 2px 8px 6px 14px;
}
.mail-folder-create-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid #99c2bc; background: rgba(255,255,255,0.9);
  color: #0f766e; font-size: 11px; font-weight: 650;
  cursor: pointer; line-height: 1.2;
  box-shadow: none;
}
.mail-folder-create-btn:hover { background: rgba(15, 118, 110, 0.08); }
.mail-folder-dialog-label {
  display: grid; gap: 6px; font-size: 13px; color: #334155;
}
.mail-folder-dialog-label input {
  padding: 8px 10px; border: 1px solid #dbe7e3; border-radius: 8px; font-size: 14px;
}
.mail-dialog-card .hint.error { color: #b91c1c; }
.mail-message-list li.mail-row {
  display: flex; align-items: stretch; gap: 4px; border-bottom: 1px solid #e8efec;
}
.mail-row-check { margin: 0 0 0 8px; align-self: center; flex: 0 0 auto; }
.mail-star {
  flex: 0 0 auto; width: 28px; border: 0; background: transparent; color: #cbd5e1;
  font-size: 16px; line-height: 1; cursor: pointer; align-self: center;
}
.mail-star.is-on { color: #f59e0b; }
.mail-row-body {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 8px 4px; text-decoration: none; color: inherit;
  transition: background .12s ease;
}
.mail-row-body:hover { background: rgba(15, 118, 110, 0.06); }
.mail-message-list li.is-unread .mail-row-body { font-weight: 700; }
.mail-message-list li.is-active .mail-row-body { background: rgba(15, 118, 110, 0.12); }
.mail-row-from {
  flex: 0 0 32%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; color: #475569;
}
.mail-row-subject {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: #0f172a;
}
.mail-row-date { flex: 0 0 auto; font-size: 11px; color: #94a3b8; white-space: nowrap; }
.mail-toolbar-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 14px; border-radius: 999px; border: 1px solid #0f766e;
  background: #fff; color: #0f766e; font-size: 12px; font-weight: 700;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.12);
}
.mail-toolbar-btn:hover { background: rgba(15, 118, 110, 0.08); }
.mail-toolbar-btn.is-solid {
  background: #0f766e; color: #fff; border-color: #0f766e;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.25);
}
.mail-dialog {
  border: 0; border-radius: 16px; padding: 0; max-width: min(520px, calc(100vw - 24px));
  box-shadow: 0 24px 48px rgba(15, 42, 36, 0.2);
}
.mail-dialog::backdrop { background: rgba(15, 23, 42, 0.35); }
.mail-dialog-card { padding: 18px 18px 16px; display: grid; gap: 12px; }
.mail-dialog-card h3 { margin: 0; font-size: 18px; }
.mail-bg-presets {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
}
.mail-bg-preset {
  min-height: 56px; border: 2px solid transparent; border-radius: 12px;
  cursor: pointer; font-size: 11px; font-weight: 700; color: #0f172a;
}
.mail-bg-preset.is-active { border-color: #0f766e; box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2); }
.mail-bg-preset.is-mint { background: linear-gradient(145deg, #ccfbf1, #99f6e4); }
.mail-bg-preset.is-sky { background: linear-gradient(145deg, #dbeafe, #bae6fd); }
.mail-bg-preset.is-ocean { background: linear-gradient(145deg, #bae6fd, #0284c7); color: #f8fafc; }
.mail-bg-preset.is-aurora { background: linear-gradient(145deg, #a5f3fc, #34d399); }
.mail-bg-preset.is-forest { background: linear-gradient(145deg, #bbf7d0, #16a34a); color: #f8fafc; }
.mail-bg-preset.is-sakura { background: linear-gradient(145deg, #ffe4e6, #fb7185); }
.mail-bg-preset.is-paper { background: linear-gradient(145deg, #faf6ef, #e7dcc8); }
.mail-bg-preset.is-sand { background: linear-gradient(145deg, #ffedd5, #d6b38a); }
.mail-bg-preset.is-dusk { background: linear-gradient(145deg, #334155, #7c3aed); color: #f8fafc; }
.mail-bg-preset.is-midnight { background: linear-gradient(145deg, #0f172a, #1d4ed8); color: #f8fafc; }
.mail-bg-preset.is-plain { background: #f1f5f9; }
.mail-bg-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mail-shell-v2[data-mail-bg="mint"] .mail-sidebar,
.mail-shell-v2[data-mail-bg="mint"] .mail-list-pane,
.mail-shell-v2[data-mail-bg="mint"] .mail-read-pane { background: linear-gradient(180deg, #f0fdfa, #ccfbf1); }
.mail-shell-v2[data-mail-bg="sky"] .mail-sidebar,
.mail-shell-v2[data-mail-bg="sky"] .mail-list-pane,
.mail-shell-v2[data-mail-bg="sky"] .mail-read-pane { background: linear-gradient(180deg, #f0f9ff, #dbeafe); }
.mail-shell-v2[data-mail-bg="ocean"] .mail-sidebar,
.mail-shell-v2[data-mail-bg="ocean"] .mail-list-pane,
.mail-shell-v2[data-mail-bg="ocean"] .mail-read-pane { background: linear-gradient(180deg, #e0f2fe, #7dd3fc); }
.mail-shell-v2[data-mail-bg="aurora"] .mail-sidebar,
.mail-shell-v2[data-mail-bg="aurora"] .mail-list-pane,
.mail-shell-v2[data-mail-bg="aurora"] .mail-read-pane { background: linear-gradient(180deg, #ecfeff, #a7f3d0); }
.mail-shell-v2[data-mail-bg="forest"] .mail-sidebar,
.mail-shell-v2[data-mail-bg="forest"] .mail-list-pane,
.mail-shell-v2[data-mail-bg="forest"] .mail-read-pane { background: linear-gradient(180deg, #f0fdf4, #86efac); }
.mail-shell-v2[data-mail-bg="sakura"] .mail-sidebar,
.mail-shell-v2[data-mail-bg="sakura"] .mail-list-pane,
.mail-shell-v2[data-mail-bg="sakura"] .mail-read-pane { background: linear-gradient(180deg, #fff1f2, #fecdd3); }
.mail-shell-v2[data-mail-bg="paper"] .mail-sidebar,
.mail-shell-v2[data-mail-bg="paper"] .mail-list-pane,
.mail-shell-v2[data-mail-bg="paper"] .mail-read-pane { background: linear-gradient(180deg, #fffdf8, #f5e6c8); }
.mail-shell-v2[data-mail-bg="sand"] .mail-sidebar,
.mail-shell-v2[data-mail-bg="sand"] .mail-list-pane,
.mail-shell-v2[data-mail-bg="sand"] .mail-read-pane { background: linear-gradient(180deg, #fff7ed, #fed7aa); }
.mail-shell-v2[data-mail-bg="dusk"] .mail-sidebar,
.mail-shell-v2[data-mail-bg="dusk"] .mail-list-pane,
.mail-shell-v2[data-mail-bg="dusk"] .mail-read-pane { background: linear-gradient(180deg, #1e293b, #4c1d95); color: #e2e8f0; }
.mail-shell-v2[data-mail-bg="dusk"] .mail-from,
.mail-shell-v2[data-mail-bg="dusk"] .mail-subject,
.mail-shell-v2[data-mail-bg="dusk"] .mail-read-header h2,
.mail-shell-v2[data-mail-bg="dusk"] .mail-read-header p,
.mail-shell-v2[data-mail-bg="dusk"] .mail-list-toolbar strong,
.mail-shell-v2[data-mail-bg="dusk"] .mail-sidebar-head strong,
.mail-shell-v2[data-mail-bg="dusk"] .mail-account-group-title,
.mail-shell-v2[data-mail-bg="dusk"] .mail-account-tree-link,
.mail-shell-v2[data-mail-bg="dusk"] .mail-folder-nav a,
.mail-shell-v2[data-mail-bg="dusk"] .mail-other-accounts > summary,
.mail-shell-v2[data-mail-bg="dusk"] .mail-folder-section,
.mail-shell-v2[data-mail-bg="dusk"] .mail-folder-count,
.mail-shell-v2[data-mail-bg="dusk"] .hint { color: #f8fafc; }
.mail-shell-v2[data-mail-bg="dusk"] .mail-account-tree {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(226, 232, 240, 0.18);
}
.mail-shell-v2[data-mail-bg="dusk"] .mail-folder-nav a.active,
.mail-shell-v2[data-mail-bg="dusk"] .mail-account-nav a.active {
  background: rgba(148, 163, 184, 0.28);
  color: #fff;
}
.mail-shell-v2[data-mail-bg="midnight"] .mail-sidebar,
.mail-shell-v2[data-mail-bg="midnight"] .mail-list-pane,
.mail-shell-v2[data-mail-bg="midnight"] .mail-read-pane { background: linear-gradient(180deg, #0f172a, #1e3a8a); color: #e2e8f0; }
.mail-shell-v2[data-mail-bg="midnight"] .mail-from,
.mail-shell-v2[data-mail-bg="midnight"] .mail-subject,
.mail-shell-v2[data-mail-bg="midnight"] .mail-read-header h2,
.mail-shell-v2[data-mail-bg="midnight"] .mail-read-header p,
.mail-shell-v2[data-mail-bg="midnight"] .mail-list-toolbar strong,
.mail-shell-v2[data-mail-bg="midnight"] .mail-sidebar-head strong,
.mail-shell-v2[data-mail-bg="midnight"] .mail-account-group-title,
.mail-shell-v2[data-mail-bg="midnight"] .mail-account-tree-link,
.mail-shell-v2[data-mail-bg="midnight"] .mail-folder-nav a,
.mail-shell-v2[data-mail-bg="midnight"] .mail-other-accounts > summary,
.mail-shell-v2[data-mail-bg="midnight"] .mail-folder-section,
.mail-shell-v2[data-mail-bg="midnight"] .mail-folder-count,
.mail-shell-v2[data-mail-bg="midnight"] .hint { color: #f8fafc; }
.mail-shell-v2[data-mail-bg="midnight"] .mail-account-tree {
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(226, 232, 240, 0.16);
}
.mail-shell-v2[data-mail-bg="midnight"] .mail-folder-nav a.active,
.mail-shell-v2[data-mail-bg="midnight"] .mail-account-nav a.active {
  background: rgba(148, 163, 184, 0.28);
  color: #fff;
}
.mail-shell-v2[data-mail-bg="plain"] .mail-sidebar,
.mail-shell-v2[data-mail-bg="plain"] .mail-list-pane,
.mail-shell-v2[data-mail-bg="plain"] .mail-read-pane { background: #f8fafc; }
.mail-shell-v2[data-mail-bg] .mail-sidebar {
  backdrop-filter: none;
}
.mail-message-list { overflow: auto; flex: 1; }
.mail-message-list li a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
  padding: 12px 14px; text-decoration: none; border-bottom: 1px solid #e8efec;
  color: inherit; transition: background .12s ease;
}
.mail-message-list li a:hover { background: rgba(15, 118, 110, 0.06); }
.mail-message-list li.is-unread a { background: #fff; font-weight: 700; }
.mail-message-list li.is-active a { background: rgba(15, 118, 110, 0.12); }
.mail-from { grid-column: 1; font-size: 12px; color: #475569; }
.mail-date { grid-column: 2; grid-row: 1 / span 2; font-size: 11px; color: #94a3b8; align-self: center; }
.mail-subject { grid-column: 1; font-size: 13px; color: #0f172a; }
.mail-read-pane {
  padding: 20px 22px; overflow: auto; min-width: 0;
  background: rgba(255,255,255,0.88);
}
.mail-read-header h2 { margin: 0 0 10px; font-size: 22px; line-height: 1.3; letter-spacing: -.01em; }
.mail-read-header p { margin: 0 0 4px; font-size: 13px; color: #475569; }
.mail-read-body {
  margin-top: 18px;
  padding: 18px 20px;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  overflow-x: auto;
  color: #0f172a;
  background: #fff;
  border: 1px solid rgba(15, 118, 110, 0.1);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 35, 31, 0.04);
  /* 送信者の inline style で position:fixed の重ね物を作られてもアプリ UI を覆えないようにする */
  position: relative; contain: layout; isolation: isolate;
}
.mail-read-body > :first-child { margin-top: 0; }
.mail-read-body > :last-child { margin-bottom: 0; }
.mail-read-empty { margin-top: 64px; text-align: center; color: #64748b; }
.mail-compose { padding: 16px; display: grid; gap: 10px; }
.mail-compose-v2 {
  padding: 0; height: 100%;
  grid-template-rows: auto 1fr auto;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 120px),
    #fff;
}
.mail-compose-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 8px;
}
.mail-compose-kicker {
  margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #0f766e;
}
.mail-compose-head h2 { margin: 0; font-size: 22px; }
.mail-compose-fields { padding: 8px 20px 0; display: grid; gap: 0; overflow: auto; }
.mail-compose-row,
.mail-compose-body {
  display: grid; grid-template-columns: 72px 1fr; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #e5eee9;
}
.mail-compose-row span,
.mail-compose-body span { color: #64748b; font-size: 13px; font-weight: 600; }
.mail-compose-row input,
.mail-compose-body textarea {
  border: 0; outline: none; background: transparent; font: inherit; width: 100%;
  resize: vertical;
}
.mail-compose-body { align-items: start; border-bottom: 0; }
.mail-compose-body textarea { min-height: 280px; line-height: 1.6; }
.mail-compose-actions {
  display: flex; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid #e5eee9;
}
.mail-compose-send {
  border: 0; border-radius: 999px; padding: 10px 22px; cursor: pointer;
  background: #0f766e; color: #fff; font-weight: 700;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.28);
}
.mail-account-form,
.mail-domain-form { display: grid; gap: 10px; max-width: 720px; }
.mail-server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.mail-account-list li,
.mail-domain-request-list li,
.mail-admin-request {
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
}
.mail-account-actions,
.mail-admin-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center;
}
.mail-local-part { display: flex; align-items: center; gap: 6px; }
.mail-local-part input { flex: 1; }
.mail-status {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; background: #e2e8f0;
}
.mail-status-pending { background: #fef3c7; color: #92400e; }
.mail-status-approved { background: #dbeafe; color: #1e40af; }
.mail-status-provisioned { background: #d1fae5; color: #065f46; }
.mail-status-rejected,
.mail-status-suspended { background: #fee2e2; color: #991b1b; }
.mail-reauth-form {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 8px;
}
.mail-reauth-form label { flex: 1 1 220px; margin: 0; }
.mail-account-card { list-style: none; }
.mail-account-card-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: flex-start;
}
.mail-account-card.is-editing {
  border: 1px solid #99f6e4; border-radius: 12px; padding: 12px; background: #f0fdfa;
}
.mail-account-edit { margin-top: 10px; }
.mail-account-edit summary {
  cursor: pointer; font-weight: 700; color: #0f766e; margin-bottom: 8px;
}
.mail-inline-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mail-label-panel {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed #d5e3dd; display: grid; gap: 10px;
}
.mail-label-panel h4 { margin: 0; font-size: 14px; }
.mail-label-create,
.mail-rule-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.mail-label-manage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mail-label-manage-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mail-label-swatch {
  width: 12px; height: 12px; border-radius: 50%; background: var(--mail-label-color, #0f766e);
}
.mail-rule-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.mail-rule-list li {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 10px; background: #f5faf8;
}
.mail-loading {
  display: flex; align-items: center; gap: 10px; padding: 20px 12px;
  color: #475569; font-size: 13px; font-weight: 600;
}
.mail-loading[hidden] { display: none !important; }
.mail-loading-spinner {
  width: 18px; height: 18px; border: 2px solid #cbd5e1; border-top-color: #0f766e;
  border-radius: 50%; animation: mailSpin 0.8s linear infinite;
}
@keyframes mailSpin { to { transform: rotate(360deg); } }
.hint.is-ok { color: #0f766e; }
.hint.is-fail { color: #b91c1c; }
@media (max-width: 960px) {
  .mail-shell,
  .mail-shell-v2 {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .mail-split { display: none; }
  .mail-sidebar,
  .mail-list-pane { border-right: 0; border-bottom: 1px solid #dbe5e1; }
  .mail-compose-row,
  .mail-compose-body { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .mail-mobile-tools { display: block; }
  .mail-list-toolbar .mail-list-tools { display: none; }
  .mail-mobile-tools-panel .mail-list-tools {
    display: grid;
    gap: 10px;
  }
  .mail-mobile-tools-panel .mail-filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .mail-mobile-tools-panel .mail-filter-field {
    width: 100%;
  }
  .mail-mobile-tools-panel .mail-filter-input,
  .mail-mobile-tools-panel .mail-filter-input:focus {
    max-width: none; width: 100%; min-width: 0;
  }
  .mail-mobile-tools-panel .mail-list-toolbar-actions {
    margin-left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .mail-mobile-tools-panel .mail-toolbar-btn {
    width: 100%;
    white-space: nowrap;
  }
  .mail-list-toolbar {
    padding: 8px 12px;
  }
}

/* ===== プラン表示・メール申請・見積 ===== */
.plan-summary-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
@media (min-width: 640px) {
  .plan-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.plan-summary-card {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc, #fff);
}
.plan-summary-card dt {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.02em;
}
.plan-summary-card dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.45;
}
.plan-summary-card .hint {
  font-weight: 400;
}
.plan-summary-card a {
  font-weight: 600;
  color: #0f766e;
}

.mail-price-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
}
@media (min-width: 560px) {
  .mail-price-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.mail-price-card {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: linear-gradient(160deg, rgba(15, 118, 110, 0.08), #fff 55%);
}
.mail-price-card .mail-price-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
  margin-bottom: 4px;
}
.mail-price-card strong {
  font-size: 22px;
  letter-spacing: -0.02em;
  color: #0f172a;
}
.mail-price-card .hint {
  margin: 6px 0 0;
}
.mail-domain-request-list li {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.mail-domain-request-list li:last-child {
  border-bottom: 0;
}
.mail-domain-request-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sales-estimate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sales-estimate-sheet {
  margin-top: 16px;
}
.sales-estimate-brand {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f766e;
}
.sales-estimate-head h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.3;
}
.sales-estimate-client {
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 600;
}
.sales-estimate-lead {
  margin: 16px 0;
  line-height: 1.6;
  color: #334155;
}
.sales-estimate-storage {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.sales-estimate-storage h2 {
  margin: 0 0 8px;
  font-size: 15px;
}
.sales-estimate-storage p {
  margin: 0;
  line-height: 1.6;
  font-size: 14px;
  color: #334155;
}
.sales-estimate-storage p + p {
  margin-top: 8px;
}
.sales-estimate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.sales-estimate-table th,
.sales-estimate-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  text-align: left;
  vertical-align: top;
}
.sales-estimate-table th {
  font-size: 12px;
  color: #64748b;
}
.sales-estimate-table .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sales-estimate-totals {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}
@media (min-width: 520px) {
  .sales-estimate-totals {
    grid-template-columns: 1fr 1fr;
  }
}
.sales-estimate-totals > div {
  padding: 14px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #f8fafc;
}
.sales-estimate-totals dt {
  margin: 0 0 4px;
  font-size: 12px;
  opacity: 0.75;
}
.sales-estimate-totals dd {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sales-estimate-notes {
  margin-top: 18px;
}
.sales-estimate-notes h2 {
  font-size: 15px;
}
.sales-estimate-bullets {
  margin: 16px 0 0;
  padding-left: 1.2em;
  line-height: 1.55;
}

/* Public landing */
.lp-body {
  margin: 0;
  background: #fff;
  color: #0f172a;
  scroll-behavior: smooth;
}

.lp-body .auth-lang-switcher {
  position: static;
  top: auto;
  right: auto;
}

.lp-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #e8eef7;
  backdrop-filter: blur(10px);
}

.lp-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.lp-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: #2563eb;
  text-decoration: none;
  flex-shrink: 0;
}

.lp-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-left: auto;
  font-size: 13px;
}

.lp-nav a {
  color: #475569;
  text-decoration: none;
}

.lp-nav a:hover {
  color: #2563eb;
}

.lp-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1.2;
}

.lp-btn-primary {
  background: #2563eb;
  color: #fff;
}

.lp-btn-ghost {
  background: #fff;
  color: #2563eb;
  border-color: #2563eb;
}

.lp-btn-lg {
  min-height: 46px;
  padding: 10px 22px;
}

.lp-btn.is-pending {
  background: #e2e8f0;
  color: #64748b;
  border-color: #cbd5e1;
  cursor: not-allowed;
  opacity: 0.95;
}

.lp-btn-ghost.is-pending {
  background: #f8fafc;
  color: #64748b;
  border-color: #cbd5e1;
}

.lp-btn-on-dark.is-pending {
  background: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.35);
}

.lp-btn-chevron::after {
  content: "›";
  margin-left: 6px;
  font-size: 1.15em;
  font-weight: 500;
  line-height: 0;
}

.lp-btn-on-dark {
  background: #fff;
  color: #1d4ed8;
}

.lp-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(920px 480px at 88% -8%, #dbeafe 0%, transparent 62%),
    radial-gradient(640px 280px at 18% 108%, #eff6ff 0%, transparent 70%),
    linear-gradient(180deg, #f7fbff 0%, #fff 72%);
}

.lp-hero::before,
.lp-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
}

.lp-hero::before {
  width: 760px;
  height: 420px;
  right: -160px;
  top: 40px;
  background: radial-gradient(ellipse at center, rgba(191, 219, 254, 0.55), transparent 68%);
  transform: rotate(-8deg);
}

.lp-hero::after {
  width: 520px;
  height: 220px;
  left: 22%;
  bottom: -90px;
  background: radial-gradient(ellipse at center, rgba(219, 234, 254, 0.7), transparent 72%);
}

.lp-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 52px 20px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 1fr);
  gap: 28px 40px;
  align-items: center;
}

.lp-hero-tag {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 600;
}

.lp-hero-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(1.7rem, 4vw, 2.55rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #1e3a8a;
}

.lp-hero-lead {
  margin: 0 0 22px;
  max-width: 36rem;
  font-size: 16px;
  line-height: 1.75;
  color: #475569;
}

.lp-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}

.lp-hero-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.lp-info-shield {
  display: inline-flex;
  flex-shrink: 0;
  margin-top: 1px;
}

.lp-info-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.lp-devices {
  position: relative;
  min-height: 340px;
  padding: 12px 8px 8px 42px;
}

.lp-badge {
  position: absolute;
  top: -6px;
  right: 4px;
  z-index: 4;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: linear-gradient(160deg, #60a5fa 0%, #2563eb 48%, #1e3a8a 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.32);
}

.lp-laptop {
  width: 100%;
  max-width: 520px;
  margin-left: auto;
  position: relative;
  z-index: 1;
}

.lp-laptop-lid {
  background: linear-gradient(180deg, #e8eaee 0%, #c9ced6 100%);
  border-radius: 18px 18px 10px 10px;
  padding: 9px 9px 11px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 28px 56px rgba(15, 23, 42, 0.22);
}

.lp-laptop-bezel {
  position: relative;
  background: #1c1f26;
  border-radius: 12px;
  padding: 12px 7px 7px;
}

.lp-laptop-camera {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0b1220;
  box-shadow: 0 0 0 1.5px #3f4654, inset 0 0 0 1.5px #2563eb33;
  transform: translateX(-50%);
}

.lp-laptop-screen {
  background: linear-gradient(180deg, #eef4ff 0%, #f8fafc 100%);
  border-radius: 4px;
  min-height: 248px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 46px 1fr;
}

.lp-mini-side {
  background: #dbeafe;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px 6px;
}

.lp-mini-side span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.72);
}

.lp-mini-side span.is-on {
  background: #2563eb;
  box-shadow: 0 6px 12px rgba(37, 99, 235, 0.28);
}

.lp-mini-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 8px;
}

.lp-mini-card {
  background: #fff;
  border: 1px solid #e8eef7;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 5px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
  min-width: 0;
}

.lp-mini-card.is-mail {
  grid-column: 1 / -1;
}

.lp-mini-card b {
  font-size: 11px;
  color: #1e293b;
}

.lp-mini-card.is-todo ul,
.lp-mini-chats,
.lp-phone-stops {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-mini-card.is-todo li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #475569;
  line-height: 1.35;
}

.lp-mini-card.is-todo i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1.5px solid #93c5fd;
  flex-shrink: 0;
}

.lp-mini-card.is-todo i.is-on {
  background: #2563eb;
  border-color: #2563eb;
}

.lp-mini-photos {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
}

.lp-mini-photos span {
  display: block;
  height: 38px;
  border-radius: 6px;
}

.lp-mini-photos .is-a {
  background: linear-gradient(160deg, #7dd3fc 0%, #2563eb 55%, #1e3a8a 100%);
}

.lp-mini-photos .is-b {
  background: linear-gradient(160deg, #bbf7d0 0%, #22c55e 50%, #14532d 100%);
}

.lp-mini-photos .is-c {
  background: linear-gradient(160deg, #fed7aa 0%, #f97316 48%, #9a3412 100%);
}

.lp-mini-card.is-note em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: #334155;
}

.lp-mini-card.is-note span {
  font-size: 10px;
  color: #64748b;
  line-height: 1.4;
}

.lp-mini-chats li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #475569;
}

.lp-mini-chats i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.lp-mini-chats .is-t { background: #2563eb; }
.lp-mini-chats .is-s { background: #7c3aed; }
.lp-mini-chats .is-y { background: #0d9488; }

.lp-mini-mail {
  display: flex;
  gap: 8px;
}

.lp-mini-mail span {
  font-size: 10px;
  color: #475569;
  background: #eff6ff;
  border-radius: 999px;
  padding: 3px 8px;
}

.lp-laptop-hinge {
  width: 72px;
  height: 7px;
  margin: -1px auto 0;
  background: linear-gradient(180deg, #aeb4be, #8d939e);
  border-radius: 0 0 4px 4px;
}

.lp-laptop-base {
  height: 14px;
  margin: 0 -22px;
  background: linear-gradient(180deg, #dfe3ea 0%, #b8bec8 100%);
  border-radius: 0 0 20px 20px;
  box-shadow: 0 10px 0 #9aa1ad, 0 18px 28px rgba(15, 23, 42, 0.12);
}

.lp-phone {
  position: absolute;
  left: 0;
  bottom: 18px;
  z-index: 3;
  width: 128px;
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border-radius: 26px;
  padding: 10px 8px 12px;
  box-shadow:
    0 0 0 1px #334155,
    0 18px 36px rgba(15, 23, 42, 0.32);
}

.lp-phone-island {
  width: 42px;
  height: 8px;
  border-radius: 999px;
  background: #020617;
  margin: 0 auto 8px;
}

.lp-phone-screen {
  background: linear-gradient(180deg, #ecfeff, #eff6ff);
  border-radius: 16px;
  min-height: 176px;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 7px;
  font-size: 10px;
}

.lp-phone-screen b {
  font-size: 10px;
}

.lp-phone-map {
  position: relative;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.15), transparent),
    linear-gradient(135deg, #bbf7d0 0%, #bfdbfe 48%, #ddd6fe 100%);
}

.lp-phone-path {
  position: absolute;
  left: 12px;
  right: 18px;
  top: 28px;
  height: 4px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  transform: rotate(-12deg);
}

.lp-phone-pin {
  position: absolute;
  right: 18px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50% 50% 50% 0;
  background: #ef4444;
  transform: rotate(-45deg);
}

.lp-phone-stops li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: #334155;
}

.lp-phone-stops strong {
  color: #2563eb;
  font-variant-numeric: tabular-nums;
}

.lp-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 20px;
}

.lp-section h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  text-align: center;
}

.lp-section > h2:not(.visually-hidden)::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: #2563eb;
}

.lp-section-lead {
  margin: 0 auto 24px;
  max-width: 40rem;
  text-align: center;
  color: #64748b;
  line-height: 1.7;
}

.lp-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-features li {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 4px;
  background: #fff;
  border: 1px solid #e8eef7;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.lp-feature-icon {
  grid-row: 1 / span 2;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lp-feature-icon.is-todo { background: #dbeafe; }
.lp-feature-icon.is-note { background: #dcfce7; }
.lp-feature-icon.is-photo { background: #ffedd5; }
.lp-feature-icon.is-msg { background: #ede9fe; }
.lp-feature-icon.is-mail { background: #ffe4e6; }
.lp-feature-icon.is-map { background: #ccfbf1; }
.lp-feature-icon.is-media { background: #fce7f3; }
.lp-feature-icon.is-life { background: #fef3c7; }

.lp-features strong,
.lp-features h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.lp-features span:last-child,
.lp-features p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.55;
}

.lp-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.lp-plan {
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.lp-plan-head {
  padding: 16px 18px 14px;
  color: #fff;
}

.lp-plan-head p {
  margin: 0 0 4px;
  font-size: 12px;
  opacity: 0.9;
}

.lp-plan-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.lp-plan.is-dedicated .lp-plan-head { background: #1d4ed8; }
.lp-plan.is-tenant .lp-plan-head { background: #0f766e; }
.lp-plan.is-standard .lp-plan-head { background: #0ea5e9; }
.lp-plan.is-light .lp-plan-head { background: #8b5cf6; }

.lp-plan-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.lp-plan-price {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
}

.lp-price-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-price-rows li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}

.lp-price-rows strong {
  white-space: nowrap;
}

.lp-plan-includes {
  margin: 0;
  padding-left: 1.1em;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.lp-plan-cta {
  margin-top: auto;
  align-self: flex-start;
}

.lp-plans-note {
  margin: 16px 0 0;
  text-align: center;
}

.lp-plans-prep-notice {
  margin: 0 auto 20px;
  max-width: 40rem;
  padding: 18px 20px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.65;
  text-align: center;
}

.lp-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.lp-flow li {
  background: #f8fbff;
  border: 1px solid #e8eef7;
  border-radius: 14px;
  padding: 18px;
}

.lp-flow-num {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
}

.lp-flow h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.lp-flow p {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.65;
}

.lp-value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.lp-value-icon {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0 auto 12px;
}

.lp-value-icon.is-lock { background: #dbeafe; }
.lp-value-icon.is-cloud { background: #dcfce7; }
.lp-value-icon.is-admin { background: #ede9fe; }

.lp-value-grid strong,
.lp-value-grid h3 {
  display: block;
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.lp-value-grid span,
.lp-value-grid p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.lp-faq {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.lp-faq details {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  background: #fff;
}

.lp-faq summary {
  cursor: pointer;
  font-weight: 600;
}

.lp-faq p {
  margin: 10px 0 0;
  color: #475569;
  line-height: 1.7;
}

.lp-banner {
  background: #2563eb;
  color: #fff;
}

.lp-banner-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.lp-banner h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.lp-banner p {
  margin: 0;
  opacity: 0.92;
}

.lp-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px;
  font-size: 13px;
}

.lp-footer a {
  color: #64748b;
}

@media (max-width: 900px) {
  .lp-header-inner {
    flex-wrap: wrap;
  }

  .lp-nav {
    order: 3;
    margin-left: 0;
    width: 100%;
  }

  .lp-hero-inner,
  .lp-plans,
  .lp-flow,
  .lp-value-grid,
  .lp-features {
    grid-template-columns: 1fr;
  }

  .lp-hero-copy h1 {
    font-size: 1.7rem;
  }

  .lp-devices {
    min-height: 0;
    padding: 8px 0 0;
  }

  .lp-badge {
    width: 96px;
    height: 96px;
    font-size: 11px;
    right: 0;
  }

  .lp-laptop {
    max-width: 100%;
  }

  .lp-laptop-base {
    margin: 0 -10px;
  }

  .lp-phone {
    display: none;
  }

  .lp-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .lp-banner-inner .lp-cta {
    margin: 0;
  }
}

@media print {
  .sales-estimate-page .site-header,
  .sales-estimate-page .settings-subnav,
  .sales-estimate-page .no-print,
  .sales-estimate-page .mobile-nav {
    display: none !important;
  }
  .sales-estimate-page {
    background: #fff;
  }
  .sales-estimate-sheet {
    box-shadow: none;
    border: none;
    margin: 0;
    padding: 0;
  }
  .sales-estimate-totals > div {
    background: #fff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1;
  }
}

.lp-hero-points {
  margin: 12px 0 0;
  padding-left: 1.15em;
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
}

.lp-plan.is-featured {
  border-color: #0f766e;
  box-shadow: 0 14px 36px rgba(15, 118, 110, 0.16);
}

.lp-plan-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fbbf24;
  color: #422006;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.lp-roadmap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-roadmap li {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lp-roadmap strong {
  font-size: 15px;
}

.lp-roadmap span {
  color: #0f766e;
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .lp-roadmap {
    grid-template-columns: 1fr;
  }
}

.guide-main {
  --guide-ink: #10231f;
  --guide-teal: #0f766e;
  --guide-line: rgba(16, 35, 31, 0.1);
  --guide-shadow: 0 18px 40px rgba(16, 35, 31, 0.07);
}

.guide-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 24px;
  margin-bottom: 16px;
  border: 1px solid var(--guide-line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 0%, rgba(15, 118, 110, 0.16), transparent 46%),
    radial-gradient(circle at 92% 10%, rgba(14, 165, 233, 0.14), transparent 40%),
    linear-gradient(180deg, #f6fbfa 0%, #ffffff 100%);
  box-shadow: var(--guide-shadow);
}

.guide-hero-copy {
  min-width: 0;
  flex: 1 1 320px;
}

.guide-kicker {
  margin: 0 0 4px;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--guide-teal);
}

.guide-hero h1 {
  margin: 0 0 8px;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  letter-spacing: -0.03em;
  color: var(--guide-ink);
}

.guide-hero-lead {
  margin: 0;
  max-width: none;
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
}

.guide-meter {
  flex: 0 0 auto;
  min-width: 200px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--guide-line);
}

.guide-meter-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #64748b;
}

.guide-meter-value {
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--guide-ink);
}

.guide-meter-value small {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
}

.guide-meter-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  overflow: hidden;
}

.guide-meter-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e, #0ea5e9);
}

.guide-meter-note {
  font-size: 11px;
  color: #94a3b8;
}

.guide-meter-badge {
  justify-self: start;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 11px;
  font-weight: 800;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.guide-rail {
  padding: 16px 14px;
  border: 1px solid var(--guide-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--guide-shadow);
  position: sticky;
  top: 84px;
}

.guide-rail-label {
  margin: 0 8px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #64748b;
}

.guide-topics {
  display: grid;
  gap: 6px;
}

.guide-topic {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(15, 118, 110, 0.04);
  color: inherit;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.guide-topic:hover,
.guide-topic:focus-visible {
  background: #d9f3ee;
  outline: none;
  transform: translateY(-1px);
}

.guide-topic.is-active {
  background: linear-gradient(150deg, #0f766e, #0d9488);
  border-color: #0f766e;
  color: #f0fdfa;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.24);
}

.guide-topic.is-soon {
  opacity: 0.72;
}

.guide-topic-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 17px;
  line-height: 1;
}

.guide-topic.is-active .guide-topic-icon {
  background: rgba(255, 255, 255, 0.18);
}

.guide-topic-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.guide-topic-copy strong {
  font-size: 14px;
  font-weight: 700;
}

.guide-topic-copy small {
  font-size: 11.5px;
  line-height: 1.4;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.guide-topic.is-active .guide-topic-copy small {
  color: rgba(240, 253, 250, 0.82);
}

.guide-topic-soon {
  flex-shrink: 0;
  align-self: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
  font-size: 10px;
  font-weight: 800;
}

.guide-topic-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 4px 0;
}

.guide-inline-form {
  display: inline;
  margin: 0;
}

.guide-topic-form {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px dashed var(--guide-line);
  border-radius: 14px;
  background: rgba(15, 118, 110, 0.03);
}

.guide-topic-form > summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: #0f766e;
}

.guide-topic-form form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.guide-topic-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.guide-topic-form input,
.guide-topic-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--guide-line, rgba(16, 35, 31, 0.1));
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.guide-topic-form textarea {
  resize: vertical;
  min-height: 68px;
}

.guide-topic-form input:focus-visible,
.guide-topic-form textarea:focus-visible {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.guide-topic-form button[type="submit"] {
  justify-self: start;
  margin-top: 2px;
  padding: 9px 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(150deg, #0f766e, #0d9488);
  color: #f0fdfa;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: filter 0.16s ease, transform 0.16s ease;
}

.guide-topic-form button[type="submit"]:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.guide-topic-limit {
  margin: 10px 4px 0;
  font-size: 11.5px;
}

.ai-assist {
  --guide-ink: #10231f;
  --guide-teal: #0f766e;
  --guide-line: rgba(16, 35, 31, 0.1);
  --guide-shadow: 0 18px 40px rgba(16, 35, 31, 0.07);
}

.ai-assist-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ai-assist-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.ai-assist-head p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #64748b;
}

.ai-assist .guide-log {
  min-height: 160px;
  max-height: 42vh;
  border: 1px solid var(--guide-line, rgba(16, 35, 31, 0.1));
  border-radius: 16px;
  padding: 14px;
}

.ai-assist .guide-composer {
  padding: 12px 0 0;
  border-top: 0;
  background: transparent;
}

.guide-stage {
  display: flex;
  flex-direction: column;
  min-height: min(70vh, 640px);
  border: 1px solid var(--guide-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--guide-shadow);
  overflow: hidden;
}

.guide-stage-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--guide-line);
  background: rgba(255, 255, 255, 0.94);
}

.guide-stage-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #0f766e, #0ea5e9);
  font-size: 19px;
  line-height: 1;
}

.guide-stage-head h2 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--guide-ink);
}

.guide-stage-head p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #64748b;
}

.guide-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #f7faf9;
  background-image: linear-gradient(180deg, transparent, rgba(15, 118, 110, 0.04));
}

.guide-empty {
  margin: auto;
  padding: 12px;
  text-align: center;
  max-width: 520px;
}

.guide-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--guide-line);
  font-size: 26px;
  box-shadow: var(--guide-shadow);
}

.guide-empty h3 {
  margin: 12px 0 4px;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  color: var(--guide-ink);
}

.guide-empty p {
  margin: 0 0 14px;
  color: #64748b;
  font-size: 13px;
}

.guide-suggests {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.guide-suggest {
  appearance: none;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--guide-line);
  background: #fff;
  color: #0f766e;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.guide-suggest:hover,
.guide-suggest:focus-visible {
  background: #d9f3ee;
  transform: translateY(-1px);
  outline: none;
}

.guide-msg {
  max-width: min(82%, 640px);
  align-self: flex-start;
  padding: 12px 15px;
  border-radius: 18px 18px 18px 6px;
  background: #fff;
  border: 1px solid var(--guide-line);
  color: var(--guide-ink);
  animation: guideIn 0.24s ease both;
}

.guide-msg.is-user {
  align-self: flex-end;
  border-radius: 18px 18px 6px 18px;
  border-color: transparent;
  background: linear-gradient(160deg, #0f766e, #0d9488);
  color: #f0fdfa;
}

.guide-msg.is-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.guide-msg-who {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #64748b;
}

.guide-msg.is-user .guide-msg-who {
  color: rgba(240, 253, 250, 0.78);
}

.guide-msg p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 14.5px;
}

@keyframes guideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.guide-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.guide-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: guideBlink 1.2s infinite ease-in-out;
}

.guide-dots i:nth-child(2) { animation-delay: 0.16s; }
.guide-dots i:nth-child(3) { animation-delay: 0.32s; }

@keyframes guideBlink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.guide-composer {
  flex-shrink: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--guide-line);
  background: rgba(255, 255, 255, 0.96);
}

.guide-composer-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--guide-line);
  border-radius: 18px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.guide-composer-box:focus-within {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.guide-composer-box textarea {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 180px;
  border: 0;
  padding: 10px 0;
  resize: none;
  font: inherit;
  line-height: 1.6;
  background: transparent;
  color: inherit;
}

.ai-assist-mic {
  width: 38px;
  height: 38px;
  margin-bottom: 3px;
}

.guide-send {
  flex-shrink: 0;
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 11px 20px;
  background: linear-gradient(150deg, #0f766e, #0d9488);
  color: #f0fdfa;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: filter 0.16s ease, transform 0.16s ease;
}

.guide-send:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.guide-send:disabled {
  background: #cbd5e1;
  color: #f8fafc;
  cursor: not-allowed;
}

.guide-composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 0 4px;
  font-size: 11.5px;
  color: #94a3b8;
}

.guide-kbd-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--guide-line);
  border-bottom-width: 2px;
  background: #f8fafc;
  color: #475569;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
}

.guide-status {
  color: #0f766e;
  font-weight: 700;
}

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

  .guide-rail {
    position: static;
  }

  .guide-topics {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .guide-stage {
    min-height: 62vh;
  }
}

@media (max-width: 600px) {
  .guide-hero {
    padding: 18px 16px;
  }

  .guide-meter {
    width: 100%;
  }

  .guide-topic-copy small {
    display: none;
  }

  .guide-msg {
    max-width: 92%;
  }
}


/* 法務ページ（特商法表記・プライバシーの委託先表） */
.legal-dl {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 10px 20px;
  margin: 0;
  align-items: start;
}

.legal-dl dt {
  font-weight: 600;
  color: var(--text-strong, #1f2937);
}

.legal-dl dd {
  margin: 0;
}

.legal-list {
  margin: 0;
  padding-left: 1.1em;
}

.legal-list li + li {
  margin-top: 4px;
}

.legal-unset {
  color: #b91c1c;
  font-weight: 600;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 4px;
  font-size: 13px;
}

.legal-table th,
.legal-table td {
  border: 1px solid var(--border, #e5e7eb);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  background: var(--surface-muted, #f8fafc);
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .legal-dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .legal-dl dd {
    margin: 0 0 10px;
  }
}

/* プラン・お支払い */
.billing-plan-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.billing-plan-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.billing-plan-card h2 {
  margin: 0;
  font-size: 1rem;
}

.billing-plan-price {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.billing-plan-card button {
  margin-top: auto;
}

.sales-setup-steps{margin:0 0 8px;padding-left:1.3em;line-height:1.7;}

/* My page accordions */
.mypage-accordion {
  margin: 0 0 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.mypage-accordion > .app-accordion-summary {
  padding: 14px 16px;
  font-weight: 700;
  color: #0f172a;
}
.mypage-accordion > .app-accordion-body {
  padding: 0 16px 16px;
  border-top: 1px solid #f1f5f9;
}
.mypage-usage-subtitle {
  margin: 18px 0 10px;
  font-size: 1rem;
  color: #0f172a;
}
.mypage-usage-meters {
  margin-bottom: 8px;
}
.mypage-ai-usage-accordion {
  margin-top: 16px;
}
.page-main-narrow .mypage-accordion .google-calendar-embed {
  margin: 0;
}

.mypage-accordion-danger {
  border-color: #f3c1c1;
}
.mypage-accordion-embed .mypage-embed-body {
  margin: 0;
}

/* TOP contact section */
#contact.lp-contact {
  scroll-margin-top: 88px;
}
.lp-contact-card {
  max-width: 40rem;
  margin: 0 auto;
  padding: 22px 20px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #f8fbff;
  text-align: center;
}
.lp-contact-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #64748b;
}
.lp-contact-email {
  margin: 0 0 18px;
}
.lp-contact-email a {
  font-size: 1.2rem;
  font-weight: 700;
  word-break: break-all;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lp-contact-actions {
  justify-content: center;
  margin-top: 12px;
}
.lp-contact-card .hint {
  margin: 18px 0 0;
}
