/* 1. AUTH & LIST UI STYLES */
:root {
  --gold: #c6a47e;
  --bg: #f4f4f4;
}

body {
  font-family: "微軟正黑體", sans-serif;
  background: var(--bg);
  margin: 0;
  padding: 20px;
}

.card {
  max-width: 500px;
  margin: 30px auto;
  background: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.no-print button {
  width: 100%;
  padding: 12px;
  background: var(--gold);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 5px;
}

.quote-item {
  background: #fff;
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 10px;
  cursor: pointer;
  text-align: left;
  border-left: 5px solid var(--gold);
}

.hidden {
  display: none !important;
}

/* 2. EXACT CSS FROM GEN.html */
/* ===== Preview Container ===== */
.container {
  display: none;
  font-family: monospace !important;
  font-size: 14px;
  color: #333;
  text-align: right;
  margin-bottom: 5px;
}

.container .header {
  text-align: left;
  margin-bottom: 5px;
  font-size: 14px;
  overflow: hidden;
}

.left-header {
  width: 100%;
  float: left;
  text-align: left;
  word-wrap: break-word;
}

.right-header {
  width: 0%;
  float: right;
  text-align: right;
}

.right-header img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ===== Table ===== */
table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-bottom: 20px;
}

th,
td {
  border: 1px solid #000;
  padding: 8px;
  text-align: center;
  font-weight: normal;
  word-wrap: break-word;
  white-space: pre-wrap;
}

th {
  background-color: #c6a47e;
}

/* ===== Sub-footer (two columns) ===== */
.sub-footer {
  overflow: hidden;
}

/* clear floats */
.terms-notes {
  float: left;
  width: 50%;
  text-align: left;
}

.contact-info {
  font-family: monospace;
}

.sub-footer .inline-container table {
  width: 50%;
  border-collapse: collapse;
  margin-left: auto;
  empty-cells: hide;
}

.sub-footer .inline-container td {
  padding: 5px;
  border: 1px solid #000;
  text-align: right;
}

.sub-footer .inline-container tr:has(td:empty) {
  display: none;
}

.sub-footer .inline-container td:first-child {
  width: 50%;
  background-color: #c6a47e;
  text-align: right;
}

.sub-footer .inline-container h3 {
  display: inline-block;
  margin-right: 10px;
}

/* ===== Inline container / notes ===== */
.inline-container {
  position: relative;
}

.notes-container {
  font-size: 10px;
  float: right;
  position: static;
  top: 0;
  right: 0;
  width: 100%;
  text-align: left;
  max-width: 50%;
  word-wrap: break-word;
}

/* ===== Misc ===== */
hr {
  border: 1px solid #000;
  margin: 20px 0;
}

.footer {
  margin-top: 20px;
  overflow: hidden;
}

.left-footer {
  width: 66%;
  float: left;
  text-align: left;
}

.right-footer {
  width: 34%;
  float: left;
}

.right-footer img,
.right-footer p {
  display: inline-block;
  text-align: right;
}
/* ===== SCREEN VIEW ===== */
@media screen {
  .container {
    display: none; /* Keep your JS logic to show/hide */
    background: white;
    width: 210mm; /* A4 Width */
    min-height: 297mm; /* A4 Height */
    margin: 0 auto; /* This centers it on huge screens */
    padding: 8mm; /* Internal margin for professional look */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
     /* Reset from huge screen text-align:right */
  }
}
/* ===== Print ===== */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    /* Chrome, Safari, Edge */
    print-color-adjust: exact !important;
    /* Firefox, Standard */
    color-adjust: exact !important;
    /* Older Firefox */
  }

  body {
    background-color: #fff;
    padding: 0;
  }

  .quotation-container {
    margin: auto;
    padding: 20px;
    border-radius: 0;
    box-shadow: none;
  }

  /* item sizing in print */
  .quotation-item {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    display: block !important;
    width: 100% !important;
  }

  .quotation-item h2 {
    font-size: 18px;
  }

  .quotation-item img.item-image {
    max-width: 100%;
    max-height: 120px;
  }

  #quotation-items {
    display: block !important;
  }

  /* hide UI controls in print */
  #add-item-btn,
  #print-btn,
  .quotation-item input[type="file"],
  .quotation-item button.remove-item-btn,
  .quotation-container {
    display: none;
  }

  .no-print {
    display: none !important;
  }

  /* preview container rules for print */
  .container {
    display: none;
    font-family: monospace;
    font-size: 14px;
    color: #333;
    text-align: right;
    margin-bottom: 5px;
  }

  .container .header {
    text-align: left;
    margin-bottom: 5px;
    font-size: 14px;
    overflow: hidden;
  }

  .left-header {
    width: 100%;
    float: left;
    text-align: left;
    word-wrap: break-word;
  }

  .right-header {
    width: 100%;
    float: right;
    text-align: right;
  }

  .right-header img {
    display: block;
    max-width: 100%;
    height: auto;
  }

  /* sub-footer */
  .sub-footer {
    overflow: hidden;
  }

  .terms-notes {
    float: left;
    width: 50%;
    text-align: left;
  }

  .contact-info {
    font-family: monospace;
  }

  .sub-footer .inline-container table {
    width: 50%;
    border-collapse: collapse;
    margin-left: auto;
    empty-cells: hide;
  }

  .sub-footer .inline-container td {
    padding: 5px;
    border: 1px solid #000;
    text-align: right;
    font-weight: bold;
  }

  .sub-footer .inline-container tr:has(td:empty) {
    display: none;
  }

  .sub-footer .inline-container td:first-child {
    width: 50%;
    background-color: #f0ebe5;
    font-weight: bold;
    text-align: right;
  }

  .sub-footer .inline-container h3 {
    display: inline-block;
    margin-right: 10px;
  }

  /* table */
  table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-bottom: 20px;
  }

  th,
  td {
    border: 1px solid #000;
    padding: 8px;
    font-size: 14px;
    font-weight: normal;
    text-align: center;
    word-wrap: break-word;
    white-space: pre-wrap;
  }

  th {
    background-color: #f0ebe5;
  }

  /* inline container / notes in print */
  .inline-container {
    position: relative;
  }

  .notes-container {
    font-size: 13px;
    float: right;
    position: static;
    top: 0;
    right: 0;
    width: 100%;
    text-align: left;
    max-width: 50%;
    word-wrap: break-word;
  }

  /* misc */
  hr {
    border: 1px solid #000;
    margin: 20px 0;
  }

  .footer {
    margin-top: 20px;
    overflow: hidden;
  }

  .left-footer {
    width: 66%;
    float: left;
    text-align: left;
  }

  .right-footer {
    width: 34%;
    float: left;
  }

  .right-footer img,
  .right-footer p {
    display: inline-block;
    text-align: right;
  }

  /* layout for printed items */
  #quotation-items {
    display: flex;
    flex-wrap: wrap;
  }

  .quotation-item {
    display: inline-block;
    vertical-align: top;
  }
}
/* Add this to your CSS file */
.clearfix::after {
  content: "";
  clear: both;
  display: table;
}

/* Update your remarks style to handle wrapping better */
.remarks {
  clear: both; /* This is the magic line */
  width: 90%;
  border: 1px solid black;
  padding: 10px;
  margin-top: 15px; /* Add some breathing room */
  box-sizing: border-box; /* Prevents border from making it wider than 100% */
  word-wrap: break-word;
}