/* Kipin — private area (files, shares, account, admin, login) and public share pages in the logbook style.
   Loaded after page.css (parchment, chart border, fonts, header). Layout.php uses <main class="sheet wide|narrow">. */
:root { --page-max: 1280px; --rust: #7a2e1e; --sea: #2f5d50;
  /* names still used by inline styles and upload.js */
  --line: rgba(34, 30, 24, .2); --accent: var(--ink-hover); --muted: rgba(34, 30, 24, .66); }

/* header / sheet / footer rows: the footer stays at the bottom of the frame on short pages */
.scroll { display: grid; grid-template-rows: auto 1fr auto; }
.sheet.wide, .sheet.narrow { align-self: start; justify-self: center; max-width: none; margin-left: 0; margin-right: 0; }
.sheet.wide { width: min(var(--page-max), 100% - 2 * clamp(8px, 3vw, 48px)); }
.sheet.narrow { width: min(560px, 100% - 16px); }
.sheet h1 { overflow-wrap: anywhere; margin-bottom: .25em; }
.sheet h2 { font-size: 1.25rem; margin-top: 1.4em; }
.page-head { margin-bottom: 18px; }
.page-head .eyebrow { margin-bottom: .3em; }
.muted { color: var(--muted); }

/* header: the logout form sits in the nav like a link */
.top nav { align-items: center; }
.top nav form.inline { display: inline; margin: 0; }
.top nav button { font: inherit; font-style: italic; font-size: 1.05rem; color: var(--ink); background: none; border: 0; padding: 0;
  cursor: pointer; }
.top nav button:hover, .top nav button:focus-visible { color: var(--ink-hover); text-decoration: underline; text-underline-offset: 4px; }

.breadcrumb { font-style: italic; color: var(--muted); }
.breadcrumb a { color: var(--ink); }
.breadcrumb a:hover { color: var(--ink-hover); }

/* buttons: ink stamp (primary) and ink outline (secondary); delete buttons in rust */
.btn { display: inline-block; padding: 10px 22px; border-radius: 3px; border: 1px solid var(--ink); background: var(--ink);
  color: #f4e9d3; font: inherit; font-size: .98rem; letter-spacing: .06em; line-height: 1.2; text-decoration: none;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.btn:hover, .btn:focus-visible { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn.secondary { background: transparent; color: var(--ink); border-color: rgba(34, 30, 24, .45); }
.btn.secondary:hover, .btn.secondary:focus-visible { background: rgba(139, 90, 28, .1); border-color: var(--ink-hover); color: var(--ink-hover); }
form[action$="/delete"] .btn.secondary, form[action$="/revoke"] .btn.secondary, form[action$="/revoke-all"] .btn.secondary {
  color: var(--rust); border-color: rgba(122, 46, 30, .45); }
form[action$="/delete"] .btn.secondary:hover, form[action$="/revoke"] .btn.secondary:hover,
form[action$="/revoke-all"] .btn.secondary:hover { background: rgba(122, 46, 30, .08); border-color: var(--rust); }
.btn:disabled { opacity: .45; cursor: default; }

/* fields: paper slips with an ink edge */
label { display: block; margin-bottom: 5px; font-style: italic; color: var(--muted); }
input, textarea, select { font: inherit; font-size: 1rem; color: var(--ink); background: rgba(255, 251, 242, .7);
  border: 1px solid rgba(34, 30, 24, .35); border-radius: 3px; padding: 9px 12px; }
input:not([type=file]), textarea { width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--ink-hover); outline-offset: 1px; border-color: transparent; }
input::placeholder { color: rgba(34, 30, 24, .45); font-style: italic; }
input[type=file] { padding: 7px 10px; background: rgba(255, 251, 242, .45); border-style: dashed; }
input[type=file]::file-selector-button { font: inherit; font-size: .9rem; margin-right: 12px; padding: 5px 14px; border-radius: 3px;
  border: 1px solid rgba(34, 30, 24, .45); background: transparent; color: var(--ink); cursor: pointer; }
