/* ===== Variables & Base ===== */
:root {
  --bg-dark: #0a0a0f;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --text: #e8e8ed;
  --text-muted: #9ca3af;
  --accent: #8b5cf6;
  --accent-secondary: #06b6d4;
  --gradient: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 50%, #8b5cf6 100%);
  --glass: rgba(255, 255, 255, 0.06);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-dark);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(6, 182, 212, 0.1), transparent);
  color: var(--text);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* ===== Screen layout ===== */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ===== Record screen ===== */
.record-screen .chat-body {
  padding: 24px;
}

.record-area {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== Loading ===== */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  z-index: 1100;
  overflow: hidden;
}

.loading-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: 40%;
  background: var(--gradient);
  animation: loadingSlide 1s ease-in-out infinite;
}

@keyframes loadingSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.loading-bar.hidden {
  display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .menu-screen { padding: 16px; }
  .menu-card { padding: 16px; }
  .chat-body { padding: 16px; }
  .message { max-width: 92%; }
}

/* ===== Legal Links ===== */
.legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.legal-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0.6;
  font-family: inherit;
}

.legal-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.legal-sep {
  color: var(--text-muted);
  font-size: 11px;
  opacity: 0.4;
}

/* ===== Tokushoho Table ===== */
.tokushoho-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tokushoho-table th,
.tokushoho-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.tokushoho-table th {
  background: var(--bg-card);
  white-space: nowrap;
  width: 35%;
  font-weight: bold;
}
@media (max-width: 640px) {
  html, body {
    min-height: 100dvh;
  }
  #app {
    min-height: 100dvh;
  }
}
