* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 24px 16px;
  background: #f5f7ff;
  color: #20243a;
  font: 16px/1.45 Arial, sans-serif;
}
.app { max-width: 900px; margin: 0 auto; }
.topbar, .library-heading, .url-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { margin: 0; font-size: 2rem; }
h2 { margin: 0 0 12px; font-size: 1.15rem; }
.subtitle { margin: 4px 0 0; color: #626984; }
.connection { padding: 5px 10px; border-radius: 20px; background: #e4f5e9; color: #24683a; font-size: .85rem; white-space: nowrap; }
.connection.offline { background: #fff0dd; color: #80500e; }
.save-panel { margin: 24px 0; padding: 18px; border: 1px solid #dfe3f2; border-radius: 12px; background: white; }
label { display: block; margin: 10px 0 5px; font-weight: bold; }
.optional, .hint { color: #6b7188; font-size: .88rem; font-weight: normal; }
input { width: 100%; min-width: 0; padding: 10px; border: 1px solid #cbd1e3; border-radius: 7px; font: inherit; }
input:focus { outline: 2px solid #7785d4; border-color: transparent; }
.url-row { align-items: stretch; }
.url-row input { flex: 1; }
button { padding: 10px 15px; border: 0; border-radius: 7px; background: #5c6ac4; color: white; font: inherit; font-weight: bold; cursor: pointer; }
button:hover { background: #4655ad; }
.hint { margin: 10px 0 0; }
.form-message { min-height: 1.2em; margin: 5px 0 0; color: #a43d32; font-size: .9rem; }
.library-heading { margin-bottom: 12px; }
.library-heading h2 { margin: 0; }
#siteCount { color: #6b7188; font-size: .9rem; }
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.site-card { overflow: hidden; border: 1px solid #dfe3f2; border-radius: 11px; background: white; }
.preview { display: block; width: 100%; height: 145px; border: 0; background: #edf0fa; }
.card-info { padding: 12px; }
.card-info h3 { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.card-url { overflow: hidden; margin: 4px 0 12px; color: #6b7188; text-overflow: ellipsis; white-space: nowrap; font-size: .83rem; }
.card-actions, .offline-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.offline-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 10px; }
.offline-status { min-height: 1em; margin: 7px 0 0; color: #626984; font-size: .8rem; }
button:disabled { opacity: .65; cursor: wait; }
[hidden] { display: none !important; }
.go-link { color: #4b59b5; font-weight: bold; text-decoration: none; }
.go-link:hover { text-decoration: underline; }
.delete-button { padding: 6px 9px; background: #f0f1f7; color: #50566e; font-size: .85rem; }
.delete-button:hover { background: #e3e5ef; }
.empty-state { grid-column: 1 / -1; padding: 26px 12px; border: 1px dashed #cbd1e3; border-radius: 10px; color: #6b7188; text-align: center; }
footer { margin-top: 26px; color: #6b7188; text-align: center; font-size: .85rem; }
@media (max-width: 560px) {
  body { padding: 18px 12px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 1.7rem; }
  .url-row { flex-direction: column; }
  .url-row button { width: 100%; }
}
