@import url('https://fonts.googleapis.com/css2?family=Afacad:wght@400;500;600;700&family=Raleway:wght@500;600;700;800&display=swap');

:root {
  --bg-color: #F6F2E7;
  --card-bg: #FFFFFF;
  --primary-color: #E07A5F;
  --primary-hover: #C9664C;
  --secondary-color: #3D5A80;
  --secondary-hover: #2E4767;
  --text-dark: #2D3748;
  --text-muted: #718096;
  --color-success: #81B29A;
  --border-radius-large: 16px;
  --border-radius-small: 8px;
  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.08);
  --font-title: 'Raleway', sans-serif;
  --font-body: 'Afacad', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Helper styles for SVG icons replacing emojis */
.author-avatar-svg {
  width: 30px;
  height: 30px;
  stroke: var(--primary-color);
  stroke-width: 2;
  fill: none;
}

.empty-saved-svg {
  width: 44px;
  height: 44px;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  fill: none;
  margin-bottom: 12px;
}

.callout-svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.modal-success-svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px auto;
  display: block;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #EAE3D2;
  font-family: var(--font-body);
  color: var(--text-dark);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: scroll; /* Prevent layout shift when scrollbars appear */
}

/* Centered Mobile-Only Viewport */
.mobile-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--bg-color);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.08);
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: 102px; /* Offset for taller bottom tab bar */
}

/* Common Header */
header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-color);
}

.brand-logo {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  flex: 1;
  margin-right: 12px;
}

.logo-img {
  width: 100%;
  max-width: 280px;
  height: auto;
  object-fit: contain;
  display: block;
}

.lang-select {
  background: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 4px 10px;
  border-radius: var(--border-radius-small);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  outline: none;
  box-shadow: var(--shadow-soft);
}

/* Tabs Content Wrapper */
.tab-content {
  display: none;
  flex-direction: column;
  padding: 0 20px 20px 20px;
  animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Bottom Tab Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 94px; /* Increased by 30px from 64px */
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 0, 0, 0.03);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.03);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex: 1;
  height: 100%;
}

.nav-item svg {
  width: 26px;
  height: 26px;
  margin-bottom: 5px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: var(--transition-smooth);
}

.nav-item.active {
  color: var(--primary-color);
}

.nav-item.active svg {
  stroke: var(--primary-color);
  fill: rgba(224, 122, 95, 0.1);
}

/* --- Tab 1: Explore View --- */
.author-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-large);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 25px;
  border: 1px solid rgba(0, 0, 0, 0.01);
}

.author-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #FEECE9;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary-color);
  flex-shrink: 0;
}

.author-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.author-info h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.author-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.welcome-link-wrapper {
  margin-top: 8px;
}

.welcome-link-btn {
  color: var(--primary-color);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-smooth);
}

.welcome-link-btn:hover {
  color: var(--primary-hover);
  transform: translateX(2px);
}

/* Post Detail Inline Images */
.post-inline-media {
  margin: 20px 0;
  width: 100%;
  border-radius: var(--border-radius-large);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.02);
}

.post-inline-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Newsletter Subscription Box */
.newsletter-box {
  background: linear-gradient(135deg, #FFF6F2 0%, #FDF0E9 100%);
  border-radius: var(--border-radius-large);
  padding: 20px;
  margin-top: 20px;
  border: 1px dashed rgba(224, 122, 95, 0.3);
  box-shadow: var(--shadow-soft);
}

.newsletter-box h4 {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 6px;
}

.newsletter-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-field {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--border-radius-small);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  background-color: var(--card-bg);
  color: var(--text-dark);
  transition: var(--transition-smooth);
}

.input-field:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(224, 122, 95, 0.1);
}

.btn-primary {
  background-color: var(--primary-color);
  color: #FFFFFF;
  border: none;
  padding: 10px 16px;
  border-radius: var(--border-radius-small);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

/* --- Tab 2: Posts View --- */
.sticky-search-container {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--bg-color);
  padding: 10px 0;
  margin-bottom: 10px;
}

.search-bar {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23718096' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") no-repeat 16px center;
  background-size: 18px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  box-shadow: var(--shadow-soft);
  transition: var(--transition-smooth);
}

.search-bar:focus {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-hover);
}

