:root {
  /* 🎨 Цвета */
  --color-bg: #eff3f6;
  --color-bg-light: #eff2f9;
  --color-bg-alt: #e4ebf1;
  --color-text: #6e7f8d;
  --color-text-muted: #b5bfc6;
  --color-border: #6e7f8d;
  --color-border-hover: #566979;
  --color-primary: #26374d;
  --color-primary-hover: #000000;
  --color-accent: #f35900;

  /* 🧱 Скругления и тени */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);

  /* ⚡ Переходы */
  --transition-fast: 0.15s ease-in-out;
  --transition-base: 0.25s ease-in-out;
}

* {
  letter-spacing: 0.04em;
  /* margin:0; */
}

body {
  width: 100%;
  height: 100vh;
  margin: 0;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  /* font-family: 'Consolas', 'Courier New', monospace; */
  font-size: x-small;
  color: var(--color-text);

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  line-height: 1.4;
  background-color: var(--color-bg);
  /* background-color: var(--color-deep-frost); */
  /* background-image: url("../assets/images/background.jpg"); */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* margin: 0px 40px; */
}

p {
  /* margin: 4px 0; */
}

table {
  margin-top: 10px;
  margin-bottom: 10px;
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  padding: 6px;
  border: 1px solid #ccc;
}

strong {
  font-weight: 600;
}

button {
  padding: 8px 12px;
  /* margin: 12px 0; */
  cursor: pointer;
  border: 1px solid var(--color-text-muted);
  border-radius: 8px;
  background-color: var(--color-bg);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  /* background-color:floralwhite; */
}

button:hover {
  border: 1px solid var(--color-border-hover);
}

input {
  /* display:flex; */
  color: var(--color-primary);
  padding: 8px;
  border-radius: 4px;
  border: none;
}

textarea {
  resize: none;
  padding: 12px;
  /* width:100%; */
  border: 1px solid var(--color-text-muted);
  border-radius: 8px;
}

fieldset {
  /* max-width: 50%; */
  border: 1px solid var(--color-text-muted);
  border-radius: 8px;
  margin:0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

legend {
  font-size: small;
  font-weight: bold;
  color: var(--color-border);
}

label {
  font-size: small;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap:12px;
  font-weight: 500;
}

.row {
  display: flex;
  flex-direction: row;
  gap: 12px;
}

#main-wrap {
  /* height:100vh; */
  /* width:100%; */
  display: flex;
  flex-direction: row;
  /* justify-content:left; */
  padding: 48px 48px;
  gap: 24px;
}

#main-menu {
  /* position:fixed; */
  /* left:0; */
  /* padding: 12px 0; */
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#main-panel {
  display: flex;
  flex-direction: column;
  /* height:100vh; */
  width: 100%;
  justify-content: space-between;
}

.header {
  background-color: var(--color-bg-alt);
  padding: 20px 48px;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  gap: 24px;
  /* background: rgba(255, 255, 255, 0.1); 
  backdrop-filter: blur(10px); 
  -webkit-backdrop-filter: blur(10px);  */

  /* padding:20px; */
}

.header-tool-btn {
  width: 80px;
  padding: 0px 16px;
  border: 1px solid var(--color-text-muted);
  border-radius: 8px;
  cursor: pointer;
}

.header-tool-btn:hover {
  border: 1px solid var(--color-border-hover);
}

#silent_auth_btn {
  margin-left: auto;
}

.generator-wrap {
  display: flex;
  /* margin: 40px 48px; */
  gap: 24px;
  flex-wrap: wrap;
}

.control-panel {
  /* padding:20px; */
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  /* width: calc(50% - 12px); */
  gap:12px;
  /* background-color: lavender; */
}

.output-wrap {
  display: flex;
  flex-direction: column;
  /* width: calc(50% - 12px); */
  gap:12px;
  min-width: 0;
  flex: 1;
}



#output {
  padding: 40px;
  background-color: floralwhite;
  /* background-color: var(--color-bg-light); */
  border: 1px solid var(--color-text-muted);
  border-radius: 8px;
  /* background: rgba(255, 255, 255, 0.8); 
  backdrop-filter: blur(8px); 
  -webkit-backdrop-filter: blur(10px);  */
}

#preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 12px;
  gap: 12px;
}

#files {
  border: 1px solid var(--color-text-muted);
  border-radius: 8px;
}

#files:hover {
  border: 1px solid var(--color-border-hover);
}

.control-panel-buttons {
  width: 100%;
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-wrap: wrap;
}



#send {
  color: aliceblue;
  background-color: var(--color-accent);
  /* border: 1px solid var(--color-accent);   */
}

#useManual {
  /* margin-bottom: 0; */
}

#manualInput {
  flex-grow: 1;
}

.preview-file-wrapper {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-text-muted);
  border-radius: 8px;
  overflow: hidden;
}

.json-preview {
  max-height: 500px;
  max-width: 600px;
  overflow: auto;
}

.json-table {
  color: #26374d;
  background-color: #fcfcfc;
  border-collapse: collapse;
  width: 100%;
  margin: 0;
  /* margin-top: 10px; */
  font-size: 13px;
}

