/* ==========================================================================
   TuTap.vn - Tab Tiện Ích CSS (Apple Native Modal Sheet, Inset Grouped, Grid)
   File: /include/css/tab_tienich.css
   ========================================================================== */

/* ==========================================================================
   APPLE IOS NATIVE MODAL SHEET (CHO TAB TIỆN ÍCH - KHÔNG LOAD TRANG MỚI)
   Giữ nguyên âm thanh, nhạc nền, tụng kinh, tiếng chuông mõ không bị ngắt quãng
   Tối ưu 100% chuẩn Apple iOS trên Mobile: không trôi, không lệch, khóa cố định
   ========================================================================== */
.ios-tool-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100% !important;
  height: 100dvh !important;
  z-index: 2147483647 !important;
  background: rgba(0, 0, 0, 0.72) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  overflow: hidden !important;
  
  box-sizing: border-box !important;
  transition: opacity 0.32s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.32s cubic-bezier(0.32, 0.72, 0, 1) !important;
}

.ios-tool-modal-overlay:not(.active) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.ios-tool-modal-overlay:not(.active) .ios-tool-modal-sheet {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate3d(0, 100vh, 0) !important;
}

.ios-tool-modal-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#expertChatModalSheet:not(.open) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(calc(100% + 80px)) !important;
}

body.has-native-modal-open #tb-top-bell,
body.has-native-modal-open #btn-thongbao,
body.has-native-modal-open #tb-notify-box,
body.has-native-modal-open #tb-notify-badge,
body.has-native-modal-open #tb-top-badge,
body.has-native-modal-open .bottom-item1,
body.has-native-modal-open .user-action-btn,
body.has-native-modal-open #ios-user-sheet,
body.has-native-modal-open #ios-user-sheet-backdrop,
body.has-native-modal-open #tutap-global-bottom-bar,
body.has-native-modal-open .native-bottom-tabbar,
body.has-native-modal-open #bottom-nav-mobile,
body.has-native-modal-open .bottom-nav,
body.has-native-modal-open .footer-nav,
body.has-native-modal-open .app-bottom-dock {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.ios-tool-modal-sheet {
  width: 100% !important;
  max-width: 1060px !important;
  height: 94vh !important;
  height: 94dvh !important;
  max-height: 94dvh !important;
  background: var(--tt-bg, #1c1511);
  border: 1px solid var(--tt-card-border, rgba(240, 207, 117, 0.25));
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 45px rgba(0, 0, 0, 0.55);
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  transform: translate3d(0, 100%, 0);
  transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1);
  position: relative !important;
}

.ios-tool-modal-overlay.active .ios-tool-modal-sheet {
  transform: translate3d(0, 0, 0);
}

/* Tối ưu riêng trên màn hình Desktop lớn */
@media (min-width: 1024px) {
  .ios-tool-modal-overlay {
    align-items: center !important;
    padding: 20px !important;
  }
  .ios-tool-modal-overlay:not(.active) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  .ios-tool-modal-overlay:not(.active) .ios-tool-modal-sheet {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translate3d(0, 100vh, 0) !important;
  }
  .ios-tool-modal-sheet {
    height: 90vh !important;
    border-radius: 22px !important;
    border-bottom: 1px solid var(--tt-card-border, rgba(240, 207, 117, 0.25)) !important;
    transform: translate3d(0, 30px, 0) scale(0.97);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.32s ease;
    opacity: 0;
  }
  .ios-tool-modal-overlay.active .ios-tool-modal-sheet {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }
}

/* TỐI ƯU CỰC KỲ VỮNG CHẮC TRÊN MÀN HÌNH ĐIỆN THOẠI (MOBILE IOS / ANDROID)
   Khắc phục triệt để hiện tượng bị trôi, lệch hoặc co hẹp độ rộng */
@media (max-width: 768px) {
  .ios-tool-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    align-items: flex-end !important;
    justify-content: stretch !important;
  }

  .ios-tool-modal-overlay:not(.active) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .ios-tool-modal-overlay:not(.active) .ios-tool-modal-sheet {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translate3d(0, 100vh, 0) !important;
  }

  .ios-tool-modal-sheet {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    height: 95% !important;
    height: 95dvh !important;
    max-height: 95dvh !important;
    border-radius: 20px 20px 0 0 !important;
    margin: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    position: absolute !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    box-sizing: border-box !important;
    transform: translate3d(0, 100%, 0);
  }

  .ios-tool-modal-overlay.active {
    display: flex !important;
  }

  .ios-tool-modal-overlay.active .ios-tool-modal-sheet {
    transform: translate3d(0, 0, 0);
  }

  .ios-navbar {
    padding: 8px 10px 8px 10px !important;
  }

  .ios-navbar-center {
    max-width: 55% !important;
  }

  .ios-navbar-title {
    font-size: 14.5px !important;
  }

  .ios-nav-back-btn span {
    font-size: 14px !important;
  }

  .ios-nav-action-pill {
    width: 29px !important;
    height: 29px !important;
  }

  .ios-nav-close-btn {
    width: 29px !important;
    height: 29px !important;
  }
}

