﻿body {
  margin: 0;
  font-family: sans-serif;
  background: #f6f7fb;
  color: #222;
  overflow-x: hidden;
}

.app {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
}

.visually-hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.header {
  text-align: center;
  margin: 24px 0 20px;
}

.header h1 {
  margin: 0;
  font-size: 28px;
}

.header p {
  margin-top: 8px;
  color: #666;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-card {
  background: #ffffff;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.dashboard-action-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  background: #ffffff;
  border-color: #dbe2ea;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.dashboard-action-title {
  font-size: 20px;
  color: #111827;
}

.dashboard-action-copy {
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
}

.kitten-accent-card,
.kitten-accent-panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.kitten-accent-card::before,
.kitten-accent-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("./konekoashi.jpg");
  background-repeat: no-repeat;
  pointer-events: none;
}

.kitten-accent-card::after,
.kitten-accent-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.kitten-accent-card {
  border-color: rgba(190, 170, 154, 0.58);
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.kitten-accent-card::before {
  opacity: 0.42;
  background-size: 220px auto;
  background-position: right -28px center;
}

.kitten-accent-card::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.94) 58%, rgba(255, 252, 248, 0.74) 100%),
    linear-gradient(135deg, rgba(255, 247, 239, 0.58), rgba(255, 255, 255, 0.24));
}

.dashboard-label {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}

.dashboard-card strong {
  font-size: 20px;
  color: #111827;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
}

.kitten-shell-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.93)),
    linear-gradient(135deg, rgba(255, 247, 239, 0.18), rgba(255, 255, 255, 0.08)),
    url("./konekoashi.jpg");
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: auto, auto, 260px auto;
  background-position: 0 0, 0 0, right -32px bottom -26px;
}

.section-title {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 20px;
}

label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  font-weight: bold;
}

input,
select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
}

button {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  background: #111827;
  color: #fff;
}

.image-status {
  margin: 8px 0 0;
  font-size: 14px;
  color: #6b7280;
}

.image-preview {
  display: block;
  max-width: 160px;
  max-height: 160px;
  width: auto;
  height: auto;
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid #dbe2ea;
  object-fit: cover;
  background: #fff;
}

.secondary-button {
  margin-top: 12px;
  background: #e5e7eb;
  color: #111827;
}

.image-action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.image-action-row button {
  flex: 1;
  width: auto;
  margin-top: 0;
}

.result {
  margin-top: 18px;
  padding: 14px;
  background: #f1f3f8;
  border-radius: 12px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.profit-plus {
  color: #1f2937;
}

.profit-minus {
  color: #dc2626;
}

.result-plus {
  background: #eaf4ff;
  border: 1px solid #bfdbfe;
}

.result-minus {
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.memo-template-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 10px;
}

.memo-template-select {
  flex: 1 1 auto;
  min-width: 0;
}

.memo-template-apply-button {
  width: auto;
  margin-top: 0;
  padding: 10px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.profit-breakdown {
  margin: 14px 0 0;
}

.profit-breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 13px;
}

.profit-breakdown-row:first-child {
  border-top: none;
}

.profit-breakdown-row dt {
  margin: 0;
  color: #64748b;
  font-weight: 700;
}

.profit-breakdown-row dd {
  margin: 0;
  color: #111827;
  font-weight: 700;
}

.danger-zone {
  margin-top: 12px;
}

.reset-button {
  background: #7f1d1d;
  color: #fff;
}

.stock-list h2 {
  font-size: 20px;
  margin-top: 0;
  margin-bottom: 12px;
}

.stock-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stock-list li {
  background: #ffffff;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  line-height: 1.6;
}

.stock-list li.stock-item-listed {
  background: #dbeafe;
  border: 1px solid #93c5fd;
}

.stock-list li.stock-item-sold {
  background: #e5e7eb;
  border: 1px solid #9ca3af;
  color: #4b5563;
}

.stock-list li.stock-item-stagnant-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
}

.stock-list li.stock-item-stagnant-danger {
  background: #fee2e2;
  border: 1px solid #ef4444;
}

.alert-text {
  display: inline-block;
  margin-top: 4px;
  font-weight: bold;
}

.alert-text.warning {
  color: #b45309;
}

.alert-text.danger {
  color: #dc2626;
}

