/* In-browser tools under /tools/ (see content/tools/). The tool itself is a
 * white card, like the homepage panels; the help text uses the blog styles. */
.ddg-tool-lead {
  color: #cfc7b5;
}

/* Tool help tables are short: no need for the blog's 560px minimum. */
.ddg-tool-page .blog-body table {
  min-width: 0;
}

.ddg-tool {
  margin: 1.5rem 0 2rem;
  padding: 16px;
  border-radius: 10px;
  background: #fff;
  color: #2b2b2b;
  font-size: 1rem;
  line-height: 1.5;
}

.ddg-tool-drop {
  position: relative;
  display: block;
  padding: 20px 16px;
  border: 2px dashed #d9a08f;
  border-radius: 10px;
  background: #fbf3ef;
  text-align: center;
  cursor: pointer;
}

.ddg-tool-drop.is-over {
  border-color: #CF4327;
  background: #f8e4dc;
}

.ddg-tool-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.ddg-tool-drop-title {
  display: block;
  color: #CF4327;
  font-size: 1.1rem;
  font-weight: bold;
}

.ddg-tool-drop-hint {
  display: block;
  margin-top: 4px;
  color: #6b6b6b;
  font-size: 0.85rem;
}

.ddg-tool-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 16px 0 8px;
  padding: 0;
  border: 0;
}

.ddg-tool-presets legend {
  margin-bottom: 6px;
  font-size: 1rem;
  font-weight: bold;
}

.ddg-tool-presets label {
  margin: 0;
}

.ddg-tool-target {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.ddg-tool-target label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.9rem;
}

.ddg-tool-target input {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font: inherit;
}

.ddg-tool-note {
  margin: 8px 0 0;
  color: #6b6b6b;
  font-size: 0.85rem;
}

.ddg-tool-editor {
  margin-top: 16px;
}

.ddg-tool-editor[hidden],
.ddg-tool-download[hidden] {
  display: none;
}

#preview {
  display: block;
  max-width: 100%;
  margin: 0 auto 12px;
  border: 1px solid #ddd;
  background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px;
}

.ddg-tool-adjust {
  display: grid;
  gap: 8px;
}

.ddg-tool-adjust label {
  display: grid;
  gap: 2px;
  margin: 0;
  font-size: 0.9rem;
}

.ddg-tool-adjust .ddg-tool-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ddg-tool-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ddg-tool-buttons button {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #2b2b2b;
  font: inherit;
  cursor: pointer;
}

.ddg-tool-result {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f3f3f3;
  font-size: 0.95rem;
}

.ddg-tool-result.is-ok {
  background: #e8f6ed;
  color: #17803d;
}

.ddg-tool-result.is-warn {
  background: #fdecea;
  color: #b3261e;
}

.ddg-tool-download {
  display: block;
  padding: 12px;
  border-radius: 6px;
  background: #CF4327;
  color: #fff;
  font-weight: bold;
  text-align: center;
}

.ddg-tool-download:hover,
.ddg-tool-download:focus {
  background: #b13820;
  color: #fff;
  text-decoration: none;
}

button.ddg-tool-download {
  width: 100%;
  border: 0;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}

button.ddg-tool-download[hidden] {
  display: none;
}

button.ddg-tool-download:disabled {
  opacity: 0.5;
  cursor: default;
}

/* JPG to PDF, compress PDF, merge and split (pdf-kb.js, pdf-merge.js) */
.ddg-pdf .ddg-tool-result[hidden] {
  display: none;
}

.ddg-pdf .ddg-tool-download + .ddg-tool-download {
  margin-top: 8px;
}

.ddg-pdf-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.ddg-pdf-list[hidden] {
  display: none;
}

.ddg-pdf-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

.ddg-pdf-list img {
  flex: none;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
}

.ddg-pdf-list li > span:first-of-type {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ddg-pdf-buttons {
  display: flex;
  flex: none;
  gap: 4px;
}

.ddg-pdf-buttons button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #2b2b2b;
  font: inherit;
  cursor: pointer;
}

.ddg-pdf-buttons button:disabled {
  opacity: 0.35;
  cursor: default;
}

.ddg-pdf-field {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  font-weight: bold;
}

.ddg-pdf-field select,
.ddg-pdf-field input,
.ddg-pdf-custom input[type="number"] {
  min-width: 0;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #2b2b2b;
  font: inherit;
  font-weight: normal;
}

.ddg-pdf-custom input[type="number"] {
  width: 6rem;
  padding: 4px 6px;
}

.ddg-pdf .ddg-tool-presets + .ddg-tool-download,
.ddg-pdf-field + .ddg-tool-download {
  margin-top: 12px;
}

/* CGPA to percentage (cgpa.js) */
.ddg-cgpa-field {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  font-weight: bold;
}

.ddg-cgpa-field[hidden],
.ddg-cgpa-custom[hidden] {
  display: none;
}

.ddg-cgpa select,
.ddg-cgpa input,
.ddg-age select,
.ddg-age input,
.ddg-drive input {
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #2b2b2b;
  font: inherit;
  font-weight: normal;
}

#cgpa-value {
  font-size: 1.25rem;
}

.ddg-cgpa-custom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0 0 12px;
}

.ddg-cgpa-custom label {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 0.9rem;
}

.ddg-cgpa-result strong {
  display: block;
  font-size: 2rem;
  line-height: 1.2;
}

.ddg-cgpa .ddg-tool-note a {
  color: #CF4327;
}

.ddg-cgpa-grades {
  margin: 20px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid #e5e5e5;
}

.ddg-cgpa-grades-title {
  margin: 0 0 8px;
  font-weight: bold;
}

.ddg-cgpa-subject {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) 4.5rem;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.ddg-cgpa-subject output {
  color: #17803d;
  text-align: right;
}

.ddg-pdf-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  font-size: 0.95rem;
}

.ddg-pdf-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Age limit check (age.js) */
.ddg-age-custom .ddg-age-wide {
  grid-column: 1 / -1;
}

.ddg-age .ddg-tool-result strong,
.ddg-age .ddg-tool-result span {
  display: block;
}

.ddg-age .ddg-tool-result span {
  margin-top: 4px;
}

/* Google Drive links (drive-link.js) */
.ddg-drive-links {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.ddg-drive-links[hidden] {
  display: none;
}

.ddg-drive-links li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.ddg-drive-label {
  grid-column: 1 / -1;
  font-weight: bold;
  font-size: 0.95rem;
}

.ddg-drive-value {
  min-width: 0;
  overflow: hidden;
  color: #CF4327;
  font-size: 0.85rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

code.ddg-drive-value {
  color: #2b2b2b;
}

.ddg-drive-links button {
  padding: 6px 14px;
  border: 0;
  border-radius: 6px;
  background: #CF4327;
  color: #fff;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}