textarea { min-height: 140px; resize: vertical; }
form .field { margin-bottom: 16px; }
.actions { display: flex; gap: 12px; margin-top: 6px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.inline { display: inline-flex; align-items: center; gap: 6px; }
.inline input[type=text], .inline input[type=password] { width: 150px; padding: 5px 9px; font-size: .92rem; }
.inline select { padding: 5px 8px; font-size: .92rem; }
.inline .ext { font-size: .92rem; margin-left: -2px; }
.new-item { margin-top: 22px; }
.new-item-row { display: flex; gap: 12px; flex-wrap: wrap; }
.new-item-row input { flex: 1 1 200px; }

/* notes in ink colours (no bright green/red on parchment) */
.error, .ok { padding: 11px 14px; border-radius: 3px; margin-bottom: 16px; font-style: italic; }
.error { color: var(--rust); background: rgba(122, 46, 30, .08); border: 1px solid rgba(122, 46, 30, .4); }
.ok { color: var(--sea); background: rgba(47, 93, 80, .08); border: 1px solid rgba(47, 93, 80, .4); }

/* lists: a ruled logbook page */
.list-card { background: rgba(255, 251, 242, .45); border: 1px solid rgba(34, 30, 24, .22); border-radius: 3px; overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 1rem;
  vertical-align: middle; }
table.list th { font-family: system-ui, sans-serif; font-weight: 600; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  opacity: .72; border-bottom: 1.4px solid var(--ink); padding-top: 13px; }
table.list tr:last-child td { border-bottom: none; }
table.list tbody tr:hover { background: rgba(139, 90, 28, .06); }
table.list td.muted { white-space: nowrap; }
table.list td:first-child { min-width: 14em; overflow-wrap: anywhere; }
table.list td a { color: var(--ink); text-decoration: none; }
table.list td a:hover { color: var(--ink-hover); text-decoration: underline; text-underline-offset: 3px; }
td.row-actions { white-space: normal; text-align: right; }
td.row-actions > .btn, td.row-actions .inline { margin: 3px 0 3px 4px; }
.inline .btn, td.row-actions .btn { padding: 5px 12px; font-size: .88rem; letter-spacing: .03em; }
code.share-url { font-size: .88rem; word-break: break-all; }

/* ink icons instead of emoji (same size as the text) */
.ico { display: inline-block; width: 1.25em; height: 1.05em; margin-right: .35em; vertical-align: -.14em;
  background: center / contain no-repeat; }
.ico.folder { background-image: url(icons/folder.svg); }
.ico.file { background-image: url(icons/file.svg); }
h1 .ico { vertical-align: -.08em; }

/* "partagé": a small rust stamp */
.badge { display: inline-block; margin-left: 8px; padding: 0 8px; border: 1.2px solid var(--rust); border-radius: 2px; color: var(--rust);
  font-family: system-ui, sans-serif; font-size: .66rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  line-height: 1.6; transform: rotate(-3deg); vertical-align: .15em; }
table.list td a.badge { color: var(--rust); text-decoration: none; }
a.badge:hover { background: rgba(122, 46, 30, .08); }
.badge.album, table.list td a.badge.album { border-color: var(--sea); color: var(--sea); transform: rotate(2deg); }
a.badge.album:hover { background: rgba(47, 93, 80, .08); }

/* upload widget */
.upload-widget { margin-top: 22px; padding: 16px 18px 18px; }
.upload-widget h2 { margin-top: 0; }
.upload-hint { margin: 6px 0 0; font-size: .9rem; font-style: italic; color: var(--muted); }
.upload-widget.drop { outline: 2px dashed var(--ink-hover); outline-offset: -6px; background: rgba(139, 90, 28, .06); }
#upload-status { margin-top: 10px; font-style: italic; color: var(--muted); }
#upload-progress { margin-top: 10px; height: 8px; border: 1px solid rgba(34, 30, 24, .4); border-radius: 2px; overflow: hidden; }
#upload-progress-bar { height: 100%; width: 0; background: var(--ink); transition: width .2s; }

footer { text-align: center; font-style: italic; font-size: .95rem; color: var(--muted); padding: 6px 16px 22px; }
footer a { color: var(--ink); }
footer a:hover { color: var(--ink-hover); }

@media (max-width: 720px) {
  .sheet.wide, .sheet.narrow { margin: 16px 0 20px; }
  .sheet.wide { width: 100%; padding-left: 14px; padding-right: 14px; }
  table.list th, table.list td { padding: 9px 10px; }
  .top nav { gap: 14px; }
}

/* password field with an eye button (admin: new user, reset) */
.pw-wrap { position: relative; display: inline-flex; align-items: center; }
.pw-wrap input { padding-right: 34px; }
.new-item-row .pw-wrap { flex: 1 1 200px; }
.new-item-row .pw-wrap input { width: 100%; }
.field .pw-wrap, label .pw-wrap { display: flex; width: 100%; }   /* login, setup, change password: full width */
.field .pw-wrap input, label .pw-wrap input { flex: 1; width: 100%; }
.pw-show { position: absolute; right: 4px; width: 28px; height: 28px; padding: 4px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.pw-show svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-show .slash { display: none; }
.pw-show[aria-pressed="true"] .slash { display: inline; }
.pw-show:hover, .pw-show:focus-visible { color: var(--ink-hover); outline: none; }