.ios-sheet-drag-handle-bar {
  width: 100%;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  background: var(--tt-tabbar-bg, #261c16);
  flex-shrink: 0;
  touch-action: none;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.ios-sheet-drag-handle-bar:active {
  cursor: grabbing;
}

.ios-sheet-drag-handle {
  width: 42px;
  height: 5px;
  background: rgba(240, 207, 117, 0.45);
  border-radius: 3px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ios-sheet-drag-handle-bar:active .ios-sheet-drag-handle {
  background: var(--tt-gold, #f0cf75);
  transform: scaleX(1.15);
}

.ios-sheet-drag-handle-bar::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.ios-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 10px 14px;
  background: var(--tt-tabbar-bg, #261c16);
  border-bottom: 1px solid var(--tt-card-border, rgba(240, 207, 117, 0.18));
  gap: 10px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.ios-navbar-left,
.ios-navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.ios-navbar-right {
  justify-content: flex-end;
}

.ios-nav-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--tt-gold, #f0cf75);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px 4px 2px;
  border-radius: 8px;
  transition: opacity 0.15s ease;
}

.ios-nav-back-btn:active {
  opacity: 0.5;
}

.ios-navbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  max-width: 50%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ios-navbar-icon {
  font-size: 18px;
}

.ios-navbar-title {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--tt-text-title, #fff);
  letter-spacing: -0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ios-nav-action-pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tt-card-bg-subtle, rgba(255, 255, 255, 0.08));
  border: 1px solid var(--tt-card-border, rgba(240, 207, 117, 0.18));
  color: var(--tt-text-title, #f0cf75);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.ios-nav-action-pill:active {
  transform: scale(0.92);
}

.ios-nav-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: var(--tt-text-title, #fff);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.ios-nav-close-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.25);
}

/* Thân modal & Iframe - CHỈ DUY NHẤT 1 THANH CUỘN CHUẨN XÁC, KHÔNG TRÙNG LẶP */
.ios-tool-body {
  position: relative !important;
  flex: 1 1 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  background: var(--tt-bg, #1c1511);
  overflow: hidden !important; /* Tuyệt đối không để auto ở đây để tránh 2 thanh cuộn */
  -webkit-overflow-scrolling: touch !important;
}

.ios-tool-iframe {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  border: none !important;
  display: block !important;
  background: transparent !important;
  box-sizing: border-box !important;
  touch-action: pan-y !important;
}

.ios-tool-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--tt-bg, #1c1511);
  z-index: 5;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.ios-tool-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ios-spinner {
  width: 32px;
  height: 32px;
  border: 3.5px solid rgba(240, 207, 117, 0.2);
  border-top-color: var(--tt-gold, #f0cf75);
  border-radius: 50%;
  animation: iosSpinnerAnim 0.75s linear infinite;
}

@keyframes iosSpinnerAnim {
  to { transform: rotate(360deg); }
}

.ios-loader-text {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 13px;
  color: var(--tt-text-muted, #aaa);
}

/* Giao diện Sáng (Light Mode) cho Modal */
html.theme-light .ios-tool-modal-sheet,
body.theme-light .ios-tool-modal-sheet {
  background: #ede6d8;
  border-color: #dfd4c0;
  box-shadow: 0 -10px 45px rgba(0, 0, 0, 0.18);
}

html.theme-light .ios-sheet-drag-handle-bar,
body.theme-light .ios-sheet-drag-handle-bar,
html.theme-light .ios-navbar,
body.theme-light .ios-navbar {
  background: #ede6d8;
  border-color: #dfd4c0;
}

html.theme-light .ios-sheet-drag-handle,
body.theme-light .ios-sheet-drag-handle {
  background: rgba(46, 31, 20, 0.25);
}

html.theme-light .ios-nav-back-btn,
body.theme-light .ios-nav-back-btn {
  color: #785309;
}

html.theme-light .ios-navbar-title,
body.theme-light .ios-navbar-title {
  color: #2e1f14;
}

html.theme-light .ios-nav-action-pill,
body.theme-light .ios-nav-action-pill {
  background: rgba(154, 110, 24, 0.08);
  border-color: rgba(154, 110, 24, 0.2);
  color: #785309;
}

html.theme-light .ios-nav-action-pill:hover,
body.theme-light .ios-nav-action-pill:hover {
  background: rgba(154, 110, 24, 0.16);
  color: #553b05;
}

html.theme-light .ios-nav-close-btn,
body.theme-light .ios-nav-close-btn {
  background: rgba(46, 31, 20, 0.08);
  color: #4d3829;
}

html.theme-light .ios-nav-close-btn:hover,
body.theme-light .ios-nav-close-btn:hover {
  background: rgba(46, 31, 20, 0.16);
}

html.theme-light .ios-tool-body,
body.theme-light .ios-tool-body,
html.theme-light .ios-tool-loader,
body.theme-light .ios-tool-loader {
  background: #ede6d8;
}

html.theme-light .ios-spinner,
body.theme-light .ios-spinner {
  border-color: rgba(154, 110, 24, 0.18);
  border-top-color: #9a6e18;
}

html.theme-light .ios-loader-text,
body.theme-light .ios-loader-text {
  color: #7e6856;
}

html.theme-light .expert-chat-icon,
body.theme-light .expert-chat-icon {
  background: linear-gradient(135deg, #fff9ee 0%, #faecd5 100%) !important;
  border-color: rgba(180, 131, 37, 0.3) !important;
  box-shadow: 0 2px 8px rgba(154, 110, 24, 0.12) !important;
}

/* ==========================================================================
   STYLE NÚT BẤM TIỆN ÍCH CHUẨN APPLE IOS NATIVE CARD (GRID ITEM)
   ========================================================================== */
.ios-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 640px) {
  .ios-tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .ios-tool-card-featured {
    grid-column: span 1 !important;
  }
}

/* Tối ưu kích thước gọn gàng, loại bỏ tràn chiều cao màn hình cho Tab Tiện Ích */
#view-tienich .tab-hero-header {
  padding: 10px 14px 8px 14px;
  margin-bottom: 8px;
}
#view-tienich .tab-hero-title {
  font-family: var(--ios-font-title-family, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif);
  font-size: var(--ios-font-size-title-3, 16.5px);
  margin-bottom: 2px;
}
#view-tienich .tab-hero-subtitle {
  font-family: var(--ios-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif);
  font-size: var(--ios-font-size-footnote, 12px);
  line-height: 1.35;
}
#view-tienich .section-container {
  margin-bottom: 8px;
  padding: 0 12px;
}
#view-tienich .native-card {
  margin: 0 12px 8px 12px;
  padding: 8px 12px;
}
#view-tienich .native-card-header {
  margin-bottom: 6px;
}
#view-tienich .tab-bottom-ornament {
  padding: 4px 12px 10px 12px !important;
  margin: 2px auto 0 auto !important;
}
@media (max-height: 750px) {
  #view-tienich .tab-bottom-ornament {
    display: none !important;
  }
}