.hidden {
  display: none !important;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(18px);
  min-width: min(88vw, 320px);
  max-width: min(88vw, 420px);
  padding: 14px 18px;
  border-radius: 16px;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 3000;
  text-align: center;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.toast-info {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.toast-error {
  background: linear-gradient(135deg, #f87171, #dc2626);
}

.item-body {
  margin-bottom: 12px;
  min-width: 0;
}

.stock-item-content {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.stock-item-media {
  flex: 0 0 88px;
}

.stock-item-thumbnail {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #dbe2ea;
  background: #ffffff;
}

.stock-item-thumbnail[hidden] {
  display: none !important;
}

.stock-item-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  padding: 8px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

.stock-item-placeholder[hidden] {
  display: none !important;
}

.button-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.button-row button {
  width: 100%;
  margin-top: 0;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}

.single-top {
  margin-top: 18px;
}

.edit-button {
  background: #2563eb;
  color: #fff;
}

.delete-button {
  background: #ef4444;
  color: #fff;
}

.save-button {
  background: #16a34a;
  color: #fff;
}

.cancel-button {
  background: #6b7280;
  color: #fff;
}

.duplicate-button {
  background: linear-gradient(180deg, #1f766a 0%, #155e63 100%);
  border: 1px solid #0f766e;
  color: #f0fdfa;
  box-shadow: 0 8px 16px rgba(15, 118, 110, 0.18);
}

.duplicate-edit-button {
  margin-top: 12px;
}

.stock-item-select-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.stock-item-select-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.stock-item-select-label input {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
}

.edit-section {
  border: 2px solid #86efac;
}

.stock-list-card {
  margin-bottom: 32px;
}

.stock-bulk-panel {
  margin-bottom: 16px;
  border: 1px solid #dbe2ea;
  border-radius: 16px;
  background: #f8fbff;
}

.stock-bulk-panel summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
}

.stock-bulk-panel summary::-webkit-details-marker {
  display: none;
}

.stock-bulk-panel[open] summary {
  border-bottom: 1px solid #dbe2ea;
}

.stock-bulk-toggle {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.stock-bulk-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.stock-bulk-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.stock-bulk-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
}

.stock-bulk-toggle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  align-self: flex-end;
}

.stock-bulk-panel-body {
  padding: 16px 18px 18px;
}

.stock-bulk-selection-count {
  margin: 0 0 12px;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.stock-bulk-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.stock-bulk-controls .filter-box {
  flex: 1 1 170px;
}

.bulk-action-button {
  flex: 1 1 180px;
  margin-top: 0;
}

.stock-bulk-note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #64748b;
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.stock-list-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-box label {
  font-size: 14px;
  font-weight: 600;
}

.filter-box select {
  min-width: 160px;
}

.stock-list-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

.stock-visibility-panel {
  min-width: min(100%, 320px);
  padding: 12px 14px;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  background: #ffffff;
}

.stock-visibility-panel summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  list-style: none;
}

.stock-visibility-panel summary::-webkit-details-marker {
  display: none;
}

.stock-visibility-panel[open] summary {
  margin-bottom: 10px;
}

.stock-visibility-panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.stock-visibility-description {
  margin: 0;
  font-size: 12px;
  color: #4b5563;
}

.stock-visibility-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.stock-visibility-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.stock-visibility-option input {
  margin: 0;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  justify-self: end;
}



.stock-export-button {
  margin-top: 0;
  width: auto;
  white-space: nowrap;
}

.stock-transfer-panel {
  min-width: min(100%, 320px);
  padding: 12px;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.stock-transfer-copy {
  margin-bottom: 10px;
}

.stock-transfer-action-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

@media (min-width: 560px) {
  .stock-transfer-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stock-transfer-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.stock-transfer-description {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #4b5563;
}

.convert-entry-panel {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #dbe4ff;
  border-radius: 14px;
  background: #f8fbff;
}

.stock-transfer-export-panel {
  border-color: #d7deea;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.convert-entry-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.convert-entry-description {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: #4b5563;
}

.convert-entry-button {
  margin-top: 12px;
  width: 100%;
}

.stock-transfer-export-button {
  margin-top: 12px;
  width: 100%;
  background: #e0ecff;
  color: #1d4ed8;
  border: 1px solid #9fc1ff;
}

.convert-preview-panel {
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.convert-header-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.convert-header-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef4ff;
  border: 1px solid #d6e1fb;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.2;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.convert-mapping-description {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.6;
  color: #7c2d12;
}

.convert-mapping-list {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}

.convert-mapping-summary {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #fed7aa;
  color: #7c2d12;
  font-size: 13px;
  line-height: 1.6;
}

.convert-mapping-summary.is-warning {
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fb923c;
}

.convert-mapping-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #fed7aa;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.convert-mapping-row.is-required {
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fb923c;
  box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.22);
}


.convert-mapping-row.is-suggested {
  border-color: #f59e0b;
  background: linear-gradient(180deg, #fffaf0 0%, #fff7ed 100%);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.16);
}

.convert-suggestion-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.convert-suggestion-note {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: #b45309;
}

.convert-mapping-source {
  font-size: 13px;
  color: #9a3412;
}

.convert-mapping-source strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  color: #431407;
}

.convert-required-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f97316;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.convert-mapping-select {
  width: 100%;
}

.convert-mapping-select.unused {
  border-color: #d1d5db;
  color: #6b7280;
  background: #f8fafc;
}

.convert-validation-summary {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #fed7aa;
  color: #7c2d12;
  font-size: 13px;
  line-height: 1.6;
}

.convert-validation-summary.is-warning {
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fb923c;
}

.convert-validation-summary.is-danger {
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
  border-color: #fb7185;
  color: #9f1239;
  box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.18);
}

.convert-validation-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #9a3412;
  line-height: 1.6;
  font-size: 13px;
}

.convert-validation-list li + li {
  margin-top: 6px;
}

.convert-validation-list.is-warning {
  color: #b91c1c;
  font-weight: 600;
}

.convert-validation-details {
  margin-top: 10px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 12px;
}

.convert-validation-details.is-warning {
  border-color: #fb7185;
  background: linear-gradient(180deg, #fff7f7 0%, #fff1f2 100%);
}

#convertValidationSection.has-blocking-issues {
  border-left: 4px solid #f43f5e;
  padding-left: 12px;
}

.convert-validation-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #9a3412;
}