/* Category Filter Chips */
.category-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 5px 0 15px 0;
  margin-bottom: 10px;
  scrollbar-width: none; /* Hide scrollbar Firefox */
}

.category-container::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}

.category-chip {
  padding: 8px 16px;
  border-radius: 20px;
  background-color: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, 0.03);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-soft);
}

.category-chip.active {
  background-color: var(--primary-color);
  color: #FFFFFF;
  border-color: var(--primary-color);
}

/* Article Cards Grid */
.article-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-large);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.01);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card-thumbnail-wrapper {
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  position: relative;
  background-color: #EEE6DB;
}

.card-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.card-content {
  padding: 16px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.card-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary-color);
  background-color: #FFF0EB;
  padding: 2px 8px;
  border-radius: 4px;
}

.card-readtime {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-dark);
}

/* --- Tab 3: Saved View --- */
.saved-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-dark);
}

.empty-saved-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-saved-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-saved-state p {
  font-size: 0.9rem;
}

/* Expandable Card Accordion Layout */
.saved-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-large);
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.02);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.saved-card-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 12px;
  user-select: none;
}

.saved-card-thumbnail {
  width: 52px;
  height: 52px;
  border-radius: var(--border-radius-small);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.saved-card-info {
  flex: 1;
}

.saved-card-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  line-height: 1.3;
}

.saved-card-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--secondary-color);
  background-color: #EDF2F7;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 8px;
}

/* Progress bar inside card */
.progress-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.progress-track {
  flex: 1;
  height: 6px;
  background-color: #EDF2F7;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--color-success);
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}

.chevron-icon {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  stroke-width: 2.5;
  fill: none;
  transition: transform 0.3s ease;
}

.saved-card.expanded .chevron-icon {
  transform: rotate(180deg);
}

.saved-card-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
}

.unscrap-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.unscrap-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.unscrap-btn:hover {
  color: #E53E3E;
  transform: scale(1.15);
}

/* Accordion Drawer Content */
.saved-card-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 0px solid rgba(0, 0, 0, 0.03);
}

.saved-card.expanded .saved-card-drawer {
  max-height: 800px; /* arbitrary large value to allow overflow */
  border-top-width: 1px;
}

.drawer-inner {
  padding: 16px;
  background-color: #FCFBF9;
}

.drawer-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

/* Checklist item styles */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-dark);
  cursor: pointer;
}

.checklist-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-muted);
  border-radius: 50%; /* Rounded checkbox for cozy feel */
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.checklist-checkbox:checked {
  background-color: var(--color-success);
  border-color: var(--color-success);
}

.checklist-checkbox:checked::after {
  content: "";
  display: block;
  width: 8px;
  height: 4px;
  border-left: 2px solid #FFFFFF;
  border-bottom: 2px solid #FFFFFF;
  transform: rotate(-45deg) translate(1px, -1px);
}

.checklist-item.checked {
  color: var(--text-muted);
  text-decoration: line-through;
}

.read-guide-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  border-radius: var(--border-radius-small);
  border: 1px solid var(--secondary-color);
  color: var(--secondary-color);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.read-guide-link:hover {
  background-color: rgba(61, 90, 128, 0.05);
}



/* --- Article Detail Page Styles --- */
.article-page {
  padding-bottom: 110px;
  background-color: var(--bg-color);
}

.detail-top-bar {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-color);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.02);
}

.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.back-link svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-dark);
  stroke-width: 2.5;
  fill: none;
}

.bookmark-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bookmark-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: var(--transition-smooth);
}

.bookmark-btn:active svg {
  transform: scale(0.8);
}

.bookmark-btn.active {
  color: var(--primary-color);
}

.bookmark-btn.active svg {
  fill: var(--primary-color);
  stroke: var(--primary-color);
  animation: bookmarkPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.4) forwards;
}

@keyframes bookmarkPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  80% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.article-header {
  padding: 15px 20px 5px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.article-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.article-title-container {
  margin-top: 5px;
  margin-bottom: 15px;
}

.article-title-container h1 {
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
  margin: 0;
}

.hero-image-wrapper {
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  position: relative;
  background-color: #EEE6DB;
  box-shadow: var(--shadow-soft);
  margin-bottom: 20px;
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-body {
  padding: 0 20px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-dark);
}

.article-body p {
  margin-bottom: 16px;
}

.article-body h2 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 25px 0 12px 0;
  color: var(--text-dark);
}