/* ==========================================================================
   APPLE IOS NATIVE INSET GROUPED LIST STYLING CHO TAB TIỆN ÍCH
   Font chữ tinh chỉnh chuẩn Apple HIG (13.5px / 11px), không bị to thô,
   Bố cục thẻ kính mờ phân nhóm như iOS Settings & Shortcuts
   ========================================================================== */
.ios-view-header {
  padding: 12px 16px 6px 16px;
  margin-bottom: 2px;
}
.ios-large-title {
  font-family: var(--ios-font-title-family, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--tt-text-title, #fff4dc);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ios-title-sub {
  font-family: var(--ios-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif);
  font-size: 11.5px;
  color: var(--tt-text-muted, #a69180);
  margin: 2px 0 0 0;
  line-height: 1.35;
}

.ios-inset-section {
  margin-bottom: 12px;
  padding: 0 12px;
}
.ios-section-header {
  font-family: var(--ios-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--tt-gold, #f0cf75);
  opacity: 0.9;
  padding: 0 4px 5px 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ios-inset-group {
  background: var(--tt-card-bg, rgba(47, 34, 26, 0.88));
  border: 1px solid var(--tt-card-border, rgba(240, 207, 117, 0.14));
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}
.ios-row-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.14s ease;
  position: relative;
}
.ios-row-item:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 54px;
  right: 0;
  height: 1px;
  background: var(--tt-card-border, rgba(240, 207, 117, 0.08));
}
.ios-row-item:hover {
  background: rgba(240, 207, 117, 0.07);
}
.ios-row-item:active {
  background: rgba(240, 207, 117, 0.14);
}
.ios-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(240, 207, 117, 0.12);
  border: 1px solid rgba(240, 207, 117, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.ios-row-content {
  flex: 1;
  min-width: 0;
}
.ios-row-title {
  font-family: var(--ios-font-title-family, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif);
  font-size: 13.5px;
  font-weight: 650;
  color: var(--tt-text-title, #fff4dc);
  letter-spacing: -0.15px;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ios-row-sub {
  font-family: var(--ios-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif);
  font-size: 11px;
  font-weight: 400;
  color: var(--tt-text-muted, #a69180);
  line-height: 1.25;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ios-row-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(240, 207, 117, 0.18);
  color: var(--tt-gold, #f0cf75);
  border: 1px solid rgba(240, 207, 117, 0.28);
  letter-spacing: 0;
}
.ios-row-chevron {
  color: var(--tt-text-muted, #8e8071);
  opacity: 0.4;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
}
.ios-row-item:hover .ios-row-chevron {
  opacity: 0.9;
  color: var(--tt-gold, #f0cf75);
  transform: translateX(1px);
}

/* Light mode cho Inset Grouped */
body.theme-light .ios-large-title { color: #2e1f14; }
body.theme-light .ios-title-sub { color: #7e6856; }
body.theme-light .ios-section-header { color: #785309; }
body.theme-light .ios-inset-group {
  background: #ffffff;
  border-color: #dfd4c0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
body.theme-light .ios-row-item:not(:last-child)::after {
  background: rgba(0, 0, 0, 0.06);
}
body.theme-light .ios-row-item:hover { background: rgba(154, 110, 24, 0.05); }
body.theme-light .ios-row-item:active { background: rgba(154, 110, 24, 0.1); }
body.theme-light .ios-row-title { color: #2e1f14; }
body.theme-light .ios-row-sub { color: #7e6856; }
body.theme-light .ios-row-icon {
  background: rgba(154, 110, 24, 0.08);
  border-color: rgba(154, 110, 24, 0.18);
}
body.theme-light .ios-row-badge {
  background: rgba(154, 110, 24, 0.1);
  color: #785309;
  border-color: rgba(154, 110, 24, 0.25);
}


.ios-tool-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--tt-card-bg, rgba(28, 22, 18, 0.85));
  border: 1px solid var(--tt-card-border, rgba(240, 207, 117, 0.18));
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.ios-tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--tt-gold, #f0cf75);
  box-shadow: 0 6px 18px rgba(240, 207, 117, 0.14);
}

.ios-tool-card:active {
  transform: scale(0.97);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ios-tool-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(240, 207, 117, 0.1);
  border: 1px solid rgba(240, 207, 117, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.ios-tool-card:hover .ios-tool-icon-box {
  transform: scale(1.06);
}

.ios-tool-text-wrap {
  flex: 1;
  min-width: 0;
}

.ios-tool-card-title {
  font-family: var(--ios-font-title-family, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif);
  font-size: var(--ios-tool-card-title-size, 14px);
  font-weight: 700;
  color: var(--tt-text-title, #f0cf75);
  letter-spacing: -0.2px;
  line-height: 1.25;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ios-tool-card-sub {
  font-family: var(--ios-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif);
  font-size: var(--ios-tool-card-sub-size, 11px);
  font-weight: 400;
  color: var(--tt-text-muted, #a19282);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ios-tool-chevron {
  color: var(--tt-text-muted, #8e8071);
  opacity: 0.45;
  flex-shrink: 0;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.ios-tool-card:hover .ios-tool-chevron {
  opacity: 0.9;
  transform: translateX(2px);
  color: var(--tt-gold, #f0cf75);
}

.ios-tool-card-featured {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(240, 207, 117, 0.12), rgba(28, 22, 18, 0.92));
  border: 1.5px solid rgba(240, 207, 117, 0.35);
  padding: 11px 14px;
}

.ios-tool-card-featured .ios-tool-icon-box {
  width: 40px;
  height: 40px;
  font-size: 22px;
  background: rgba(240, 207, 117, 0.16);
  border-color: rgba(240, 207, 117, 0.38);
}

.ios-tool-badge-pill {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(240, 207, 117, 0.2);
  color: var(--tt-gold, #f0cf75);
  border: 1px solid rgba(240, 207, 117, 0.3);
  margin-left: 6px;
  vertical-align: 1px;
}

/* Light mode cho Cards */
html.theme-light .ios-tool-card,
body.theme-light .ios-tool-card {
  background: #ffffff;
  border-color: #dfd4c0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

html.theme-light .ios-tool-card:hover,
body.theme-light .ios-tool-card:hover {
  border-color: #9a6e18;
  box-shadow: 0 6px 18px rgba(154, 110, 24, 0.15);
  background: #ffffff;
}

html.theme-light .ios-tool-card-title,
body.theme-light .ios-tool-card-title {
  color: #2e1f14;
}

html.theme-light .ios-tool-card-sub,
body.theme-light .ios-tool-card-sub {
  color: #7e6856;
}

html.theme-light .ios-tool-chevron,
body.theme-light .ios-tool-chevron {
  color: #9a6e18;
  opacity: 0.7;
}

html.theme-light .ios-tool-card:hover .ios-tool-chevron,
body.theme-light .ios-tool-card:hover .ios-tool-chevron {
  color: #634304;
  opacity: 1;
}

html.theme-light .ios-tool-icon-box,
body.theme-light .ios-tool-icon-box {
  background: rgba(154, 110, 24, 0.08);
  border-color: rgba(154, 110, 24, 0.18);
}

html.theme-light .ios-tool-card-featured,
body.theme-light .ios-tool-card-featured {
  background: linear-gradient(135deg, rgba(247, 243, 235, 0.95), #ffffff);
  border-color: rgba(180, 131, 37, 0.35);
}

html.theme-light .ios-tool-badge-pill,
body.theme-light .ios-tool-badge-pill {
  background: rgba(154, 110, 24, 0.12);
  color: #785309;
  border-color: rgba(154, 110, 24, 0.28);
}