.convert-validation-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: #9a3412;
  opacity: 0.85;
}

.stock-export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.convert-action-row {
  margin-top: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.convert-action-row .stock-export-button {
  width: 100%;
}

.stock-export-actions .stock-export-button {
  flex: 1 1 140px;
}

.stock-export-button-primary {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.stock-export-button-primary.is-warning {
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  color: #9a3412;
  border-color: #fb923c;
}

.stock-admin-tools {
  margin-top: 10px;
  border-top: 1px dashed #d1d5db;
  padding-top: 10px;
}

.stock-admin-tools summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  list-style: none;
}

.stock-admin-tools summary::-webkit-details-marker {
  display: none;
}

.stock-admin-tools summary::after {
  content: "開く";
  margin-left: 8px;
  font-size: 11px;
  color: #9ca3af;
}

.stock-admin-tools[open] summary::after {
  content: "閉じる";
}

.stock-admin-tools-body {
  margin-top: 10px;
}

.stock-admin-tools-text {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
}

.stock-admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stock-admin-actions .stock-export-button {
  flex: 1 1 140px;
}

.tax-support-panel {
  margin-top: 18px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(34, 197, 94, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.kitten-accent-panel {
  border-color: rgba(190, 170, 154, 0.5);
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.kitten-accent-panel::before {
  opacity: 0.2;
  background-size: 300px auto;
  background-position: right -48px top -14px;
}

.kitten-accent-panel::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.97)),
    linear-gradient(120deg, rgba(255, 248, 241, 0.28), rgba(255, 255, 255, 0.08));
}

.tax-support-copy {
  margin-bottom: 16px;
}

.tax-support-summary-toggle {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.tax-support-summary-toggle::-webkit-details-marker {
  display: none;
}

.tax-support-summary-heading {
  flex: 1 1 auto;
  min-width: 0;
}

.tax-support-summary-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  align-self: flex-end;
}

.tax-support-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.tax-support-description {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: #475569;
}

.tax-support-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #64748b;
}

.tax-support-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.tax-support-year-box {
  min-width: 180px;
}

.tax-support-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.tax-support-summary-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.82);
}

.tax-support-summary-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #64748b;
}

.tax-support-summary-card strong {
  font-size: 20px;
  color: #0f172a;
}

.tax-support-status-message {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.7;
  color: #475569;
}

.tax-support-category-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tax-support-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.72);
  color: #334155;
  font-size: 12px;
  line-height: 1.4;
}

.tax-support-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.tax-export-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 14px 16px !important;
  text-align: left;
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  color: #1d4ed8 !important;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(29, 78, 216, 0.08);
}

.tax-export-button-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.tax-export-button-copy {
  font-size: 12px;
  line-height: 1.6;
  font-weight: 500;
  color: #3b82f6;
}

.import-preview-panel {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #f59e0b;
  border-radius: 14px;
  background: #fff7ed;
}

.import-preview-title {
  margin: 0 0 8px;
  font-size: 18px;
}

.import-preview-text {
  margin: 0 0 12px;
  color: #7c2d12;
  line-height: 1.5;
}

.import-preview-summary {
  margin: 0;
  display: grid;
  gap: 10px;
}

.import-preview-summary div {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #fed7aa;
}

.import-preview-summary dt {
  font-size: 12px;
  font-weight: 700;
  color: #9a3412;
}

.import-preview-summary dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: #431407;
  word-break: break-word;
}

