/* =========================================================
   yakio — visual 2.0
   Tema claro/escuro: segue o sistema; html[data-theme] força um dos dois.
   ========================================================= */
@font-face { font-family: 'Manrope'; font-weight: 400; font-display: swap; src: url('/fonts/manrope-400.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 500; font-display: swap; src: url('/fonts/manrope-500.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 600; font-display: swap; src: url('/fonts/manrope-600.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 700; font-display: swap; src: url('/fonts/manrope-700.woff2') format('woff2'); }
/* identidade yakio: carvão #0B0C0C, osso #EBE4DA, cobre #A6563B e o ponto turquesa #18C6B4 (só em sinais: não lidas, online, foco) */
:root {
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --r: 12px; --r-sm: 8px; --r-lg: 16px;
  --carvao: #0B0C0C; --osso: #EBE4DA; --cobre: #A6563B; --turquesa: #18C6B4; --dot: #18C6B4; --on-dot: #0B0C0C;

  --bg: #F4EFE8; --panel: #FFFFFF; --panel-2: #FAF7F3; --panel-3: #F1EBE2; --border: #E7E0D5; --border-strong: #D4CABB;
  --text: #0B0C0C; --muted: #6E685F; --faint: #9C958B;
  --accent: #0B0C0C; --accent-2: #A6563B; --accent-soft: rgba(166, 86, 59, .10); --on-accent: #FBF9F6;
  --brand-ink: #0B0C0C; /* carvão do logo yakio */
  --brand-teal: #A6563B; /* destaque de marca: cobre */
  --in: #FFFFFF; --out: #DCF3EF; --hover: #F6F1EA; --active: #F2E8DF;
  --chat-bg: #F4EFE8; --chat-dots: rgba(11, 12, 12, .035); --watermark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='947.70 69.12 104.76 100.72'%3E  %3Cpath fill='%230B0C0C' fill-opacity='.05' fill-rule='evenodd' d='M951.80 69.19 L968.19 69.17 C968.68 69.18 969.34 69.26 969.56 69.70 L988.31 109.09 C988.96 110.42 989.81 111.63 990.56 112.89 C991.29 111.62 992.17 110.41 992.75 109.06 L1009.19 69.53 C1009.73 69.39 1010.25 69.14 1010.81 69.13 L1029.06 69.12 C1029.49 69.13 1029.83 69.50 1030.21 69.69 L993.76 153.94 C992.94 155.79 991.90 157.55 990.72 159.19 C989.53 160.83 988.17 162.35 986.69 163.72 C985.40 164.90 983.98 165.98 982.45 166.81 C980.83 167.69 979.08 168.32 977.31 168.83 C975.73 169.28 974.08 169.51 972.44 169.66 C970.74 169.83 969.02 169.84 967.31 169.79 C965.31 169.74 963.29 169.70 961.31 169.35 C960.85 169.28 960.54 168.83 960.16 168.56 L964.50 152.81 C964.62 152.43 965.05 152.17 965.44 152.08 C966.62 151.81 967.87 151.98 969.06 151.76 C969.97 151.60 970.88 151.37 971.69 150.94 C972.77 150.37 973.86 149.73 974.66 148.81 C975.92 147.36 976.90 145.66 977.77 143.94 C978.85 141.81 979.58 139.52 980.49 137.31 C978.89 133.69 977.43 130.00 975.69 126.44 L947.91 70.81 C947.76 70.51 947.77 70.15 947.70 69.81 C947.82 69.67 947.94 69.52 948.06 69.37 C949.31 69.31 950.55 69.20 951.80 69.19 Z'/%3E  %3Cpath fill='%2318C6B4' fill-opacity='.18' fill-rule='nonzero' d='M1052.46 130.01 C1052.46 130.26 1052.45 130.50 1052.44 130.75 C1052.43 130.99 1052.41 131.24 1052.39 131.48 C1052.36 131.72 1052.33 131.97 1052.30 132.21 C1052.26 132.45 1052.22 132.69 1052.17 132.93 C1052.12 133.18 1052.07 133.41 1052.01 133.65 C1051.95 133.89 1051.89 134.13 1051.81 134.36 C1051.74 134.60 1051.67 134.83 1051.58 135.06 C1051.50 135.29 1051.41 135.52 1051.32 135.75 C1051.22 135.97 1051.13 136.20 1051.02 136.42 C1050.92 136.64 1050.81 136.86 1050.69 137.08 C1050.57 137.29 1050.45 137.51 1050.33 137.72 C1050.20 137.93 1050.07 138.13 1049.93 138.34 C1049.80 138.54 1049.66 138.74 1049.51 138.94 C1049.36 139.14 1049.21 139.33 1049.06 139.52 C1048.90 139.71 1048.74 139.89 1048.58 140.08 C1048.41 140.26 1048.24 140.44 1048.07 140.61 C1047.90 140.78 1047.72 140.95 1047.54 141.12 C1047.35 141.28 1047.17 141.44 1046.98 141.60 C1046.79 141.75 1046.60 141.90 1046.40 142.05 C1046.20 142.20 1046.00 142.34 1045.80 142.47 C1045.59 142.61 1045.39 142.74 1045.18 142.87 C1044.97 142.99 1044.75 143.11 1044.54 143.23 C1044.32 143.35 1044.10 143.46 1043.88 143.56 C1043.66 143.67 1043.43 143.77 1043.21 143.86 C1042.98 143.95 1042.75 144.04 1042.52 144.12 C1042.29 144.21 1042.06 144.28 1041.82 144.35 C1041.59 144.43 1041.35 144.49 1041.11 144.55 C1040.87 144.61 1040.64 144.66 1040.39 144.71 C1040.15 144.76 1039.91 144.80 1039.67 144.84 C1039.43 144.87 1039.18 144.90 1038.94 144.93 C1038.70 144.95 1038.45 144.97 1038.21 144.98 C1037.96 144.99 1037.72 145.00 1037.47 145.00 C1037.22 145.00 1036.98 144.99 1036.73 144.98 C1036.49 144.97 1036.24 144.95 1036.00 144.93 C1035.76 144.90 1035.51 144.87 1035.27 144.84 C1035.03 144.80 1034.79 144.76 1034.55 144.71 C1034.30 144.66 1034.07 144.61 1033.83 144.55 C1033.59 144.49 1033.35 144.43 1033.12 144.35 C1032.88 144.28 1032.65 144.21 1032.42 144.12 C1032.19 144.04 1031.96 143.95 1031.73 143.86 C1031.51 143.77 1031.28 143.67 1031.06 143.56 C1030.84 143.46 1030.62 143.35 1030.40 143.23 C1030.19 143.11 1029.97 142.99 1029.76 142.87 C1029.55 142.74 1029.35 142.61 1029.14 142.47 C1028.94 142.34 1028.74 142.20 1028.54 142.05 C1028.34 141.90 1028.15 141.75 1027.96 141.60 C1027.77 141.44 1027.58 141.28 1027.40 141.12 C1027.22 140.95 1027.04 140.78 1026.87 140.61 C1026.70 140.44 1026.53 140.26 1026.36 140.08 C1026.20 139.89 1026.04 139.71 1025.88 139.52 C1025.73 139.33 1025.58 139.14 1025.43 138.94 C1025.28 138.74 1025.14 138.54 1025.01 138.34 C1024.87 138.13 1024.74 137.93 1024.61 137.72 C1024.49 137.51 1024.37 137.29 1024.25 137.08 C1024.13 136.86 1024.02 136.64 1023.92 136.42 C1023.81 136.20 1023.71 135.97 1023.62 135.75 C1023.53 135.52 1023.44 135.29 1023.36 135.06 C1023.27 134.83 1023.20 134.60 1023.13 134.36 C1023.05 134.13 1022.99 133.89 1022.93 133.65 C1022.87 133.41 1022.82 133.18 1022.77 132.93 C1022.72 132.69 1022.68 132.45 1022.64 132.21 C1022.61 131.97 1022.58 131.72 1022.55 131.48 C1022.53 131.24 1022.51 130.99 1022.50 130.75 C1022.49 130.50 1022.48 130.26 1022.48 130.01 C1022.48 129.76 1022.49 129.52 1022.50 129.27 C1022.51 129.03 1022.53 128.78 1022.55 128.54 C1022.58 128.30 1022.61 128.05 1022.64 127.81 C1022.68 127.57 1022.72 127.33 1022.77 127.09 C1022.82 126.84 1022.87 126.61 1022.93 126.37 C1022.99 126.13 1023.05 125.89 1023.13 125.66 C1023.20 125.42 1023.27 125.19 1023.36 124.96 C1023.44 124.73 1023.53 124.50 1023.62 124.27 C1023.71 124.05 1023.81 123.82 1023.92 123.60 C1024.02 123.38 1024.13 123.16 1024.25 122.94 C1024.37 122.73 1024.49 122.51 1024.61 122.30 C1024.74 122.09 1024.87 121.89 1025.01 121.68 C1025.14 121.48 1025.28 121.28 1025.43 121.08 C1025.58 120.88 1025.73 120.69 1025.88 120.50 C1026.04 120.31 1026.20 120.13 1026.36 119.94 C1026.53 119.76 1026.70 119.58 1026.87 119.41 C1027.04 119.24 1027.22 119.07 1027.40 118.90 C1027.58 118.74 1027.77 118.58 1027.96 118.42 C1028.15 118.27 1028.34 118.12 1028.54 117.97 C1028.74 117.82 1028.94 117.68 1029.14 117.55 C1029.35 117.41 1029.55 117.28 1029.76 117.15 C1029.97 117.03 1030.19 116.91 1030.40 116.79 C1030.62 116.67 1030.84 116.56 1031.06 116.46 C1031.28 116.35 1031.51 116.25 1031.73 116.16 C1031.96 116.07 1032.19 115.98 1032.42 115.90 C1032.65 115.81 1032.88 115.74 1033.12 115.67 C1033.35 115.59 1033.59 115.53 1033.83 115.47 C1034.07 115.41 1034.30 115.36 1034.55 115.31 C1034.79 115.26 1035.03 115.22 1035.27 115.18 C1035.51 115.15 1035.76 115.12 1036.00 115.09 C1036.24 115.07 1036.49 115.05 1036.73 115.04 C1036.98 115.03 1037.22 115.02 1037.47 115.02 C1037.72 115.02 1037.96 115.03 1038.21 115.04 C1038.45 115.05 1038.70 115.07 1038.94 115.09 C1039.18 115.12 1039.43 115.15 1039.67 115.18 C1039.91 115.22 1040.15 115.26 1040.39 115.31 C1040.64 115.36 1040.87 115.41 1041.11 115.47 C1041.35 115.53 1041.59 115.59 1041.82 115.67 C1042.06 115.74 1042.29 115.81 1042.52 115.90 C1042.75 115.98 1042.98 116.07 1043.21 116.16 C1043.43 116.25 1043.66 116.35 1043.88 116.46 C1044.10 116.56 1044.32 116.67 1044.54 116.79 C1044.75 116.91 1044.97 117.03 1045.18 117.15 C1045.39 117.28 1045.59 117.41 1045.80 117.55 C1046.00 117.68 1046.20 117.82 1046.40 117.97 C1046.60 118.12 1046.79 118.27 1046.98 118.42 C1047.17 118.58 1047.35 118.74 1047.54 118.90 C1047.72 119.07 1047.90 119.24 1048.07 119.41 C1048.24 119.58 1048.41 119.76 1048.58 119.94 C1048.74 120.13 1048.90 120.31 1049.06 120.50 C1049.21 120.69 1049.36 120.88 1049.51 121.08 C1049.66 121.28 1049.80 121.48 1049.93 121.68 C1050.07 121.89 1050.20 122.09 1050.33 122.30 C1050.45 122.51 1050.57 122.73 1050.69 122.94 C1050.81 123.16 1050.92 123.38 1051.02 123.60 C1051.13 123.82 1051.22 124.05 1051.32 124.27 C1051.41 124.50 1051.50 124.73 1051.58 124.96 C1051.67 125.19 1051.74 125.42 1051.81 125.66 C1051.89 125.89 1051.95 126.13 1052.01 126.37 C1052.07 126.61 1052.12 126.84 1052.17 127.09 C1052.22 127.33 1052.26 127.57 1052.30 127.81 C1052.33 128.05 1052.36 128.30 1052.39 128.54 C1052.41 128.78 1052.43 129.03 1052.44 129.27 C1052.45 129.52 1052.46 129.76 1052.46 130.01 Z'/%3E%3C/svg%3E");
  --danger: #d9443f; --danger-soft: rgba(217, 68, 63, .12); --warn: #c98700; --blue: #1a7fd0; --tick: #12A797;
  --note-bg: #fff4d6; --note-text: #4a3b00; --banner-bg: #fff1d2; --banner-text: #5b4300; --banner-err-bg: #ffe2e4; --banner-err-text: #7a0b14;
  --ai-bg: rgba(166, 86, 59, .08);
  --shadow-sm: 0 1px 2px rgba(11, 12, 12, .06);
  --shadow: 0 6px 20px rgba(11, 12, 12, .08);
  --shadow-lg: 0 24px 60px rgba(11, 12, 12, .18);
  --ring: 0 0 0 3px rgba(24, 198, 180, .35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0C0C; --panel: #131312; --panel-2: #191817; --panel-3: #211F1D; --border: #2A2724; --border-strong: #3A3631;
    --text: #EBE4DA; --muted: #A9A49C; --faint: #6F6A63;
    --accent: #EBE4DA; --accent-2: #D9875F; --accent-soft: rgba(192, 106, 74, .17); --on-accent: #0B0C0C;
    --brand-ink: #EBE4DA; --brand-teal: #D9875F;
    --in: #1C1B19; --out: #133F3A; --hover: #1B1A18; --active: #2B211C;
    --chat-bg: #0F0F0E; --chat-dots: rgba(235, 228, 218, .03); --watermark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='947.70 69.12 104.76 100.72'%3E  %3Cpath fill='%23EBE4DA' fill-opacity='.045' fill-rule='evenodd' d='M951.80 69.19 L968.19 69.17 C968.68 69.18 969.34 69.26 969.56 69.70 L988.31 109.09 C988.96 110.42 989.81 111.63 990.56 112.89 C991.29 111.62 992.17 110.41 992.75 109.06 L1009.19 69.53 C1009.73 69.39 1010.25 69.14 1010.81 69.13 L1029.06 69.12 C1029.49 69.13 1029.83 69.50 1030.21 69.69 L993.76 153.94 C992.94 155.79 991.90 157.55 990.72 159.19 C989.53 160.83 988.17 162.35 986.69 163.72 C985.40 164.90 983.98 165.98 982.45 166.81 C980.83 167.69 979.08 168.32 977.31 168.83 C975.73 169.28 974.08 169.51 972.44 169.66 C970.74 169.83 969.02 169.84 967.31 169.79 C965.31 169.74 963.29 169.70 961.31 169.35 C960.85 169.28 960.54 168.83 960.16 168.56 L964.50 152.81 C964.62 152.43 965.05 152.17 965.44 152.08 C966.62 151.81 967.87 151.98 969.06 151.76 C969.97 151.60 970.88 151.37 971.69 150.94 C972.77 150.37 973.86 149.73 974.66 148.81 C975.92 147.36 976.90 145.66 977.77 143.94 C978.85 141.81 979.58 139.52 980.49 137.31 C978.89 133.69 977.43 130.00 975.69 126.44 L947.91 70.81 C947.76 70.51 947.77 70.15 947.70 69.81 C947.82 69.67 947.94 69.52 948.06 69.37 C949.31 69.31 950.55 69.20 951.80 69.19 Z'/%3E  %3Cpath fill='%2318C6B4' fill-opacity='.16' fill-rule='nonzero' d='M1052.46 130.01 C1052.46 130.26 1052.45 130.50 1052.44 130.75 C1052.43 130.99 1052.41 131.24 1052.39 131.48 C1052.36 131.72 1052.33 131.97 1052.30 132.21 C1052.26 132.45 1052.22 132.69 1052.17 132.93 C1052.12 133.18 1052.07 133.41 1052.01 133.65 C1051.95 133.89 1051.89 134.13 1051.81 134.36 C1051.74 134.60 1051.67 134.83 1051.58 135.06 C1051.50 135.29 1051.41 135.52 1051.32 135.75 C1051.22 135.97 1051.13 136.20 1051.02 136.42 C1050.92 136.64 1050.81 136.86 1050.69 137.08 C1050.57 137.29 1050.45 137.51 1050.33 137.72 C1050.20 137.93 1050.07 138.13 1049.93 138.34 C1049.80 138.54 1049.66 138.74 1049.51 138.94 C1049.36 139.14 1049.21 139.33 1049.06 139.52 C1048.90 139.71 1048.74 139.89 1048.58 140.08 C1048.41 140.26 1048.24 140.44 1048.07 140.61 C1047.90 140.78 1047.72 140.95 1047.54 141.12 C1047.35 141.28 1047.17 141.44 1046.98 141.60 C1046.79 141.75 1046.60 141.90 1046.40 142.05 C1046.20 142.20 1046.00 142.34 1045.80 142.47 C1045.59 142.61 1045.39 142.74 1045.18 142.87 C1044.97 142.99 1044.75 143.11 1044.54 143.23 C1044.32 143.35 1044.10 143.46 1043.88 143.56 C1043.66 143.67 1043.43 143.77 1043.21 143.86 C1042.98 143.95 1042.75 144.04 1042.52 144.12 C1042.29 144.21 1042.06 144.28 1041.82 144.35 C1041.59 144.43 1041.35 144.49 1041.11 144.55 C1040.87 144.61 1040.64 144.66 1040.39 144.71 C1040.15 144.76 1039.91 144.80 1039.67 144.84 C1039.43 144.87 1039.18 144.90 1038.94 144.93 C1038.70 144.95 1038.45 144.97 1038.21 144.98 C1037.96 144.99 1037.72 145.00 1037.47 145.00 C1037.22 145.00 1036.98 144.99 1036.73 144.98 C1036.49 144.97 1036.24 144.95 1036.00 144.93 C1035.76 144.90 1035.51 144.87 1035.27 144.84 C1035.03 144.80 1034.79 144.76 1034.55 144.71 C1034.30 144.66 1034.07 144.61 1033.83 144.55 C1033.59 144.49 1033.35 144.43 1033.12 144.35 C1032.88 144.28 1032.65 144.21 1032.42 144.12 C1032.19 144.04 1031.96 143.95 1031.73 143.86 C1031.51 143.77 1031.28 143.67 1031.06 143.56 C1030.84 143.46 1030.62 143.35 1030.40 143.23 C1030.19 143.11 1029.97 142.99 1029.76 142.87 C1029.55 142.74 1029.35 142.61 1029.14 142.47 C1028.94 142.34 1028.74 142.20 1028.54 142.05 C1028.34 141.90 1028.15 141.75 1027.96 141.60 C1027.77 141.44 1027.58 141.28 1027.40 141.12 C1027.22 140.95 1027.04 140.78 1026.87 140.61 C1026.70 140.44 1026.53 140.26 1026.36 140.08 C1026.20 139.89 1026.04 139.71 1025.88 139.52 C1025.73 139.33 1025.58 139.14 1025.43 138.94 C1025.28 138.74 1025.14 138.54 1025.01 138.34 C1024.87 138.13 1024.74 137.93 1024.61 137.72 C1024.49 137.51 1024.37 137.29 1024.25 137.08 C1024.13 136.86 1024.02 136.64 1023.92 136.42 C1023.81 136.20 1023.71 135.97 1023.62 135.75 C1023.53 135.52 1023.44 135.29 1023.36 135.06 C1023.27 134.83 1023.20 134.60 1023.13 134.36 C1023.05 134.13 1022.99 133.89 1022.93 133.65 C1022.87 133.41 1022.82 133.18 1022.77 132.93 C1022.72 132.69 1022.68 132.45 1022.64 132.21 C1022.61 131.97 1022.58 131.72 1022.55 131.48 C1022.53 131.24 1022.51 130.99 1022.50 130.75 C1022.49 130.50 1022.48 130.26 1022.48 130.01 C1022.48 129.76 1022.49 129.52 1022.50 129.27 C1022.51 129.03 1022.53 128.78 1022.55 128.54 C1022.58 128.30 1022.61 128.05 1022.64 127.81 C1022.68 127.57 1022.72 127.33 1022.77 127.09 C1022.82 126.84 1022.87 126.61 1022.93 126.37 C1022.99 126.13 1023.05 125.89 1023.13 125.66 C1023.20 125.42 1023.27 125.19 1023.36 124.96 C1023.44 124.73 1023.53 124.50 1023.62 124.27 C1023.71 124.05 1023.81 123.82 1023.92 123.60 C1024.02 123.38 1024.13 123.16 1024.25 122.94 C1024.37 122.73 1024.49 122.51 1024.61 122.30 C1024.74 122.09 1024.87 121.89 1025.01 121.68 C1025.14 121.48 1025.28 121.28 1025.43 121.08 C1025.58 120.88 1025.73 120.69 1025.88 120.50 C1026.04 120.31 1026.20 120.13 1026.36 119.94 C1026.53 119.76 1026.70 119.58 1026.87 119.41 C1027.04 119.24 1027.22 119.07 1027.40 118.90 C1027.58 118.74 1027.77 118.58 1027.96 118.42 C1028.15 118.27 1028.34 118.12 1028.54 117.97 C1028.74 117.82 1028.94 117.68 1029.14 117.55 C1029.35 117.41 1029.55 117.28 1029.76 117.15 C1029.97 117.03 1030.19 116.91 1030.40 116.79 C1030.62 116.67 1030.84 116.56 1031.06 116.46 C1031.28 116.35 1031.51 116.25 1031.73 116.16 C1031.96 116.07 1032.19 115.98 1032.42 115.90 C1032.65 115.81 1032.88 115.74 1033.12 115.67 C1033.35 115.59 1033.59 115.53 1033.83 115.47 C1034.07 115.41 1034.30 115.36 1034.55 115.31 C1034.79 115.26 1035.03 115.22 1035.27 115.18 C1035.51 115.15 1035.76 115.12 1036.00 115.09 C1036.24 115.07 1036.49 115.05 1036.73 115.04 C1036.98 115.03 1037.22 115.02 1037.47 115.02 C1037.72 115.02 1037.96 115.03 1038.21 115.04 C1038.45 115.05 1038.70 115.07 1038.94 115.09 C1039.18 115.12 1039.43 115.15 1039.67 115.18 C1039.91 115.22 1040.15 115.26 1040.39 115.31 C1040.64 115.36 1040.87 115.41 1041.11 115.47 C1041.35 115.53 1041.59 115.59 1041.82 115.67 C1042.06 115.74 1042.29 115.81 1042.52 115.90 C1042.75 115.98 1042.98 116.07 1043.21 116.16 C1043.43 116.25 1043.66 116.35 1043.88 116.46 C1044.10 116.56 1044.32 116.67 1044.54 116.79 C1044.75 116.91 1044.97 117.03 1045.18 117.15 C1045.39 117.28 1045.59 117.41 1045.80 117.55 C1046.00 117.68 1046.20 117.82 1046.40 117.97 C1046.60 118.12 1046.79 118.27 1046.98 118.42 C1047.17 118.58 1047.35 118.74 1047.54 118.90 C1047.72 119.07 1047.90 119.24 1048.07 119.41 C1048.24 119.58 1048.41 119.76 1048.58 119.94 C1048.74 120.13 1048.90 120.31 1049.06 120.50 C1049.21 120.69 1049.36 120.88 1049.51 121.08 C1049.66 121.28 1049.80 121.48 1049.93 121.68 C1050.07 121.89 1050.20 122.09 1050.33 122.30 C1050.45 122.51 1050.57 122.73 1050.69 122.94 C1050.81 123.16 1050.92 123.38 1051.02 123.60 C1051.13 123.82 1051.22 124.05 1051.32 124.27 C1051.41 124.50 1051.50 124.73 1051.58 124.96 C1051.67 125.19 1051.74 125.42 1051.81 125.66 C1051.89 125.89 1051.95 126.13 1052.01 126.37 C1052.07 126.61 1052.12 126.84 1052.17 127.09 C1052.22 127.33 1052.26 127.57 1052.30 127.81 C1052.33 128.05 1052.36 128.30 1052.39 128.54 C1052.41 128.78 1052.43 129.03 1052.44 129.27 C1052.45 129.52 1052.46 129.76 1052.46 130.01 Z'/%3E%3C/svg%3E");
    --danger: #ff6369; --danger-soft: rgba(255, 99, 105, .14); --warn: #f0b429; --blue: #53b1fd; --tick: #18C6B4;
    --note-bg: #3a3214; --note-text: #f3e3a3; --banner-bg: #3a3214; --banner-text: #f6e3a0; --banner-err-bg: #3d1418; --banner-err-text: #ffc9cd;
    --ai-bg: rgba(192, 106, 74, .12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 8px 24px rgba(0, 0, 0, .4); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
    --ring: 0 0 0 3px rgba(24, 198, 180, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0C0C; --panel: #131312; --panel-2: #191817; --panel-3: #211F1D; --border: #2A2724; --border-strong: #3A3631;
  --text: #EBE4DA; --muted: #A9A49C; --faint: #6F6A63;
  --accent: #EBE4DA; --accent-2: #D9875F; --accent-soft: rgba(192, 106, 74, .17); --on-accent: #0B0C0C;
  --brand-ink: #EBE4DA; --brand-teal: #D9875F;
  --in: #1C1B19; --out: #133F3A; --hover: #1B1A18; --active: #2B211C;
  --chat-bg: #0F0F0E; --chat-dots: rgba(235, 228, 218, .03); --watermark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='947.70 69.12 104.76 100.72'%3E  %3Cpath fill='%23EBE4DA' fill-opacity='.045' fill-rule='evenodd' d='M951.80 69.19 L968.19 69.17 C968.68 69.18 969.34 69.26 969.56 69.70 L988.31 109.09 C988.96 110.42 989.81 111.63 990.56 112.89 C991.29 111.62 992.17 110.41 992.75 109.06 L1009.19 69.53 C1009.73 69.39 1010.25 69.14 1010.81 69.13 L1029.06 69.12 C1029.49 69.13 1029.83 69.50 1030.21 69.69 L993.76 153.94 C992.94 155.79 991.90 157.55 990.72 159.19 C989.53 160.83 988.17 162.35 986.69 163.72 C985.40 164.90 983.98 165.98 982.45 166.81 C980.83 167.69 979.08 168.32 977.31 168.83 C975.73 169.28 974.08 169.51 972.44 169.66 C970.74 169.83 969.02 169.84 967.31 169.79 C965.31 169.74 963.29 169.70 961.31 169.35 C960.85 169.28 960.54 168.83 960.16 168.56 L964.50 152.81 C964.62 152.43 965.05 152.17 965.44 152.08 C966.62 151.81 967.87 151.98 969.06 151.76 C969.97 151.60 970.88 151.37 971.69 150.94 C972.77 150.37 973.86 149.73 974.66 148.81 C975.92 147.36 976.90 145.66 977.77 143.94 C978.85 141.81 979.58 139.52 980.49 137.31 C978.89 133.69 977.43 130.00 975.69 126.44 L947.91 70.81 C947.76 70.51 947.77 70.15 947.70 69.81 C947.82 69.67 947.94 69.52 948.06 69.37 C949.31 69.31 950.55 69.20 951.80 69.19 Z'/%3E  %3Cpath fill='%2318C6B4' fill-opacity='.16' fill-rule='nonzero' d='M1052.46 130.01 C1052.46 130.26 1052.45 130.50 1052.44 130.75 C1052.43 130.99 1052.41 131.24 1052.39 131.48 C1052.36 131.72 1052.33 131.97 1052.30 132.21 C1052.26 132.45 1052.22 132.69 1052.17 132.93 C1052.12 133.18 1052.07 133.41 1052.01 133.65 C1051.95 133.89 1051.89 134.13 1051.81 134.36 C1051.74 134.60 1051.67 134.83 1051.58 135.06 C1051.50 135.29 1051.41 135.52 1051.32 135.75 C1051.22 135.97 1051.13 136.20 1051.02 136.42 C1050.92 136.64 1050.81 136.86 1050.69 137.08 C1050.57 137.29 1050.45 137.51 1050.33 137.72 C1050.20 137.93 1050.07 138.13 1049.93 138.34 C1049.80 138.54 1049.66 138.74 1049.51 138.94 C1049.36 139.14 1049.21 139.33 1049.06 139.52 C1048.90 139.71 1048.74 139.89 1048.58 140.08 C1048.41 140.26 1048.24 140.44 1048.07 140.61 C1047.90 140.78 1047.72 140.95 1047.54 141.12 C1047.35 141.28 1047.17 141.44 1046.98 141.60 C1046.79 141.75 1046.60 141.90 1046.40 142.05 C1046.20 142.20 1046.00 142.34 1045.80 142.47 C1045.59 142.61 1045.39 142.74 1045.18 142.87 C1044.97 142.99 1044.75 143.11 1044.54 143.23 C1044.32 143.35 1044.10 143.46 1043.88 143.56 C1043.66 143.67 1043.43 143.77 1043.21 143.86 C1042.98 143.95 1042.75 144.04 1042.52 144.12 C1042.29 144.21 1042.06 144.28 1041.82 144.35 C1041.59 144.43 1041.35 144.49 1041.11 144.55 C1040.87 144.61 1040.64 144.66 1040.39 144.71 C1040.15 144.76 1039.91 144.80 1039.67 144.84 C1039.43 144.87 1039.18 144.90 1038.94 144.93 C1038.70 144.95 1038.45 144.97 1038.21 144.98 C1037.96 144.99 1037.72 145.00 1037.47 145.00 C1037.22 145.00 1036.98 144.99 1036.73 144.98 C1036.49 144.97 1036.24 144.95 1036.00 144.93 C1035.76 144.90 1035.51 144.87 1035.27 144.84 C1035.03 144.80 1034.79 144.76 1034.55 144.71 C1034.30 144.66 1034.07 144.61 1033.83 144.55 C1033.59 144.49 1033.35 144.43 1033.12 144.35 C1032.88 144.28 1032.65 144.21 1032.42 144.12 C1032.19 144.04 1031.96 143.95 1031.73 143.86 C1031.51 143.77 1031.28 143.67 1031.06 143.56 C1030.84 143.46 1030.62 143.35 1030.40 143.23 C1030.19 143.11 1029.97 142.99 1029.76 142.87 C1029.55 142.74 1029.35 142.61 1029.14 142.47 C1028.94 142.34 1028.74 142.20 1028.54 142.05 C1028.34 141.90 1028.15 141.75 1027.96 141.60 C1027.77 141.44 1027.58 141.28 1027.40 141.12 C1027.22 140.95 1027.04 140.78 1026.87 140.61 C1026.70 140.44 1026.53 140.26 1026.36 140.08 C1026.20 139.89 1026.04 139.71 1025.88 139.52 C1025.73 139.33 1025.58 139.14 1025.43 138.94 C1025.28 138.74 1025.14 138.54 1025.01 138.34 C1024.87 138.13 1024.74 137.93 1024.61 137.72 C1024.49 137.51 1024.37 137.29 1024.25 137.08 C1024.13 136.86 1024.02 136.64 1023.92 136.42 C1023.81 136.20 1023.71 135.97 1023.62 135.75 C1023.53 135.52 1023.44 135.29 1023.36 135.06 C1023.27 134.83 1023.20 134.60 1023.13 134.36 C1023.05 134.13 1022.99 133.89 1022.93 133.65 C1022.87 133.41 1022.82 133.18 1022.77 132.93 C1022.72 132.69 1022.68 132.45 1022.64 132.21 C1022.61 131.97 1022.58 131.72 1022.55 131.48 C1022.53 131.24 1022.51 130.99 1022.50 130.75 C1022.49 130.50 1022.48 130.26 1022.48 130.01 C1022.48 129.76 1022.49 129.52 1022.50 129.27 C1022.51 129.03 1022.53 128.78 1022.55 128.54 C1022.58 128.30 1022.61 128.05 1022.64 127.81 C1022.68 127.57 1022.72 127.33 1022.77 127.09 C1022.82 126.84 1022.87 126.61 1022.93 126.37 C1022.99 126.13 1023.05 125.89 1023.13 125.66 C1023.20 125.42 1023.27 125.19 1023.36 124.96 C1023.44 124.73 1023.53 124.50 1023.62 124.27 C1023.71 124.05 1023.81 123.82 1023.92 123.60 C1024.02 123.38 1024.13 123.16 1024.25 122.94 C1024.37 122.73 1024.49 122.51 1024.61 122.30 C1024.74 122.09 1024.87 121.89 1025.01 121.68 C1025.14 121.48 1025.28 121.28 1025.43 121.08 C1025.58 120.88 1025.73 120.69 1025.88 120.50 C1026.04 120.31 1026.20 120.13 1026.36 119.94 C1026.53 119.76 1026.70 119.58 1026.87 119.41 C1027.04 119.24 1027.22 119.07 1027.40 118.90 C1027.58 118.74 1027.77 118.58 1027.96 118.42 C1028.15 118.27 1028.34 118.12 1028.54 117.97 C1028.74 117.82 1028.94 117.68 1029.14 117.55 C1029.35 117.41 1029.55 117.28 1029.76 117.15 C1029.97 117.03 1030.19 116.91 1030.40 116.79 C1030.62 116.67 1030.84 116.56 1031.06 116.46 C1031.28 116.35 1031.51 116.25 1031.73 116.16 C1031.96 116.07 1032.19 115.98 1032.42 115.90 C1032.65 115.81 1032.88 115.74 1033.12 115.67 C1033.35 115.59 1033.59 115.53 1033.83 115.47 C1034.07 115.41 1034.30 115.36 1034.55 115.31 C1034.79 115.26 1035.03 115.22 1035.27 115.18 C1035.51 115.15 1035.76 115.12 1036.00 115.09 C1036.24 115.07 1036.49 115.05 1036.73 115.04 C1036.98 115.03 1037.22 115.02 1037.47 115.02 C1037.72 115.02 1037.96 115.03 1038.21 115.04 C1038.45 115.05 1038.70 115.07 1038.94 115.09 C1039.18 115.12 1039.43 115.15 1039.67 115.18 C1039.91 115.22 1040.15 115.26 1040.39 115.31 C1040.64 115.36 1040.87 115.41 1041.11 115.47 C1041.35 115.53 1041.59 115.59 1041.82 115.67 C1042.06 115.74 1042.29 115.81 1042.52 115.90 C1042.75 115.98 1042.98 116.07 1043.21 116.16 C1043.43 116.25 1043.66 116.35 1043.88 116.46 C1044.10 116.56 1044.32 116.67 1044.54 116.79 C1044.75 116.91 1044.97 117.03 1045.18 117.15 C1045.39 117.28 1045.59 117.41 1045.80 117.55 C1046.00 117.68 1046.20 117.82 1046.40 117.97 C1046.60 118.12 1046.79 118.27 1046.98 118.42 C1047.17 118.58 1047.35 118.74 1047.54 118.90 C1047.72 119.07 1047.90 119.24 1048.07 119.41 C1048.24 119.58 1048.41 119.76 1048.58 119.94 C1048.74 120.13 1048.90 120.31 1049.06 120.50 C1049.21 120.69 1049.36 120.88 1049.51 121.08 C1049.66 121.28 1049.80 121.48 1049.93 121.68 C1050.07 121.89 1050.20 122.09 1050.33 122.30 C1050.45 122.51 1050.57 122.73 1050.69 122.94 C1050.81 123.16 1050.92 123.38 1051.02 123.60 C1051.13 123.82 1051.22 124.05 1051.32 124.27 C1051.41 124.50 1051.50 124.73 1051.58 124.96 C1051.67 125.19 1051.74 125.42 1051.81 125.66 C1051.89 125.89 1051.95 126.13 1052.01 126.37 C1052.07 126.61 1052.12 126.84 1052.17 127.09 C1052.22 127.33 1052.26 127.57 1052.30 127.81 C1052.33 128.05 1052.36 128.30 1052.39 128.54 C1052.41 128.78 1052.43 129.03 1052.44 129.27 C1052.45 129.52 1052.46 129.76 1052.46 130.01 Z'/%3E%3C/svg%3E");
  --danger: #ff6369; --danger-soft: rgba(255, 99, 105, .14); --warn: #f0b429; --blue: #53b1fd; --tick: #18C6B4;
  --note-bg: #3a3214; --note-text: #f3e3a3; --banner-bg: #3a3214; --banner-text: #f6e3a0; --banner-err-bg: #3d1418; --banner-err-text: #ffc9cd;
  --ai-bg: rgba(192, 106, 74, .12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 8px 24px rgba(0, 0, 0, .4); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  --ring: 0 0 0 3px rgba(24, 198, 180, .45);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.45 var(--font); font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased;
  background: var(--bg); color: var(--text); overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); }
h2, h3, h4 { letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.help { font-size: 12.5px; color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; font-size: 13px; }
.ico { flex: none; display: block; }
::selection { background: var(--accent-soft); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
code { background: var(--panel-3); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }

/* ---------- campos e botões ---------- */
input, select, textarea {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type=range] { accent-color: var(--accent); padding: 0; border: 0; box-shadow: none; }
input[type=color] { padding: 2px; width: 40px; height: 30px; cursor: pointer; }
select { cursor: pointer; }
select:disabled { opacity: .55; cursor: not-allowed; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 15px; cursor: pointer;
  background: var(--panel); font-weight: 500; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: #009574; border-color: #009574; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(.95); }

.icon {
  border: 0; background: none; cursor: pointer; width: 38px; height: 38px; border-radius: 10px;
  color: var(--muted); flex: none; display: inline-grid; place-items: center; font-size: 17px;
  transition: background .15s, color .15s;
}
.icon:hover { background: var(--hover); color: var(--text); }
.icon.send { color: var(--accent); }

/* ---------- login ---------- */
/* login em duas metades: marca à esquerda, formulário à direita */
.login-screen { min-height: 100vh; min-height: 100dvh; display: flex; background: var(--panel); }
.login-brand {
  position: relative; overflow: hidden; flex: 0 0 46%; max-width: 640px; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; padding: 44px 52px;
  background: var(--carvao); color: var(--osso);
}
/* sol de cobre saindo pela borda (identidade yakio) */
.login-brand::after {
  content: ''; position: absolute; width: 620px; height: 620px; right: -260px; bottom: -240px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 34% 30%, #C06A4A, var(--cobre) 55%, #6E3320 100%); opacity: .95;
}
.lb-tree { display: none; }
.lb-top, .lb-mid, .lb-foot { position: relative; z-index: 1; }
.lb-top { display: flex; align-items: center; }
.lb-top img { width: 132px; height: auto; }
.lb-mid h1 { font-size: 34px; line-height: 1.18; letter-spacing: -.025em; font-weight: 700; margin: 0 0 34px; max-width: 440px; }
.lb-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.lb-feats li { display: flex; gap: 14px; align-items: flex-start; }
.lb-feats b { display: block; font-weight: 600; font-size: 15px; }
.lb-feats small { display: block; color: rgba(255, 255, 255, .72); font-size: 13.5px; line-height: 1.45; margin-top: 2px; }
.lb-ico {
  flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--turquesa);
  background: rgba(235, 228, 218, .08); border: 1px solid rgba(235, 228, 218, .14);
}
.lb-foot { font-size: 12.5px; color: rgba(255, 255, 255, .6); }

.login-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; gap: 28px; }
.login-form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 16px; }
.login-form h2 { margin: 0; font-size: 28px; letter-spacing: -.02em; color: var(--brand-ink); }
.login-form > p { margin: -10px 0 6px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text); }
.input-ico { position: relative; display: block; }
.input-ico > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-ico input { width: 100%; padding: 12px 14px 12px 42px; font-size: 15px; border-radius: 12px; }
.input-ico input[name="password"] { padding-right: 46px; }
.input-ico:focus-within > svg { color: var(--brand-teal); }
.input-ico input:focus { border-color: var(--turquesa); box-shadow: var(--ring); }
.input-ico.invalid input { border-color: var(--danger); }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 9px;
  background: none; color: var(--faint); cursor: pointer; display: grid; place-items: center;
}
.pw-toggle:hover { background: var(--hover); color: var(--text); }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: -6px 0 -4px; }
.login-btn {
  padding: 13px; font-size: 15px; font-weight: 600; border: 0; border-radius: 12px; color: #fff; cursor: pointer;
  background: var(--carvao); box-shadow: 0 8px 20px rgba(11, 12, 12, .2);
  transition: filter .15s, transform .15s;
}
.login-btn:hover { filter: brightness(1.08); }
.login-btn:active { transform: translateY(1px); }
.login-btn:disabled { opacity: .7; cursor: default; }
.login-note { font-size: 12.5px; color: var(--muted); text-align: center; margin: 0; max-width: 360px; }

/* assistente de primeiro acesso */
.setup { width: min(380px, 100%); display: flex; flex-direction: column; gap: 26px; }
.setup .login-form { width: 100%; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; font-size: 12px; color: var(--faint); font-weight: 600; }
.setup-steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; text-align: center; }
.setup-steps li:not(:first-child)::before { content: ''; position: absolute; top: 13px; right: calc(50% + 17px); width: calc(100% - 28px); height: 2px; background: var(--border); }
.setup-steps li.done:not(:first-child)::before, .setup-steps li.on:not(:first-child)::before { background: var(--brand-teal); }
.setup-steps span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); background: var(--panel); font-size: 12.5px; }
.setup-steps li.on { color: var(--brand-ink); }
.setup-steps li.on span { border-color: var(--brand-teal); color: var(--brand-teal); }
.setup-steps li.done span { background: var(--brand-teal); border-color: var(--brand-teal); color: #fff; }
.setup-hint { margin: -10px 0 0; font-size: 12px; color: var(--muted); font-weight: 400; }
.setup-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.setup-skip { padding: 12px; border-radius: 12px; font-weight: 600; }
.setup-how { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; color: var(--text); }
.setup .qr { margin: 4px auto; }
.setup-ok, .setup-wait { padding: 16px; border-radius: 12px; background: var(--hover, rgba(19, 127, 144, .08)); font-size: 14px; text-align: center; }
.setup-next-list { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.8; }
.setup .lic-key { min-height: 96px; }

@media (max-width: 820px) {
  .login-screen { flex-direction: column; }
  .login-brand { flex: none; max-width: none; padding: 22px 20px 26px; gap: 14px; }
  .lb-tree { width: 260px; right: -70px; bottom: -90px; }
  .lb-mid h1 { font-size: 21px; margin: 0; }
  .lb-feats, .lb-foot { display: none; }
  .login-main { justify-content: flex-start; padding: 32px 16px; }
}

.card { background: var(--panel); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 32px; border: 1px solid var(--border); }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; }
.login-card p { margin: 0 0 8px; }
.login-card input { padding: 11px 14px; }
.login-card .btn { padding: 11px; margin-top: 4px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.logo { color: var(--brand-ink); }
.logo-mark {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; padding: 5px;
  background: #fff; border: 1px solid var(--border); box-shadow: 0 6px 16px rgba(22, 54, 95, .14);
}
.logo-mark img, .rail-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- estrutura ---------- */
#app { display: flex; height: 100vh; height: 100dvh; background: var(--panel); }
#sidebar, #email-sidebar { width: 30%; min-width: 330px; max-width: 440px; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--panel); }
#conversation { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--chat-bg); position: relative; }
#email-view { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--panel-2); }
#crm { width: 350px; border-left: 1px solid var(--border); display: flex; flex-direction: column; background: var(--panel); }

.bar {
  height: 62px; background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px; flex: none;
}
.bar-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.bar-actions { margin-left: auto; display: flex; gap: 2px; }
.me { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.me span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.dot-img { object-fit: cover; background: var(--panel-3); }
.dot-inline { display: inline-grid; vertical-align: middle; margin-right: 6px; }
#me { cursor: pointer; border-radius: 999px; padding: 2px 10px 2px 2px; margin-left: -2px; transition: background .15s; }
#me:hover { background: var(--hover); }
.av-edit { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 6px 0 4px; }
.av-preview { position: relative; border-radius: 50%; box-shadow: 0 0 0 4px var(--panel), 0 0 0 5px var(--border); }
.av-preview.loading::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: rgba(0, 0, 0, .35); }
.av-preview.loading::before {
  content: ''; position: absolute; z-index: 1; inset: 50% auto auto 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: av-spin .8s linear infinite;
}
@keyframes av-spin { to { transform: rotate(360deg); } }
.av-edit .help { max-width: 340px; margin: 0; }
.av-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.av-actions .btn { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- barra de canais ---------- */
.rail {
  width: 68px; flex: none; background: var(--panel-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 6px;
}
.rail-logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 12px; overflow: hidden;
  box-shadow: 0 4px 12px rgba(11, 12, 12, .14);
}
/* logo do cliente: fundo branco com respiro; o yakio já vem no quadrado carvão */
.rail-logo.client { padding: 4px; background: #fff; border: 1px solid var(--border); }
.rail-btn {
  position: relative; width: 46px; height: 46px; border: 0; border-radius: 13px; background: none; cursor: pointer;
  color: var(--muted); display: grid; place-items: center; transition: background .15s, color .15s;
}
.rail-btn:hover { background: var(--hover); color: var(--text); }
.rail-btn.active { background: var(--accent-soft); color: var(--accent-2); }
.rail-btn.active::before { content: ''; position: absolute; left: -11px; top: 11px; bottom: 11px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.rail-label { display: none; }
.rail-spacer { flex: 1; }
.rail-badge {
  position: absolute; top: 3px; right: 1px; background: var(--dot); color: var(--on-dot); font-size: 10.5px; font-weight: 700;
  border-radius: 9px; padding: 0 5px; min-width: 18px; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--panel-2);
}
.rail-badge.late { background: var(--danger); }

/* ---------- avisos, busca, filtros ---------- */
.wa-banner {
  margin: 10px 12px 0; padding: 10px 12px; border-radius: 10px; background: var(--banner-bg); color: var(--banner-text);
  font-size: 13px; cursor: pointer; font-weight: 500;
}
#lic-banner { cursor: pointer; }
.lic-block { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; overflow: auto;
  background: linear-gradient(155deg, #10284a 0%, #16446e 45%, #13808f 100%); }
.lic-card { width: min(460px, 100%); background: var(--panel); border-radius: 20px; padding: 30px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 12px; }
.lic-card h2 { margin: 0; font-size: 22px; color: var(--brand-ink); letter-spacing: -.02em; }
.lic-card p { margin: 0; }
.lic-logo { width: 56px; height: 56px; padding: 6px; border-radius: 16px; background: #fff; border: 1px solid var(--border); }
.lic-out { align-self: flex-start; }
.lic-label { font-size: 13px; font-weight: 600; margin-top: 4px; }
.lic-key { width: 100%; min-height: 84px; font: 12px/1.45 ui-monospace, Menlo, monospace; resize: vertical; word-break: break-all; }
.lic-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.lic-info { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.lic-row { display: flex; gap: 12px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.lic-row:last-child { border-bottom: 0; }
.lic-row.top { align-items: flex-start; }
.lic-row > span { width: 120px; flex: none; color: var(--muted); }
.lic-chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.lic-chip.ok { background: var(--accent-soft); color: var(--accent-2); }
.lic-chip.warn { background: var(--banner-bg); color: var(--banner-text); }
.lic-chip.bad { background: var(--danger-soft); color: var(--danger); }
.lic-bar { display: block; width: 140px; height: 5px; border-radius: 9px; background: var(--panel-3); margin-top: 5px; overflow: hidden; }
.lic-bar i { display: block; height: 100%; background: var(--accent); }
.lic-bar.over i { background: var(--danger); }
.lic-mods { display: flex; flex-direction: column; gap: 3px; }
.lic-mods .off { color: var(--faint); }
.wa-banner.err { background: var(--banner-err-bg); color: var(--banner-err-text); }
.search { position: relative; padding: 10px 12px 8px; }
.search .ico { position: absolute; left: 24px; top: 50%; transform: translateY(-40%); color: var(--faint); pointer-events: none; }
.search input { width: 100%; padding-left: 36px; background: var(--panel-2); border-color: transparent; border-radius: 10px; }
.search input:focus { background: var(--panel); }
.chips { display: flex; gap: 6px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--panel);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; white-space: nowrap; color: var(--muted); font-size: 13px; font-weight: 500;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { background: var(--hover); color: var(--text); }
.chip.active { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; font-weight: 600; }
.chip-icon { padding: 5px 9px; }
.subfilters { display: flex; gap: 6px; padding: 0 12px 10px; border-bottom: 1px solid var(--border); }
.subfilters select { flex: 1 1 0; padding: 6px 8px; font-size: 12.5px; min-width: 0; border-radius: 8px; background: var(--panel); }

/* ---------- lista de conversas ---------- */
.chat-list { flex: 1; overflow-y: auto; padding: 6px 6px 10px; }
.chat-item {
  display: flex; gap: 12px; padding: 10px; cursor: pointer; align-items: center; border-radius: 12px;
  transition: background .12s;
}
.chat-item + .chat-item { margin-top: 2px; }
.chat-item:hover { background: var(--hover); }
.chat-item.active { background: var(--active); }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--panel-3); flex: none;
  display: grid; place-items: center; font-weight: 600; color: #fff; font-size: 15px;
}
.chat-info { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 6px; }
.chat-name { font-weight: 600; font-size: 15px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-time { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.chat-item.unread .chat-time { color: var(--accent-2); font-weight: 600; }
.chat-preview { flex: 1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.chat-item.unread .chat-preview { color: var(--text); }
.badge { background: var(--dot); color: var(--on-dot); border-radius: 999px; padding: 0 7px; font-size: 11.5px; font-weight: 700; min-width: 20px; line-height: 20px; text-align: center; }
.meta-row { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; align-items: center; }
.meta-row:empty { display: none; }
.tag, .dept { font-size: 11px; padding: 1px 8px; border-radius: 999px; color: #fff; font-weight: 500; line-height: 18px; }
.owner { font-size: 11px; padding: 0 7px; border-radius: 999px; border: 1px solid; line-height: 17px; font-weight: 500; }
.status-pill, .bot-pill { font-size: 11px; color: var(--muted); }
.viewing-dots { display: inline-flex; gap: 2px; }
.viewing-dots span { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px var(--panel); }
.online-users { border-top: 1px solid var(--border); padding: 9px 14px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.online-users .u { display: inline-flex; align-items: center; gap: 5px; }
.online-users .u .dot-online { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px #25d366; margin: 2px 2px 2px 0; }

/* ---------- estado vazio ---------- */
.empty { flex: 1; display: grid; place-items: center; text-align: center; background: var(--panel-2); }
.empty-inner { max-width: 420px; padding: 24px; }
.empty h2 { margin: 14px 0 6px; font-size: 22px; }
.big {
  width: 88px; height: 88px; border-radius: 28px; margin: 0 auto; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-2);
}

/* ---------- conversa ---------- */
#chat, #em-thread { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-header { gap: 10px; }
.chat-header .avatar { width: 40px; height: 40px; font-size: 14px; }
.chat-title { flex: 1; min-width: 0; cursor: pointer; }
.chat-title .name { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title .sub { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-actions { display: flex; gap: 4px; align-items: center; }
.chat-actions select { padding: 6px 8px; font-size: 13px; max-width: 160px; border-radius: 8px; }
.chat-header .chat-title { min-width: 110px; }
@media (max-width: 1500px) { #crm:not(.hidden) ~ * .chat-actions select, .chat-actions select { max-width: 132px; } }
.viewers-bar { padding: 7px 16px; font-size: 13px; background: var(--banner-bg); color: var(--banner-text); font-weight: 500; }
.msg-search { padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--border); }
.msg-search input { width: 100%; }

.messages {
  flex: 1; overflow-y: auto; padding: 14px 7% 10px; display: flex; flex-direction: column; gap: 3px;
  /* marca d'água: o logo fica parado no centro enquanto as mensagens rolam por cima */
  background-image: var(--watermark), radial-gradient(var(--chat-dots) 1px, transparent 1px);
  background-size: min(220px, 40%) auto, 20px 20px; background-position: center, 0 0; background-repeat: no-repeat, repeat;
}
.day {
  align-self: center; background: var(--panel); color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  padding: 5px 12px; border-radius: 999px; margin: 12px 0 8px; box-shadow: var(--shadow-sm); text-transform: uppercase;
}
.msg { display: flex; position: relative; }
.msg.out { justify-content: flex-end; }
.bubble {
  max-width: min(65%, 580px); background: var(--in); border-radius: 12px; border-top-left-radius: 4px;
  padding: 7px 10px 5px; box-shadow: var(--shadow-sm); position: relative; overflow-wrap: anywhere; line-height: 1.42;
}
.msg.out .bubble { background: var(--out); border-top-left-radius: 12px; border-top-right-radius: 4px; }
.msg.highlight .bubble { box-shadow: 0 0 0 2px var(--accent); }
.author { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; display: flex; gap: 6px; align-items: center; }
.author .phone-src, .author.bot { font-weight: 500; color: var(--muted); }
.text { white-space: pre-wrap; }
.text a { color: var(--blue); }
.text code { background: rgba(0, 0, 0, .06); }
.foot { font-size: 11px; color: var(--muted); float: right; margin: 5px 0 -2px 12px; display: flex; gap: 3px; align-items: center; font-variant-numeric: tabular-nums; }
.ticks { letter-spacing: -3px; padding-right: 3px; }
.ticks.read { color: var(--tick); }
.quoted { border-left: 3px solid var(--accent); background: rgba(0, 0, 0, .05); border-radius: 8px; padding: 5px 9px; margin-bottom: 5px; font-size: 13px; cursor: pointer; }
.quoted b { color: var(--accent-2); display: block; font-size: 12.5px; }
.fwd { font-size: 12px; color: var(--muted); font-style: italic; }
.deleted { font-style: italic; color: var(--muted); }
.media-img { display: block; max-width: 100%; max-height: 340px; border-radius: 8px; cursor: zoom-in; min-width: 120px; min-height: 80px; background: rgba(0, 0, 0, .06); }
.media-video { max-width: 100%; max-height: 340px; border-radius: 8px; display: block; }
.sticker { width: 140px; height: 140px; object-fit: contain; }
audio { max-width: 280px; height: 40px; display: block; }
.doc { display: flex; gap: 10px; align-items: center; background: rgba(0, 0, 0, .05); padding: 10px 12px; border-radius: 10px; text-decoration: none; color: inherit; }
.doc .ext { background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 700; border-radius: 6px; padding: 6px 6px; }
.reactions { position: absolute; bottom: -14px; right: 8px; background: var(--panel); border-radius: 999px; padding: 1px 7px; font-size: 13px; box-shadow: var(--shadow); border: 1px solid var(--border); cursor: default; }
.msg.has-reactions { margin-bottom: 14px; }
.msg-menu-btn {
  position: absolute; top: 4px; right: 4px; opacity: 0; border: 0; border-radius: 50%; background: var(--panel);
  cursor: pointer; width: 22px; height: 22px; font-size: 11px; color: var(--muted); box-shadow: var(--shadow-sm); transition: opacity .12s;
}
.bubble:hover .msg-menu-btn { opacity: 1; }
.poll div { padding: 4px 0; border-bottom: 1px solid var(--border); }
.load-more { align-self: center; margin: 6px; }

/* ---------- caixa de mensagem ---------- */
.composer { background: var(--panel); border-top: 1px solid var(--border); padding: 8px 12px; position: relative; flex: none; }
.composer-row, .recording { display: flex; align-items: flex-end; gap: 4px; }
.recording { align-items: center; justify-content: flex-end; padding: 4px; gap: 10px; font-variant-numeric: tabular-nums; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
#input {
  flex: 1; resize: none; max-height: 140px; background: var(--panel-2); border-color: transparent;
  border-radius: 22px; padding: 10px 16px; margin: 0 4px; line-height: 1.4;
}
#input:focus { background: var(--panel); border-color: var(--accent); }
#btn-send, #btn-record, #rec-send { background: var(--accent); color: var(--on-accent); border-radius: 50%; width: 42px; height: 42px; }
#btn-send:hover, #btn-record:hover, #rec-send:hover { background: var(--accent-2); color: #fff; }
.reply-preview { display: flex; gap: 8px; align-items: center; background: var(--panel-2); border-radius: 10px; padding: 7px 10px; margin-bottom: 8px; border-left: 3px solid var(--accent); }
.reply-preview .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.quick-replies, .emoji-panel, .attach-menu, .ai-panel {
  position: absolute; bottom: calc(100% + 6px); left: 12px; background: var(--panel); border-radius: 14px; border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; z-index: 6; animation: rise .14s ease-out;
}
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }
.quick-replies { right: 12px; padding: 6px; }
.quick-replies div { padding: 8px 12px; cursor: pointer; border-radius: 8px; }
.quick-replies div.sel, .quick-replies div:hover { background: var(--hover); }
.emoji-panel { width: min(340px, calc(100vw - 24px)); display: grid; grid-template-columns: repeat(8, 1fr); padding: 8px; font-size: 22px; }
.emoji-panel span { cursor: pointer; text-align: center; border-radius: 8px; padding: 3px; }
.emoji-panel span:hover { background: var(--hover); }
.attach-menu { left: 54px; display: flex; flex-direction: column; padding: 6px; min-width: 230px; }
.attach-menu button { display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; padding: 8px 10px; cursor: pointer; border-radius: 10px; font-weight: 500; }
.attach-menu button:hover { background: var(--hover); }
.am { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.am-img { background: #8b5cf6; } .am-doc { background: #3b82f6; } .am-user { background: #0ea5a4; }
.am-pin { background: #ef4444; } .am-poll { background: #f59e0b; } .am-cal { background: #137f90; }
.drop-hint {
  position: absolute; inset: 62px 0 0; background: color-mix(in srgb, var(--accent) 18%, transparent); border: 2px dashed var(--accent);
  display: grid; place-items: center; font-size: 20px; font-weight: 600; pointer-events: none; z-index: 5;
}

/* ---------- painel do cliente (CRM) ---------- */
.crm-body { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 18px; }
.crm-head { text-align: center; padding-bottom: 6px; }
.crm-head h3 { margin: 6px 0 2px; }
.crm-head .avatar { width: 92px; height: 92px; margin: 0 auto 8px; font-size: 30px; }
.section { border-top: 1px solid var(--border); padding-top: 14px; }
.section h4 { margin: 0 0 10px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; display: flex; align-items: center; gap: 6px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field input, .field textarea, .field select { width: 100%; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-picker .tag { cursor: pointer; opacity: .35; padding: 3px 11px; font-size: 12px; transition: opacity .12s; }
.tag-picker .tag.on { opacity: 1; }
.note { background: var(--note-bg); color: var(--note-text); border-radius: 10px; padding: 9px 11px; font-size: 13px; margin-bottom: 6px; }
.note small { display: block; opacity: .75; margin-top: 4px; }
.activity { font-size: 12px; color: var(--muted); padding: 4px 0; }

/* ---------- janelas (modal), menus, avisos ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(8, 14, 18, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 20; padding: 16px; animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal-card {
  background: var(--panel); border-radius: 18px; padding: 24px; width: min(580px, 100%); max-height: 90vh; overflow-y: auto;
  position: relative; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal h3 { margin: 0 34px 14px 0; font-size: 18px; }
.modal h4 { margin: 14px 0 6px; font-size: 14px; }
.modal .form { display: flex; flex-direction: column; gap: 10px; }
.modal textarea { width: 100%; }
.modal table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal td, .modal th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.qr { display: block; margin: 14px auto; border-radius: 12px; background: #fff; padding: 10px; box-shadow: var(--shadow); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--panel-2); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-size: 24px; }
.pick-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.pick-list label { display: flex; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: center; }
.pick-list label:last-child { border-bottom: 0; }
.pick-list label:hover { background: var(--hover); }
.pick-list input:disabled, .pick-list input:disabled + * { cursor: not-allowed; }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 30; pointer-events: none; }
.toast {
  background: #1d272d; color: #f2f6f8; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); max-width: min(560px, 92vw);
  font-weight: 500; animation: rise .18s ease-out;
}
.ctx-menu { position: fixed; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); padding: 6px; z-index: 25; min-width: 220px; animation: rise .12s ease-out; }
.ctx-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; cursor: pointer; border-radius: 8px; font-size: 13.5px; }
.ctx-menu button:hover { background: var(--hover); }
.ctx-menu .emojis { display: flex; padding: 4px 6px 8px; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.ctx-menu .emojis span { cursor: pointer; font-size: 22px; padding: 3px; border-radius: 8px; transition: transform .1s; }
.ctx-menu .emojis span:hover { background: var(--hover); transform: scale(1.15); }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .9); display: grid; place-items: center; z-index: 40; cursor: zoom-out; }
.lightbox img { max-width: 95vw; max-height: 95vh; border-radius: 6px; }

/* ---------- robô, agendamento ---------- */
.sched { display: flex; gap: 8px; align-items: flex-start; background: var(--panel-2); border-radius: 10px; padding: 9px 11px; margin-bottom: 6px; font-size: 13px; }
.sched .t { flex: 1; white-space: pre-wrap; }
.sched small { display: block; color: var(--muted); }
.hours-grid { display: grid; grid-template-columns: 96px 1fr 1fr; gap: 6px 10px; align-items: center; }
.hours-grid input[type=time] { padding: 6px 8px; }

/* ---------- páginas (relatórios, funil, tarefas, usuários) ---------- */
.page { position: fixed; inset: 0; z-index: 12; background: var(--bg); display: flex; flex-direction: column; animation: fade .15s ease-out; }
.page .bar h3 { margin: 0; font-size: 17px; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.page-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.page-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.page-tools select, .page-tools input { padding: 7px 10px; font-size: 13px; }
.page-tools .btn { padding: 7px 13px; font-size: 13px; }
.page-tools .chips { padding: 0; }
.page-body { flex: 1; overflow: auto; padding: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.kpi .v { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; font-weight: 500; margin-top: 2px; }
.kpi .s { color: var(--faint); font-size: 12px; margin-top: 2px; }
.kpi.warn .v { color: var(--warn); }
.report-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.card-box { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; overflow-x: auto; box-shadow: var(--shadow-sm); }
.card-box h4 { margin: 0 0 12px; font-size: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--hover); }
.late { color: var(--danger); font-weight: 600; }

.kanban { display: flex; gap: 12px; height: 100%; align-items: stretch; min-width: max-content; }
.kcol { width: 280px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; max-height: 100%; }
.kcol.over { box-shadow: 0 0 0 2px var(--accent); }
.kcol header { padding: 12px 14px 10px; border-bottom: 3px solid; }
.kcol header b { display: flex; justify-content: space-between; }
.kcol header small { color: var(--muted); font-variant-numeric: tabular-nums; }
.kcards { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.kcard { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px; box-shadow: var(--shadow-sm); cursor: grab; font-size: 13px; transition: box-shadow .12s, transform .12s; }
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kcard.dragging { opacity: .4; }
.kcard .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 5px; color: var(--muted); font-size: 12px; }
.kcard .val { margin-left: auto; color: var(--accent-2); font-weight: 600; cursor: pointer; }
.kmore { text-align: center; color: var(--muted); font-size: 12px; padding: 6px; }

/* ---------- IA ---------- */
.ai-panel { right: 12px; padding: 12px; max-height: 50vh; }
.ai-panel .head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 10px; }
.ai-panel .head button { margin-left: auto; }
.ai-opt { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; cursor: pointer; white-space: pre-wrap; border: 1px solid transparent; transition: border-color .12s; }
.ai-opt:hover { border-color: var(--accent); }
.ai-box { background: var(--ai-bg); border-radius: 12px; padding: 12px; font-size: 13px; margin-top: 8px; }
.ai-box ul, .ai-box ol { margin: 6px 0; padding-left: 18px; }
.ai-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-actions .btn { padding: 6px 12px; font-size: 13px; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- permissões ---------- */
.no-export .export-btn, .no-ai .ai-section { display: none !important; }

/* ---------- e-mail ---------- */
.em-folders { padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.em-folders .chip .n { background: var(--dot); color: var(--on-dot); border-radius: 999px; padding: 0 6px; font-size: 10.5px; line-height: 16px; font-weight: 700; }
.em-folders .chip.active .n { background: var(--accent-2); }
.em-item .chat-name { font-size: 14.5px; }
.em-item .em-subj { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.em-item.unread .chat-name, .em-item.unread .em-subj { font-weight: 700; }
.em-msgs { flex: 1; overflow-y: auto; padding: 16px 5%; display: flex; flex-direction: column; gap: 12px; }
.em-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; flex-shrink: 0; } /* sem encolher: e-mail grande fica inteiro e a lista rola */
.em-card.out { border-left: 4px solid var(--accent); }
.em-card header { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.em-card.collapsed header { border-bottom: 0; }
.em-card header .who { flex: 1; min-width: 0; }
.em-card header .who b { display: block; }
.em-card header small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-card.collapsed .em-body, .em-card.collapsed .em-atts { display: none; }
.em-body { padding: 14px; }
.em-body pre { white-space: pre-wrap; font: inherit; margin: 0; overflow-wrap: anywhere; }
.em-body iframe { width: 100%; border: 0; background: #fff; border-radius: 8px; min-height: 60px; }
.em-atts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 14px; }
.em-att { display: inline-flex; gap: 6px; align-items: center; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; text-decoration: none; color: inherit; }
.em-att:hover { border-color: var(--accent); }
.em-imgs { font-size: 12.5px; padding: 8px 14px; background: var(--banner-bg); color: var(--banner-text); display: flex; align-items: center; gap: 8px; }
.em-imgs button { margin-left: auto; padding: 4px 10px; font-size: 12px; }
.em-folder-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; margin-left: 6px; }
.em-reply { background: var(--panel); border-top: 1px solid var(--border); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.em-reply-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.em-reply-head .chip { margin-left: auto; }
.em-reply textarea { width: 100%; resize: vertical; min-height: 76px; background: var(--panel-2); border-color: transparent; }
.em-reply textarea:focus { background: var(--panel); }
.em-reply-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.em-files { display: flex; gap: 6px; flex-wrap: wrap; }
.em-files:empty { display: none; }
.em-files span { background: var(--panel-2); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.acc-status { font-size: 12px; }
.acc-grid { display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
.acc-grid label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 3px; font-weight: 500; }
.acc-grid input, .acc-grid select { width: 100%; }
.test-ok { color: #16a34a; } .test-err { color: var(--danger); }
.sig-box { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sig-preview { background: #fff; color: #555; border-radius: 8px; padding: 12px 14px; font: 14px/1.5 Arial, Helvetica, sans-serif; white-space: pre-wrap; min-height: 40px; border: 1px solid #e5e7eb; }
.sig-preview img { display: block; max-width: 100%; height: auto; margin-top: 6px; }
.sig-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sig-row input[type=range] { flex: 1; min-width: 120px; }
#em-sync.spinning .ico { animation: spin 1s linear infinite; }
#em-sync.spinning { pointer-events: none; color: var(--accent); }
#app.mode-email #sidebar, #app.mode-email #conversation, #app.mode-email #crm { display: none !important; }

/* ---------- tarefas ---------- */
.tk-wrap { max-width: 880px; margin: 0 auto; }
.tk-group { margin: 18px 0 10px; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.tk-group.late { color: var(--danger); }
.tk-list { padding: 4px 14px; }
.tk-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.tk-row:last-child { border-bottom: 0; }
.tk-row.done .tk-title { text-decoration: line-through; color: var(--muted); }
.tk-check { width: 20px; height: 20px; margin-top: 1px; cursor: pointer; flex: none; border-radius: 6px; }
.tk-main { flex: 1; min-width: 0; }
.tk-title { font-weight: 600; overflow-wrap: anywhere; }
.tk-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.tk-meta a { color: var(--accent-2); text-decoration: none; font-weight: 500; }
.tk-meta a:hover { text-decoration: underline; }
.tk-notes { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; }
.tk-row .icon { width: 32px; height: 32px; font-size: 15px; }
#crm-tasks .tk-row { padding: 8px 0; }
.tk-alerts { position: fixed; right: 18px; bottom: 18px; z-index: 35; display: flex; flex-direction: column; gap: 10px; width: min(370px, calc(100vw - 32px)); }
.tk-alert {
  background: var(--panel); border: 1px solid var(--border); border-left: 5px solid var(--warn); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; animation: rise .22s ease-out;
}
.tk-alert-head { display: flex; align-items: center; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tk-alert-head button { margin-left: auto; width: 28px; height: 28px; font-size: 14px; }

/* ---------- responsivo ---------- */
.mobile-only { display: none; }
@media (max-width: 900px) {
  #crm { position: fixed; inset: 0; width: auto; z-index: 15; }
  .chat-actions select { max-width: 104px; }
  .report-grid { grid-template-columns: 1fr; }
  .page .bar { height: auto; flex-wrap: wrap; padding: 10px 12px; }
  .page-tools { width: 100%; justify-content: flex-start; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  #app { flex-direction: column-reverse; }
  #app > aside, #app > main { min-height: 0; flex: 1; }
  #sidebar, #email-sidebar { width: 100%; max-width: none; min-width: 0; border-right: 0; }
  #conversation, #email-view { display: none; }
  #app.in-chat #sidebar, #app.in-email #email-sidebar { display: none !important; }
  #app.in-chat #conversation:not(.hidden), #app.in-email #email-view:not(.hidden) { display: flex !important; }
  .chat-header { height: auto; flex-wrap: wrap; padding: 8px 10px; row-gap: 6px; }
  .chat-header .chat-actions { order: 3; width: 100%; }
  .chat-header .chat-actions { gap: 2px; }
  .chat-header .chat-actions select { flex: 1 1 0; min-width: 0; max-width: none; }
  .mobile-only { display: inline-grid; }
  .messages { padding: 10px 10px 8px; }
  .bubble { max-width: 86%; }
  #btn-msg-search { display: none; }
  .em-msgs { padding: 10px; }

  /* barra de baixo: com muitos módulos os botões não cabem; ela rola para o lado sem empurrar a tela */
  .rail {
    width: 100%; max-width: 100vw; height: auto; flex-direction: row; justify-content: space-between; align-items: stretch;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--border); gap: 0;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .rail::-webkit-scrollbar { display: none; }
  .rail-logo, .rail-spacer { display: none; }
  .rail-btn { width: auto; flex: 1 0 58px; min-width: 58px; height: 52px; display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; border-radius: 12px; }
  .rail-label { white-space: nowrap; }
  .rail-btn.active::before { display: none; }
  .rail-label { display: block; font-size: 11px; font-weight: 600; }
  .rail-badge { right: calc(50% - 26px); }
  #app.in-chat .rail, #app.in-email .rail { display: none; }
  .tk-alerts { bottom: 78px; }
  .modal { padding: 0; place-items: end center; }
  .modal-card { border-radius: 20px 20px 0 0; max-height: 92vh; width: 100%; animation: sheet .2s ease-out; }
  @keyframes sheet { from { transform: translateY(30px); opacity: .5; } }
  .page-body { padding: 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { min-width: 0; padding: 12px 14px; overflow-wrap: anywhere; }
  .kpi .v { font-size: 21px; }
}

/* ---------- transcrição de áudio ---------- */
.transcript { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; padding: 7px 9px; border-radius: 8px; background: rgba(0, 0, 0, .05); font-size: 13.5px; line-height: 1.4; max-width: 300px; }
.transcript .ico { margin-top: 2px; color: #8b5cf6; }
.transcript-btn { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; border: 0; background: none; color: var(--accent-2); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 2px 0; }
.transcript-btn:disabled { opacity: .5; cursor: default; }

/* ---------- busca geral ---------- */
.palette { position: fixed; inset: 0; z-index: 45; background: rgba(8, 14, 18, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; animation: fade .12s ease-out; }
.palette-card { width: min(680px, 100%); max-height: 76vh; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: pop .15s ease-out; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-input input { flex: 1; border: 0; background: none; box-shadow: none; padding: 4px 0; font-size: 16px; color: var(--text); }
.palette-input input:focus { box-shadow: none; }
.palette kbd { font: 600 11px var(--font); background: var(--panel-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.palette-results { overflow-y: auto; padding: 6px; flex: 1; }
.pal-group { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; padding: 10px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.pal-item.sel, .pal-item:hover { background: var(--active); }
.pal-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.pal-item.sel .pal-ic { background: var(--accent-soft); color: var(--accent-2); }
.pal-main { flex: 1; min-width: 0; }
.pal-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-meta { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.palette mark { background: rgba(255, 196, 0, .35); color: inherit; border-radius: 3px; padding: 0 1px; }
.pal-empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.pal-empty .ico { margin: 0 auto 8px; color: var(--faint); }
.palette-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
@media (max-width: 720px) {
  .palette { padding: 0; align-items: stretch; }
  .palette-card { max-height: none; height: 100%; border-radius: 0; }
  .palette-foot { display: none; }
}

.un-at { display: grid; place-items: center; padding: 0 10px; height: 38px; background: var(--panel-2); border: 1px solid var(--border); border-right: 0; border-radius: 10px 0 0 10px; color: var(--muted); font-weight: 600; }

/* botões de som e sair na barra lateral */
.rail-btn.muted-on { color: var(--danger); }
.rail-logout:hover { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 720px) {
  /* no celular a barra de baixo fica só com os canais, a busca e as configurações; "Sair" está nas configurações */
  #rail-logout { display: none; }
}

/* ---------- Trello ---------- */
.page-body.tr-body { padding: 14px; }
.tr-board { display: flex; gap: 12px; align-items: flex-start; height: 100%; min-width: max-content; }
.tr-list { width: 272px; flex: none; background: #f1f2f4; color: #172b4d; border-radius: 12px; display: flex; flex-direction: column; max-height: 100%; box-shadow: 0 1px 1px rgba(9, 30, 66, .25); }
.tr-list header { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; font-size: 14px; }
.tr-list header b { flex: 1; overflow-wrap: anywhere; }
.tr-count { font-size: 12px; color: #626f86; }
.tr-cards { flex: 1; overflow-y: auto; padding: 2px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 12px; }
.tr-card { background: #fff; border-radius: 8px; padding: 8px 10px; box-shadow: 0 1px 1px rgba(9, 30, 66, .25); cursor: pointer; font-size: 14px; overflow: hidden; }
.tr-card:hover { box-shadow: 0 0 0 2px #388bff; }
.tr-card.dragging { opacity: .4; }
.tr-cover { height: 32px; margin: -8px -10px 8px; }
.tr-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tr-labels span { min-width: 40px; height: 16px; line-height: 16px; border-radius: 4px; padding: 0 6px; font-size: 11px; font-weight: 600; color: #172b4d; }
.tr-title { overflow-wrap: anywhere; }
.tr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; color: #44546f; font-size: 12px; }
.tr-meta:empty { display: none; }
.tr-badge { display: inline-flex; align-items: center; gap: 3px; border-radius: 4px; padding: 0 3px; }
.tr-badge.ok { background: #1f845a; color: #fff; }
.tr-badge.late { background: #c9372c; color: #fff; }
.tr-badge.soon { background: #f5cd47; color: #172b4d; }
.tr-members { margin-left: auto; display: flex; }
.tr-av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: #dfe1e6; color: #172b4d; font-size: 10px; font-weight: 700; margin-left: -4px; box-shadow: 0 0 0 2px #fff; object-fit: cover; }
.tr-add { margin: 6px 8px 8px; border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 8px; color: #44546f; cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 500; }
.tr-add:hover { background: rgba(9, 30, 66, .08); color: #172b4d; }
.tr-addbox { padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 6px; }
.tr-addbox textarea { background: #fff; color: #172b4d; border-color: #388bff; }
.tr-newlist { border: 0; background: rgba(255, 255, 255, .24); color: #fff; padding: 12px; text-align: left; cursor: pointer; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.tr-newlist:hover { background: rgba(255, 255, 255, .34); }
.tr-drop { height: 36px; border-radius: 8px; background: rgba(9, 30, 66, .13); flex: none; }
.tr-connect { max-width: 520px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tr-steps li { margin-bottom: 8px; }
.tc-name { font-size: 18px; font-weight: 700; width: 100%; border-color: transparent; padding: 6px 8px; }
.tc-name:hover { border-color: var(--border); }
.tc-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 12px; }
.tc-check label { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.tc-check input:checked + span { text-decoration: line-through; color: var(--muted); }
.tc-comments { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.tc-cm { background: var(--panel-2); border-radius: 10px; padding: 8px 10px; font-size: 13px; white-space: pre-wrap; }
.tr-mem { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-3); color: var(--text); }
.tr-mem .tr-av { margin-left: 0; box-shadow: none; width: 20px; height: 20px; }
@media (max-width: 720px) { .tc-grid { grid-template-columns: 1fr; } .tr-list { width: 82vw; } }
.tc-check label { justify-content: flex-start; }
.tc-check input[type=checkbox], .field label input[type=checkbox] { width: 16px !important; flex: none; }
a.btn { text-decoration: none; color: inherit; }

/* ---------- integrações ---------- */
.int-sec { border-top: 1px solid var(--border); padding: 14px 0 6px; }
.int-sec h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; flex-wrap: wrap; }
.int-badge { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--panel-3); color: var(--muted); }
.int-badge.ok { background: var(--accent-soft); color: var(--accent-2); }
.int-steps { margin: 4px 0 8px; padding-left: 18px; }
.int-steps li { margin-bottom: 4px; }
.int-copy { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px 6px 6px 12px; margin: 4px 0 10px; }
.int-copy code { flex: 1; background: none; padding: 0; font-size: 13px; overflow-wrap: anywhere; }
.int-copy .btn { padding: 5px 12px; font-size: 12.5px; }
.int-field { margin-bottom: 10px; }
.int-out { margin-top: 5px; min-height: 1em; }
/* listas longas do Trello: o cartão mantém a altura e a coluna rola (antes os cartões eram espremidos) */
.tr-card, .tr-drop, .tr-addbox { flex-shrink: 0; }
.tr-list { min-height: 0; }
.tr-cards { min-height: 12px; overscroll-behavior: contain; }
.page-body.tr-body { overflow-x: auto; overflow-y: hidden; }
.tr-board { height: 100%; align-items: flex-start; }
.tr-list { max-height: calc(100% - 4px); }

/* ---------- figurinhas ---------- */
.sticker-panel { position: absolute; bottom: calc(100% + 6px); left: 12px; width: min(380px, calc(100vw - 24px)); max-height: 360px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 6; animation: rise .14s ease-out; }
.stk-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px 14px; border-bottom: 1px solid var(--border); }
.stk-head b { flex: 1; font-size: 13.5px; }
.stk-head .btn { padding: 5px 10px; font-size: 12.5px; }
.stk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px; overflow-y: auto; }
.stk { position: relative; aspect-ratio: 1; border-radius: 10px; cursor: pointer; display: grid; place-items: center; transition: background .12s; }
.stk:hover { background: var(--hover); }
.stk img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.stk-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--panel); box-shadow: var(--shadow-sm); color: var(--muted); display: none; place-items: center; cursor: pointer; padding: 0; }
.stk:hover .stk-del { display: grid; }
.stk-del:hover { color: var(--danger); }
.stk-empty { grid-column: 1 / -1; text-align: center; padding: 18px 8px; }
/* figurinha aparece solta, sem balão (como no WhatsApp) */
.msg.is-sticker .bubble { background: transparent !important; box-shadow: none; padding: 0; }
.msg.is-sticker .foot { background: var(--panel); border-radius: 999px; padding: 1px 7px; margin-top: 2px; box-shadow: var(--shadow-sm); }
.msg.is-sticker .author { background: var(--panel); border-radius: 8px; padding: 2px 8px; display: inline-flex; }
/* figurinha: nome em cima, figurinha, horário embaixo — alinhados do lado da mensagem */
.msg.is-sticker .bubble { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: none; }
.msg.out.is-sticker .bubble { align-items: flex-end; }
.msg.is-sticker .author { order: 0; margin: 0; }
.msg.is-sticker .sticker { order: 1; display: block; }
.msg.is-sticker .foot { order: 2; float: none; margin: 0; }
.msg.is-sticker .bubble > div[style*="clear"] { display: none; }
.msg.is-sticker .reactions { position: static; order: 3; }

.pal-loading { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- backups ---------- */
.bk { display: flex; flex-direction: column; gap: 12px; min-width: min(520px, 100%); }
.bk-alert { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.bk-alert.err { background: rgba(220, 53, 69, .1); color: var(--danger); }
.bk-alert.warn { background: rgba(240, 173, 78, .15); }
.bk-status { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bk-status > div { background: var(--hover); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.bk-status span { font-size: 12px; color: var(--muted); }
.bk-status > .bk-ext { grid-column: 1 / -1; }
.bk-ext small { font-size: 12px; color: var(--muted); }
.bk-ext.err { background: rgba(220, 53, 69, .1); }
.bk-ext.err b { color: var(--danger); }
.bk-ext.warn { background: rgba(240, 173, 78, .15); }
.bk-sec { font-weight: 700; font-size: 13px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.bk-sec small { font-weight: 400; word-break: break-all; }
.bk-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.bk-check input { margin-top: 3px; }
.bk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bk-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.bk-table { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.bk-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.bk-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.bk-table tr:last-child td { border-bottom: 0; }
.bk-table .num { text-align: right; color: var(--muted); }
.bk-act { text-align: right; }
.bk-act .btn { padding: 4px 9px; font-size: 12.5px; margin-left: 4px; }
.bk-act .icon { vertical-align: middle; margin-left: 2px; }
.bk-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--active); color: var(--accent); font-weight: 600; }
.bk-chip.man { background: var(--hover); color: var(--muted); }
.bk-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bk-upload input { flex: 1; min-width: 0; }
.bk-progress { height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.bk-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
@media (max-width: 560px) { .bk-table td:nth-child(2) { display: none; } .bk-act .btn { padding: 4px 7px; } }

/* ---------- cara da empresa ---------- */
.login-company { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; font-weight: 700; font-size: 17px; color: var(--brand-ink); }
.login-company img { max-height: 56px; max-width: 200px; object-fit: contain; }
.login-company.only-logo span { font-size: 15px; color: var(--muted); font-weight: 600; }
.rail-logo.client { padding: 3px; }
.br { display: flex; flex-direction: column; gap: 12px; min-width: min(420px, 100%); }
.br .field { margin: 0; }
.br-sec { font-weight: 700; font-size: 13px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.br-logo { min-height: 96px; display: grid; place-items: center; padding: 14px; border-radius: 12px; border: 1px dashed var(--border);
  background: repeating-conic-gradient(var(--hover) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.br-logo img { max-height: 120px; max-width: 100%; object-fit: contain; }

/* ---------- distribuição automática ---------- */
.dist { display: flex; flex-direction: column; gap: 12px; min-width: min(500px, 100%); }
.dist-modes { display: flex; flex-direction: column; gap: 8px; }
.dist-mode { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.dist-mode.on { border-color: var(--accent); background: var(--active); }
.dist-mode input { margin-top: 3px; }
.dist-mode span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.dist-mode small { color: var(--muted); font-size: 12.5px; }
.dist-opts { display: flex; flex-direction: column; gap: 10px; }
.dist-opts .field { margin: 0; }
.dist-opts input[type=number] { width: 120px; }
.dist-people { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.dist-people label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.dist-admin { font-size: 11px; color: var(--muted); }
.dist-paused, .dist-online { font-size: 11px; padding: 1px 7px; border-radius: 999px; font-weight: 600; }
.dist-paused { background: rgba(240, 173, 78, .18); color: #a86a00; }
.dist-online { background: rgba(37, 211, 102, .15); color: #128c4a; }

/* ---------- central de configurações ---------- */
.st { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; padding-bottom: 30px; }
.st-me { display: flex; align-items: center; gap: 14px; padding: 6px 4px; }
.st-me b { display: block; font-size: 17px; }
.st-me small { color: var(--muted); }
.st h4 { margin: 0 0 8px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }
.st-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.st-item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 13px 16px; border: 0; background: none; color: var(--text);
  text-align: left; cursor: pointer; font: inherit; border-bottom: 1px solid var(--border); }
.st-item:last-child { border-bottom: 0; }
.st-item:not(.static):hover { background: var(--hover); }
.st-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); flex: none; }
.st-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-txt b { font-weight: 600; font-size: 14.5px; }
.st-txt small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.st-go { color: var(--faint); font-size: 22px; line-height: 1; }
.st-chip { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--hover); color: var(--muted); white-space: nowrap; }
.st-chip.ok { background: rgba(37, 211, 102, .14); color: #128c4a; }
.st-chip.warn { background: rgba(240, 173, 78, .18); color: #a86a00; }
.st-chip.bad { background: rgba(220, 53, 69, .12); color: var(--danger); }
.st-logout { align-self: center; display: inline-flex; align-items: center; gap: 8px; color: var(--danger); }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--border); transition: background .15s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; background: var(--hover); border-radius: 10px; padding: 3px; gap: 2px; flex: none; }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 8px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
@media (max-width: 560px) {
  .st-item { padding: 12px; gap: 12px; }
  .st-item.static { flex-wrap: wrap; }
  .st-item.static .seg { margin-left: 50px; }
  .st-chip { display: none; }
}

/* ---------- fluxos automáticos ---------- */
.flow-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 16px; font-size: 13px; background: var(--accent-soft); color: var(--text); border-bottom: 1px solid var(--border); }
.flow-bar .btn { padding: 4px 10px; font-size: 12.5px; }
.fl-list { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.fl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fl-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.fl-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.fl-table .num { text-align: right; width: 90px; }
.fl-sub { font-size: 12.5px; margin-top: 2px; }
.fl-act { text-align: right; white-space: nowrap; }
.fl-act .btn { margin-left: 4px; }
.fl-empty { text-align: center; padding: 40px 16px; border: 1px dashed var(--border); border-radius: 16px; }
.fl-pick { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; max-height: 50vh; overflow-y: auto; }
.page-body.fl-body { padding: 0; overflow: hidden; }
.page-tools .fl-name { width: 200px; font-weight: 600; }
.page-tools #fl-keywords { width: 210px; }
.fl-active { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
#fl-save.pulse { box-shadow: 0 0 0 3px rgba(240, 173, 78, .45); }
.fl-wrap { display: flex; height: 100%; min-height: 0; }
.fl-palette { width: 220px; flex: none; overflow-y: auto; padding: 12px; border-right: 1px solid var(--border); background: var(--panel); display: flex; flex-direction: column; gap: 6px; }
.fl-pal-title { font-weight: 700; font-size: 13px; padding: 2px 4px 6px; display: flex; justify-content: space-between; align-items: baseline; }
.fl-pal-title small { font-weight: 400; font-size: 11.5px; }
.fl-pal { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); cursor: grab; text-align: left; font: inherit; }
.fl-pal:hover { border-color: var(--accent); background: var(--hover); }
.fl-pal span:last-child { display: flex; flex-direction: column; min-width: 0; }
.fl-pal b { font-size: 13px; font-weight: 600; }
.fl-pal small { font-size: 11.5px; color: var(--muted); }
.fl-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; color: #fff; background: var(--c, var(--cobret)); }
.fl-stage { flex: 1; position: relative; min-width: 0; }
.fl-canvas { position: absolute; inset: 0; background-color: var(--chat-bg); background-image: radial-gradient(var(--chat-dots) 1.2px, transparent 1.2px); background-size: 22px 22px; }
.fl-zoom { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 4px; box-shadow: var(--shadow); z-index: 3; }
.fl-zoom .icon { width: auto; min-width: 32px; padding: 0 8px; font-weight: 700; font-size: 13px; }
.fl-hint { position: absolute; left: 14px; bottom: 14px; max-width: min(560px, calc(100% - 260px)); font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; z-index: 3; }

/* blocos (sobrepõe o tema padrão do Drawflow) */
/* sombra colorida com a cor do ícone de cada bloco (--fc vem do editor) */
#fl-canvas .drawflow-node { --fl-shadow: 0 14px 34px -6px color-mix(in srgb, var(--fc, #000) 70%, transparent), 0 4px 12px -2px color-mix(in srgb, var(--fc, #000) 42%, transparent), 0 1px 3px rgba(0, 0, 0, .12); width: 270px; padding: 0; background: var(--panel); color: var(--text); border: 1.5px solid color-mix(in srgb, var(--fc, var(--border)) 35%, var(--border)); border-radius: 14px; box-shadow: var(--fl-shadow); min-height: 0; transition: box-shadow .2s, border-color .2s; }
#fl-canvas .drawflow-node:hover { background: var(--panel); }
#fl-canvas .drawflow-node.selected { background: var(--panel); border-color: var(--fc, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fc, var(--accent)) 28%, transparent), var(--fl-shadow); color: var(--text); }
#fl-canvas .drawflow-node .drawflow_content_node { width: 100%; }
#fl-canvas .drawflow-node .input, #fl-canvas .drawflow-node .output { width: 16px; height: 16px; background: var(--panel); border: 2.5px solid var(--accent); }
#fl-canvas .drawflow-node .input { left: -9px; }
#fl-canvas .drawflow-node .output { right: -9px; position: relative; }
#fl-canvas .drawflow-node .output:hover, #fl-canvas .drawflow-node .input:hover { background: var(--accent); }
#fl-canvas .drawflow-node .outputs { display: flex; flex-direction: column; gap: 14px; }
#fl-canvas .drawflow-node .output[data-label]::after { content: attr(data-label); position: absolute; left: 18px; top: -15px; white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; pointer-events: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
#fl-canvas .connection .main-path { stroke: var(--accent); stroke-width: 3px; }
#fl-canvas .connection .main-path:hover, #fl-canvas .connection .main-path.selected { stroke: var(--danger); }
#fl-canvas .drawflow-delete { background: var(--danger); color: #fff; border: 2px solid var(--panel); line-height: 26px; font-weight: 700; }
#fl-canvas .fl-start { width: 220px; }
.fl-h { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.fl-h b { flex: 1; }
.fl-stat { font-size: 11px; font-weight: 700; color: var(--accent-2); white-space: nowrap; }
.fl-wait { color: #a86a00; margin-left: 4px; }
.fl-b { padding: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.fl-b textarea, .fl-b input, .fl-b select { width: 100%; font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.fl-b textarea { resize: vertical; min-height: 38px; }
.fl-row { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.fl-row .fl-num { width: 64px; flex: none; }
.fl-row select { flex: 1; }
.fl-row .fl-var { flex: 1; }
.fl-check { display: flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
.fl-check input { width: auto !important; }
.fl-note { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.fl-vars { display: flex; flex-wrap: wrap; gap: 4px; }
.fl-vars button { border: 1px dashed var(--border); background: none; color: var(--accent-2); border-radius: 6px; font-size: 11px; padding: 1px 6px; cursor: pointer; font-family: var(--mono, monospace); }
.fl-vars button:hover { border-color: var(--accent); }
.fl-opts { display: flex; flex-direction: column; gap: 6px; }
.fl-opt { display: grid; grid-template-columns: 18px 1fr 26px; gap: 4px; align-items: center; }
.fl-opt .fl-kw { grid-column: 2 / 4; font-size: 11.5px; padding: 4px 8px; }
.fl-opt b { color: var(--accent-2); text-align: center; }
.fl-emojis { display: flex; flex-wrap: wrap; gap: 4px; }
.fl-emojis button { font-size: 20px; border: 1px solid var(--border); background: none; border-radius: 8px; width: 38px; height: 36px; cursor: pointer; }
.fl-emojis button.on { border-color: var(--accent); background: var(--accent-soft); }
.fl-thumb { max-width: 100%; max-height: 140px; border-radius: 8px; object-fit: contain; align-self: center; }
.fl-thumb.st { width: 96px; height: 96px; }
.fl-file { padding: 8px; border-radius: 8px; background: var(--hover); word-break: break-all; }
.fl-file.empty { color: var(--muted); text-align: center; }
.fl-b audio { width: 100%; height: 34px; }
.fl-up { align-self: flex-start; }
.fl-lbl { display: flex; flex-direction: column; gap: 3px; color: var(--muted); }
@media (max-width: 720px) {
  .fl-palette { width: 150px; padding: 8px; }
  .fl-pal small, .fl-hint { display: none; }
  .page-tools .fl-name, .page-tools #fl-keywords { width: 120px; }
}

/* agentes de IA */
.ag { display: flex; flex-direction: column; gap: 12px; min-width: min(560px, 100%); }
.ag .field { margin: 0; }
.ag textarea { width: 100%; resize: vertical; }
.ag-chat { display: flex; flex-direction: column; gap: 6px; max-height: 280px; min-height: 90px; overflow-y: auto; padding: 10px; border-radius: 12px; background: var(--chat-bg); border: 1px solid var(--border); }
.ag-b { max-width: 82%; padding: 7px 10px; border-radius: 10px; font-size: 13.5px; white-space: pre-wrap; box-shadow: var(--shadow-sm); }
.ag-b.client { align-self: flex-start; background: var(--in); }
.ag-b.agent { align-self: flex-end; background: var(--out); }
.ag-b.typing { opacity: .6; font-style: italic; }
.ag-end { align-self: center; font-size: 12.5px; color: var(--muted); background: var(--panel); border-radius: 999px; padding: 3px 10px; }

/* PIX e campanhas */
.fl-amount { max-width: 110px; }
.fl-pixout { font-size: 11.5px; display: flex; flex-direction: column; gap: 4px; }
.fl-pixout code { word-break: break-all; font-size: 10.5px; padding: 6px; border-radius: 6px; background: var(--hover); max-height: 70px; overflow: auto; }
.pix-ok { color: #128c4a; font-weight: 600; }
.pix-bad { color: var(--danger); font-weight: 600; }
.cp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-tags .tag { cursor: pointer; opacity: .45; }
.cp-tags .tag.on { opacity: 1; box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.cp-count { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.cp-prog { min-width: 180px; }
.cp-prog small { color: var(--muted); font-size: 12px; }
.cp-prog .bk-progress { margin-bottom: 4px; }

/* etapas do funil */
.stg-list { display: flex; flex-direction: column; gap: 6px; }
.stg-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 30px 30px 30px; gap: 6px; align-items: center; }
.stg-row input { min-width: 0; }
.stg-row input[type=color] { width: 40px; height: 34px; padding: 2px; border-radius: 8px; }

#fl-canvas .drawflow-node.fl-missing { border-color: #e9a100; box-shadow: 0 0 0 3px rgba(233, 161, 0, .3), var(--fl-shadow); }

/* quadro do editor: movimento leve */
#fl-canvas .drawflow { will-change: transform; }
#fl-canvas.fl-moving .drawflow-node { transition: none !important; }
#fl-canvas.fl-moving .connection .main-path { transition: none !important; }
#fl-canvas .parent-drawflow, #fl-canvas { touch-action: none; overscroll-behavior: contain; }
.fl-zoom #fl-fit { font-weight: 600; }
@media (max-width: 900px) { .fl-hint { display: none; } }

/* seleção de vários blocos e ímã das ligações */
.fl-selbox { position: absolute; z-index: 5; border: 1.5px dashed var(--accent); background: rgba(19, 127, 144, .1); border-radius: 6px; pointer-events: none; }
#fl-canvas .drawflow-node.fl-multi { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--fl-shadow); }
#fl-canvas .drawflow-node.fl-snap { border-color: #16a34a; box-shadow: 0 0 0 4px rgba(22, 163, 74, .25), var(--fl-shadow); transition: border-color .25s, box-shadow .25s; }
#fl-canvas .drawflow-node.fl-snap .input { background: #16a34a; border-color: #16a34a; transform: scale(1.35); transition: transform .3s cubic-bezier(.4, 0, .2, 1), background .3s; }
.fl-selhint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4; background: var(--accent); color: var(--on-accent); font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow); white-space: nowrap; }

/* animações das ligações */
#fl-canvas .connection .main-path.fl-tension { stroke: #e9a100; transition: none; filter: drop-shadow(0 0 3px rgba(233, 161, 0, .5)); }
#fl-canvas .connection.fl-snapped .main-path { animation: fl-snap .28s ease-out; }
@keyframes fl-snap { 0% { stroke: #e9a100; stroke-width: 6px; } 100% { stroke-width: 3px; } }
#fl-canvas.fl-pulling, #fl-canvas.fl-pulling * { cursor: grabbing !important; }
#fl-canvas .drawflow-node .input { cursor: grab; transition: transform .15s; }
#fl-canvas .drawflow-node .input.fl-popped { animation: fl-pop .4s ease-out; }
@keyframes fl-pop { 0% { transform: scale(1.6); background: #e9a100; } 60% { transform: scale(.85); } 100% { transform: scale(1); } }
#fl-canvas .fl-tendril { pointer-events: none; z-index: 2; }
#fl-canvas .fl-tendril path { fill: none; stroke: #16a34a; stroke-width: 3px; stroke-linecap: round; stroke-dasharray: 2 7; animation: fl-flow 1.1s linear infinite; opacity: .9; }
#fl-canvas .fl-tendril.fl-joined path { stroke-dasharray: none; animation: fl-join .5s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes fl-flow { to { stroke-dashoffset: -16; } }
@keyframes fl-join { 0% { stroke-width: 6px; opacity: 1; } 100% { stroke-width: 2px; opacity: 0; } }
#fl-canvas .drawflow-node.fl-linked { animation: fl-linked .7s ease-out; }
@keyframes fl-linked { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .55); } 100% { box-shadow: 0 0 0 14px rgba(22, 163, 74, 0); } }

/* telas (fluxos, tarefas, Trello, relatórios…) abrem ao lado da barra lateral, que fica sempre à mão */
@media (min-width: 721px) { .page { left: 68px; } }

/* menu: o que fazer com resposta fora das opções */
.fl-fail { display: grid; gap: 6px; margin-top: 4px; padding: 8px; border-radius: 8px; background: color-mix(in srgb, var(--fc, #6366f1) 8%, transparent); border: 1px dashed color-mix(in srgb, var(--fc, #6366f1) 35%, transparent); }
.fl-fail > b { font-size: 12.5px; }

/* conversa com fluxo automático rodando */
.flow-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; line-height: 17px; padding: 0 7px 0 5px; border-radius: 999px;
  color: var(--accent-2); background: var(--accent-soft); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-pill svg { flex: none; }
.flow-pill.waiting svg { animation: flowPulse 1.6s ease-in-out infinite; }
@keyframes flowPulse { 50% { opacity: .35; } }

/* fundo do quadro: mãozinha para arrastar */
#fl-canvas, #fl-canvas > .drawflow { cursor: grab; }
#fl-canvas:active:not(:has(.drawflow-node:active)), #fl-canvas.fl-grabbing, #fl-canvas.fl-grabbing * { cursor: grabbing; }

/* ---------- vários números de WhatsApp ---------- */
.num-bar { display: flex; gap: 6px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; }
.num-bar::-webkit-scrollbar { display: none; }
.num-bar .nb { display: inline-flex; align-items: center; gap: 6px; flex: none; border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.num-bar .nb.on { border-color: var(--nc, var(--accent)); background: color-mix(in srgb, var(--nc, var(--accent)) 14%, var(--panel)); font-weight: 600; }
.nb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--nc, var(--accent)); flex: none; display: inline-block; }
.nb-dot.off { background: transparent; box-shadow: inset 0 0 0 2px var(--nc, var(--accent)); }
.nb-count { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }
.num-pill { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; line-height: 17px; padding: 0 7px; border-radius: 999px;
  color: color-mix(in srgb, var(--nc) 75%, var(--text)); background: color-mix(in srgb, var(--nc) 15%, transparent); border: 1px solid color-mix(in srgb, var(--nc) 45%, transparent);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 16px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--panel); }
.num-info a { text-decoration: none; }
.num-info .ni-off { color: var(--danger, #c0392b); font-weight: 600; }
.num-info.warn { background: color-mix(in srgb, var(--danger, #c0392b) 8%, var(--panel)); }
#chat.num-off .composer { opacity: .45; pointer-events: none; }
.num-cards { display: grid; gap: 10px; margin: 10px 0; }
.num-card { border: 1px solid var(--border); border-left: 4px solid var(--nc); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; background: var(--panel); }
.nc-head { display: flex; align-items: center; gap: 8px; }
.nc-head input[type=color] { width: 26px; height: 26px; border: none; padding: 0; background: none; cursor: pointer; }
.nc-name { font-size: 14.5px; }
.nc-qr { display: grid; justify-items: center; gap: 6px; padding: 6px 0; }
.nc-qr .qr { background: #fff; padding: 8px; border-radius: 10px; }
.nc-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.nc-add { display: flex; gap: 8px; }
.nc-add input { flex: 1; }
.num-pick { display: grid; gap: 8px; }
.num-pick .btn { justify-content: flex-start; gap: 8px; }

/* fluxo: em quais números o gatilho dispara */
.fl-nums { position: relative; }
.fl-nums summary { cursor: pointer; list-style: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; background: var(--panel); white-space: nowrap; }
.fl-nums summary::-webkit-details-marker { display: none; }
.fl-nums[open] summary { border-color: var(--accent); }
.fl-nums-box { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 260px; display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.18)); }
.fl-nums-box .help { margin: 0; }
.fl-nums-box label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* seletor de número: campo acima da busca que abre a lista */
.num-bar { display: block; padding: 10px 12px 0; overflow: visible; }
.num-select { position: relative; }
.ns-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 12px; min-height: 44px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ns-btn:hover, .num-select.open .ns-btn { border-color: var(--accent); background: var(--panel); }
.ns-txt { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.ns-txt b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-txt small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-chev { color: var(--muted); display: inline-flex; flex: none; transition: transform .15s; }
.num-select.open .ns-chev { transform: rotate(180deg); }
.ns-dots { display: inline-flex; flex: none; }
.ns-dots .nb-dot + .nb-dot { margin-left: -3px; box-shadow: 0 0 0 2px var(--panel-2); }
.ns-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; padding: 6px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel); box-shadow: 0 12px 32px rgba(0, 0, 0, .28); max-height: 60vh; overflow-y: auto; }
.num-select.open .ns-menu { display: grid; gap: 2px; }
.ns-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ns-opt:hover, .ns-opt:focus-visible { background: var(--panel-2); outline: none; }
.ns-opt.on { background: var(--accent-soft); }
.ns-check { width: 16px; flex: none; color: var(--accent); display: inline-flex; }
.num-bar + .search { padding-top: 8px; }

/* anúncios e vendas */
.ad-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; line-height: 17px; padding: 0 7px 0 5px; border-radius: 999px;
  color: #b4306e; background: color-mix(in srgb, #d6249f 12%, transparent); white-space: nowrap; }
.ad-pill.facebook { color: #1b5fc1; background: color-mix(in srgb, #1877f2 12%, transparent); }
.ad-pill svg { flex: none; }
.ad-thumb { flex: none; border-radius: 8px; object-fit: cover; background: var(--panel-2); border: 1px solid var(--border); }
.ad-thumb.none { visibility: hidden; }
.ad-info { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, #d6249f 5%, var(--panel)); font-size: 12.5px; }
.ad-info .ai-txt { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.ad-info .ai-txt b { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.ad-info .ai-title { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-info small { color: var(--muted); }
.ad-info .ai-open { padding: 4px 10px; font-size: 12px; text-decoration: none; white-space: nowrap; }
.ad-info .ai-close { flex: none; }
.crm-ad { display: flex; gap: 8px; align-items: center; padding: 4px 0; color: var(--text); }
.crm-ad b, .crm-sale b { display: block; font-size: 13px; }
.crm-ad small, .crm-sale small { color: var(--muted); font-size: 11.5px; }
#crm-ads h5 { margin: 10px 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.crm-sale { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 6px 0; border-top: 1px solid var(--border); color: var(--text); }
.crm-sale small { grid-column: 1; }
.crm-sale a, .crm-sale > span { grid-column: 2; grid-row: 1; font-size: 12px; }
.crm-sale.canceled b { text-decoration: line-through; color: var(--muted); }
.tbl-wrap { overflow-x: auto; }
.ads-tbl .ad-cell { display: flex; gap: 10px; align-items: center; min-width: 240px; white-space: normal; }
.ads-tbl .ad-cell small, .ads-tbl .organic small { display: block; color: var(--muted); font-size: 11.5px; }
.ads-tbl .organic td { background: var(--panel-2); }
.warn-text { color: var(--warn, #b7791f); }

/* anúncios: gasto (fase 2) */
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); font-size: 13px; color: var(--muted); }
.meta-line b { color: var(--text); }
.meta-line .btn { padding: 4px 10px; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.meta-line.err { border-color: color-mix(in srgb, var(--danger, #c0392b) 40%, var(--border)); color: var(--danger, #c0392b); }
.meta-line.off { background: color-mix(in srgb, #d6249f 5%, var(--panel)); }
.kpi.good .v { color: var(--ok, #1a8f4c); }
.kpi.bad .v { color: var(--danger, #c0392b); }
.ads-tbl td.pos { color: var(--ok, #1a8f4c); }
.ads-tbl td.neg { color: var(--danger, #c0392b); }
.ad-live { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 600; line-height: 16px; vertical-align: 1px;
  color: var(--ok, #1a8f4c); background: color-mix(in srgb, var(--ok, #1a8f4c) 12%, transparent); }
.ads-chart { margin-bottom: 14px; }
.ads-chart h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ads-chart .lg { display: inline-flex; align-items: center; gap: 4px 10px; font-size: 12px; font-weight: 500; color: var(--muted); }
.ads-chart .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 2px; vertical-align: -1px; }
.ads-chart svg { width: 100%; height: 180px; display: block; }
.ads-chart .bar-spend, .ads-chart .sw.spend { fill: color-mix(in srgb, var(--muted) 55%, transparent); background: color-mix(in srgb, var(--muted) 55%, transparent); }
.ads-chart .bar-rev, .ads-chart .sw.rev { fill: var(--accent); background: var(--accent); }
.ads-chart .axis { stroke: var(--border); }
.ads-chart text { font-size: 10px; fill: var(--muted); }
.capi-tbl td { font-size: 12.5px; vertical-align: top; }
.capi-tbl td:nth-child(4) { max-width: 260px; }

.fl-ads .fl-nums-box { width: 320px; max-height: 380px; overflow: auto; }
.ad-pill.link { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ai-link { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); flex: none; }
.route-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: center; padding: 8px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 10px; }
.route-row select { min-width: 0; width: 100%; }
.route-row .rt-match { grid-column: 1 / 3; }
.route-row .rt-del { grid-column: 3; grid-row: 1; }
.link-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; display: grid; gap: 6px; }
.link-item.off { opacity: .6; }
.link-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.link-stats { margin-left: auto; font-size: 12.5px; color: var(--muted, #777); }
.link-url { flex: 1; min-width: 0; font-size: 12.5px; }
.link-new { margin-bottom: 12px; }

.kb-intro p { margin: 0 0 6px; }
.kb-list { display: grid; gap: 10px; margin-top: 12px; }
.kb-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--panel); }
.kb-item[role=button] { cursor: pointer; }
.kb-item[role=button]:hover { border-color: var(--accent); }
.kb-item.off { opacity: .6; }
.kb-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kb-cat { font-size: 12px; color: var(--muted, #777); }
.kb-tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.kb-tag.off { background: color-mix(in srgb, var(--muted, #777) 18%, transparent); color: var(--muted, #777); }
.kb-body { margin: 6px 0 4px; white-space: pre-wrap; font-size: 13.5px; }
.kb-answer { border-left: 3px solid var(--accent); padding: 8px 12px; background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 0 8px 8px 0; white-space: pre-wrap; }

/* alerta de tempo de espera */
.sla-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.sla-pill.warn { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #b45309; }
.sla-pill.late { background: color-mix(in srgb, #ef4444 16%, transparent); color: #dc2626; }
.sla-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; flex: none; }
.sla-dot.warn { background: #f59e0b; } .sla-dot.late { background: #ef4444; }
.sla-wait.warn { color: #d97706; } .sla-wait.late { color: #dc2626; }
.sla-tbl td { vertical-align: middle; }
.sla-row.sla-late td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
.sla-switch { justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.sla-switch > span { display: flex; flex-direction: column; }
.sla-times { gap: 6px; align-items: center; flex-wrap: wrap; }
.sla-times input { width: 70px; }
.sla-times .sla-dot.late { margin-left: 10px; }
.sla-off { opacity: .45; pointer-events: none; }
.sla-depts input { width: 80px; text-align: right; }
.kpi.bad .v { color: #dc2626; }
.h4-link { font-size: 12px; font-weight: 500; margin-left: 8px; }
:root[data-theme="dark"] .sla-pill.warn { color: #fbbf24; }
:root[data-theme="dark"] .sla-pill.late { color: #f87171; }
.sla-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; cursor: pointer; }
.sla-check input { margin-top: 3px; }
.sla-check span { display: flex; flex-direction: column; gap: 1px; }

/* ---------- produtos e estoque ---------- */
.modal-card:has(.pr-wide) { width: min(920px, 100%); }
.pr-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
.pr-grid .pr-span2 { grid-column: span 2; }
.pr-vars { overflow-x: auto; margin: 4px 0; }
.pr-vars table { min-width: 560px; }
.pr-vars th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.pr-vars td { padding: 4px; }
.pr-vars input { width: 100%; min-width: 70px; }
.pr-vars td.pr-stock { white-space: nowrap; }
.pr-fiscal { margin: 10px 0 0; border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.pr-fiscal summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 2px 0; }
.pr-fiscal[open] summary { margin-bottom: 8px; }
.pr-tbl td small { font-weight: 400; }
.pr-tbl code { font-size: 12px; }
.pr-tbl .pr-note { white-space: normal; max-width: 260px; color: var(--muted); }
tr.pr-off td { opacity: .55; }
.pr-probs { margin: 6px 0 0; padding-left: 18px; font-size: 13px; max-height: 180px; overflow-y: auto; }
.btn.sm { padding: 3px 9px; font-size: 12px; border-radius: 8px; }
.bad-text { color: var(--danger); }
.ok-text { color: var(--accent); }
@media (max-width: 640px) {
  .pr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pr-grade { border: 1px dashed var(--border); border-radius: 12px; padding: 10px 12px; margin: 4px 0 8px; }
.pr-grid.pr-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pr-vars td.num, .pr-vars th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- caixa (PDV) ---------- */
.pdv { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.pdv-search { position: relative; margin-bottom: 12px; }
.pdv-search input { width: 100%; font-size: 17px; padding: 13px 16px; border-radius: 12px; }
.pdv-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto; }
.pdv-res { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.pdv-res:last-child { border-bottom: 0; }
.pdv-res.on, .pdv-res:hover { background: var(--accent-soft); }
.pdv-res-r { text-align: right; white-space: nowrap; }
.pdv-cart { min-height: 260px; }
.pdv-tbl td { vertical-align: middle; }
.pdv-tbl tr.pdv-last td { background: var(--accent-soft); }
.pdv-qty { display: inline-flex; align-items: center; gap: 2px; }
.pdv-qty input { width: 58px; text-align: center; padding: 5px 4px; }
.pdv-qty .icon { width: 26px; height: 26px; font-size: 16px; }
.pdv-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 230px; color: var(--muted); text-align: center; }
.pdv-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; }
.pdv-cust summary { cursor: pointer; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.pdv-totals { display: flex; flex-direction: column; gap: 6px; }
.pdv-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.pdv-line input { width: 110px; text-align: right; }
.pdv-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.pdv-total span { font-weight: 600; }
.pdv-total b { font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pdv-pay { font-size: 16px; padding: 12px; }
.btn kbd, .pdv-pay kbd { font: 11px/1 inherit; opacity: .75; border: 1px solid currentColor; border-radius: 4px; padding: 2px 4px; margin-left: 4px; }
.pdv-methods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pdv-payrow { display: grid; grid-template-columns: 1fr 130px auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.pdv-payrow input { text-align: right; }
.pdv-paysum { margin-top: 8px; }
.pdv-pix { display: flex; gap: 14px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin: 6px 0; }
.pdv-pix img { background: #fff; border-radius: 8px; padding: 4px; }
.pdv-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; color: var(--accent); }
.pdv-done h3 { color: var(--text); margin: 4px 0 !important; }
.pdv-done .pdv-total { width: 100%; color: var(--text); }
/* nome do produto quebra linha em vez de alargar a venda */
.pdv-tbl td:first-child { white-space: normal; overflow-wrap: anywhere; }
.pdv-unit { display: none; }
@media (max-width: 900px) {
  .pdv { grid-template-columns: minmax(0, 1fr); }
  .pdv-side { position: static; }
}
@media (max-width: 560px) {
  /* celular: o preço unitário vai para baixo do nome e a quantidade fica mais estreita */
  .pdv-tbl th:nth-child(3), .pdv-tbl td:nth-child(3) { display: none; }
  .pdv-unit { display: inline; }
  .pdv-tbl th, .pdv-tbl td { padding: 8px 4px; }
  .pdv-qty input { width: 40px; }
  .pdv-payrow { grid-template-columns: minmax(0, 1fr) 96px auto auto; gap: 6px; }
  /* listas de produtos, vendas e caixas: só as colunas principais, com os nomes quebrando linha */
  .m-hide { display: none; }
  .pr-tbl td:not(.num) { white-space: normal; overflow-wrap: anywhere; }
  .pr-tbl th, .pr-tbl td { padding-left: 5px; padding-right: 5px; }
  .us-tbl td:first-child { white-space: normal; overflow-wrap: anywhere; }
  .us-tbl td:first-child small { margin-left: 0 !important; }
  /* variações do produto: cada linha vira um cartão com os campos rotulados */
  .pf-grid table, .pf-grid tbody { display: block; min-width: 0; }
  .pf-grid tr:first-child { display: none; }
  .pf-grid tr[data-i] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
  .pf-grid td { display: block; padding: 0; min-width: 0; }
  .pf-grid td[data-l]::before { content: attr(data-l); display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
  .pf-grid input { min-width: 0; }
  .pf-grid td.pf-del { grid-column: 1 / -1; text-align: right; }
}

.pr-tbl .pr-code { width: 1%; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; padding-right: 4px; }
.pr-codeline { margin: -8px 0 12px; }
.pr-codechip { display: inline-block; background: var(--accent-soft); color: var(--accent-2); border-radius: 6px; padding: 1px 8px; font-variant-numeric: tabular-nums; }

.pdv-cmd { background: var(--hover); border-radius: 8px; padding: 8px 10px; font-size: 12px; white-space: pre-wrap; word-break: break-all; margin: 6px 0 10px; user-select: all; }

.pdv-open { max-width: 420px; margin: 40px auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; color: var(--accent); }
.pdv-open h3 { color: var(--text); margin: 4px 0; }
.pdv-open .field { width: 100%; text-align: left; color: var(--text); }
.pdv-open input { font-size: 18px; text-align: right; }
.pdv-session { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.pdv-session-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pdv-kpis { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pdv-kpis .kpi { padding: 10px 12px; }
.pdv-kpis .kpi .v { font-size: 18px; }

.nf-box { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-radius: 10px; padding: 8px 12px; margin: 10px 0; font-size: 13px; background: var(--hover); }
.nf-box.authorized { background: var(--accent-soft); color: var(--accent-2); }
.nf-box.rejected { background: var(--danger-soft); color: var(--danger); }
.nf-box.pending { background: rgba(217, 148, 0, .12); color: var(--warn); }
.pdv-cont { display: flex; flex-direction: column; gap: 4px; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; background: var(--hover); }
.pdv-cont.on { background: rgba(217, 148, 0, .12); color: var(--warn); }
.pdv-cont small { color: inherit; opacity: .9; }
.pdv-cont .btn { margin-top: 4px; }
.nf-gaps td, .nf-gaps th { padding: 5px 6px; font-size: 13px; }
.nf-cert { margin-bottom: 6px; }
.nf-cert input[type=file] { max-width: 100%; min-width: 0; }
/* séries da NFC-e: tabela pequena, cabe no celular sem rolar */
.pr-vars.nf-series table { min-width: 0; width: 100%; }
.nf-series .nf-s-serie { width: 64px; }
.nf-series .nf-s-next { width: 104px; }
@media (max-width: 560px) {
  .nf-series th { white-space: normal; }
  .nf-series td { padding: 3px 2px; }
  .nf-series input { min-width: 0; }
  .nf-series .nf-s-serie { width: 48px; }
  .nf-series .nf-s-next { width: 76px; }
}

/* ---------- relatórios do caixa (vendas e estoque) ---------- */
.prr-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.prr-filters select, .prr-filters input[type=date] { width: auto; max-width: 100%; }
.prr-inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.prr-chart { margin-bottom: 16px; }
.prr-bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; align-items: end; height: 170px; padding-bottom: 20px; position: relative; border-bottom: 1px solid var(--border); }
.prr-bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; cursor: default; }
.prr-bar i { display: block; width: min(100%, 28px); background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; transition: opacity .15s; }
.prr-bar span { position: absolute; top: 100%; margin-top: 4px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.prr-bars:hover .prr-bar i { opacity: .55; }
.prr-bars .prr-bar:hover i, .prr-bar:focus i { opacity: 1; }
.prr-bar:hover::after, .prr-bar:focus::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 3;
  background: var(--text); color: var(--panel); font-size: 12px; font-weight: 600; padding: 5px 8px; border-radius: 7px; white-space: nowrap; pointer-events: none;
}
.prr-bar:first-child:hover::after, .prr-bar:first-child:focus::after, .prr-bar:nth-child(2):hover::after, .prr-bar:nth-child(2):focus::after { left: 0; transform: none; }
.prr-bar:last-child:hover::after, .prr-bar:last-child:focus::after, .prr-bar:nth-last-child(2):hover::after, .prr-bar:nth-last-child(2):focus::after { left: auto; right: 0; transform: none; }
.prr-side { display: flex; flex-direction: column; gap: 16px; }
.prr-shares td { white-space: normal; }
.prr-share-td { width: 30%; min-width: 70px; }
.prr-share { height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.prr-share i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.prr-mobile-only { display: none; }
@media (max-width: 560px) {
  .prr-filters > * { flex: 1 1 auto; }
  .prr-filters .export-btn { flex: 1 1 45%; }
  .prr-bars { height: 140px; }
  .prr-share-td { min-width: 52px; }
  .prr-mobile-only { display: inline; }
}
.prr-tbl td:first-child { white-space: normal; overflow-wrap: anywhere; min-width: 130px; }
@media (max-width: 560px) { .prr-tbl td:first-child { min-width: 0; } }
.nowrap { white-space: nowrap; }

/* ---------- player de áudio das mensagens (duração aparece antes de tocar) ---------- */
.vp { display: flex; align-items: center; gap: 10px; width: 280px; max-width: 100%; padding: 4px 2px; }
.vp-play { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--accent); color: var(--on-accent); padding: 0; }
.vp-play:hover { filter: brightness(1.08); }
.vp-track { flex: 1; min-width: 60px; height: 22px; display: flex; align-items: center; cursor: pointer; position: relative; outline: none; }
.vp-track::before { content: ''; position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 35%, transparent); }
.vp-fill { position: relative; height: 4px; border-radius: 2px; background: var(--accent); }
.vp-fill::after { content: ''; position: absolute; right: -6px; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.vp-track:focus-visible::before { box-shadow: 0 0 0 2px var(--accent-soft); }
.vp-time { flex: none; min-width: 36px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.vp-speed { flex: none; border: 1px solid var(--border); background: none; color: var(--muted); font: 600 11.5px var(--font); border-radius: 10px; padding: 2px 7px; cursor: pointer; }
.vp.on .vp-time { color: var(--text); }

/* busca na lista de conversas: trecho da mensagem encontrada, com a palavra destacada */
.chat-hit mark, .chat-name mark { background: rgba(255, 196, 0, .35); color: inherit; border-radius: 3px; padding: 0 1px; }
.chat-hit { color: var(--text); }

/* ---------- pedidos pelo WhatsApp ---------- */
.order-bar { display: flex; align-items: center; gap: 10px; padding: 7px 16px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); font-size: 13px; }
.order-bar > span { flex: 1; min-width: 0; }
.order-bar .ico { color: var(--accent); flex: none; }
.ord h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ord h3 small { font-weight: 500; }
.ord-pill { font-size: 12px; font-weight: 600; border: 1px solid currentColor; border-radius: 999px; padding: 1px 9px; }
.ord h3 #ord-chat { margin-left: auto; }
.ord-search { margin: 8px 0 10px; }
.ord-items { max-height: 38vh; overflow-y: auto; margin-bottom: 10px; }
.ord-empty { text-align: center; padding: 18px 8px; margin: 0; }
.ord-grid { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr); gap: 12px; align-items: end; }
.ord-tot { text-align: right; font-size: 12.5px; }
.ord-tot .pdv-total { border-top: 0; margin: 0; padding: 0; justify-content: flex-end; gap: 12px; }
.ord .seg { margin-top: 4px; }
.ord-preview { margin: 6px 0 10px; font-size: 13px; }
.ord-preview summary { cursor: pointer; color: var(--accent-2); font-weight: 600; }
.ord-preview pre { white-space: pre-wrap; font: 13px/1.45 var(--font); background: var(--hover); border-radius: 10px; padding: 10px 12px; margin: 8px 0 4px; }
.ord-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.ord-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ord-pay label { font-weight: 600; margin-right: auto; }
.ord-pay select { width: auto; }
.ord-cancel { color: var(--danger); }
@media (max-width: 560px) {
  .ord-grid { grid-template-columns: 1fr; }
  .ord-pay label { width: 100%; }
  .ord-pay select, .ord-pay .btn { flex: 1 1 auto; }
}
@media (max-width: 560px) {
  /* no pedido a 3ª coluna é o total do item (no Caixa é o preço unitário, que some no celular) */
  .ord-tbl th:nth-child(3), .ord-tbl td:nth-child(3) { display: table-cell; }
}

/* números de WhatsApp: aparelho conectado (tipo que o WhatsApp informa + apelido) */
.nc-device { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 4px; }
.nc-device .icon { width: 26px; height: 26px; }

/* ---------- fotos dos produtos e "mandar produto" na conversa ---------- */
.am-prod { background: #f59e0b; }
.pr-photos { margin: 0 0 6px; }
.pr-ph-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pr-ph { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--hover); flex: none; }
.pr-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pr-ph-main { position: absolute; left: 4px; bottom: 4px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.pr-ph-cover, .pr-ph-del { position: absolute; top: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; padding: 0; }
.pr-ph-cover { left: 4px; } .pr-ph-del { right: 4px; }
.pr-ph-add { display: grid; place-items: center; align-content: center; gap: 2px; cursor: pointer; color: var(--muted); border-style: dashed; }
.pr-ph-add:hover { border-color: var(--accent); color: var(--accent); }
.pr-thumb { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; float: left; margin: 1px 8px 0 0; }
.ps #ps-q { width: 100%; margin-bottom: 10px; }
.ps-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; }
.ps-item { display: flex; gap: 10px; align-items: center; text-align: left; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.ps-item:hover { border-color: var(--accent); }
.ps-th { width: 52px; height: 52px; border-radius: 9px; overflow: hidden; background: var(--hover); display: grid; place-items: center; font-size: 22px; flex: none; }
.ps-th img { width: 100%; height: 100%; object-fit: cover; }
.ps-tx { display: flex; flex-direction: column; min-width: 0; }
.ps-tx b, .ps-tx small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.ps-ph { position: relative; width: 92px; height: 92px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid var(--border); background: var(--hover); cursor: pointer; }
.ps-ph.on { border-color: var(--accent); }
.ps-ph img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .55; }
.ps-ph.on img { opacity: 1; }
.ps-ph .lib-n, .ps .lib-n { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.ps textarea { width: 100%; }
.ps-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* pedido pago: NFC-e (pergunta depois de confirmar o pagamento) */
.ord-nfce { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; margin: 4px 0 12px; font-size: 13.5px; }
.ord-nfce.ask { border-color: var(--accent); background: var(--accent-soft); }
.ord-nfce-acts { display: flex; gap: 6px; margin-left: auto; }

/* Caixa › Vendas e Caixas: período de/até */
.pdv-range { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pdv-range input[type=date] { width: auto; }

/* ---------- clientes ---------- */
.cu .seg { margin: 0 0 10px; }
.cu h4 { margin: 14px 0 6px; font-size: 13.5px; }
.cu h4 small { font-weight: 500; }
.cu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cu-inline { display: flex; gap: 6px; }
.cu-inline input { flex: 1; min-width: 0; }
.cu-tbl .kb-tag { white-space: nowrap; }
.cu-prev { margin: 8px 0; padding-left: 18px; }
.cu-errs { font-size: 13px; margin: 6px 0; }
.cu-errs ul { margin: 6px 0; padding-left: 18px; max-height: 160px; overflow-y: auto; }
@media (max-width: 560px) { .cu-grid { grid-template-columns: minmax(0, 1fr); } .cu-grid .pr-span2 { grid-column: auto; } }
.cu-crm { font-size: 13.5px; line-height: 1.45; }
.cu-crm-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
#cu-find-box input { width: 100%; margin-top: 8px; }
#cu-find-res { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.cu-pick { text-align: left; }
.pdv-cu { position: relative; }

/* ---------- NF-e (nota para empresas) ---------- */
.nfe h4 { margin: 12px 0 6px; font-size: 13.5px; }
.nfe-cust { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; font-size: 13.5px; line-height: 1.45; }
.nfe-cust-acts { display: flex; gap: 6px; }
#nfe-cu-search { margin-top: 8px; }
#nfe-cu-search input { width: 100%; }
.nfe-cu-res { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.nfe .actions a.btn { text-decoration: none; }
.nfe-cu-res .cu-pick { justify-content: flex-start; text-align: left; white-space: normal; }

.nfe-transp { margin-top: 4px; }
.nfe-transp input#nfe-tr-q { width: 100%; margin-top: 6px; }
.nfe-carrier { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; }
.nfe-vol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; margin-top: 6px; }
.nfe-vol input { width: 100%; }
@media (max-width: 560px) { .nfe-vol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nfe-cce { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 4px; }
.nfe-cce-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; line-height: 1.45; }
.nfe-cce-item small { overflow-wrap: anywhere; }
.nfe-cce-acts { display: flex; gap: 4px; flex-shrink: 0; }
#nfe-cce-new { margin-top: 8px; }
#nfe-cce-form { margin-top: 8px; }
#nfe-cce-form textarea { width: 100%; }
@media (max-width: 560px) { .nfe-cce-item { flex-direction: column; } }

/* ---------- devolução de venda ---------- */
.ret-items { width: 100%; }
.ret-items td { vertical-align: middle; }
.ret-q { display: inline-flex; gap: 4px; align-items: center; justify-content: flex-end; }
.ret-q input { width: 70px; text-align: right; }
.ret-of-sale { margin: 10px 0; }
.ret-of-sale h4 { margin: 0 0 6px; font-size: 13.5px; }
.ret-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; margin-bottom: 4px; border: 1px solid var(--border); border-radius: 10px; background: none; color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.ret-row:hover { background: var(--hover); }
.nf-box.ask { outline: 2px solid var(--accent); }
@media (max-width: 560px) { .ret-q input { width: 56px; } .ret-items th:nth-child(3), .ret-items td:nth-child(3) { display: none; } }

/* notas de compra */
.nc-off { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.nc-state { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; font-size: 13px; margin-bottom: 14px; padding: 10px 14px; }
.nc-key { word-break: break-all; font-variant-numeric: tabular-nums; }
.nc-manif { display: flex; gap: 6px; flex-wrap: wrap; }
.nc-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.nc h4 { margin: 14px 0 6px; font-size: 14px; }
.nc-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.nc-item-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.nc-item-q { white-space: nowrap; font-variant-numeric: tabular-nums; }
.nc-act { margin: 8px 0 4px; }
.nc-act button { font-size: 12.5px; }
.nc-link { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; font-size: 13px; }
.nc-chosen { display: inline-flex; gap: 6px; align-items: center; padding: 5px 0; }
.nc-search { position: relative; flex: 1; min-width: 220px; }
.nc-search input { width: 100%; }
.nc-results { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nc-results button { text-align: left; border: 1px solid var(--border); background: var(--panel); color: inherit; font: inherit; font-size: 13px; padding: 6px 9px; border-radius: 8px; cursor: pointer; }
.nc-results button:hover { background: var(--hover); }
.nc-new { display: grid; grid-template-columns: 2fr 1fr 1.3fr; gap: 0 10px; }
.nc-new .field { margin-bottom: 4px; }
.nc-convrow { display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.nc-conv { display: inline-flex; gap: 6px; align-items: center; }
.nc-conv input { width: 70px; text-align: right; }
.nc-res { color: var(--muted); }
.nc-dups { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; margin: 0; }
@media (max-width: 560px) { .nc-new { grid-template-columns: 1fr; } }

/* automações do funil */
.fl-q { color: var(--accent); cursor: pointer; text-decoration: underline dotted; }
#fl-tcfg .fl-nums-box { width: 320px; }
#fl-tcfg .fl-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
#fl-tcfg .fl-lbl { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }

/* campos do contato e formulários */
.cf-manage { font-size: 12px; font-weight: 400; margin-left: 6px; }
.cf-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.cf-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.cf-name { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cf-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-ord { display: inline-flex; gap: 2px; }
.cf-form { border-top: 1px solid var(--border); margin-top: 10px; }
.cf-form:empty { display: none; }
.fm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.fm-fields { display: flex; flex-direction: column; gap: 4px; }
.fm-f { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 400; }
.fm-req { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); }
.fm-copy { display: flex; gap: 6px; align-items: flex-start; }
.fm-copy input, .fm-copy textarea { flex: 1; font-size: 12.5px; }

/* orçamento */
.ord-kind { display: flex; margin: 4px 0 10px; }
.ord-kind button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px; }
.ord-kind button small { font-size: 11px; opacity: .75; font-weight: 400; }

/* metas e comissões */
.gl-month { display: inline-flex; align-items: center; gap: 8px; }
.gl-bar { height: 8px; border-radius: 99px; background: var(--hover); overflow: hidden; min-width: 120px; margin-bottom: 3px; }
.gl-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.gl-bar.warn i { background: var(--warn, #d99400); }
.gl-bar.bad i { background: var(--danger); }
.gl-cell { min-width: 150px; }
.gl-mine { margin-bottom: 14px; }
.gl-mine .gl-bar { height: 12px; }
.gl-form { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.gl-row { display: grid; grid-template-columns: 1fr 130px 100px; gap: 8px; align-items: center; }
.gl-row input { text-align: right; }
.gl-head { font-size: 12px; color: var(--muted); }
.pdv-seller { margin-top: 10px; }

/* Instagram Direct */
.ig-pill { --nc: #d62976; }
.ig-window { font-size: 12.5px; padding: 6px 12px; margin: 0 8px 6px; border-radius: 10px; background: rgba(214, 41, 118, .1); color: var(--text); }
.ig-window.late { background: rgba(217, 148, 0, .14); }
.ig-window.closed { background: var(--danger-soft, rgba(234, 0, 56, .1)); }
.ig-steps ol { padding-left: 20px; margin: 8px 0; font-size: 13.5px; line-height: 1.5; }
.ig-steps summary { cursor: pointer; }

/* ---------- celular: enquadramento ---------- */
/* Botão "Mais" da barra de baixo e botão de filtros da lista: só no celular */
#rail-more, #f-more { display: none; }
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* iPhone instalado como app: a barra de status (hora, bateria) e a faixa de gestos ficam por cima da tela.
   Com viewport-fit=cover, env(safe-area-inset-*) diz quanto espaço reservar. */
#app, .login-screen { padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.page, .palette { padding-top: env(safe-area-inset-top); }

/* Telas de toque: campo com letra menor que 16 px faz o iPhone dar zoom ao tocar, e a tela fica torta depois */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea { font-size: 16px !important; }
}

@media (max-width: 720px) {
  /* barra de baixo: 4 atalhos + "Mais" (o resto abre numa lista), sem rolar para o lado */
  .rail { overflow-x: visible; }
  .rail-btn.in-more { display: none !important; }
  #rail-more { display: flex; }
  .rail-btn { flex: 1 1 0; min-width: 0; }

  /* lista de conversas: menos coisa em cima, mais conversa na tela */
  #online-users { display: none; }
  #f-more { display: inline-flex; flex: none; }
  #f-more.on { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }
  #sidebar .subfilters { display: none; }
  #sidebar .subfilters.open { display: flex; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chips .chip { flex: none; }

  /* conversa aberta e e-mail aberto: a caixa de texto não fica embaixo da faixa de gestos do iPhone */
  .composer { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .modal-card { padding-bottom: calc(16px + env(safe-area-inset-bottom)); max-height: calc(100dvh - env(safe-area-inset-top) - 12px); }

  /* páginas (Clientes, Produtos…): busca na largura toda e tabelas com rolagem para o lado */
  .page-tools input[type=search] { flex: 1 1 100%; min-width: 0 !important; width: 100%; }
  .page-body table { min-width: 100%; }
  .page-body { overflow-x: hidden; }
  .cu-tbl td:nth-child(2) { white-space: nowrap; }
  .page-body .table-wrap, .page-body .card:has(> table) { overflow-x: auto; }
}

/* aviso para instalar o app (celular, fora do app instalado) */
.install-tip { display: flex; align-items: center; gap: 10px; margin: 0 12px 10px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 13.5px; }
.install-tip b { color: var(--accent-2); }
.install-tip .grow { flex: 1; min-width: 0; }
.install-tip button.x { background: none; border: 0; color: var(--muted); padding: 4px; cursor: pointer; }
.more-sheet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.more-sheet button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; position: relative; }
.more-sheet button.active { border-color: var(--accent); color: var(--accent-2); }
.more-sheet .rail-badge { position: absolute; top: 6px; right: 10px; }

/* ---------- celular: iPhone de verdade (app instalado) ---------- */
@media (max-width: 720px) {
  /* A tela do app ocupa o aparelho inteiro, presa às bordas. Com altura em 100dvh o iPhone instalado como app
     às vezes calcula a tela menor e sobra uma faixa vazia embaixo. Fundo da página na cor do app, por garantia. */
  html, body { background: var(--panel); }
  #app { position: fixed; top: 0; right: 0; bottom: 0; left: 0; height: auto; }

  /* barra de baixo do tamanho da do iPhone: ícones logo acima da faixa de gestos, sem sobra embaixo */
  .rail { padding: 4px 4px max(4px, calc(env(safe-area-inset-bottom) - 10px)); }
  .rail-btn { height: 48px; gap: 2px; }
  .rail-label { font-size: 10.5px; }

  /* topo da lista mais baixo: sobra mais tela para as conversas */
  #sidebar > .bar, #email-sidebar > .bar { height: 52px; }
  .wa-banner { margin: 8px 12px 0; padding: 7px 10px; font-size: 12.5px; border-radius: 9px; }
  .num-bar { padding: 8px 12px 0; }
  .ns-btn { min-height: 40px; padding: 4px 10px; }
  .search { padding: 8px 12px 6px; }
  .num-bar + .search { padding-top: 6px; }
  .search input { padding-top: 7px; padding-bottom: 7px; }
  .chips { padding-bottom: 6px; gap: 5px; }
  .chip { padding: 4px 11px; font-size: 13px; }
  .install-tip { margin: 0 12px 8px; padding: 8px 10px; font-size: 12.5px; }

  /* conversa na lista: mais compacta (etiquetas menores) */
  .chat-list { padding-top: 2px; }
  .chat-item { padding: 8px 10px; gap: 11px; }
  .chat-item .avatar { width: 46px; height: 46px; }
  .chat-name { font-size: 15.5px; }
  .chat-preview { font-size: 14px; }
  .meta-row { margin-top: 3px; gap: 3px; }
  .meta-row .tag, .meta-row .dept { font-size: 10.5px; line-height: 16px; padding: 0 7px; }
}

/* toque das notificações nos Ajustes */
.st-toque { width: auto; min-width: 130px; margin-right: 8px; }