.json-table th,
.json-table td {
  border: 1px solid #ddd;
  padding: 4px 6px;
  text-align: left;
  word-spacing: 0;
  font-size: 10px;
}

.json-table th {
  font-weight: 600;
}

.file-delete-btn {
  font-size: large;

  /* position: absolute;
  top: 8px;
  left: 8px; */
  cursor: pointer;
  margin: 0;
  padding: 0;

  line-height: 1; /* важно! убирает лишние отступы сверху/снизу */
  text-align: center;
  width: 32px; /* квадратная ширина */
  height: 32px; /* квадратная высота */
  display: flex; /* для центрирования содержимого */
  align-items: center;
  justify-content: center;
  margin: 4px 12px;
}

.file-delete-btn:hover {
  background: var(--color-border-hover);
  color: var(--color-bg-light);
}

.pdf-embed {
  /* max-width: 600px;
  width: 100%; */
  width: 550px;
  height: 500px;
  overflow: hidden;
  border: 1px solid #ccc;
  overflow: hidden;
  background: #f5f5f5;
}

.file-name-wrap {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  background-color: var(--color-bg-alt);
}

.file-icon {
  width: 30px;
  margin: 0 12px;
}

.file-name {
  font-size: 14px;
  color: var(--color-primary);
  text-align: center;
  flex-grow: 1;
}

.drive-files-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drive-item {
  font-size: 14px;
  padding-left: 12px;
  cursor: pointer;
  text-decoration: none;
}

.drive-item p {
  margin: 0;
}

.drive-item:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.footer {
  background-color: var(--color-primary);
  padding: 20px 48px;
  margin-top: auto;
}

.trans-calculator-wrap {
  align-items: stretch;
  /* margin-top: 12px; */
  display: flex;
  flex-direction: row;
  gap: 24px;
  min-height: 400px;
}

.trans-calc-google-panel {
  min-height: 400px;
  width: 16%;
  display: flex;
  flex-direction: column;
  /* max-width: 255px; */
}

.google-output {
  /* width:100%; */
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-text-muted);
  border-radius: 8px;
  padding: 12px 24px;
  gap: 12px;
  min-height: 220px;
  /* height: 100%; */
}

.google-output-list {
  /* display: flex;
  flex-direction: row;
  flex-wrap: wrap; */
  /* padding:12px 24px; */

  gap: 12px;
  display: grid;
  /* grid-template-columns: repeat(3, 1fr);  */
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 12px; /* отступы между ячейками */
  box-sizing: border-box;
}

.google-output-item {
  text-align: center;
  font-size: larger;
  cursor: pointer;
  padding: 12px;
  border: 1px solid var(--color-text-muted);
  border-radius: 8px;
}

.google-output-item:hover {
  border: 1px solid var(--color-border-hover);
}

.google-output-item.active {
  background: var(--color-border-hover);
  color: white;
  font-weight: bold;
  transform: scale(0.98);
}

.data-check-wrap {
  width: 40%;
  align-items: stretch;
  min-height: 400px;
  /* height: 600px; */
  display: flex;
  flex-direction: column;
  gap:12px;
}

.data-check-panel {
  /* flex: 1; */
  /* flex-grow: 1; */
  min-height:350px;
  /* height:100%; */
  /* height: 600px; */
  max-height: 350px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-text-muted);
  border-radius: 8px;
  padding: 12px;
  overflow-y: scroll;
}

#calculateBtn {
  align-self: flex-start;
  width: auto;
  color: #f5f5f5;
  background-color: var(--color-accent);
  margin-top: 0;
}

.calc-result-wrap {
  width: 100%;
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap:12px;
}

.calc-result-list {
  /* width:100%; */
  height: 100%;
  /* border: 1px solid var(--color-text-muted);
  border-radius: 8px; */
  padding: 0px 24px;
}

.adress-fields {
  /* flex-wrap: wrap; */
  display:flex;
  flex-direction: row;
  gap:12px;
}

.units-fields {
  /* display:flex;
  flex-direction: row;
  flex-wrap: wrap; */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap:12px;
}

.deliveryForm {
  /* flex-grow: 1; */
  display:flex;
  flex-direction: column;
  gap:12px;
  /* flex-wrap: wrap; */
}

.calc-result-row {
  display:flex;
  flex-direction: row;
  align-items: center;
  gap:12px;
  /* padding:8px; */
  /* border: 1px solid var(--color-text-muted);
  border-radius: 8px; */
}

.calc-result-row button {

  display: inline-flex;
  width: 35%;
  min-width: max-content; 
  white-space: nowrap;
    overflow: hidden;      
    text-overflow: ellipsis;
}

.calc-result-row div {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width:120px;
  align-items: start;
}

.toggle-group {
  display: flex;
  flex-direction: row;
  gap:12px;
}

.toggle-group input {
  display: none;
}

.toggle-group label {
  padding: 6px 14px;
  
  border-radius: 8px;
  /* background: #fff; */
  cursor: pointer;
  user-select: none;
  transition: .2s;
  font-size: 14px;
  border: 1px solid var(--color-text-muted);
}

.toggle-group label:hover {
  border: 1px solid var(--color-text);
}

.toggle-group input:checked + label {
  background: var(--color-border);
  color: #fff;
}