.import-preview-warning {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.5;
}
.import-preview-status-message {
  margin: 12px 0 0;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid #fed7aa;
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  color: #9a3412;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 600;
}

.import-preview-status-message.is-danger {
  border-color: #fda4af;
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
  color: #9f1239;
}

.import-preview-status-message.is-success {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
  color: #166534;
}

.import-preview-subsection {
  margin-top: 14px;
}

.import-preview-subtitle {
  margin: 0 0 8px;
  font-size: 15px;
  color: #7c2d12;
}

.import-preview-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.import-preview-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  overflow: hidden;
  table-layout: auto;
}

.import-preview-table th,
.import-preview-table td {
  padding: 8px 10px;
  border: 1px solid #fed7aa;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.import-preview-table th {
  background: #ffedd5;
  color: #9a3412;
  font-weight: 700;
  min-width: 56px;
}

.import-preview-table td {
  min-width: 64px;
}

@media (max-width: 520px) {
  .import-preview-table th,
  .import-preview-table td {
    padding: 7px 8px;
    font-size: 12px;
  }
}

.import-preview-error-list {
  margin: 0;
  padding-left: 20px;
  color: #9a3412;
  line-height: 1.5;
}



#inventoryCsvImportErrorsSection.is-danger {
  border-color: #fda4af;
  background: linear-gradient(180deg, #fff7f7 0%, #fff1f2 100%);
}

.search-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-box label {
  font-size: 14px;
  font-weight: 600;
}

.search-box input {
  min-width: 220px;
}

@media (max-width: 480px) {
  .stock-transfer-panel {
    min-width: 100%;
  }

  .stock-transfer-action-grid {
    grid-template-columns: 1fr;
  }

  .stock-export-actions .stock-export-button,
  .stock-admin-actions .stock-export-button {
    width: 100%;
  }
}

.wallet-ledger-section {
  margin-top: 32px;
  padding: 20px;
  background: #fff;
  border-radius: 16px;
}

.wallet-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.wallet-ledger-form {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.wallet-ledger-list {
  display: grid;
  gap: 12px;
}

.wallet-ledger-section {
  margin-top: 32px;
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.wallet-ledger-section h2,
.wallet-ledger-section h3 {
  margin-top: 0;
}

.wallet-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.wallet-summary .summary-card {
  background: #f7f9fc;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  padding: 16px;
}

.wallet-summary .summary-card h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: #666;
}

.wallet-summary .summary-card p {
  font-size: 28px;
  font-weight: bold;
  margin: 0;
  color: #111827;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.wallet-ledger-form {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.wallet-ledger-list-wrapper {
  margin-top: 12px;
}

.ledger-list-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  margin-top: 12px;
}

.ledger-filter-group {
  margin-top: 14px;
}