.article-body ol, .article-body ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.article-body li {
  margin-bottom: 8px;
}

/* Callout Boxes */
.callout-box {
  border-radius: var(--border-radius-large);
  padding: 16px;
  margin: 20px 0;
  display: flex;
  gap: 12px;
  box-shadow: var(--shadow-soft);
}

.callout-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.callout-content {
  font-size: 0.85rem;
  line-height: 1.5;
}

.callout-box.tip {
  background-color: #EDF2F7;
  border-left: 4px solid var(--secondary-color);
}

.callout-box.warning {
  background-color: #FFF8F0;
  border-left: 4px solid var(--primary-color);
}

/* Embedded Post Checklist Widget */
.post-checklist-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-large);
  padding: 20px;
  margin: 25px 0;
  box-shadow: var(--shadow-soft);
  border-left: 4px solid var(--color-success);
}

.post-checklist-card h4 {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dark);
}

.post-checklist-progress {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

/* --- Modals & Overlays --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(45, 55, 72, 0.6);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.3s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background-color: var(--bg-color);
  width: 100%;
  max-width: 360px;
  border-radius: var(--border-radius-large);
  padding: 25px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  animation: modalPopUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPopUp {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
}

.modal-box h4 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.modal-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.modal-close-btn {
  background-color: var(--primary-color);
  color: #FFFFFF;
  border: none;
  padding: 10px 24px;
  border-radius: var(--border-radius-small);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  background-color: var(--primary-hover);
}

/* --- Tab 4: Tools/Utility View --- */
.tools-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.tool-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-large);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.01);
  max-height: 56px; /* Collapsed height (padding + header) */
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-card.expanded {
  max-height: 800px; /* Expand to show content */
}

.tool-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  height: 24px;
}

.tool-card-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.tool-card-title svg {
  flex-shrink: 0;
}

.tool-card .chevron-icon {
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
  stroke-width: 2.5;
  fill: none;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.tool-card.expanded .chevron-icon {
  transform: rotate(180deg);
}

.tool-card-content {
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  margin-top: 16px;
}

.converter-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-group-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.converter-arrow {
  text-align: center;
  font-size: 1.2rem;
  color: var(--primary-color);
  font-weight: 700;
  user-select: none;
  margin: -4px 0;
}

.rate-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: right;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.rate-input {
  width: 60px;
  padding: 2px 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  font-family: inherit;
  font-size: inherit;
  text-align: center;
  color: var(--primary-color);
  font-weight: 700;
  background: var(--card-bg);
  outline: none;
  transition: var(--transition-smooth);
}

.rate-input:focus {
  border-color: var(--primary-color);
}

.emergency-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.emergency-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.emergency-item:last-child {
  border-bottom: none;
}

.emergency-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dark);
}

.emergency-num {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--secondary-color);
  text-decoration: none;
  background-color: rgba(61, 90, 128, 0.08);
  padding: 4px 10px;
  border-radius: var(--border-radius-small);
  transition: var(--transition-smooth);
}

.emergency-num:hover {
  background-color: var(--secondary-color);
  color: #FFFFFF;
}

/* --- Phrasebook List Styles --- */
.phrase-categories {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  scrollbar-width: none;
}

.phrase-categories::-webkit-scrollbar {
  display: none;
}

.phrase-cat-chip {
  padding: 6px 12px;
  border-radius: 14px;
  background-color: var(--bg-color);
  border: 1px solid rgba(0, 0, 0, 0.02);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.phrase-cat-chip.active {
  background-color: var(--primary-color);
  color: #FFFFFF;
  border-color: var(--primary-color);
}

.phrase-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.phrase-group {
  display: none;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.phrase-group.active {
  display: flex;
}

.phrase-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.phrase-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.phrase-idr {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
}

.phrase-kr-wrapper {
  background: rgba(224, 122, 95, 0.05);
  border-left: 3px solid var(--primary-color);
  padding: 8px 12px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.phrase-kr-hangul {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-color);
}

.phrase-kr-rom {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-muted);
}