.ledger-filter-label {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.wallet-ledger-list {
  display: grid;
  gap: 12px;
}

@media (max-width: 768px) {
  .wallet-summary {
    grid-template-columns: 1fr;
  }
}

.wallet-ledger-item {
  background: #f7f9fc;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  padding: 12px;
}

.ledger-help-text {
  margin: 10px 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #555;
}

.monthly-summary-section {
  margin-top: 24px;
  padding: 20px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.monthly-summary-section h2 {
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: bold;
}

.monthly-summary-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.monthly-summary-card {
  padding: 16px;
  border: 1px solid #d9d9e3;
  border-radius: 14px;
  background: #f8f8fc;
}

.monthly-summary-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: bold;
}

.monthly-summary-card p {
  margin: 4px 0;
  font-size: 15px;
  line-height: 1.6;
}

.monthly-balance-plus {
  color: #1a7f37;
  font-weight: bold;
}

.monthly-balance-minus {
  color: #d93025;
  font-weight: bold;
}

.monthly-chart-section {
  margin-top: 24px;
  padding: 20px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.monthly-chart-section h2 {
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: bold;
}

.chart-container {
  position: relative;
  width: 100%;
  min-height: 320px;
}

.chart-container-pie {
  max-width: 460px;
  margin: 0 auto;
}

.balance-chart-section {
  margin-top: 24px;
  padding: 20px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.balance-chart-section h2 {
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: bold;
}

.breakdown-chart-section {
  margin-top: 24px;
  padding: 20px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.analysis-page-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.analysis-section-heading h2 {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
}

.analysis-section-description,
.analysis-pie-summary-text {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
}

.analysis-pie-summary-text {
  margin-bottom: 16px;
}

.analysis-period-toggle {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: #f3f4f6;
}

.analysis-toggle-button {
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.analysis-toggle-button.active {
  background: #0f1a3a;
  color: #ffffff;
}

.view-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.view-switch-button {
  width: 100%;
  min-width: 0;
  margin-top: 0;
  padding: 12px 10px;
  border: 1px solid #d0d7e2;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #222222;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.view-switch-button.active {
  background: #0f1a3a;
  color: #ffffff;
  border-color: #0f1a3a;
  box-shadow: 0 10px 18px rgba(15, 26, 58, 0.16);
}

.ledger-page-section {
  margin-top: 20px;
  padding: 20px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ledger-page-section h2 {
  margin-bottom: 16px;
  font-size: 28px;
  font-weight: bold;
}

.wallet-ledger-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.wallet-ledger-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.wallet-ledger-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.wallet-ledger-card-category {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  line-height: 1.4;
}

.wallet-ledger-card-amount {
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.2;
}

.wallet-ledger-card-amount.income {
  color: #059669;
}

.wallet-ledger-card-amount.expense {
  color: #dc2626;
}

.wallet-ledger-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.wallet-ledger-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.wallet-ledger-badge.income {
  background: #dcfce7;
  color: #166534;
}

.wallet-ledger-badge.expense {
  background: #fee2e2;
  color: #991b1b;
}

.wallet-ledger-date {
  font-size: 13px;
  color: #6b7280;
}

.wallet-ledger-card-memo {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
  background: #f9fafb;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  word-break: break-word;
}

.wallet-ledger-card-actions {
  display: flex;
  gap: 8px;
}

.wallet-ledger-card-actions button {
  width: auto;
  flex: 1;
  min-height: 40px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.wallet-ledger-edit-button {
  background: #e0f2fe;
  color: #075985;
}

.wallet-ledger-delete-button {
  background: #fee2e2;
  color: #991b1b;
}

.ledger-filter-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
}

.ledger-filter-button {
  width: 100% !important;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
}

.ledger-filter-button.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.ledger-page-header h2 {
  margin-bottom: 6px;
}

.ledger-page-description {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

@media (max-width: 480px) {
  .wallet-ledger-card {
    padding: 12px;
  }

  .wallet-ledger-card-category {
    font-size: 14px;
  }

  .wallet-ledger-card-amount {
    font-size: 18px;
  }

  .wallet-ledger-card-actions {
      flex-direction: row;
  }

  .ledger-list-controls .filter-box,
  .ledger-list-controls .filter-box select {
    width: 100%;
  }

  .ledger-filter-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ledger-top-summary {
  margin-top: 16px;
  margin-bottom: 20px;
}

.ledger-summary-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ledger-summary-card-main {
  margin-bottom: 12px;
  padding: 18px 18px;
}

.ledger-summary-label {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}

.ledger-summary-card strong {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.ledger-summary-card-main strong {
  font-size: 28px;
}

.ledger-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.ledger-summary-positive {
  color: #059669 !important;
}

.ledger-summary-negative {
  color: #dc2626 !important;
}

.ledger-top-summary {
  margin-top: 16px;
  margin-bottom: 20px;
}

.ledger-summary-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ledger-summary-card-main {
  margin-bottom: 12px;
  padding: 18px 18px;
}

.ledger-summary-label {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}

.ledger-summary-card strong {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.ledger-summary-card-main strong {
  font-size: 28px;
}

.ledger-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.ledger-summary-positive {
  color: #059669 !important;
}

.ledger-summary-negative {
  color: #dc2626 !important;
}

#showLedgerViewButton {
  font-size: 14px;
  line-height: 1.2;
  padding-top: 10px;
  padding-bottom: 10px;
}

@media (max-width: 520px) {
  .wallet-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-summary .summary-card,
  .ledger-summary-card {
    padding: 12px;
  }

  .wallet-summary .summary-card h3,
  .ledger-summary-label {
    font-size: 12px;
  }

  .wallet-summary .summary-card p,
  .ledger-summary-card strong {
    font-size: 22px;
  }

  .ledger-summary-card-main strong {
    font-size: 26px;
  }
}

@media (max-width: 380px) {
  .wallet-summary,
  .ledger-summary-grid {
    grid-template-columns: 1fr;
  }
}


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

.header-brand {
  display: flex;
  flex-direction: column;
}

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

.icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  margin-top: 0;
  padding: 0;
  border: 1px solid #d0d7e2;
  border-radius: 12px;
  background: #ffffff;
  color: #0f1a3a;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-icon-button {
  box-shadow: 0 4px 14px rgba(15, 26, 58, 0.06);
}

.install-app-button {
  box-shadow: 0 4px 14px rgba(255, 107, 124, 0.18);
  border-color: rgba(255, 107, 124, 0.24);
  color: #ff5f74;
  font-size: 24px;
  font-weight: 700;
}

.settings-card {
  margin-top: 20px;
}

.settings-group + .settings-group {
  margin-top: 20px;
}

.settings-group-title {
  margin: 0 0 8px;
  font-size: 18px;
}

.settings-group-description {
  margin: 0 0 12px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.7;
}

.stock-settings-shortcut {
  min-width: min(100%, 320px);
  padding: 12px 14px;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  background: #ffffff;
}

.stock-settings-shortcut-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.stock-settings-shortcut-text {
  margin: 6px 0 0;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.7;
}

.stock-settings-shortcut-button {
  width: auto;
  margin-top: 12px;
}

.stock-visibility-toggle {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.stock-visibility-toggle::-webkit-details-marker {
  display: none;
}

.stock-visibility-toggle-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stock-visibility-toggle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  align-self: flex-end;
}

.stock-visibility-panel-actions {
  display: flex;
  justify-content: flex-end;
}

.stock-danger-zone {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.stock-danger-zone .reset-button {
  width: auto;
  min-width: 220px;
  padding-inline: 24px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 480px) {
  .stock-settings-shortcut,
  .stock-visibility-panel {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .stock-visibility-panel-actions {
    justify-content: stretch;
  }

  .stock-visibility-panel-actions .stock-settings-shortcut-button {
    width: 100%;
  }
}





.stock-admin-tools {
  display: none;
}



body {
  --app-bg: #f6f7fb;
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --text-color: #222222;
  --muted-color: #6b7280;
  --surface-soft: #f9fafb;
  --surface-alt: #f3f4f6;
  --accent-color: #0f172a;
  --accent-soft: #dbeafe;
  --background-image-tint: rgba(246, 247, 251, 0.58);
  --font-base-size: 14px;
  --font-small-size: 12px;
  --font-title-size: 20px;
  --font-section-size: 18px;
  --user-bg-image: none;
}

body.theme-light {
  --app-bg: #f6f7fb;
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --text-color: #222222;
  --muted-color: #6b7280;
  --surface-soft: #f9fafb;
  --surface-alt: #f3f4f6;
  --accent-color: #0f172a;
  --accent-soft: #dbeafe;
  --background-image-tint: rgba(246, 247, 251, 0.58);
}

body.theme-dark {
  --app-bg: #111827;
  --card-bg: #1f2937;
  --card-border: #374151;
  --text-color: #f9fafb;
  --muted-color: #cbd5e1;
  --surface-soft: #273244;
  --surface-alt: #334155;
  --accent-color: #93c5fd;
  --accent-soft: #1e3a8a;
  --background-image-tint: rgba(17, 24, 39, 0.64);
}

body.theme-sakura {
  --app-bg: #fff5f7;
  --card-bg: #ffffff;
  --card-border: #f3c8d2;
  --text-color: #4b2c39;
  --muted-color: #8b5f6f;
  --surface-soft: #fff0f3;
  --surface-alt: #fde2e7;
  --accent-color: #be5c76;
  --accent-soft: #ffe0e9;
  --background-image-tint: rgba(255, 245, 247, 0.62);
}

body.theme-sky {
  --app-bg: #eff8ff;
  --card-bg: #ffffff;
  --card-border: #cfe5f7;
  --text-color: #1f3b53;
  --muted-color: #5c7a95;
  --surface-soft: #f3faff;
  --surface-alt: #ddeffd;
  --accent-color: #2563eb;
  --accent-soft: #dbeafe;
  --background-image-tint: rgba(239, 248, 255, 0.6);
}

body.font-small {
  --font-base-size: 13px;
  --font-small-size: 11px;
  --font-title-size: 18px;
  --font-section-size: 17px;
}

body.font-medium {
  --font-base-size: 14px;
  --font-small-size: 12px;
  --font-title-size: 20px;
  --font-section-size: 18px;
}

body.font-large {
  --font-base-size: 15px;
  --font-small-size: 13px;
  --font-title-size: 22px;
  --font-section-size: 20px;
}

body {
  background: var(--app-bg);
  color: var(--text-color);
  font-size: var(--font-base-size);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-image: none;
}

body.custom-background-enabled {
  background-image:
    linear-gradient(var(--background-image-tint), var(--background-image-tint)),
    var(--user-bg-image);
}

body,
button,
input,
select,
textarea {
  font-size: var(--font-base-size);
}

.header-brand h1,
.section-title {
  font-size: var(--font-title-size);
}

.settings-group-title,
.monthly-summary-card h3 {
  font-size: var(--font-section-size);
}

.header-brand p,
.settings-group-description,
.stock-settings-shortcut-text,
.wallet-ledger-card-memo,
.wallet-ledger-badge,
.ledger-summary-label {
  font-size: var(--font-small-size);
}

.card,
.dashboard-card,
.monthly-summary-card,
.wallet-ledger-card,
.ledger-summary-card,
.stock-transfer-panel,
.stock-settings-shortcut,
.item-card,
.icon-button,
input,
select,
textarea {
  background: var(--card-bg);
  border-color: var(--card-border);
  color: var(--text-color);
}

.stock-visibility-option,
.wallet-ledger-card-memo,
.ledger-summary-card,
.wallet-summary .summary-card,
.monthly-summary-card {
  background: var(--surface-soft);
  border-color: var(--card-border);
}

.dashboard-label,
.settings-group-description,
.stock-settings-shortcut-text,
.stock-transfer-panel p,
.header-brand p,
.ledger-summary-label {
  color: var(--muted-color);
}

body.theme-dark .view-switch-button,
body.theme-dark .secondary-button,
body.theme-dark .icon-button,
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  background: #273244;
  color: #f9fafb;
  border-color: #475569;
}

body.theme-dark .view-switch-button.active,
body.theme-dark .primary-button,
body.theme-dark .stock-settings-shortcut-button {
  background: #93c5fd;
  color: #0f172a;
  border-color: #93c5fd;
}

body.theme-dark .dashboard-action-card {
  background: var(--card-bg);
  border-color: var(--card-border);
}

body.theme-dark .kitten-accent-card,
body.theme-dark .kitten-accent-panel {
  border-color: rgba(148, 163, 184, 0.24);
}

body.theme-dark .kitten-accent-card::after,
body.theme-dark .kitten-accent-panel::after {
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.94) 0%, rgba(17, 24, 39, 0.9) 60%, rgba(30, 41, 59, 0.74) 100%),
    linear-gradient(135deg, rgba(51, 65, 85, 0.24), rgba(15, 23, 42, 0.16));
}

body.theme-dark .kitten-shell-card::after {
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.94), rgba(17, 24, 39, 0.9)),
    linear-gradient(135deg, rgba(51, 65, 85, 0.16), rgba(15, 23, 42, 0.08)),
    url("./konekoashi.jpg");
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: auto, auto, 260px auto;
  background-position: 0 0, 0 0, right -32px bottom -26px;
}

body.theme-dark .dashboard-action-title {
  color: var(--text-color);
}

body.theme-dark .dashboard-action-copy {
  color: var(--muted-color);
}

body.theme-dark .tax-support-summary-badge,
body.theme-dark .tax-export-button {
  background: linear-gradient(180deg, #24425e 0%, #1b334a 100%) !important;
  color: #d8f0ff !important;
  border-color: #3f7ea1 !important;
}

body.theme-dark .tax-support-note {
  color: #cbd5e1;
}

body.theme-dark .tax-export-button-copy {
  color: #b7d6ea;
}

body.theme-dark .analysis-period-toggle {
  background: #1e293b;
}

body.theme-dark .analysis-toggle-button {
  color: #e2e8f0;
}

body.theme-dark .analysis-toggle-button.active {
  background: #93c5fd;
  color: #0f172a;
}

.setting-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.setting-file-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--text-color);
}

.setting-help-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted-color);
}

.setting-inline-button {
  align-self: flex-start;
  min-width: 0;
  padding-inline: 14px;
}

.setting-image-preview {
  width: min(100%, 240px);
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.setting-image-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.setting-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-color);
}

.setting-select {
  width: 100%;
}

.stock-visibility-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}


.stock-visibility-label {
  min-width: 0;
  overflow-wrap: anywhere;
}



@media (max-width: 480px) {
  .view-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .view-switch-button {
    padding: 11px 6px;
    font-size: 12px;
  }
}

.stock-export-actions-single .stock-export-button {
  flex: 0 1 220px;
  margin-inline: auto;
}

/* ver2.0.1 UI polish */
.card,
.monthly-summary-section,
.monthly-chart-section,
.balance-chart-section,
.breakdown-chart-section,
.expense-category-chart-section {
  border: 1px solid #edf0f5;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

label {
  margin-top: 14px;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.01em;
}

input,
select {
  padding: 13px 14px;
  border: 1px solid #d7deea;
  border-radius: 14px;
  background: #fbfcff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #ff6b7c;
  box-shadow: 0 0 0 4px rgba(255, 107, 124, 0.14);
  background: #ffffff;
}

.section-title {
  margin-bottom: 18px;
  letter-spacing: 0.01em;
}

.form-group {
  padding: 12px 14px 14px;
  background: #ffffff;
  border: 1px solid #edf0f5;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.form-group label {
  margin-top: 0;
}

.button-row {
  gap: 10px;
  margin-top: 14px;
}

.button-row button {
  border-radius: 14px;
  min-height: 48px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.button-row button:hover,
.save-button:hover,
.cancel-button:hover {
  transform: translateY(-1px);
}

.save-button {
  background: linear-gradient(180deg, #ff6677 0%, #ff475d 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(255, 71, 93, 0.18);
}

.cancel-button {
  background: #fff5f6;
  color: #ff475d;
  border: 1px solid #ffc6ce !important;
}

.analysis-control-panel {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  margin-top: 20px;
  background: linear-gradient(180deg, #fff8f8 0%, #ffffff 100%);
  border: 1px solid #ffe0e4;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(255, 99, 132, 0.08);
}

.analysis-control-copy h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #0f172a;
}

.analysis-control-copy p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
}

.analysis-month-picker {
  min-width: min(100%, 220px);
}

.analysis-field-label {
  margin-top: 0;
}

.analysis-page-header {
  margin-bottom: 8px;
}

.analysis-section-heading {
  align-items: center;
}

.analysis-period-toggle {
  border: 1px solid #e5e7eb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.analysis-toggle-button {
  min-height: 40px;
  padding-inline: 16px;
}

.analysis-pie-summary-text {
  margin-bottom: 18px;
}

.monthly-summary-card {
  border-radius: 18px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.monthly-summary-card.is-selected {
  border-color: #ffb0bb;
  background: linear-gradient(180deg, #fff7f8 0%, #ffffff 100%);
  box-shadow: 0 12px 24px rgba(255, 107, 124, 0.12);
  transform: translateY(-1px);
}

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

.monthly-summary-card-header h3 {
  margin: 0;
}

.monthly-summary-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ffeff2;
  color: #e11d48;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.expense-category-chart-section {
  margin-top: 24px;
  padding: 20px;
  background: #ffffff;
}

body.theme-dark .analysis-control-panel {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  border-color: #334155;
}

body.theme-dark .tax-support-panel {
  border-color: rgba(74, 222, 128, 0.18);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.82));
}

body.theme-dark .tax-support-title,
body.theme-dark .tax-support-summary-card strong {
  color: #f8fafc;
}

body.theme-dark .tax-support-description,
body.theme-dark .tax-support-status-message,
body.theme-dark .tax-support-summary-label {
  color: #cbd5e1;
}

body.theme-dark .tax-support-summary-card {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.8);
}

body.theme-dark .tax-support-category-chip {
  background: rgba(51, 65, 85, 0.86);
  color: #e2e8f0;
}

body.theme-dark .analysis-control-copy h3,
body.theme-dark label {
  color: #e5e7eb;
}

body.theme-dark .analysis-control-copy p {
  color: #cbd5e1;
}

body.theme-dark .card,
body.theme-dark .monthly-summary-section,
body.theme-dark .monthly-chart-section,
body.theme-dark .balance-chart-section,
body.theme-dark .breakdown-chart-section,
body.theme-dark .expense-category-chart-section,
body.theme-dark .form-group {
  border-color: #334155;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.35);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  background: #273244;
  border-color: #475569;
  color: #f9fafb;
}

body.theme-dark .cancel-button {
  background: #273244;
  color: #fda4af;
  border-color: #475569 !important;
}

body.theme-dark .form-group,
body.theme-dark .monthly-summary-card.is-selected {
  border-color: #475569;
}

body.theme-dark .monthly-summary-card.is-selected {
  background: linear-gradient(180deg, #273244 0%, #1f2937 100%);
}

body.theme-dark .monthly-summary-badge {
  background: #3f1d2e;
  color: #fda4af;
}

@media (max-width: 640px) {
  .analysis-control-panel {
    padding: 16px;
  }

  .analysis-month-picker {
    width: 100%;
  }

  .analysis-period-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .analysis-toggle-button {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .button-row {
    flex-direction: column;
  }

  .monthly-summary-card-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

body.theme-dark .stock-bulk-panel {
  background: #111827;
  border-color: #334155;
}

body.theme-dark .stock-bulk-text,
body.theme-dark .stock-bulk-note,
body.theme-dark .profit-breakdown-row dt,
body.theme-dark .stock-item-select-label {
  color: #cbd5e1;
}

body.theme-dark .stock-bulk-title,
body.theme-dark .stock-bulk-selection-count,
body.theme-dark .profit-breakdown-row dd {
  color: #f8fafc;
}

body.theme-dark .stock-bulk-toggle-badge {
  background: #1e3a8a;
  color: #dbeafe;
}

body.theme-dark .duplicate-button {
  background: linear-gradient(180deg, #0f766e 0%, #134e4a 100%);
  border-color: #5eead4;
  color: #ecfeff;
}

@media (max-width: 640px) {
  .stock-bulk-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .bulk-action-button {
    width: 100%;
  }

  .memo-template-row {
    flex-direction: column;
  }

  .memo-template-apply-button {
    width: 100%;
  }
}



